Auto merge of #12915 - epage:test-targets, r=weihanglo

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

We already refer to test targets as "test targets" instead of "tests" in `--test` but not `--tests` or in the error output.  This makes it uniformly refer to them as "test targets", making it clearer that these aren't test functions.

Fixes #7864
This commit is contained in:
bors 2023-11-03 20:56:31 +00:00
commit 65e297d1ec
16 changed files with 34 additions and 34 deletions

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -59,7 +59,7 @@ Available binaries:
.with_stderr(
"\
error: \"--bench\" takes one argument.
Available benches:
Available bench targets:
bench1
bench2
@ -75,7 +75,7 @@ Available benches:
.with_stderr(
"\
error: \"--test\" takes one argument.
Available tests:
Available test targets:
test1
test2
@ -139,7 +139,7 @@ No binaries available.
.with_stderr(
"\
error: \"--bench\" takes one argument.
No benches available.
No bench targets available.
",
)
@ -153,7 +153,7 @@ No benches available.
.with_stderr(
"\
error: \"--test\" takes one argument.
No tests available.
No test targets available.
",
)