Skip to content

Commit 8d1d20d

Browse files
committed
Auto merge of #12422 - obi1kenobi:patch-2, r=epage
Clarify in `--help` that `cargo test --all-targets` excludes doctests Per my proposal here: #6669 (comment) I tried to keep the edit minimalistic to match the surrounding style. If the maintainers are amenable to it, I think it could also be useful to do one or more of: - Offer concrete guidance on what to do to run actually-all tests (`--all-targets` then separately `--doc`). - Link to the issue at: #6669 - Mention that `cargo test` without `--all-targets` runs doctests by default, which seems not immediately obvious. I'd be happy to attempt to add any of the above that the maintainers feel would be a good fit here.
2 parents c91a693 + 2f59b20 commit 8d1d20d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/bin/cargo/commands/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub fn cli() -> Command {
3434
"Test all tests",
3535
"Test only the specified bench target",
3636
"Test all benches",
37-
"Test all targets",
37+
"Test all targets (does not include doctests)",
3838
)
3939
.arg(flag("doc", "Test only this library's documentation"))
4040
.arg(flag("no-run", "Compile, but don't run tests"))

tests/testsuite/cargo_test/help/stdout.log

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Options:
1717
--test [<NAME>] Test only the specified test target
1818
--benches Test all benches
1919
--bench [<NAME>] Test only the specified bench target
20-
--all-targets Test all targets
20+
--all-targets Test all targets (does not include doctests)
2121
--doc Test only this library's documentation
2222
--no-run Compile, but don't run tests
2323
--no-fail-fast Run all tests regardless of failure

0 commit comments

Comments
 (0)