Skip to content

Commit

Permalink
Auto merge of #14675 - RalfJung:help, r=weihanglo
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
bors committed Oct 12, 2024
2 parents 2c4cf1d + 2783a0f commit de128be
Show file tree
Hide file tree
Showing 36 changed files with 150 additions and 150 deletions.
4 changes: 2 additions & 2 deletions src/bin/cargo/commands/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ pub fn cli() -> Command {
"Benchmark only the specified example",
"Benchmark all examples",
"Benchmark only the specified test target",
"Benchmark all test targets",
"Benchmark all targets that have `test = true` set",
"Benchmark only the specified bench target",
"Benchmark all bench targets",
"Benchmark all targets that have `bench = true` set",
"Benchmark all targets",
)
.arg_features()
Expand Down
4 changes: 2 additions & 2 deletions src/bin/cargo/commands/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ pub fn cli() -> Command {
"Build only the specified example",
"Build all examples",
"Build only the specified test target",
"Build all test targets",
"Build all targets that have `test = true` set",
"Build only the specified bench target",
"Build all bench targets",
"Build all targets that have `bench = true` set",
"Build all targets",
)
.arg_features()
Expand Down
4 changes: 2 additions & 2 deletions src/bin/cargo/commands/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ pub fn cli() -> Command {
"Check only the specified example",
"Check all examples",
"Check only the specified test target",
"Check all test targets",
"Check all targets that have `test = true` set",
"Check only the specified bench target",
"Check all bench targets",
"Check all targets that have `bench = true` set",
"Check all targets",
)
.arg_features()
Expand Down
4 changes: 2 additions & 2 deletions src/bin/cargo/commands/fix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ pub fn cli() -> Command {
"Fix only the specified example",
"Fix all examples",
"Fix only the specified test target",
"Fix all test targets",
"Fix all targets that have `test = true` set",
"Fix only the specified bench target",
"Fix all bench targets",
"Fix all targets that have `bench = true` set",
"Fix all targets (default)",
)
.arg_features()
Expand Down
4 changes: 2 additions & 2 deletions src/bin/cargo/commands/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ pub fn cli() -> Command {
"Build only the specified example",
"Build all examples",
"Build only the specified test target",
"Build all test targets",
"Build all targets that have `test = true` set",
"Build only the specified bench target",
"Build all bench targets",
"Build all targets that have `bench = true` set",
"Build all targets",
)
.arg_features()
Expand Down
4 changes: 2 additions & 2 deletions src/bin/cargo/commands/rustdoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ pub fn cli() -> Command {
"Build only the specified example",
"Build all examples",
"Build only the specified test target",
"Build all test targets",
"Build all targets that have `test = true` set",
"Build only the specified bench target",
"Build all bench targets",
"Build all targets that have `bench = true` set",
"Build all targets",
)
.arg_features()
Expand Down
4 changes: 2 additions & 2 deletions src/bin/cargo/commands/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ pub fn cli() -> Command {
"Test only the specified example",
"Test all examples",
"Test only the specified test target",
"Test all test targets",
"Test all targets that have `test = true` set",
"Test only the specified bench target",
"Test all bench targets",
"Test all targets that have `bench = true` set",
"Test all targets (does not include doctests)",
)
.arg(
Expand Down
20 changes: 10 additions & 10 deletions src/doc/man/generated_txt/cargo-bench.txt
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,11 @@ OPTIONS
multiple times and supports common Unix glob patterns.

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

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

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

Expand Down
28 changes: 14 additions & 14 deletions src/doc/man/generated_txt/cargo-build.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,26 +89,26 @@ OPTIONS
multiple times and supports common Unix glob patterns.

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

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

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

--all-targets
Build all targets. This is equivalent to specifying --lib --bins
Expand Down
28 changes: 14 additions & 14 deletions src/doc/man/generated_txt/cargo-check.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,26 +86,26 @@ OPTIONS
multiple times and supports common Unix glob patterns.

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

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

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

--all-targets
Check all targets. This is equivalent to specifying --lib --bins
Expand Down
28 changes: 14 additions & 14 deletions src/doc/man/generated_txt/cargo-fix.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,26 +159,26 @@ OPTIONS
multiple times and supports common Unix glob patterns.

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

--bench name…
Fix the specified benchmark. This flag may be specified multiple
times and supports common Unix glob patterns.

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

--all-targets
Fix all targets. This is equivalent to specifying --lib --bins
Expand Down
28 changes: 14 additions & 14 deletions src/doc/man/generated_txt/cargo-rustc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,26 +80,26 @@ OPTIONS
multiple times and supports common Unix glob patterns.

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

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

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

--all-targets
Build all targets. This is equivalent to specifying --lib --bins
Expand Down
24 changes: 12 additions & 12 deletions src/doc/man/generated_txt/cargo-rustdoc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,24 +80,24 @@ OPTIONS
multiple times and supports common Unix glob patterns.

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

--bench name…
Document the specified benchmark. This flag may be specified
multiple times and supports common Unix glob patterns.

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

Expand Down
Loading

0 comments on commit de128be

Please sign in to comment.