Skip to content

Commit 65e297d

Browse files
committed
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
2 parents 0fe3257 + 76918a0 commit 65e297d

File tree

16 files changed

+34
-34
lines changed

16 files changed

+34
-34
lines changed

src/bin/cargo/commands/bench.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ pub fn cli() -> Command {
3737
"Benchmark only the specified example",
3838
"Benchmark all examples",
3939
"Benchmark only the specified test target",
40-
"Benchmark all tests",
40+
"Benchmark all test targets",
4141
"Benchmark only the specified bench target",
42-
"Benchmark all benches",
42+
"Benchmark all bench targets",
4343
"Benchmark all targets",
4444
)
4545
.arg_features()

src/bin/cargo/commands/build.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ pub fn cli() -> Command {
2323
"Build only the specified example",
2424
"Build all examples",
2525
"Build only the specified test target",
26-
"Build all tests",
26+
"Build all test targets",
2727
"Build only the specified bench target",
28-
"Build all benches",
28+
"Build all bench targets",
2929
"Build all targets",
3030
)
3131
.arg_features()

src/bin/cargo/commands/check.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ pub fn cli() -> Command {
2323
"Check only the specified example",
2424
"Check all examples",
2525
"Check only the specified test target",
26-
"Check all tests",
26+
"Check all test targets",
2727
"Check only the specified bench target",
28-
"Check all benches",
28+
"Check all bench targets",
2929
"Check all targets",
3030
)
3131
.arg_features()

src/bin/cargo/commands/fix.rs

+2-2
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 tests",
44+
"Fix all test targets",
4545
"Fix only the specified bench target",
46-
"Fix all benches",
46+
"Fix all bench targets",
4747
"Fix all targets (default)",
4848
)
4949
.arg_features()

src/bin/cargo/commands/rustc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ pub fn cli() -> Command {
3939
"Build only the specified example",
4040
"Build all examples",
4141
"Build only the specified test target",
42-
"Build all tests",
42+
"Build all test targets",
4343
"Build only the specified bench target",
44-
"Build all benches",
44+
"Build all bench targets",
4545
"Build all targets",
4646
)
4747
.arg_features()

src/bin/cargo/commands/rustdoc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ pub fn cli() -> Command {
2727
"Build only the specified example",
2828
"Build all examples",
2929
"Build only the specified test target",
30-
"Build all tests",
30+
"Build all test targets",
3131
"Build only the specified bench target",
32-
"Build all benches",
32+
"Build all bench targets",
3333
"Build all targets",
3434
)
3535
.arg_features()

src/bin/cargo/commands/test.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ pub fn cli() -> Command {
4343
"Test only the specified example",
4444
"Test all examples",
4545
"Test only the specified test target",
46-
"Test all tests",
46+
"Test all test targets",
4747
"Test only the specified bench target",
48-
"Test all benches",
48+
"Test all bench targets",
4949
"Test all targets (does not include doctests)",
5050
)
5151
.arg_features()

src/cargo/util/workspace.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ pub fn print_available_binaries(ws: &Workspace<'_>, options: &CompileOptions) ->
8787
}
8888

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

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

9797
/// The path that we pass to rustc is actually fairly important because it will

tests/testsuite/cargo_bench/help/stdout.log

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ Target Selection:
3131
--bin [<NAME>] Benchmark only the specified binary
3232
--examples Benchmark all examples
3333
--example [<NAME>] Benchmark only the specified example
34-
--tests Benchmark all tests
34+
--tests Benchmark all test targets
3535
--test [<NAME>] Benchmark only the specified test target
36-
--benches Benchmark all benches
36+
--benches Benchmark all bench targets
3737
--bench [<NAME>] Benchmark only the specified bench target
3838
--all-targets Benchmark all targets
3939

tests/testsuite/cargo_build/help/stdout.log

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ Target Selection:
2626
--bin [<NAME>] Build only the specified binary
2727
--examples Build all examples
2828
--example [<NAME>] Build only the specified example
29-
--tests Build all tests
29+
--tests Build all test targets
3030
--test [<NAME>] Build only the specified test target
31-
--benches Build all benches
31+
--benches Build all bench targets
3232
--bench [<NAME>] Build only the specified bench target
3333
--all-targets Build all targets
3434

tests/testsuite/cargo_check/help/stdout.log

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ Target Selection:
2626
--bin [<NAME>] Check only the specified binary
2727
--examples Check all examples
2828
--example [<NAME>] Check only the specified example
29-
--tests Check all tests
29+
--tests Check all test targets
3030
--test [<NAME>] Check only the specified test target
31-
--benches Check all benches
31+
--benches Check all bench targets
3232
--bench [<NAME>] Check only the specified bench target
3333
--all-targets Check all targets
3434

tests/testsuite/cargo_fix/help/stdout.log

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ Target Selection:
3131
--bin [<NAME>] Fix only the specified binary
3232
--examples Fix all examples
3333
--example [<NAME>] Fix only the specified example
34-
--tests Fix all tests
34+
--tests Fix all test targets
3535
--test [<NAME>] Fix only the specified test target
36-
--benches Fix all benches
36+
--benches Fix all bench targets
3737
--bench [<NAME>] Fix only the specified bench target
3838
--all-targets Fix all targets (default)
3939

tests/testsuite/cargo_rustc/help/stdout.log

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ Target Selection:
2828
--bin [<NAME>] Build only the specified binary
2929
--examples Build all examples
3030
--example [<NAME>] Build only the specified example
31-
--tests Build all tests
31+
--tests Build all test targets
3232
--test [<NAME>] Build only the specified test target
33-
--benches Build all benches
33+
--benches Build all bench targets
3434
--bench [<NAME>] Build only the specified bench target
3535
--all-targets Build all targets
3636

tests/testsuite/cargo_rustdoc/help/stdout.log

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ Target Selection:
2626
--bin [<NAME>] Build only the specified binary
2727
--examples Build all examples
2828
--example [<NAME>] Build only the specified example
29-
--tests Build all tests
29+
--tests Build all test targets
3030
--test [<NAME>] Build only the specified test target
31-
--benches Build all benches
31+
--benches Build all bench targets
3232
--bench [<NAME>] Build only the specified bench target
3333
--all-targets Build all targets
3434

tests/testsuite/cargo_test/help/stdout.log

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ Target Selection:
3333
--bin [<NAME>] Test only the specified binary
3434
--examples Test all examples
3535
--example [<NAME>] Test only the specified example
36-
--tests Test all tests
36+
--tests Test all test targets
3737
--test [<NAME>] Test only the specified test target
38-
--benches Test all benches
38+
--benches Test all bench targets
3939
--bench [<NAME>] Test only the specified bench target
4040
--all-targets Test all targets (does not include doctests)
4141

tests/testsuite/list_availables.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Available binaries:
5959
.with_stderr(
6060
"\
6161
error: \"--bench\" takes one argument.
62-
Available benches:
62+
Available bench targets:
6363
bench1
6464
bench2
6565
@@ -75,7 +75,7 @@ Available benches:
7575
.with_stderr(
7676
"\
7777
error: \"--test\" takes one argument.
78-
Available tests:
78+
Available test targets:
7979
test1
8080
test2
8181
@@ -139,7 +139,7 @@ No binaries available.
139139
.with_stderr(
140140
"\
141141
error: \"--bench\" takes one argument.
142-
No benches available.
142+
No bench targets available.
143143
144144
",
145145
)
@@ -153,7 +153,7 @@ No benches available.
153153
.with_stderr(
154154
"\
155155
error: \"--test\" takes one argument.
156-
No tests available.
156+
No test targets available.
157157
158158
",
159159
)

0 commit comments

Comments
 (0)