From d8dcf8ba8f59bf9ddeaab942028f236cfe62c98b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Mon, 27 Jan 2020 18:52:22 -0700 Subject: Use Command::new() instead of Command::cargo_new() This seems to actually fix the issue #16 as documented at: https://users.rust-lang.org/t/github-actions-randomly-kill-a-test-program/37255/6 --- tests/cli.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/cli.rs') diff --git a/tests/cli.rs b/tests/cli.rs index 3573113..38b0419 100644 --- a/tests/cli.rs +++ b/tests/cli.rs @@ -45,7 +45,7 @@ impl Success2 for Assert { #[test] fn test_help() { - let mut cmd = Command::cargo_bin("fpm").unwrap(); + let mut cmd = Command::new("./target/debug/fpm"); cmd.arg("--help"); cmd.assert() .success2() @@ -56,7 +56,7 @@ fn test_help() { #[test] fn test_1() { - let mut build = Command::cargo_bin("fpm").unwrap(); + let mut build = Command::new("./target/debug/fpm"); build.arg("build") .arg("--target-dir") .arg("build-test") @@ -66,7 +66,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 = Command::new("./target/debug/fpm"); run.arg("run") .current_dir("tests/1"); run.assert() @@ -76,7 +76,7 @@ fn test_1() { #[test] fn test_2() { - let mut build = Command::cargo_bin("fpm").unwrap(); + let mut build = Command::new("./target/debug/fpm"); build.arg("build") .arg("--target-dir") .arg("build-test") @@ -86,7 +86,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 = Command::new("./target/debug/fpm"); run.arg("run") .current_dir("tests/2"); run.assert() -- cgit v1.2.3