@@ -141,7 +141,7 @@ impl TestCase {
141141 & self ,
142142 opts : & Opts ,
143143 bin_path : & Path ,
144- cli_opts : Option < & str > ,
144+ cli_opts : & Option < Vec < String > > ,
145145 ) -> Result < Option < Vec < PathBuf > > , TestError > {
146146 let ( chip_dir, mut process_stderr_paths) = self
147147 . setup_case ( & opts. output_dir , bin_path, cli_opts)
@@ -175,7 +175,7 @@ impl TestCase {
175175 & self ,
176176 output_dir : & Path ,
177177 svd2rust_bin_path : & Path ,
178- command : Option < & str > ,
178+ command : & Option < Vec < String > > ,
179179 ) -> Result < ( PathBuf , Vec < PathBuf > ) , TestError > {
180180 let user = match std:: env:: var ( "USER" ) {
181181 Ok ( val) => val,
@@ -211,10 +211,6 @@ impl TestCase {
211211 . capture_outputs ( true , "cargo init" , None , None , & [ ] )
212212 . with_context ( || "Failed to cargo init" ) ?;
213213
214- let command_split = command
215- . map ( |cmd| shell_words:: split ( cmd) . context ( "unable to split command into args" ) )
216- . transpose ( ) ?;
217-
218214 self . prepare_chip_test_toml ( & chip_dir, command) ?;
219215 let chip_svd = self . prepare_svd_file ( & chip_dir) ?;
220216 self . prepare_rust_toolchain_file ( & chip_dir) ?;
@@ -228,7 +224,7 @@ impl TestCase {
228224 & chip_dir,
229225 & lib_rs_file,
230226 & svd2rust_err_file,
231- & command_split ,
227+ command ,
232228 ) ?;
233229 process_stderr_paths. push ( svd2rust_err_file) ;
234230 match self . arch {
@@ -331,7 +327,11 @@ impl TestCase {
331327 Ok ( ( ) )
332328 }
333329
334- fn prepare_chip_test_toml ( & self , chip_dir : & Path , opts : Option < & str > ) -> Result < ( ) , TestError > {
330+ fn prepare_chip_test_toml (
331+ & self ,
332+ chip_dir : & Path ,
333+ opts : & Option < Vec < String > > ,
334+ ) -> Result < ( ) , TestError > {
335335 let svd_toml = path_helper_base ( chip_dir, & [ "Cargo.toml" ] ) ;
336336 let mut file = OpenOptions :: new ( )
337337 . append ( true )
@@ -348,8 +348,12 @@ impl TestCase {
348348 Target :: XtensaLX => [ ] . iter ( ) ,
349349 Target :: None => unreachable ! ( ) ,
350350 } )
351- . chain ( if opts. unwrap_or_default ( ) . contains ( "--atomics" ) {
352- CRATES_ATOMICS . iter ( )
351+ . chain ( if let Some ( opts) = opts {
352+ if opts. iter ( ) . find ( |v| v. contains ( "atomics" ) ) . is_some ( ) {
353+ CRATES_ATOMICS . iter ( )
354+ } else {
355+ [ ] . iter ( )
356+ }
353357 } else {
354358 [ ] . iter ( )
355359 } )
0 commit comments