From adf85d35c70916297729a157f93df08d0c15be6c Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Tue, 20 Sep 2016 14:27:48 -0500 Subject: [PATCH 1/2] libtest: add a --skip flag to the test runner This flag takes a FILTER argument and instructs the test runner to skip the tests whose names contain the word FILTER. --skip can be used several times. --- src/libtest/lib.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index 2b4193306ddf5..3b97246ea145f 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)) @@ -1095,6 +1100,11 @@ pub fn filter_tests(opts: &TestOpts, tests: Vec) -> Vec Date: Tue, 27 Sep 2016 23:03:29 -0500 Subject: [PATCH 2/2] fix compiletest --- src/tools/compiletest/src/main.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs index 4afeb3613319b..114cfaf7972ea 100644 --- a/src/tools/compiletest/src/main.rs +++ b/src/tools/compiletest/src/main.rs @@ -313,6 +313,7 @@ pub fn test_opts(config: &Config) -> test::TestOpts { }, color: test::AutoColor, test_threads: None, + skip: vec![], } }