File tree Expand file tree Collapse file tree 3 files changed +16
-15
lines changed
crates/intrinsic-test/src Expand file tree Collapse file tree 3 files changed +16
-15
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ impl SupportedArchitectureTest for ArmArchitectureTest {
104104 }
105105
106106 fn compare_outputs ( & self ) -> bool {
107- if let Some ( ref toolchain ) = self . cli_options . toolchain {
107+ if self . cli_options . toolchain . is_some ( ) {
108108 let intrinsics_name_list = self
109109 . intrinsics
110110 . iter ( )
@@ -113,8 +113,7 @@ impl SupportedArchitectureTest for ArmArchitectureTest {
113113
114114 compare_outputs (
115115 & intrinsics_name_list,
116- toolchain,
117- & self . cli_options . c_runner ,
116+ & self . cli_options . runner ,
118117 & self . cli_options . target ,
119118 )
120119 } else {
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ pub struct ProcessedCli {
6060 pub filename : PathBuf ,
6161 pub toolchain : Option < String > ,
6262 pub cpp_compiler : Option < String > ,
63- pub c_runner : String ,
63+ pub runner : String ,
6464 pub target : String ,
6565 pub linker : Option < String > ,
6666 pub cxx_toolchain_dir : Option < String > ,
@@ -102,7 +102,7 @@ impl ProcessedCli {
102102 Self {
103103 toolchain,
104104 cpp_compiler,
105- c_runner,
105+ runner : c_runner,
106106 target,
107107 linker,
108108 cxx_toolchain_dir,
Original file line number Diff line number Diff line change @@ -4,24 +4,26 @@ use std::process::Command;
44
55pub fn compare_outputs (
66 intrinsic_name_list : & Vec < String > ,
7- toolchain : & str ,
87 runner : & str ,
98 target : & str ,
109) -> bool {
10+ fn runner_command ( runner : & str ) -> Command {
11+ let mut it = runner. split_whitespace ( ) ;
12+ let mut cmd = Command :: new ( it. next ( ) . unwrap ( ) ) ;
13+ cmd. args ( it) ;
14+
15+ cmd
16+ }
17+
1118 let intrinsics = intrinsic_name_list
1219 . par_iter ( )
1320 . filter_map ( |intrinsic_name| {
14- let c = Command :: new ( "sh" )
15- . arg ( "-c" )
16- . arg ( format ! ( "{runner} ./c_programs/{intrinsic_name}" ) )
21+ let c = runner_command ( runner)
22+ . arg ( format ! ( "./c_programs/{intrinsic_name}" ) )
1723 . output ( ) ;
1824
19- let rust = Command :: new ( "sh" )
20- . current_dir ( "rust_programs" )
21- . arg ( "-c" )
22- . arg ( format ! (
23- "cargo {toolchain} run --target {target} --bin {intrinsic_name} --release" ,
24- ) )
25+ let rust = runner_command ( runner)
26+ . arg ( format ! ( "./rust_programs/target/{target}/release/{intrinsic_name}" ) )
2527 . env ( "RUSTFLAGS" , "-Cdebuginfo=0" )
2628 . output ( ) ;
2729
You can’t perform that action at this time.
0 commit comments