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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

0 commit comments

Comments
 (0)