From e996422d3ae2b2b8d68adb1598a18fee22ef8fae Mon Sep 17 00:00:00 2001 From: Isaac Corbrey Date: Tue, 28 Jul 2020 05:19:58 -0900 Subject: [PATCH] fix: Clarify test name filter usage Set aside description of the usage example in the top description section and added a more consise example in the example section at the bottom of the man page. --- src/doc/man/cargo-test.adoc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/doc/man/cargo-test.adoc b/src/doc/man/cargo-test.adoc index 32aa5ff66..ba338b12b 100644 --- a/src/doc/man/cargo-test.adoc +++ b/src/doc/man/cargo-test.adoc @@ -21,8 +21,10 @@ dashes (`--`) are passed to the test binaries and thus to _libtest_ (rustc's built in unit-test and micro-benchmarking framework). If you're passing arguments to both Cargo and the binary, the ones after `--` go to the binary, the ones before go to Cargo. For details about libtest's arguments see the -output of `cargo test \-- --help`. As an example, this will run all tests with -`foo` in their name on 3 threads in parallel: +output of `cargo test \-- --help`. + +As an example, this will filter for tests with `foo` in their name and run them +on 3 threads in parallel: cargo test foo -- --test-threads 3 @@ -152,6 +154,10 @@ include::section-exit-status.adoc[] cargo test +. Run only tests whose names match against a filter string: + + cargo test name_filter + . Run only a specific test within a specific integration test: cargo test --test int_test_name -- modname::test_name