Skip to content

Commit 3def3bf

Browse files
committed
Auto merge of #4050 - eminence:help_jobs_text, r=alexcrichton
Reword the `cargo test --help` text about the --jobs argument This should reduce confusion about what the --jobs argument does and how to control the number of simultaneous running test cases. Closes #4045
2 parents d5bfd58 + 1791354 commit 3def3bf

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/bin/test.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Options:
5656
--no-run Compile, but don't run tests
5757
-p SPEC, --package SPEC ... Package to run tests for
5858
--all Test all packages in the workspace
59-
-j N, --jobs N Number of parallel jobs, defaults to # of CPUs
59+
-j N, --jobs N Number of parallel builds, see below for details
6060
--release Build artifacts in release mode, with optimizations
6161
--features FEATURES Space-separated list of features to also build
6262
--all-features Build all available features
@@ -86,7 +86,12 @@ All packages in the workspace are tested if the `--all` flag is supplied. The
8686
`--all` flag may be supplied in the presence of a virtual manifest.
8787
8888
The --jobs argument affects the building of the test executable but does
89-
not affect how many jobs are used when running the tests.
89+
not affect how many jobs are used when running the tests. The default value
90+
for the --jobs argument is the number of CPUs. If you want to control the
91+
number of simultaneous running test cases, pass the `--test-threads` option
92+
to the test binaries:
93+
94+
cargo test -- --test-threads=1
9095
9196
Compilation can be configured via the `test` profile in the manifest.
9297

0 commit comments

Comments
 (0)