From: Ralf Jung Date: Thu, 22 Oct 2020 08:36:01 +0000 (+0200) Subject: fix './miri test' X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=80c4b5d6741745803f86c8a96389001e3cf617ca;p=rust.git fix './miri test' --- diff --git a/tests/compiletest.rs b/tests/compiletest.rs index 35c1de3399c..ac44c48d621 100644 --- a/tests/compiletest.rs +++ b/tests/compiletest.rs @@ -24,10 +24,10 @@ fn run_tests(mode: &str, path: &str, target: &str) { } else { flags.push("-Dwarnings -Dunused".to_owned()); // overwrite the -Aunused in compiletest-rs } - if let Ok(sysroot) = std::env::var("MIRI_SYSROOT") { + if let Ok(sysroot) = env::var("MIRI_SYSROOT") { flags.push(format!("--sysroot {}", sysroot)); } - if let Ok(extra_flags) = std::env::var("MIRIFLAGS") { + if let Ok(extra_flags) = env::var("MIRIFLAGS") { flags.push(extra_flags); } @@ -80,14 +80,16 @@ fn get_host() -> String { } fn get_target() -> String { - std::env::var("MIRI_TEST_TARGET").unwrap_or_else(|_| get_host()) + env::var("MIRI_TEST_TARGET").unwrap_or_else(|_| get_host()) } fn test_runner(_tests: &[&()]) { // Add a test env var to do environment communication tests. - std::env::set_var("MIRI_ENV_VAR_TEST", "0"); + env::set_var("MIRI_ENV_VAR_TEST", "0"); // Let the tests know where to store temp files (they might run for a different target, which can make this hard to find). - std::env::set_var("MIRI_TEMP", std::env::temp_dir()); + env::set_var("MIRI_TEMP", env::temp_dir()); + // Panic tests expect backtraces to be printed. + env::set_var("RUST_BACKTRACE", "1"); let target = get_target(); miri_pass("tests/run-pass", &target);