Skip to content

Commit 1d9dc86

Browse files
committed
Tests read TARGET environment variable for helpers
1 parent c29a783 commit 1d9dc86

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

tests/functions.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,17 @@ fn make_helpers() {
1414
cmd
1515
.arg("src/test_helpers.rs")
1616
.arg("-o")
17-
.arg(LIBPATH)
18-
// .arg("--target")
19-
// .arg(env!("LIBLOADING_TEST_TARGET"))
20-
.arg("-O");
21-
22-
cmd
23-
.output()
24-
.expect("could not compile the test helpers!");
17+
.arg(LIBPATH);
18+
if let Some(target) = std::env::var_os("TARGET") {
19+
cmd.arg("--target").arg(target);
20+
} else {
21+
eprintln!("WARNING: $TARGET NOT SPECIFIED! BUILDING HELPER MODULE FOR NATIVE TARGET.");
22+
}
23+
assert!(cmd
24+
.status()
25+
.expect("could not compile the test helpers!")
26+
.success()
27+
);
2528
});
2629
}
2730

0 commit comments

Comments
 (0)