diff options
author | Ondřej Čertík <ondrej@certik.us> | 2020-01-27 22:34:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-27 22:34:42 -0700 |
commit | e6430d057db51822b1d8e633b0beaab9ab19cd99 (patch) | |
tree | 046baa3f5a9844d16948b4efadd216a6c5a13101 | |
parent | 3ca76f09989c26b1964e669efba941d0ba41129e (diff) | |
parent | c109de444b913b23766df1378e583d9cab77bda5 (diff) | |
download | fpm-e6430d057db51822b1d8e633b0beaab9ab19cd99.tar.gz fpm-e6430d057db51822b1d8e633b0beaab9ab19cd99.zip |
Merge pull request #29 from certik/sigkill_fix
Use Command::new() instead of Command::cargo_new()
-rw-r--r-- | .github/workflows/CI.yml | 9 | ||||
-rw-r--r-- | tests/cli.rs | 17 |
2 files changed, 13 insertions, 13 deletions
diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 2f351a1..fce83bb 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -58,13 +58,6 @@ jobs: run: | cargo test --verbose --no-run - - name: Run tests (Linux, Windows) - if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'windows') + - name: Run tests run: | cargo test - - # Workaround for https://github.com/fortran-lang/fpm/issues/16 - - name: Run tests (macOS) - if: contains(matrix.os, 'macos') - run: | - cargo test || cargo test || cargo test diff --git a/tests/cli.rs b/tests/cli.rs index 3573113..d03e449 100644 --- a/tests/cli.rs +++ b/tests/cli.rs @@ -43,9 +43,16 @@ impl Success2 for Assert { } } +fn fpm_bin() -> Command { + let mut fpm_bin_relative: std::path::PathBuf = ["target", "debug", "fpm"].iter().collect(); + fpm_bin_relative.set_extension(std::env::consts::EXE_EXTENSION); + let fpm_bin_absolute = std::fs::canonicalize(fpm_bin_relative).unwrap(); + Command::new(fpm_bin_absolute.to_str().unwrap()) +} + #[test] fn test_help() { - let mut cmd = Command::cargo_bin("fpm").unwrap(); + let mut cmd = fpm_bin(); cmd.arg("--help"); cmd.assert() .success2() @@ -56,7 +63,7 @@ fn test_help() { #[test] fn test_1() { - let mut build = Command::cargo_bin("fpm").unwrap(); + let mut build = fpm_bin(); build.arg("build") .arg("--target-dir") .arg("build-test") @@ -66,7 +73,7 @@ fn test_1() { .stdout(predicate::str::contains("Built target p1") .and(predicate::str::contains("TEST1 OK").not())); - let mut run = Command::cargo_bin("fpm").unwrap(); + let mut run = fpm_bin(); run.arg("run") .current_dir("tests/1"); run.assert() @@ -76,7 +83,7 @@ fn test_1() { #[test] fn test_2() { - let mut build = Command::cargo_bin("fpm").unwrap(); + let mut build = fpm_bin(); build.arg("build") .arg("--target-dir") .arg("build-test") @@ -86,7 +93,7 @@ fn test_2() { .stdout(predicate::str::contains("Built target p1") .and(predicate::str::contains("TEST2 OK").not())); - let mut run = Command::cargo_bin("fpm").unwrap(); + let mut run = fpm_bin(); run.arg("run") .current_dir("tests/2"); run.assert() |