@@ -59,6 +59,13 @@ fn test_config(target: &str, path: &str, mode: Mode, with_dependencies: bool) ->
59
59
let mut program = CommandBuilder :: rustc ( ) ;
60
60
program. program = miri_path ( ) ;
61
61
62
+ // Add a test env var to do environment communication tests.
63
+ program. envs . push ( ( "MIRI_ENV_VAR_TEST" . into ( ) , Some ( "0" . into ( ) ) ) ) ;
64
+ // Let the tests know where to store temp files (they might run for a different target, which can make this hard to find).
65
+ program. envs . push ( ( "MIRI_TEMP" . into ( ) , Some ( tmpdir. to_owned ( ) . into ( ) ) ) ) ;
66
+ // If a test ICEs, we want to see a backtrace.
67
+ program. envs . push ( ( "RUST_BACKTRACE" . into ( ) , Some ( "1" . into ( ) ) ) ) ;
68
+
62
69
// Add some flags we always want.
63
70
program. args . push (
64
71
format ! (
@@ -128,15 +135,6 @@ fn run_tests(
128
135
) -> Result < ( ) > {
129
136
let mut config = test_config ( target, path, mode, with_dependencies) ;
130
137
131
- // Add a test env var to do environment communication tests.
132
- config. program . envs . push ( ( "MIRI_ENV_VAR_TEST" . into ( ) , Some ( "0" . into ( ) ) ) ) ;
133
-
134
- // Let the tests know where to store temp files (they might run for a different target, which can make this hard to find).
135
- config. program . envs . push ( ( "MIRI_TEMP" . into ( ) , Some ( tmpdir. to_owned ( ) . into ( ) ) ) ) ;
136
-
137
- // If a test ICEs, we want to see a backtrace.
138
- config. program . envs . push ( ( "RUST_BACKTRACE" . into ( ) , Some ( "1" . into ( ) ) ) ) ;
139
-
140
138
// Handle command-line arguments.
141
139
let args = ui_test:: Args :: test ( ) ?;
142
140
let default_bless = env:: var_os ( "RUSTC_BLESS" ) . is_some_and ( |v| v != "0" ) ;
@@ -306,6 +304,7 @@ fn run_dep_mode(target: String, mut args: impl Iterator<Item = OsString>) -> Res
306
304
/* with dependencies */ true ,
307
305
) ;
308
306
config. program . args . clear ( ) ; // We want to give the user full control over flags
307
+ config. program . env . clear ( ) ; // and the env
309
308
let dep_args = config. build_dependencies ( ) ?;
310
309
311
310
let mut cmd = config. program . build ( & config. out_dir ) ;
0 commit comments