1
- use crate :: command_prelude:: * ;
2
-
3
1
use cargo:: ops:: { self , CompileFilter } ;
4
2
3
+ use crate :: command_prelude:: * ;
4
+
5
5
pub fn cli ( ) -> App {
6
6
subcommand ( "test" )
7
- // subcommand aliases are handled in aliased_command()
7
+ // Subcommand aliases are handled in ` aliased_command()`.
8
8
// .alias("t")
9
9
. setting ( AppSettings :: TrailingVarArg )
10
10
. about ( "Execute all unit and integration tests and build examples of a local package" )
@@ -47,17 +47,17 @@ pub fn cli() -> App {
47
47
. arg_message_format ( )
48
48
. after_help (
49
49
"\
50
- The test filtering argument ` TESTNAME` and all the arguments following the
50
+ The test filtering argument TESTNAME and all the arguments following the
51
51
two dashes (`--`) are passed to the test binaries and thus to libtest
52
- (rustc's built in unit-test and micro-benchmarking framework). If you're
52
+ (rustc's built in unit-test and micro-benchmarking framework). If you're
53
53
passing arguments to both Cargo and the binary, the ones after `--` go to the
54
- binary, the ones before go to Cargo. For details about libtest's arguments see
55
- the output of `cargo test -- --help`. As an example, this will run all
54
+ binary, the ones before go to Cargo. For details about libtest's arguments see
55
+ the output of `cargo test -- --help`. As an example, this will run all
56
56
tests with `foo` in their name on 3 threads in parallel:
57
57
58
58
cargo test foo -- --test-threads 3
59
59
60
- If the --package argument is given, then SPEC is a package id specification
60
+ If the ` --package` argument is given, then SPEC is a package ID specification
61
61
which indicates which package should be tested. If it is not given, then the
62
62
current package is tested. For more information on SPEC and its format, see the
63
63
`cargo help pkgid` command.
@@ -66,9 +66,9 @@ All packages in the workspace are tested if the `--all` flag is supplied. The
66
66
`--all` flag is automatically assumed for a virtual manifest.
67
67
Note that `--exclude` has to be specified in conjunction with the `--all` flag.
68
68
69
- The --jobs argument affects the building of the test executable but does
69
+ The ` --jobs` argument affects the building of the test executable but does
70
70
not affect how many jobs are used when running the tests. The default value
71
- for the --jobs argument is the number of CPUs. If you want to control the
71
+ for the ` --jobs` argument is the number of CPUs. If you want to control the
72
72
number of simultaneous running test cases, pass the `--test-threads` option
73
73
to the test binaries:
74
74
@@ -77,7 +77,7 @@ to the test binaries:
77
77
Compilation can be configured via the `test` profile in the manifest.
78
78
79
79
By default the rust test harness hides output from test execution to
80
- keep results readable. Test output can be recovered (e.g. for debugging)
80
+ keep results readable. Test output can be recovered (e.g., for debugging)
81
81
by passing `--nocapture` to the test binaries:
82
82
83
83
cargo test -- --nocapture
@@ -130,8 +130,8 @@ pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
130
130
compile_opts,
131
131
} ;
132
132
133
- // TESTNAME is actually an argument of the test binary, but it's
134
- // important so we explicitly mention it and reconfigure
133
+ // ` TESTNAME` is actually an argument of the test binary, but it's
134
+ // important, so we explicitly mention it and reconfigure.
135
135
let mut test_args = vec ! [ ] ;
136
136
test_args. extend ( args. value_of ( "TESTNAME" ) . into_iter ( ) . map ( |s| s. to_string ( ) ) ) ;
137
137
test_args. extend (
0 commit comments