Skip to content

Commit

Permalink
don't run the mod_example test when using cross
Browse files Browse the repository at this point in the history
it depends on escargot also supporting cross, which it doesn't at this time
  • Loading branch information
glehmann committed Jan 28, 2024
1 parent cd621e5 commit c5fec1a
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions tests/cargo.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::process;
use std::process::Command;

use assert_cmd::cargo::CURRENT_TARGET;
use assert_cmd::prelude::*;

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

#[test]
fn mod_example() {
let bin_under_test = escargot::CargoBuild::new()
.bin("bin_fixture")
.current_release()
.current_target()
.run()
.unwrap();
let mut cmd = bin_under_test.command();
let output = cmd.unwrap();
println!("{:?}", output);
let runner_env = format!(
"CARGO_TARGET_{}_RUNNER",
CURRENT_TARGET.replace('-', "_").to_uppercase()
);
if std::env::var(runner_env).is_ok() {
// not running this test on cross because escargot doesn't support the cargo target runner yet
} else {
let bin_under_test = escargot::CargoBuild::new()
.bin("bin_fixture")
.current_release()
.current_target()
.run()
.unwrap();
let mut cmd = bin_under_test.command();
let output = cmd.unwrap();
println!("{:?}", output);
}
}

#[test]
Expand Down

0 comments on commit c5fec1a

Please sign in to comment.