Skip to content

Commit b28a1b2

Browse files
Rollup merge of #80053 - gilescope:include-ignore, r=m-ou-se
stabilise `cargo test -- --include-ignored` stabilise `cargo test -- --include-ignored` On stable there's no way to run ignored tests as well as the normal tests. An example use case where stabilising this would help: Exercism has some initial tests and then some additional ignored tests that people run currently with --ignore but currently they can't run all the tests in one go without being on nightly. It would be a little more ergonomic if this flag was stablilised. ( Fixes #65770 ) I built with ./x.py build -i library/test - but as libtest is a dylib is there an easy way to invoke it manually to check it's working as expected? (I've updated the automated tests.)
2 parents ac37c32 + fe2880a commit b28a1b2

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

library/test/src/cli.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,9 @@ fn parse_opts_impl(matches: getopts::Matches) -> OptRes {
230230
// Unstable flags
231231
let force_run_in_process = unstable_optflag!(matches, allow_unstable, "force-run-in-process");
232232
let exclude_should_panic = unstable_optflag!(matches, allow_unstable, "exclude-should-panic");
233-
let include_ignored = unstable_optflag!(matches, allow_unstable, "include-ignored");
234233
let time_options = get_time_options(&matches, allow_unstable)?;
235234

235+
let include_ignored = matches.opt_present("include-ignored");
236236
let quiet = matches.opt_present("quiet");
237237
let exact = matches.opt_present("exact");
238238
let list = matches.opt_present("list");

library/test/src/tests.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -391,12 +391,7 @@ fn parse_show_output_flag() {
391391

392392
#[test]
393393
fn parse_include_ignored_flag() {
394-
let args = vec![
395-
"progname".to_string(),
396-
"filter".to_string(),
397-
"-Zunstable-options".to_string(),
398-
"--include-ignored".to_string(),
399-
];
394+
let args = vec!["progname".to_string(), "filter".to_string(), "--include-ignored".to_string()];
400395
let opts = parse_opts(&args).unwrap().unwrap();
401396
assert_eq!(opts.run_ignored, RunIgnored::Yes);
402397
}

0 commit comments

Comments
 (0)