Skip to content

Commit

Permalink
Auto merge of #12492 - weihanglo:keep-going-doc, r=epage
Browse files Browse the repository at this point in the history
doc(unstable): `cargo test` does not provide `--keep-going`
  • Loading branch information
bors committed Aug 14, 2023
2 parents f137594 + b45ffa9 commit 3b4dd4b
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/doc/src/reference/unstable.md
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,9 @@ like to stabilize it somehow!
### keep-going
* Tracking Issue: [#10496](https://github.com/rust-lang/cargo/issues/10496)

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

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

While `cargo test` and `cargo bench` commands involve compilation, they do not provide a `--keep-going` flag.
Both commands already include a similar `--no-fail-fast` flag, allowing running as many tests as possible without stopping at the first failure.
To "compile" as many tests as possible, use target selection flags like `--tests` to build test binaries separately.
For example,

```console
cargo build --tests --keep-going -Zunstable-options
cargo test --tests --no-fail-fast
```

### config-include
* Tracking Issue: [#7723](https://github.com/rust-lang/cargo/issues/7723)

Expand Down

0 comments on commit 3b4dd4b

Please sign in to comment.