Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): Clarify --test is for targets, not test functions #12915

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/bin/cargo/commands/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ pub fn cli() -> Command {
"Benchmark only the specified example",
"Benchmark all examples",
"Benchmark only the specified test target",
"Benchmark all tests",
"Benchmark all test targets",
"Benchmark only the specified bench target",
"Benchmark all benches",
"Benchmark all bench targets",
"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 @@ -23,9 +23,9 @@ pub fn cli() -> Command {
"Build only the specified example",
"Build all examples",
"Build only the specified test target",
"Build all tests",
"Build all test targets",
"Build only the specified bench target",
"Build all benches",
"Build all bench targets",
"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 @@ -23,9 +23,9 @@ pub fn cli() -> Command {
"Check only the specified example",
"Check all examples",
"Check only the specified test target",
"Check all tests",
"Check all test targets",
"Check only the specified bench target",
"Check all benches",
"Check all bench targets",
"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 tests",
"Fix all test targets",
"Fix only the specified bench target",
"Fix all benches",
"Fix all bench targets",
"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 @@ -39,9 +39,9 @@ pub fn cli() -> Command {
"Build only the specified example",
"Build all examples",
"Build only the specified test target",
"Build all tests",
"Build all test targets",
"Build only the specified bench target",
"Build all benches",
"Build all bench targets",
"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 @@ -27,9 +27,9 @@ pub fn cli() -> Command {
"Build only the specified example",
"Build all examples",
"Build only the specified test target",
"Build all tests",
"Build all test targets",
"Build only the specified bench target",
"Build all benches",
"Build all bench targets",
"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 @@ -43,9 +43,9 @@ pub fn cli() -> Command {
"Test only the specified example",
"Test all examples",
"Test only the specified test target",
"Test all tests",
"Test all test targets",
"Test only the specified bench target",
"Test all benches",
"Test all bench targets",
"Test all targets (does not include doctests)",
)
.arg_features()
Expand Down
4 changes: 2 additions & 2 deletions src/cargo/util/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ pub fn print_available_binaries(ws: &Workspace<'_>, options: &CompileOptions) ->
}

pub fn print_available_benches(ws: &Workspace<'_>, options: &CompileOptions) -> CargoResult<()> {
print_available_targets(Target::is_bench, ws, options, "--bench", "benches")
print_available_targets(Target::is_bench, ws, options, "--bench", "bench targets")
}

pub fn print_available_tests(ws: &Workspace<'_>, options: &CompileOptions) -> CargoResult<()> {
print_available_targets(Target::is_test, ws, options, "--test", "tests")
print_available_targets(Target::is_test, ws, options, "--test", "test targets")
}

/// The path that we pass to rustc is actually fairly important because it will
Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/cargo_bench/help/stdout.log
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ Target Selection:
--bin [<NAME>] Benchmark only the specified binary
--examples Benchmark all examples
--example [<NAME>] Benchmark only the specified example
--tests Benchmark all tests
--tests Benchmark all test targets
--test [<NAME>] Benchmark only the specified test target
--benches Benchmark all benches
--benches Benchmark all bench targets
--bench [<NAME>] Benchmark only the specified bench target
--all-targets Benchmark all targets

Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/cargo_build/help/stdout.log
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ Target Selection:
--bin [<NAME>] Build only the specified binary
--examples Build all examples
--example [<NAME>] Build only the specified example
--tests Build all tests
--tests Build all test targets
--test [<NAME>] Build only the specified test target
--benches Build all benches
--benches Build all bench targets
--bench [<NAME>] Build only the specified bench target
--all-targets Build all targets

Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/cargo_check/help/stdout.log
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ Target Selection:
--bin [<NAME>] Check only the specified binary
--examples Check all examples
--example [<NAME>] Check only the specified example
--tests Check all tests
--tests Check all test targets
--test [<NAME>] Check only the specified test target
--benches Check all benches
--benches Check all bench targets
--bench [<NAME>] Check only the specified bench target
--all-targets Check all targets

Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/cargo_fix/help/stdout.log
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ Target Selection:
--bin [<NAME>] Fix only the specified binary
--examples Fix all examples
--example [<NAME>] Fix only the specified example
--tests Fix all tests
--tests Fix all test targets
--test [<NAME>] Fix only the specified test target
--benches Fix all benches
--benches Fix all bench targets
--bench [<NAME>] Fix only the specified bench target
--all-targets Fix all targets (default)

Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/cargo_rustc/help/stdout.log
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ Target Selection:
--bin [<NAME>] Build only the specified binary
--examples Build all examples
--example [<NAME>] Build only the specified example
--tests Build all tests
--tests Build all test targets
--test [<NAME>] Build only the specified test target
--benches Build all benches
--benches Build all bench targets
--bench [<NAME>] Build only the specified bench target
--all-targets Build all targets

Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/cargo_rustdoc/help/stdout.log
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ Target Selection:
--bin [<NAME>] Build only the specified binary
--examples Build all examples
--example [<NAME>] Build only the specified example
--tests Build all tests
--tests Build all test targets
--test [<NAME>] Build only the specified test target
--benches Build all benches
--benches Build all bench targets
--bench [<NAME>] Build only the specified bench target
--all-targets Build all targets

Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/cargo_test/help/stdout.log
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ Target Selection:
--bin [<NAME>] Test only the specified binary
--examples Test all examples
--example [<NAME>] Test only the specified example
--tests Test all tests
--tests Test all test targets
--test [<NAME>] Test only the specified test target
--benches Test all benches
--benches Test all bench targets
--bench [<NAME>] Test only the specified bench target
--all-targets Test all targets (does not include doctests)

Expand Down
8 changes: 4 additions & 4 deletions tests/testsuite/list_availables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Available binaries:
.with_stderr(
"\
error: \"--bench\" takes one argument.
Available benches:
Available bench targets:
bench1
bench2

Expand All @@ -75,7 +75,7 @@ Available benches:
.with_stderr(
"\
error: \"--test\" takes one argument.
Available tests:
Available test targets:
test1
test2

Expand Down Expand Up @@ -139,7 +139,7 @@ No binaries available.
.with_stderr(
"\
error: \"--bench\" takes one argument.
No benches available.
No bench targets available.

",
)
Expand All @@ -153,7 +153,7 @@ No benches available.
.with_stderr(
"\
error: \"--test\" takes one argument.
No tests available.
No test targets available.

",
)
Expand Down