Skip to content

Commit c5fec1a

Browse files
committed
don't run the mod_example test when using cross
it depends on escargot also supporting cross, which it doesn't at this time
1 parent cd621e5 commit c5fec1a

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

tests/cargo.rs

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use std::process;
22
use std::process::Command;
33

4+
use assert_cmd::cargo::CURRENT_TARGET;
45
use assert_cmd::prelude::*;
56

67
#[test]
@@ -19,15 +20,23 @@ fn cargo_binary_with_empty_env() {
1920

2021
#[test]
2122
fn mod_example() {
22-
let bin_under_test = escargot::CargoBuild::new()
23-
.bin("bin_fixture")
24-
.current_release()
25-
.current_target()
26-
.run()
27-
.unwrap();
28-
let mut cmd = bin_under_test.command();
29-
let output = cmd.unwrap();
30-
println!("{:?}", output);
23+
let runner_env = format!(
24+
"CARGO_TARGET_{}_RUNNER",
25+
CURRENT_TARGET.replace('-', "_").to_uppercase()
26+
);
27+
if std::env::var(runner_env).is_ok() {
28+
// not running this test on cross because escargot doesn't support the cargo target runner yet
29+
} else {
30+
let bin_under_test = escargot::CargoBuild::new()
31+
.bin("bin_fixture")
32+
.current_release()
33+
.current_target()
34+
.run()
35+
.unwrap();
36+
let mut cmd = bin_under_test.command();
37+
let output = cmd.unwrap();
38+
println!("{:?}", output);
39+
}
3140
}
3241

3342
#[test]

0 commit comments

Comments
 (0)