From 3b33ae03620c86dc8b1657059992da659614bfb8 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 17 May 2021 17:54:55 +0100 Subject: [PATCH] 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 --- apitest/apitest.rs | 7 +++++-- apitest/at-otter.rs | 1 - wdriver/wdriver.rs | 1 - 3 files changed, 5 insertions(+), 4 deletions(-) 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")?; -- 2.30.2