]> git.lizzy.rs Git - rust.git/commitdiff
fix './miri test'
authorRalf Jung <post@ralfj.de>
Thu, 22 Oct 2020 08:36:01 +0000 (10:36 +0200)
committerRalf Jung <post@ralfj.de>
Thu, 22 Oct 2020 08:36:05 +0000 (10:36 +0200)
tests/compiletest.rs

index 35c1de3399c02ef51ca8a691fe3bc5a9de622cfe..ac44c48d6214a702ebdb434011e12a2d6b42fa52 100644 (file)
@@ -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);