From 79a856bbabba02153289061c16bc2cc1075d49ff Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 21 Feb 2021 21:28:46 +0000 Subject: [PATCH] apitest: Tests tracking: break out WantedTests NFC Signed-off-by: Ian Jackson --- apitest.rs | 7 +++++++ wdriver.rs | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/apitest.rs b/apitest.rs index f7712db3..3f2472b7 100644 --- a/apitest.rs +++ b/apitest.rs @@ -125,6 +125,13 @@ pub struct Opts { #[structopt(long="--pause", default_value="0ms")] pub pause: humantime::Duration, + #[structopt(flatten)] + pub tests: WantedTests, +} + +#[derive(Clone,Debug)] +#[derive(StructOpt)] +pub struct WantedTests { pub tests: Vec, } diff --git a/wdriver.rs b/wdriver.rs index 8a29821c..6b80c3b1 100644 --- a/wdriver.rs +++ b/wdriver.rs @@ -361,8 +361,8 @@ impl Setup { pub fn want_test(&mut self, tname: &str) -> bool { self.found_tests.insert(tname.to_owned()); let y = - self.opts.tests.is_empty() || - self.opts.tests.iter().any(|s| s==tname); + self.opts.tests.tests.is_empty() || + self.opts.tests.tests.iter().any(|s| s==tname); y } @@ -652,7 +652,7 @@ impl Drop for Setup { .context("screenshots, in Setup::drop") .just_warn(); - let missing_tests = self.opts.tests.iter().cloned() + let missing_tests = self.opts.tests.tests.iter().cloned() .filter(|s| !self.found_tests.contains(s)) .collect::>(); -- 2.30.2