Skip to content

Commit 37983c1

Browse files
committed
Make x t miri respect MIRI_TEMP
1 parent bfe762e commit 37983c1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/tools/miri/tests/compiletest.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,10 @@ fn test_config(target: &str, path: &str, mode: Mode, with_dependencies: bool) ->
8181

8282
// Add a test env var to do environment communication tests.
8383
program.envs.push(("MIRI_ENV_VAR_TEST".into(), Some("0".into())));
84-
// Let the tests know where to store temp files (they might run for a different target, which can make this hard to find).
85-
program.envs.push(("MIRI_TEMP".into(), Some(env::temp_dir().into())));
8684

85+
// Let the tests know where to store temp files (they might run for a different target, which can make this hard to find).
86+
program.envs.push(("MIRI_TEMP".into(), Some(env::var_os("MIRI_TEMP").unwrap_or_else(|| env::temp_dir().into()))));
87+
8788
let mut config = Config {
8889
target: Some(target.to_owned()),
8990
stderr_filters: STDERR.clone(),

0 commit comments

Comments
 (0)