File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ fn optgroups() -> getopts::Options {
57
57
. optflag ( "" , "test" , "Run tests and not benchmarks" )
58
58
. optflag ( "" , "bench" , "Run benchmarks instead of tests" )
59
59
. optflag ( "" , "list" , "List all tests and benchmarks" )
60
+ . optflag ( "" , "fail-fast" , "Don't start new tests after the first failure" )
60
61
. optflag ( "h" , "help" , "Display this message" )
61
62
. optopt ( "" , "logfile" , "Write logs to the specified file (deprecated)" , "PATH" )
62
63
. optflag (
@@ -270,6 +271,7 @@ fn parse_opts_impl(matches: getopts::Matches) -> OptRes {
270
271
let exact = matches. opt_present ( "exact" ) ;
271
272
let list = matches. opt_present ( "list" ) ;
272
273
let skip = matches. opt_strs ( "skip" ) ;
274
+ let fail_fast = matches. opt_present ( "fail-fast" ) ;
273
275
274
276
let bench_benchmarks = matches. opt_present ( "bench" ) ;
275
277
let run_tests = !bench_benchmarks || matches. opt_present ( "test" ) ;
@@ -307,7 +309,7 @@ fn parse_opts_impl(matches: getopts::Matches) -> OptRes {
307
309
skip,
308
310
time_options,
309
311
options,
310
- fail_fast : false ,
312
+ fail_fast,
311
313
} ;
312
314
313
315
Ok ( test_opts)
Original file line number Diff line number Diff line change @@ -158,6 +158,16 @@ unstable-options` flag. See [tracking issue
158
158
159
159
The following options affect how tests are executed.
160
160
161
+ #### ` --fail-fast `
162
+
163
+ Stops tests after the first failure.
164
+
165
+ If running tests in parallel (which is the default), then tests that have already been started on
166
+ other threads will be allowed to run to completion before the process exits.
167
+
168
+ Note that when running tests in parallel, the test execution order is non-deterministic:
169
+ if multiple tests would fail, the first failure encountered will be reported.
170
+
161
171
#### ` --test-threads ` _ NUM_THREADS_
162
172
163
173
Sets the number of threads to use for running tests in parallel. By default,
You can’t perform that action at this time.
0 commit comments