From: Ian Jackson Date: Sun, 21 Feb 2021 21:28:46 +0000 (+0000) Subject: apitest: Tests tracking: break out WantedTests X-Git-Tag: otter-0.4.0~395 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=79a856bbabba02153289061c16bc2cc1075d49ff;p=otter.git apitest: Tests tracking: break out WantedTests NFC Signed-off-by: Ian Jackson --- 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::>();