@@ -1939,7 +1939,8 @@ impl<'test> TestCx<'test> {
1939
1939
let mut test_client =
1940
1940
Command :: new ( self . config . remote_test_client . as_ref ( ) . unwrap ( ) ) ;
1941
1941
test_client
1942
- . args ( & [ "run" , & support_libs. len ( ) . to_string ( ) , & prog] )
1942
+ . args ( & [ "run" , & support_libs. len ( ) . to_string ( ) ] )
1943
+ . arg ( & prog)
1943
1944
. args ( support_libs)
1944
1945
. args ( args) ;
1945
1946
@@ -2525,15 +2526,15 @@ impl<'test> TestCx<'test> {
2525
2526
// If this is emscripten, then run tests under nodejs
2526
2527
if self . config . target . contains ( "emscripten" ) {
2527
2528
if let Some ( ref p) = self . config . nodejs {
2528
- args. push ( p. clone ( ) ) ;
2529
+ args. push ( p. into ( ) ) ;
2529
2530
} else {
2530
2531
self . fatal ( "emscripten target requested and no NodeJS binary found (--nodejs)" ) ;
2531
2532
}
2532
2533
// If this is otherwise wasm, then run tests under nodejs with our
2533
2534
// shim
2534
2535
} else if self . config . target . contains ( "wasm32" ) {
2535
2536
if let Some ( ref p) = self . config . nodejs {
2536
- args. push ( p. clone ( ) ) ;
2537
+ args. push ( p. into ( ) ) ;
2537
2538
} else {
2538
2539
self . fatal ( "wasm32 target requested and no NodeJS binary found (--nodejs)" ) ;
2539
2540
}
@@ -2545,13 +2546,12 @@ impl<'test> TestCx<'test> {
2545
2546
. unwrap ( ) // chop off `ui`
2546
2547
. parent ( )
2547
2548
. unwrap ( ) ; // chop off `tests`
2548
- args. push ( src. join ( "src/etc/wasm32-shim.js" ) . display ( ) . to_string ( ) ) ;
2549
+ args. push ( src. join ( "src/etc/wasm32-shim.js" ) . into_os_string ( ) ) ;
2549
2550
}
2550
2551
2551
2552
let exe_file = self . make_exe_name ( ) ;
2552
2553
2553
- // FIXME (#9639): This needs to handle non-utf8 paths
2554
- args. push ( exe_file. to_str ( ) . unwrap ( ) . to_owned ( ) ) ;
2554
+ args. push ( exe_file. into_os_string ( ) ) ;
2555
2555
2556
2556
// Add the arguments in the run_flags directive
2557
2557
args. extend ( self . split_maybe_args ( & self . props . run_flags ) ) ;
@@ -2560,12 +2560,16 @@ impl<'test> TestCx<'test> {
2560
2560
ProcArgs { prog, args }
2561
2561
}
2562
2562
2563
- fn split_maybe_args ( & self , argstr : & Option < String > ) -> Vec < String > {
2563
+ fn split_maybe_args ( & self , argstr : & Option < String > ) -> Vec < OsString > {
2564
2564
match * argstr {
2565
2565
Some ( ref s) => s
2566
2566
. split ( ' ' )
2567
2567
. filter_map ( |s| {
2568
- if s. chars ( ) . all ( |c| c. is_whitespace ( ) ) { None } else { Some ( s. to_owned ( ) ) }
2568
+ if s. chars ( ) . all ( |c| c. is_whitespace ( ) ) {
2569
+ None
2570
+ } else {
2571
+ Some ( OsString :: from ( s) )
2572
+ }
2569
2573
} )
2570
2574
. collect ( ) ,
2571
2575
None => Vec :: new ( ) ,
@@ -4372,8 +4376,8 @@ impl<'test> TestCx<'test> {
4372
4376
}
4373
4377
4374
4378
struct ProcArgs {
4375
- prog : String ,
4376
- args : Vec < String > ,
4379
+ prog : OsString ,
4380
+ args : Vec < OsString > ,
4377
4381
}
4378
4382
4379
4383
pub struct ProcRes {
0 commit comments