Skip to content

Commit 3b4dd4b

Browse files
committed
Auto merge of #12492 - weihanglo:keep-going-doc, r=epage
doc(unstable): `cargo test` does not provide `--keep-going`
2 parents f137594 + b45ffa9 commit 3b4dd4b

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/doc/src/reference/unstable.md

+13-3
Original file line numberDiff line numberDiff line change
@@ -432,9 +432,9 @@ like to stabilize it somehow!
432432
### keep-going
433433
* Tracking Issue: [#10496](https://github.com/rust-lang/cargo/issues/10496)
434434

435-
`cargo build --keep-going` (and similarly for `check`, `test` etc) will build as
436-
many crates in the dependency graph as possible, rather than aborting the build
437-
at the first one that fails to build.
435+
`cargo build --keep-going` (and similarly for every command involving compilation, like `check` and `doc`)
436+
will build as many crates in the dependency graph as possible,
437+
rather than aborting the build at the first one that fails to build.
438438

439439
For example if the current package depends on dependencies `fails` and `works`,
440440
one of which fails to build, `cargo check -j1` may or may not build the one that
@@ -449,6 +449,16 @@ The `-Z unstable-options` command-line option must be used in order to use
449449
cargo check --keep-going -Z unstable-options
450450
```
451451

452+
While `cargo test` and `cargo bench` commands involve compilation, they do not provide a `--keep-going` flag.
453+
Both commands already include a similar `--no-fail-fast` flag, allowing running as many tests as possible without stopping at the first failure.
454+
To "compile" as many tests as possible, use target selection flags like `--tests` to build test binaries separately.
455+
For example,
456+
457+
```console
458+
cargo build --tests --keep-going -Zunstable-options
459+
cargo test --tests --no-fail-fast
460+
```
461+
452462
### config-include
453463
* Tracking Issue: [#7723](https://github.com/rust-lang/cargo/issues/7723)
454464

0 commit comments

Comments
 (0)