diff --git a/ci/svd2rust-regress/src/diff.rs b/ci/svd2rust-regress/src/diff.rs index b51375b6..de4d0d31 100644 --- a/ci/svd2rust-regress/src/diff.rs +++ b/ci/svd2rust-regress/src/diff.rs @@ -235,10 +235,10 @@ impl Diffing { ) => last_args.as_deref(), None => None, }); - let join = |opt1: Option<&str>, opt2: Option<&str>| -> Option { + let join = |opt1: Option<&str>, opt2: Option<&str>| -> Option> { match (opt1, opt2) { - (Some(str1), Some(str2)) => Some(format!("{} {}", str1, str2)), - (Some(str), None) | (None, Some(str)) => Some(str.to_owned()), + (Some(str1), Some(str2)) => vec![str1.to_owned(), str2.to_owned()].into(), + (Some(str), None) | (None, Some(str)) => Some(vec![str.to_owned()]), (None, None) => None, } }; @@ -246,14 +246,14 @@ impl Diffing { .setup_case( &opts.output_dir.join("baseline"), &baseline_bin, - join(baseline_cmd, last_args).as_deref(), + &join(baseline_cmd, last_args), ) .with_context(|| "couldn't create head")?; let current = test .setup_case( &opts.output_dir.join("current"), ¤t_bin, - join(current_cmd, last_args).as_deref(), + &join(current_cmd, last_args), ) .with_context(|| "couldn't create base")?; diff --git a/ci/svd2rust-regress/src/main.rs b/ci/svd2rust-regress/src/main.rs index 2f3f9d0e..e45e4612 100644 --- a/ci/svd2rust-regress/src/main.rs +++ b/ci/svd2rust-regress/src/main.rs @@ -100,7 +100,7 @@ pub struct TestAll { #[clap(short = 'p', long = "svd2rust-path", default_value = default_svd2rust())] pub current_bin_path: PathBuf, #[clap(last = true)] - pub command: Option>, + pub passthrough_opts: Option>, // TODO: Specify smaller subset of tests? Maybe with tags? // TODO: Compile svd2rust? } @@ -149,7 +149,7 @@ pub struct Test { #[clap(short = 'p', long = "svd2rust-path", default_value = default_svd2rust())] pub current_bin_path: PathBuf, #[clap(last = true)] - pub command: Option>, + pub passthrough_opts: Option>, } impl Test { @@ -191,7 +191,7 @@ impl Test { .ok_or_else(|| anyhow::anyhow!("no test found for chip"))? .to_owned() }; - test.test(opts, &self.current_bin_path, &self.command)?; + test.test(opts, &self.current_bin_path, &self.passthrough_opts)?; Ok(()) } } @@ -247,7 +247,7 @@ impl TestAll { tests.par_iter().for_each(|t| { let start = Instant::now(); - match t.test(opt, &self.current_bin_path, &self.command) { + match t.test(opt, &self.current_bin_path, &self.passthrough_opts) { Ok(s) => { if let Some(stderrs) = s { let mut buf = String::new();