Skip to content

Commit a9f86ad

Browse files
committed
Auto merge of #13756 - dtolnay-contrib:testdoc, r=weihanglo
Recategorize cargo test's `--doc` flag under "Target Selection" ### What does this PR try to resolve? In `cargo help test`, the `--doc` flag is listed under a section called "Target Selection" next to `--lib`, `--bin`, `--bins`, `--example`, `--examples`, `--test`, `--tests`, `--bench`, `--benches`, and `--all-targets`. But in `cargo test --help`, it was instead listed in an "Options" section next to `--no-run`, `--message-format`, `--color`, etc, which seems less appropriate than "Target Selection". ### How should we test and review this PR? - `cargo build --release` - `cargo test --release --test testsuite -- cargo_test::help::case` - `target/release/cargo test --help` - `target/release/cargo help test` (unchanged)
2 parents 07ac23a + afea119 commit a9f86ad

File tree

2 files changed

+34
-31
lines changed

2 files changed

+34
-31
lines changed

src/bin/cargo/commands/test.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ pub fn cli() -> Command {
1818
.num_args(0..)
1919
.last(true),
2020
)
21-
.arg(flag("doc", "Test only this library's documentation"))
2221
.arg(flag("no-run", "Compile, but don't run tests"))
2322
.arg(flag("no-fail-fast", "Run all tests regardless of failure"))
2423
.arg_future_incompat_report()
@@ -47,6 +46,10 @@ pub fn cli() -> Command {
4746
"Test all bench targets",
4847
"Test all targets (does not include doctests)",
4948
)
49+
.arg(
50+
flag("doc", "Test only this library's documentation")
51+
.help_heading(heading::TARGET_SELECTION),
52+
)
5053
.arg_features()
5154
.arg_jobs()
5255
.arg_unsupported_keep_going()

tests/testsuite/cargo_test/help/stdout.term.svg

Lines changed: 30 additions & 30 deletions
Loading

0 commit comments

Comments
 (0)