From: Ian Jackson Date: Mon, 17 May 2021 16:54:55 +0000 (+0100) Subject: apitest: Un-clone-and-hack api early arg test predicate X-Git-Tag: otter-0.6.0~183 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=3b33ae03620c86dc8b1657059992da659614bfb8;p=otter.git apitest: Un-clone-and-hack api early arg test predicate At some point I guess we could make this concrete entirely but this will do for now. Signed-off-by: Ian Jackson --- diff --git a/apitest/apitest.rs b/apitest/apitest.rs index 04b0b877..06799fad 100644 --- a/apitest/apitest.rs +++ b/apitest/apitest.rs @@ -958,7 +958,7 @@ impl MgmtChannel { // ==================== core entrypoint, for wdriver too ==================== #[throws(AE)] -pub fn setup_core(module_paths: &[&str], early_args: EarlyArgPredicate) -> +pub fn setup_core(module_paths: &[&str]) -> (O, Instance, SetupCore) where O: StructOpt + AsRef { @@ -995,7 +995,10 @@ pub fn setup_core(module_paths: &[&str], early_args: EarlyArgPredicate) -> .to_owned(); if !opts.no_bwrap { - reinvoke_via_bwrap(&opts, ¤t_exe, early_args) + reinvoke_via_bwrap( + &opts, ¤t_exe, + &mut |s: &OsStr| s.to_str().unwrap().starts_with("--test=") + ) .context("reinvoke via bwrap")?; } diff --git a/apitest/at-otter.rs b/apitest/at-otter.rs index 5d7018bb..412faf23 100644 --- a/apitest/at-otter.rs +++ b/apitest/at-otter.rs @@ -781,7 +781,6 @@ pub fn main() { { let (opts, _instance, su) = setup_core( &[module_path!()], - &mut |s: &OsStr| s.to_str().unwrap().starts_with("--test=") )?; let spec = su.ds.game_spec_data()?; let mut mc = su.mgmt_conn(); diff --git a/wdriver/wdriver.rs b/wdriver/wdriver.rs index 8e9ad7ee..00ca2948 100644 --- a/wdriver/wdriver.rs +++ b/wdriver/wdriver.rs @@ -819,7 +819,6 @@ pub fn setup(exe_module_path: &str) -> (Setup, Instance) { let (opts, instance, core) = apitest::setup_core( &[exe_module_path, "otter_webdriver_tests"], - &mut |s: &OsStr| s.to_str().unwrap().starts_with("--test=") )?; prepare_xserver(&core.cln, &core.ds).did("setup X server")?;