Skip to content

Commit 9cb10cd

Browse files
committed
Auto merge of #1593 - rust-lang:test, r=RalfJung
fix './miri test'
2 parents ce31a12 + 80c4b5d commit 9cb10cd

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tests/compiletest.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ fn run_tests(mode: &str, path: &str, target: &str) {
2424
} else {
2525
flags.push("-Dwarnings -Dunused".to_owned()); // overwrite the -Aunused in compiletest-rs
2626
}
27-
if let Ok(sysroot) = std::env::var("MIRI_SYSROOT") {
27+
if let Ok(sysroot) = env::var("MIRI_SYSROOT") {
2828
flags.push(format!("--sysroot {}", sysroot));
2929
}
30-
if let Ok(extra_flags) = std::env::var("MIRIFLAGS") {
30+
if let Ok(extra_flags) = env::var("MIRIFLAGS") {
3131
flags.push(extra_flags);
3232
}
3333

@@ -80,14 +80,16 @@ fn get_host() -> String {
8080
}
8181

8282
fn get_target() -> String {
83-
std::env::var("MIRI_TEST_TARGET").unwrap_or_else(|_| get_host())
83+
env::var("MIRI_TEST_TARGET").unwrap_or_else(|_| get_host())
8484
}
8585

8686
fn test_runner(_tests: &[&()]) {
8787
// Add a test env var to do environment communication tests.
88-
std::env::set_var("MIRI_ENV_VAR_TEST", "0");
88+
env::set_var("MIRI_ENV_VAR_TEST", "0");
8989
// Let the tests know where to store temp files (they might run for a different target, which can make this hard to find).
90-
std::env::set_var("MIRI_TEMP", std::env::temp_dir());
90+
env::set_var("MIRI_TEMP", env::temp_dir());
91+
// Panic tests expect backtraces to be printed.
92+
env::set_var("RUST_BACKTRACE", "1");
9193

9294
let target = get_target();
9395
miri_pass("tests/run-pass", &target);

0 commit comments

Comments
 (0)