Skip to content

Commit de128be

Browse files
committed
Auto merge of #14675 - RalfJung:help, r=weihanglo
cargo test --help: clarify --tests and --benches This tries to reduce the confusion expressed in #10936. I am not sure what it means to "test a target in benchmark mode", this is copied verbatim from `cargo help test`.
2 parents 2c4cf1d + 2783a0f commit de128be

36 files changed

+150
-150
lines changed

src/bin/cargo/commands/bench.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ pub fn cli() -> Command {
3636
"Benchmark only the specified example",
3737
"Benchmark all examples",
3838
"Benchmark only the specified test target",
39-
"Benchmark all test targets",
39+
"Benchmark all targets that have `test = true` set",
4040
"Benchmark only the specified bench target",
41-
"Benchmark all bench targets",
41+
"Benchmark all targets that have `bench = true` set",
4242
"Benchmark all targets",
4343
)
4444
.arg_features()

src/bin/cargo/commands/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ pub fn cli() -> Command {
2222
"Build only the specified example",
2323
"Build all examples",
2424
"Build only the specified test target",
25-
"Build all test targets",
25+
"Build all targets that have `test = true` set",
2626
"Build only the specified bench target",
27-
"Build all bench targets",
27+
"Build all targets that have `bench = true` set",
2828
"Build all targets",
2929
)
3030
.arg_features()

src/bin/cargo/commands/check.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ pub fn cli() -> Command {
2222
"Check only the specified example",
2323
"Check all examples",
2424
"Check only the specified test target",
25-
"Check all test targets",
25+
"Check all targets that have `test = true` set",
2626
"Check only the specified bench target",
27-
"Check all bench targets",
27+
"Check all targets that have `bench = true` set",
2828
"Check all targets",
2929
)
3030
.arg_features()

src/bin/cargo/commands/fix.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ pub fn cli() -> Command {
4141
"Fix only the specified example",
4242
"Fix all examples",
4343
"Fix only the specified test target",
44-
"Fix all test targets",
44+
"Fix all targets that have `test = true` set",
4545
"Fix only the specified bench target",
46-
"Fix all bench targets",
46+
"Fix all targets that have `bench = true` set",
4747
"Fix all targets (default)",
4848
)
4949
.arg_features()

src/bin/cargo/commands/rustc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ pub fn cli() -> Command {
3838
"Build only the specified example",
3939
"Build all examples",
4040
"Build only the specified test target",
41-
"Build all test targets",
41+
"Build all targets that have `test = true` set",
4242
"Build only the specified bench target",
43-
"Build all bench targets",
43+
"Build all targets that have `bench = true` set",
4444
"Build all targets",
4545
)
4646
.arg_features()

src/bin/cargo/commands/rustdoc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ pub fn cli() -> Command {
2626
"Build only the specified example",
2727
"Build all examples",
2828
"Build only the specified test target",
29-
"Build all test targets",
29+
"Build all targets that have `test = true` set",
3030
"Build only the specified bench target",
31-
"Build all bench targets",
31+
"Build all targets that have `bench = true` set",
3232
"Build all targets",
3333
)
3434
.arg_features()

src/bin/cargo/commands/test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ pub fn cli() -> Command {
4141
"Test only the specified example",
4242
"Test all examples",
4343
"Test only the specified test target",
44-
"Test all test targets",
44+
"Test all targets that have `test = true` set",
4545
"Test only the specified bench target",
46-
"Test all bench targets",
46+
"Test all targets that have `bench = true` set",
4747
"Test all targets (does not include doctests)",
4848
)
4949
.arg(

src/doc/man/generated_txt/cargo-bench.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,11 @@ OPTIONS
172172
multiple times and supports common Unix glob patterns.
173173

174174
--tests
175-
Benchmark all targets in test mode that have the test = true
176-
manifest flag set. By default this includes the library and binaries
177-
built as unittests, and integration tests. Be aware that this will
178-
also build any required dependencies, so the lib target may be built
179-
twice (once as a unittest, and once as a dependency for binaries,
175+
Benchmark all targets that have the test = true manifest flag set.
176+
By default this includes the library and binaries built as
177+
unittests, and integration tests. Be aware that this will also build
178+
any required dependencies, so the lib target may be built twice
179+
(once as a unittest, and once as a dependency for binaries,
180180
integration tests, etc.). Targets may be enabled or disabled by
181181
setting the test flag in the manifest settings for the target.
182182

@@ -185,11 +185,11 @@ OPTIONS
185185
multiple times and supports common Unix glob patterns.
186186

187187
--benches
188-
Benchmark all targets in benchmark mode that have the bench = true
189-
manifest flag set. By default this includes the library and binaries
190-
built as benchmarks, and bench targets. Be aware that this will also
191-
build any required dependencies, so the lib target may be built
192-
twice (once as a benchmark, and once as a dependency for binaries,
188+
Benchmark all targets that have the bench = true manifest flag set.
189+
By default this includes the library and binaries built as
190+
benchmarks, and bench targets. Be aware that this will also build
191+
any required dependencies, so the lib target may be built twice
192+
(once as a benchmark, and once as a dependency for binaries,
193193
benchmarks, etc.). Targets may be enabled or disabled by setting the
194194
bench flag in the manifest settings for the target.
195195

src/doc/man/generated_txt/cargo-build.txt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -89,26 +89,26 @@ OPTIONS
8989
multiple times and supports common Unix glob patterns.
9090

9191
--tests
92-
Build all targets in test mode that have the test = true manifest
93-
flag set. By default this includes the library and binaries built as
94-
unittests, and integration tests. Be aware that this will also build
95-
any required dependencies, so the lib target may be built twice
96-
(once as a unittest, and once as a dependency for binaries,
97-
integration tests, etc.). Targets may be enabled or disabled by
98-
setting the test flag in the manifest settings for the target.
92+
Build all targets that have the test = true manifest flag set. By
93+
default this includes the library and binaries built as unittests,
94+
and integration tests. Be aware that this will also build any
95+
required dependencies, so the lib target may be built twice (once as
96+
a unittest, and once as a dependency for binaries, integration
97+
tests, etc.). Targets may be enabled or disabled by setting the test
98+
flag in the manifest settings for the target.
9999

100100
--bench name…
101101
Build the specified benchmark. This flag may be specified multiple
102102
times and supports common Unix glob patterns.
103103

104104
--benches
105-
Build all targets in benchmark mode that have the bench = true
106-
manifest flag set. By default this includes the library and binaries
107-
built as benchmarks, and bench targets. Be aware that this will also
108-
build any required dependencies, so the lib target may be built
109-
twice (once as a benchmark, and once as a dependency for binaries,
110-
benchmarks, etc.). Targets may be enabled or disabled by setting the
111-
bench flag in the manifest settings for the target.
105+
Build all targets that have the bench = true manifest flag set. By
106+
default this includes the library and binaries built as benchmarks,
107+
and bench targets. Be aware that this will also build any required
108+
dependencies, so the lib target may be built twice (once as a
109+
benchmark, and once as a dependency for binaries, benchmarks, etc.).
110+
Targets may be enabled or disabled by setting the bench flag in the
111+
manifest settings for the target.
112112

113113
--all-targets
114114
Build all targets. This is equivalent to specifying --lib --bins

src/doc/man/generated_txt/cargo-check.txt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -86,26 +86,26 @@ OPTIONS
8686
multiple times and supports common Unix glob patterns.
8787

8888
--tests
89-
Check all targets in test mode that have the test = true manifest
90-
flag set. By default this includes the library and binaries built as
91-
unittests, and integration tests. Be aware that this will also build
92-
any required dependencies, so the lib target may be built twice
93-
(once as a unittest, and once as a dependency for binaries,
94-
integration tests, etc.). Targets may be enabled or disabled by
95-
setting the test flag in the manifest settings for the target.
89+
Check all targets that have the test = true manifest flag set. By
90+
default this includes the library and binaries built as unittests,
91+
and integration tests. Be aware that this will also build any
92+
required dependencies, so the lib target may be built twice (once as
93+
a unittest, and once as a dependency for binaries, integration
94+
tests, etc.). Targets may be enabled or disabled by setting the test
95+
flag in the manifest settings for the target.
9696

9797
--bench name…
9898
Check the specified benchmark. This flag may be specified multiple
9999
times and supports common Unix glob patterns.
100100

101101
--benches
102-
Check all targets in benchmark mode that have the bench = true
103-
manifest flag set. By default this includes the library and binaries
104-
built as benchmarks, and bench targets. Be aware that this will also
105-
build any required dependencies, so the lib target may be built
106-
twice (once as a benchmark, and once as a dependency for binaries,
107-
benchmarks, etc.). Targets may be enabled or disabled by setting the
108-
bench flag in the manifest settings for the target.
102+
Check all targets that have the bench = true manifest flag set. By
103+
default this includes the library and binaries built as benchmarks,
104+
and bench targets. Be aware that this will also build any required
105+
dependencies, so the lib target may be built twice (once as a
106+
benchmark, and once as a dependency for binaries, benchmarks, etc.).
107+
Targets may be enabled or disabled by setting the bench flag in the
108+
manifest settings for the target.
109109

110110
--all-targets
111111
Check all targets. This is equivalent to specifying --lib --bins

0 commit comments

Comments
 (0)