about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMaybe Waffle <waffle.lapkin@gmail.com>2024-03-06 20:34:31 +0000
committerMaybe Waffle <waffle.lapkin@gmail.com>2024-03-06 22:53:49 +0000
commitee1c691befd416221354b3595fd109a7d480ec01 (patch)
treef40832f8eb1ac5c15f5ecc03ee3aafb1d9e8c320
parentbfe762e0ed2e95041cc12c02c5565c4368f2cc9f (diff)
downloadrust-ee1c691befd416221354b3595fd109a7d480ec01.tar.gz
rust-ee1c691befd416221354b3595fd109a7d480ec01.zip
Make `x t miri` respect `MIRI_TEMP`
-rw-r--r--src/tools/miri/tests/compiletest.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tools/miri/tests/compiletest.rs b/src/tools/miri/tests/compiletest.rs
index 9f467724565..db0768848fd 100644
--- a/src/tools/miri/tests/compiletest.rs
+++ b/src/tools/miri/tests/compiletest.rs
@@ -81,8 +81,10 @@ fn test_config(target: &str, path: &str, mode: Mode, with_dependencies: bool) ->
 
     // Add a test env var to do environment communication tests.
     program.envs.push(("MIRI_ENV_VAR_TEST".into(), Some("0".into())));
+
     // Let the tests know where to store temp files (they might run for a different target, which can make this hard to find).
-    program.envs.push(("MIRI_TEMP".into(), Some(env::temp_dir().into())));
+    let miri_temp = env::var_os("MIRI_TEMP").unwrap_or_else(|| env::temp_dir().into());
+    program.envs.push(("MIRI_TEMP".into(), Some(miri_temp)));
 
     let mut config = Config {
         target: Some(target.to_owned()),