chiark / gitweb /
apitest: Un-clone-and-hack api early arg test predicate
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 17 May 2021 16:54:55 +0000 (17:54 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 17 May 2021 16:55:39 +0000 (17:55 +0100)
At some point I guess we could make this concrete entirely but
this will do for now.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
apitest/apitest.rs
apitest/at-otter.rs
wdriver/wdriver.rs

index 04b0b8777933cd4c6382296cbff7a0f006ef8f1a..06799fad53f64665cf6e806c20a41b17a12976f0 100644 (file)
@@ -958,7 +958,7 @@ impl MgmtChannel {
 // ==================== core entrypoint, for wdriver too ====================
 
 #[throws(AE)]
-pub fn setup_core<O>(module_paths: &[&str], early_args: EarlyArgPredicate) ->
+pub fn setup_core<O>(module_paths: &[&str]) ->
   (O, Instance, SetupCore)
   where O: StructOpt + AsRef<Opts>
 {
@@ -995,7 +995,10 @@ pub fn setup_core<O>(module_paths: &[&str], early_args: EarlyArgPredicate) ->
     .to_owned();
 
   if !opts.no_bwrap {
-    reinvoke_via_bwrap(&opts, &current_exe, early_args)
+    reinvoke_via_bwrap(
+      &opts, &current_exe,
+      &mut |s: &OsStr| s.to_str().unwrap().starts_with("--test=")
+    )
       .context("reinvoke via bwrap")?;
   }
 
index 5d7018bbd7b27ac42163b9e0620753447a464a95..412faf23fb4d48300d5f7150ebf341906690f6da 100644 (file)
@@ -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();
index 8e9ad7eec7658b91634f300d759e3e1acb6dbff9..00ca2948f21bd9569220449ab9512925b3d67a7c 100644 (file)
@@ -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")?;