@@ -335,14 +335,13 @@ impl<'test> TestCx<'test> {
335
335
. args ( & [ "--target" , & self . config . target ] )
336
336
. arg ( "-L" ) . arg ( & aux_dir)
337
337
. args ( self . split_maybe_args ( & self . config . target_rustcflags ) )
338
- . args ( & self . props . compile_flags ) ;
338
+ . args ( & self . props . compile_flags )
339
+ . envs ( self . props . exec_env . clone ( ) ) ;
339
340
340
341
self . compose_and_run ( rustc,
341
- self . props . exec_env . clone ( ) ,
342
342
self . config . compile_lib_path . to_str ( ) . unwrap ( ) ,
343
343
Some ( aux_dir. to_str ( ) . unwrap ( ) ) ,
344
- Some ( src) ,
345
- None )
344
+ Some ( src) )
346
345
}
347
346
348
347
fn compare_source ( & self ,
@@ -642,16 +641,13 @@ actual:\n\
642
641
format!( "-command={}" , debugger_script. to_str( ) . unwrap( ) ) ] ;
643
642
644
643
let mut gdb = Command :: new ( self . config . gdb . as_ref ( ) . unwrap ( ) ) ;
645
- gdb. args ( & debugger_opts) ;
646
-
647
- let environment = vec ! [ ( "PYTHONPATH" . to_owned( ) , rust_pp_module_abs_path) ] ;
644
+ gdb. args ( & debugger_opts)
645
+ . env ( "PYTHONPATH" , rust_pp_module_abs_path) ;
648
646
649
647
debugger_run_result =
650
648
self . compose_and_run ( gdb,
651
- environment,
652
649
self . config . run_lib_path . to_str ( ) . unwrap ( ) ,
653
650
None ,
654
- None ,
655
651
None ) ;
656
652
}
657
653
}
@@ -1203,30 +1199,26 @@ actual:\n\
1203
1199
}
1204
1200
let mut test_client = Command :: new (
1205
1201
self . config . remote_test_client . as_ref ( ) . unwrap ( ) ) ;
1206
- test_client. args ( & [ "run" , & prog] ) ;
1207
- test_client. args ( args) ;
1202
+ test_client
1203
+ . args ( & [ "run" , & prog] )
1204
+ . args ( args)
1205
+ . envs ( env. clone ( ) ) ;
1208
1206
self . compose_and_run ( test_client,
1209
- env,
1210
1207
self . config . run_lib_path . to_str ( ) . unwrap ( ) ,
1211
1208
Some ( aux_dir. to_str ( ) . unwrap ( ) ) ,
1212
- None ,
1213
1209
None )
1214
1210
}
1215
1211
_ => {
1216
1212
let aux_dir = self . aux_output_dir_name ( ) ;
1217
- let working_dir =
1218
- Some ( self . output_base_name ( )
1219
- . parent ( ) . unwrap ( )
1220
- . to_str ( ) . unwrap ( ) . to_owned ( ) ) ;
1221
1213
let ProcArgs { prog, args } = self . make_run_args ( ) ;
1222
1214
let mut program = Command :: new ( & prog) ;
1223
- program. args ( args) ;
1215
+ program. args ( args)
1216
+ . current_dir ( & self . output_base_name ( ) . parent ( ) . unwrap ( ) )
1217
+ . envs ( env. clone ( ) ) ;
1224
1218
self . compose_and_run ( program,
1225
- env,
1226
1219
self . config . run_lib_path . to_str ( ) . unwrap ( ) ,
1227
1220
Some ( aux_dir. to_str ( ) . unwrap ( ) ) ,
1228
- None ,
1229
- working_dir)
1221
+ None )
1230
1222
}
1231
1223
}
1232
1224
}
@@ -1304,10 +1296,8 @@ actual:\n\
1304
1296
let mut rustc = Command :: new ( prog) ;
1305
1297
rustc. args ( & args) ;
1306
1298
let auxres = aux_cx. compose_and_run ( rustc,
1307
- Vec :: new ( ) ,
1308
1299
aux_cx. config . compile_lib_path . to_str ( ) . unwrap ( ) ,
1309
1300
Some ( aux_dir. to_str ( ) . unwrap ( ) ) ,
1310
- None ,
1311
1301
None ) ;
1312
1302
if !auxres. status . success ( ) {
1313
1303
self . fatal_proc_rec (
@@ -1319,23 +1309,20 @@ actual:\n\
1319
1309
1320
1310
let ProcArgs { prog, args } = args;
1321
1311
let mut rustc = Command :: new ( prog) ;
1322
- rustc. args ( args) ;
1312
+ rustc. args ( args)
1313
+ . envs ( self . props . rustc_env . clone ( ) ) ;
1323
1314
1324
1315
self . compose_and_run ( rustc,
1325
- self . props . rustc_env . clone ( ) ,
1326
1316
self . config . compile_lib_path . to_str ( ) . unwrap ( ) ,
1327
1317
Some ( aux_dir. to_str ( ) . unwrap ( ) ) ,
1328
- input,
1329
- None )
1318
+ input)
1330
1319
}
1331
1320
1332
1321
fn compose_and_run ( & self ,
1333
1322
mut command : Command ,
1334
- procenv : Vec < ( String , String ) > ,
1335
1323
lib_path : & str ,
1336
1324
aux_path : Option < & str > ,
1337
- input : Option < String > ,
1338
- working_dir : Option < String > ) -> ProcRes {
1325
+ input : Option < String > ) -> ProcRes {
1339
1326
let cmdline =
1340
1327
{
1341
1328
let cmdline = self . make_cmdline ( & command, lib_path) ;
@@ -1349,12 +1336,6 @@ actual:\n\
1349
1336
. stdin ( Stdio :: piped ( ) ) ;
1350
1337
1351
1338
procsrv:: add_target_env ( & mut command, lib_path, aux_path) ;
1352
- for ( key, val) in procenv {
1353
- command. env ( & key, & val) ;
1354
- }
1355
- if let Some ( cwd) = working_dir {
1356
- command. current_dir ( cwd) ;
1357
- }
1358
1339
1359
1340
let mut child = command. spawn ( ) . expect ( & format ! ( "failed to exec `{:?}`" , & command) ) ;
1360
1341
if let Some ( input) = input {
@@ -1706,10 +1687,9 @@ actual:\n\
1706
1687
fn check_ir_with_filecheck ( & self ) -> ProcRes {
1707
1688
let irfile = self . output_base_name ( ) . with_extension ( "ll" ) ;
1708
1689
let mut filecheck = Command :: new ( self . config . llvm_filecheck . as_ref ( ) . unwrap ( ) ) ;
1709
- // FIXME (#9639): This needs to handle non-utf8 paths
1710
- filecheck. arg ( & format ! ( "-input-file={}" , irfile. to_str( ) . unwrap( ) ) ) ;
1711
- filecheck. arg ( & self . testpaths . file ) ;
1712
- self . compose_and_run ( filecheck, Vec :: new ( ) , "" , None , None , None )
1690
+ filecheck. arg ( "--input-file" ) . arg ( irfile)
1691
+ . arg ( & self . testpaths . file ) ;
1692
+ self . compose_and_run ( filecheck, "" , None , None )
1713
1693
}
1714
1694
1715
1695
fn run_codegen_test ( & self ) {
0 commit comments