From 76918a0e99ef87f1e01d0e7866e498b8702b5a89 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Fri, 3 Nov 2023 15:45:00 -0500 Subject: [PATCH] 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 --- src/bin/cargo/commands/bench.rs | 4 ++-- src/bin/cargo/commands/build.rs | 4 ++-- src/bin/cargo/commands/check.rs | 4 ++-- src/bin/cargo/commands/fix.rs | 4 ++-- src/bin/cargo/commands/rustc.rs | 4 ++-- src/bin/cargo/commands/rustdoc.rs | 4 ++-- src/bin/cargo/commands/test.rs | 4 ++-- src/cargo/util/workspace.rs | 4 ++-- tests/testsuite/cargo_bench/help/stdout.log | 4 ++-- tests/testsuite/cargo_build/help/stdout.log | 4 ++-- tests/testsuite/cargo_check/help/stdout.log | 4 ++-- tests/testsuite/cargo_fix/help/stdout.log | 4 ++-- tests/testsuite/cargo_rustc/help/stdout.log | 4 ++-- tests/testsuite/cargo_rustdoc/help/stdout.log | 4 ++-- tests/testsuite/cargo_test/help/stdout.log | 4 ++-- tests/testsuite/list_availables.rs | 8 ++++---- 16 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/bin/cargo/commands/bench.rs b/src/bin/cargo/commands/bench.rs index 4a84505a69a..85c975a6cf2 100644 --- a/src/bin/cargo/commands/bench.rs +++ b/src/bin/cargo/commands/bench.rs @@ -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() diff --git a/src/bin/cargo/commands/build.rs b/src/bin/cargo/commands/build.rs index 083b43e45ea..e2ed87d1bf6 100644 --- a/src/bin/cargo/commands/build.rs +++ b/src/bin/cargo/commands/build.rs @@ -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() diff --git a/src/bin/cargo/commands/check.rs b/src/bin/cargo/commands/check.rs index a54e84cdcdd..77e2b928085 100644 --- a/src/bin/cargo/commands/check.rs +++ b/src/bin/cargo/commands/check.rs @@ -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() diff --git a/src/bin/cargo/commands/fix.rs b/src/bin/cargo/commands/fix.rs index 0ecf47450ae..bd938dbc748 100644 --- a/src/bin/cargo/commands/fix.rs +++ b/src/bin/cargo/commands/fix.rs @@ -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() diff --git a/src/bin/cargo/commands/rustc.rs b/src/bin/cargo/commands/rustc.rs index 5c6086ed742..9b6a57577df 100644 --- a/src/bin/cargo/commands/rustc.rs +++ b/src/bin/cargo/commands/rustc.rs @@ -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() diff --git a/src/bin/cargo/commands/rustdoc.rs b/src/bin/cargo/commands/rustdoc.rs index 1c88829fbcb..72de57ad016 100644 --- a/src/bin/cargo/commands/rustdoc.rs +++ b/src/bin/cargo/commands/rustdoc.rs @@ -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() diff --git a/src/bin/cargo/commands/test.rs b/src/bin/cargo/commands/test.rs index b9d956b5a00..6e8aff0435e 100644 --- a/src/bin/cargo/commands/test.rs +++ b/src/bin/cargo/commands/test.rs @@ -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() diff --git a/src/cargo/util/workspace.rs b/src/cargo/util/workspace.rs index e8317f101e4..a2e0fff5068 100644 --- a/src/cargo/util/workspace.rs +++ b/src/cargo/util/workspace.rs @@ -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 diff --git a/tests/testsuite/cargo_bench/help/stdout.log b/tests/testsuite/cargo_bench/help/stdout.log index a310f73aa28..95546b4a3e9 100644 --- a/tests/testsuite/cargo_bench/help/stdout.log +++ b/tests/testsuite/cargo_bench/help/stdout.log @@ -31,9 +31,9 @@ Target Selection: --bin [] Benchmark only the specified binary --examples Benchmark all examples --example [] Benchmark only the specified example - --tests Benchmark all tests + --tests Benchmark all test targets --test [] Benchmark only the specified test target - --benches Benchmark all benches + --benches Benchmark all bench targets --bench [] Benchmark only the specified bench target --all-targets Benchmark all targets diff --git a/tests/testsuite/cargo_build/help/stdout.log b/tests/testsuite/cargo_build/help/stdout.log index 56b934cd168..58b12cdcd6b 100644 --- a/tests/testsuite/cargo_build/help/stdout.log +++ b/tests/testsuite/cargo_build/help/stdout.log @@ -26,9 +26,9 @@ Target Selection: --bin [] Build only the specified binary --examples Build all examples --example [] Build only the specified example - --tests Build all tests + --tests Build all test targets --test [] Build only the specified test target - --benches Build all benches + --benches Build all bench targets --bench [] Build only the specified bench target --all-targets Build all targets diff --git a/tests/testsuite/cargo_check/help/stdout.log b/tests/testsuite/cargo_check/help/stdout.log index 92d44a6ded2..bbf090d1d5f 100644 --- a/tests/testsuite/cargo_check/help/stdout.log +++ b/tests/testsuite/cargo_check/help/stdout.log @@ -26,9 +26,9 @@ Target Selection: --bin [] Check only the specified binary --examples Check all examples --example [] Check only the specified example - --tests Check all tests + --tests Check all test targets --test [] Check only the specified test target - --benches Check all benches + --benches Check all bench targets --bench [] Check only the specified bench target --all-targets Check all targets diff --git a/tests/testsuite/cargo_fix/help/stdout.log b/tests/testsuite/cargo_fix/help/stdout.log index dbbd11b7752..3e8b1427fbb 100644 --- a/tests/testsuite/cargo_fix/help/stdout.log +++ b/tests/testsuite/cargo_fix/help/stdout.log @@ -31,9 +31,9 @@ Target Selection: --bin [] Fix only the specified binary --examples Fix all examples --example [] Fix only the specified example - --tests Fix all tests + --tests Fix all test targets --test [] Fix only the specified test target - --benches Fix all benches + --benches Fix all bench targets --bench [] Fix only the specified bench target --all-targets Fix all targets (default) diff --git a/tests/testsuite/cargo_rustc/help/stdout.log b/tests/testsuite/cargo_rustc/help/stdout.log index 8d184dc0629..60069f526eb 100644 --- a/tests/testsuite/cargo_rustc/help/stdout.log +++ b/tests/testsuite/cargo_rustc/help/stdout.log @@ -28,9 +28,9 @@ Target Selection: --bin [] Build only the specified binary --examples Build all examples --example [] Build only the specified example - --tests Build all tests + --tests Build all test targets --test [] Build only the specified test target - --benches Build all benches + --benches Build all bench targets --bench [] Build only the specified bench target --all-targets Build all targets diff --git a/tests/testsuite/cargo_rustdoc/help/stdout.log b/tests/testsuite/cargo_rustdoc/help/stdout.log index 8d4415cbb63..67ee27e6b2d 100644 --- a/tests/testsuite/cargo_rustdoc/help/stdout.log +++ b/tests/testsuite/cargo_rustdoc/help/stdout.log @@ -26,9 +26,9 @@ Target Selection: --bin [] Build only the specified binary --examples Build all examples --example [] Build only the specified example - --tests Build all tests + --tests Build all test targets --test [] Build only the specified test target - --benches Build all benches + --benches Build all bench targets --bench [] Build only the specified bench target --all-targets Build all targets diff --git a/tests/testsuite/cargo_test/help/stdout.log b/tests/testsuite/cargo_test/help/stdout.log index d69fcb0edb5..d7ec18f46bc 100644 --- a/tests/testsuite/cargo_test/help/stdout.log +++ b/tests/testsuite/cargo_test/help/stdout.log @@ -33,9 +33,9 @@ Target Selection: --bin [] Test only the specified binary --examples Test all examples --example [] Test only the specified example - --tests Test all tests + --tests Test all test targets --test [] Test only the specified test target - --benches Test all benches + --benches Test all bench targets --bench [] Test only the specified bench target --all-targets Test all targets (does not include doctests) diff --git a/tests/testsuite/list_availables.rs b/tests/testsuite/list_availables.rs index fe635a19bd5..ebd6e9c1c7e 100644 --- a/tests/testsuite/list_availables.rs +++ b/tests/testsuite/list_availables.rs @@ -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. ", )