Skip to content

Commit

Permalink
this should fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
robamu committed Feb 3, 2025
1 parent 72e5075 commit 1ea7ef0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions ci/svd2rust-regress/src/diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,25 +235,25 @@ impl Diffing {
) => last_args.as_deref(),
None => None,
});
let join = |opt1: Option<&str>, opt2: Option<&str>| -> Option<String> {
let join = |opt1: Option<&str>, opt2: Option<&str>| -> Option<Vec<String>> {
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,
}
};
let baseline = test
.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"),
&current_bin,
join(current_cmd, last_args).as_deref(),
&join(current_cmd, last_args),
)
.with_context(|| "couldn't create base")?;

Expand Down
8 changes: 4 additions & 4 deletions ci/svd2rust-regress/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Vec<String>>,
pub passthrough_opts: Option<Vec<String>>,
// TODO: Specify smaller subset of tests? Maybe with tags?
// TODO: Compile svd2rust?
}
Expand Down Expand Up @@ -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<Vec<String>>,
pub passthrough_opts: Option<Vec<String>>,
}

impl Test {
Expand Down Expand Up @@ -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(())
}
}
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 1ea7ef0

Please sign in to comment.