Skip to content

Commit 1939b52

Browse files
authored
Rollup merge of rust-lang#142807 - sourcefrog:failfast, r=dtolnay
libtest: expose --fail-fast as an unstable command-line option This exposes the `fail_fast` option added in rust-lang#105153 on the test harness command line, so that workflows that only want to know if any test fails can find out without waiting for everything to run. For example, cargo-mutants just needs to know if any tests fails. It only works with `-Zunstable-options`. Tracking issue: rust-lang#142859
2 parents ac6ee69 + 69a27cd commit 1939b52

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/src/cli.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ fn optgroups() -> getopts::Options {
5757
.optflag("", "test", "Run tests and not benchmarks")
5858
.optflag("", "bench", "Run benchmarks instead of tests")
5959
.optflag("", "list", "List all tests and benchmarks")
60+
.optflag("", "fail-fast", "Don't start new tests after the first failure")
6061
.optflag("h", "help", "Display this message")
6162
.optopt("", "logfile", "Write logs to the specified file (deprecated)", "PATH")
6263
.optflag(
@@ -260,6 +261,7 @@ fn parse_opts_impl(matches: getopts::Matches) -> OptRes {
260261
// Unstable flags
261262
let force_run_in_process = unstable_optflag!(matches, allow_unstable, "force-run-in-process");
262263
let exclude_should_panic = unstable_optflag!(matches, allow_unstable, "exclude-should-panic");
264+
let fail_fast = unstable_optflag!(matches, allow_unstable, "fail-fast");
263265
let time_options = get_time_options(&matches, allow_unstable)?;
264266
let shuffle = get_shuffle(&matches, allow_unstable)?;
265267
let shuffle_seed = get_shuffle_seed(&matches, allow_unstable)?;
@@ -306,7 +308,7 @@ fn parse_opts_impl(matches: getopts::Matches) -> OptRes {
306308
skip,
307309
time_options,
308310
options,
309-
fail_fast: false,
311+
fail_fast,
310312
};
311313

312314
Ok(test_opts)

0 commit comments

Comments
 (0)