diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index 13d57f784e7..dcfd3f754c7 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -303,6 +303,7 @@ pub struct TestOpts { pub color: ColorConfig, pub quiet: bool, pub test_threads: Option, + pub skip: Vec, } impl TestOpts { @@ -318,6 +319,7 @@ impl TestOpts { color: AutoColor, quiet: false, test_threads: None, + skip: vec![], } } } @@ -337,6 +339,8 @@ fn optgroups() -> Vec { task, allow printing directly"), getopts::optopt("", "test-threads", "Number of threads used for running tests \ in parallel", "n_threads"), + getopts::optmulti("", "skip", "Skip tests whose names contain FILTER (this flag can \ + be used multiple times)","FILTER"), getopts::optflag("q", "quiet", "Display one character per test instead of one line"), getopts::optopt("", "color", "Configure coloring of output: auto = colorize if stdout is a tty and tests are run on serially (default); @@ -446,6 +450,7 @@ pub fn parse_opts(args: &[String]) -> Option { color: color, quiet: quiet, test_threads: test_threads, + skip: matches.opt_strs("skip"), }; Some(Ok(test_opts)) @@ -1101,6 +1106,11 @@ pub fn filter_tests(opts: &TestOpts, tests: Vec) -> Vec test::TestOpts { }, color: test::AutoColor, test_threads: None, + skip: vec![], } }