@@ -1933,7 +1933,8 @@ impl<'test> TestCx<'test> {
1933
1933
let mut test_client =
1934
1934
Command :: new ( self . config . remote_test_client . as_ref ( ) . unwrap ( ) ) ;
1935
1935
test_client
1936
- . args ( & [ "run" , & support_libs. len ( ) . to_string ( ) , & prog] )
1936
+ . args ( & [ "run" , & support_libs. len ( ) . to_string ( ) ] )
1937
+ . arg ( & prog)
1937
1938
. args ( support_libs)
1938
1939
. args ( args) ;
1939
1940
@@ -2516,15 +2517,15 @@ impl<'test> TestCx<'test> {
2516
2517
// If this is emscripten, then run tests under nodejs
2517
2518
if self . config . target . contains ( "emscripten" ) {
2518
2519
if let Some ( ref p) = self . config . nodejs {
2519
- args. push ( p. clone ( ) ) ;
2520
+ args. push ( p. into ( ) ) ;
2520
2521
} else {
2521
2522
self . fatal ( "emscripten target requested and no NodeJS binary found (--nodejs)" ) ;
2522
2523
}
2523
2524
// If this is otherwise wasm, then run tests under nodejs with our
2524
2525
// shim
2525
2526
} else if self . config . target . contains ( "wasm32" ) {
2526
2527
if let Some ( ref p) = self . config . nodejs {
2527
- args. push ( p. clone ( ) ) ;
2528
+ args. push ( p. into ( ) ) ;
2528
2529
} else {
2529
2530
self . fatal ( "wasm32 target requested and no NodeJS binary found (--nodejs)" ) ;
2530
2531
}
@@ -2536,13 +2537,12 @@ impl<'test> TestCx<'test> {
2536
2537
. unwrap ( ) // chop off `ui`
2537
2538
. parent ( )
2538
2539
. unwrap ( ) ; // chop off `tests`
2539
- args. push ( src. join ( "src/etc/wasm32-shim.js" ) . display ( ) . to_string ( ) ) ;
2540
+ args. push ( src. join ( "src/etc/wasm32-shim.js" ) . into_os_string ( ) ) ;
2540
2541
}
2541
2542
2542
2543
let exe_file = self . make_exe_name ( ) ;
2543
2544
2544
- // FIXME (#9639): This needs to handle non-utf8 paths
2545
- args. push ( exe_file. to_str ( ) . unwrap ( ) . to_owned ( ) ) ;
2545
+ args. push ( exe_file. into_os_string ( ) ) ;
2546
2546
2547
2547
// Add the arguments in the run_flags directive
2548
2548
args. extend ( self . split_maybe_args ( & self . props . run_flags ) ) ;
@@ -2551,12 +2551,16 @@ impl<'test> TestCx<'test> {
2551
2551
ProcArgs { prog, args }
2552
2552
}
2553
2553
2554
- fn split_maybe_args ( & self , argstr : & Option < String > ) -> Vec < String > {
2554
+ fn split_maybe_args ( & self , argstr : & Option < String > ) -> Vec < OsString > {
2555
2555
match * argstr {
2556
2556
Some ( ref s) => s
2557
2557
. split ( ' ' )
2558
2558
. filter_map ( |s| {
2559
- if s. chars ( ) . all ( |c| c. is_whitespace ( ) ) { None } else { Some ( s. to_owned ( ) ) }
2559
+ if s. chars ( ) . all ( |c| c. is_whitespace ( ) ) {
2560
+ None
2561
+ } else {
2562
+ Some ( OsString :: from ( s) )
2563
+ }
2560
2564
} )
2561
2565
. collect ( ) ,
2562
2566
None => Vec :: new ( ) ,
@@ -4363,8 +4367,8 @@ impl<'test> TestCx<'test> {
4363
4367
}
4364
4368
4365
4369
struct ProcArgs {
4366
- prog : String ,
4367
- args : Vec < String > ,
4370
+ prog : OsString ,
4371
+ args : Vec < OsString > ,
4368
4372
}
4369
4373
4370
4374
pub struct ProcRes {
0 commit comments