From: Ian Jackson Date: Sat, 13 Mar 2021 13:24:02 +0000 (+0000) Subject: apitest: make test! use a wanted_tests() method on $c X-Git-Tag: otter-0.4.0~127 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=ecd9fae4ba321daa1ce489ae243237c93540e460;p=otter.git apitest: make test! use a wanted_tests() method on $c Signed-off-by: Ian Jackson --- diff --git a/apitest.rs b/apitest.rs index eea5acf2..690df4b6 100644 --- a/apitest.rs +++ b/apitest.rs @@ -226,7 +226,7 @@ impl Drop for TrackWantedTests { #[macro_export] macro_rules! test { ($c:expr, $tname:expr, $s:stmt) => { - if $c.su.wanted_tests.wantp($tname) { + if $c.wanted_tests().wantp($tname) { debug!("-------------------- {} starting --------------------", $tname); $s info!("-------------------- {} completed --------------------", $tname); diff --git a/apitest/at-otter.rs b/apitest/at-otter.rs index c9095f01..e2ce45a6 100644 --- a/apitest/at-otter.rs +++ b/apitest/at-otter.rs @@ -16,6 +16,12 @@ struct Ctx { } deref_to_field!{Ctx, SetupCore, su} +impl Ctx { + fn wanted_tests(&mut self) -> &mut TrackWantedTests { + &mut self.su.wanted_tests + } +} + #[derive(Debug)] struct Player { url: String, diff --git a/wdriver/wdt-altergame.rs b/wdriver/wdt-altergame.rs index 28c1b101..90edfc4e 100644 --- a/wdriver/wdt-altergame.rs +++ b/wdriver/wdt-altergame.rs @@ -12,6 +12,10 @@ struct Ctx { } impl Ctx { + fn wanted_tests(&mut self) -> &mut TrackWantedTests { + &mut self.su.wanted_tests + } + #[throws(AE)] fn check_link(&mut self, desc: &'static str, url: Option<&str>) { (||{ diff --git a/wdriver/wdt-hand.rs b/wdriver/wdt-hand.rs index 301f0be7..7c20e671 100644 --- a/wdriver/wdt-hand.rs +++ b/wdriver/wdt-hand.rs @@ -11,6 +11,12 @@ struct Ctx { } deref_to_field!{Ctx, Setup, su} +impl Ctx { + fn wanted_tests(&mut self) -> &mut TrackWantedTests { + &mut self.su.wanted_tests + } +} + const HAND: &str = "6.1"; const ALICE: &str = "1#1"; diff --git a/wdriver/wdt-simple.rs b/wdriver/wdt-simple.rs index 167235e7..24063b08 100644 --- a/wdriver/wdt-simple.rs +++ b/wdriver/wdt-simple.rs @@ -13,6 +13,10 @@ struct Ctx { deref_to_field!{Ctx, Setup, su} impl Ctx { + fn wanted_tests(&mut self) -> &mut TrackWantedTests { + &mut self.su.wanted_tests + } + #[throws(AE)] fn drag(&mut self){ let su = &mut self.su;