pub use std::env;
pub use std::fmt::{self, Debug};
pub use std::collections::hash_map::HashMap;
+pub use std::collections::btree_set::BTreeSet;
pub use std::convert::TryInto;
pub use std::fs;
pub use std::io::{self, BufRead, BufReader, ErrorKind, Write};
#[structopt(long="--geckodriver-args", default_value="")]
geckodriver_args: String,
+
+ tests: Vec<String>,
}
#[derive(Debug)]
pub mgmt_conn: MgmtChannel,
pub opts: Opts,
pub server_child: process::Child,
+ found_tests: BTreeSet<String>,
driver: T4d,
current_window: WindowState,
screenshot_count: ScreenShotCount,
}
impl Setup {
- pub fn want_test(&self, _tname: &str) -> bool { true }
+ 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);
+ y
+ }
#[throws(AE)]
pub fn new_window<'s>(&'s mut self, instance: &Instance, name: &str)
})()
.context("screenshots, in Setup::drop")
.just_warn();
+
+ let missing_tests = self.opts.tests.iter().cloned()
+ .filter(|s| !self.found_tests.contains(s))
+ .collect::<Vec<_>>();
+
+ if !missing_tests.is_empty() {
+ for f in &self.found_tests {
+ eprintln!("fyi: test that exists: {}", f);
+ }
+ for m in &missing_tests {
+ eprintln!("warning: unknown test requested: {}", m);
+ }
+ }
}
}
server_child,
driver,
opts,
+ found_tests: default(),
screenshot_count,
current_window: None,
windows_squirreled,