File tree Expand file tree Collapse file tree 3 files changed +44
-8
lines changed Expand file tree Collapse file tree 3 files changed +44
-8
lines changed Original file line number Diff line number Diff line change @@ -21,8 +21,10 @@ dashes (`--`) are passed to the test binaries and thus to _libtest_ (rustc's
2121built in unit-test and micro-benchmarking framework). If you're passing
2222arguments to both Cargo and the binary, the ones after `--` go to the binary,
2323the ones before go to Cargo. For details about libtest's arguments see the
24- output of `cargo test \-- --help`. As an example, this will run all tests with
25- `foo` in their name on 3 threads in parallel:
24+ output of `cargo test \-- --help`.
25+
26+ As an example, this will filter for tests with `foo` in their name and run them
27+ on 3 threads in parallel:
2628
2729 cargo test foo -- --test-threads 3
2830
@@ -152,6 +154,10 @@ include::section-exit-status.adoc[]
152154
153155 cargo test
154156
157+ . Run only tests whose names match against a filter string:
158+
159+ cargo test name_filter
160+
155161. Run only a specific test within a specific integration test:
156162
157163 cargo test --test int_test_name -- modname::test_name
Original file line number Diff line number Diff line change @@ -22,8 +22,11 @@ <h2 id="cargo_test_description">DESCRIPTION</h2>
2222built in unit-test and micro-benchmarking framework). If you’re passing
2323arguments to both Cargo and the binary, the ones after < code > --</ code > go to the binary,
2424the ones before go to Cargo. For details about libtest’s arguments see the
25- output of < code > cargo test -- --help</ code > . As an example, this will run all tests with
26- < code > foo</ code > in their name on 3 threads in parallel:</ p >
25+ output of < code > cargo test -- --help</ code > .</ p >
26+ </ div >
27+ < div class ="paragraph ">
28+ < p > As an example, this will filter for tests with < code > foo</ code > in their name and run them
29+ on 3 threads in parallel:</ p >
2730</ div >
2831< div class ="literalblock ">
2932< div class ="content ">
@@ -581,6 +584,14 @@ <h2 id="cargo_test_examples">EXAMPLES</h2>
581584</ div >
582585</ li >
583586< li >
587+ < p > Run only tests whose names match against a filter string:</ p >
588+ < div class ="literalblock ">
589+ < div class ="content ">
590+ < pre > cargo test name_filter</ pre >
591+ </ div >
592+ </ div >
593+ </ li >
594+ < li >
584595< p > Run only a specific test within a specific integration test:</ p >
585596< div class ="literalblock ">
586597< div class ="content ">
Original file line number Diff line number Diff line change 22.\" Title: cargo-test
33.\" Author: [see the "AUTHOR(S)" section]
44.\" Generator: Asciidoctor 2.0.10
5- .\" Date: 2020-06-25
5+ .\" Date: 2020-07-28
66.\" Manual: \ \&
77.\" Source: \ \&
88.\" Language: English
99.\"
10- .TH "CARGO\- TEST" "1" "2020-06-25 " "\ \& " "\ \& "
10+ .TH "CARGO\- TEST" "1" "2020-07-28 " "\ \& " "\ \& "
1111.ie \n( .g .ds Aq \(aq
1212.el .ds Aq '
1313.ss \n[ .ss ] 0
@@ -41,8 +41,10 @@ dashes (\fB\-\-\fP) are passed to the test binaries and thus to \fIlibtest\fP (r
4141built in unit\- test and micro\- benchmarking framework). If you\(cq re passing
4242arguments to both Cargo and the binary, the ones after \fB \-\- \fP go to the binary,
4343the ones before go to Cargo. For details about libtest\(cq s arguments see the
44- output of \fB cargo test \-\- \-\- help \fP . As an example, this will run all tests with
45- \fB foo \fP in their name on 3 threads in parallel:
44+ output of \fB cargo test \-\- \-\- help \fP .
45+ .sp
46+ As an example, this will filter for tests with \fB foo \fP in their name and run them
47+ on 3 threads in parallel:
4648.sp
4749.if n .RS 4
4850.nf
@@ -678,6 +680,23 @@ cargo test
678680. sp -1
679681. IP " 2." 4.2
680682.\}
683+ Run only tests whose names match against a filter string:
684+ .sp
685+ .if n .RS 4
686+ .nf
687+ cargo test name_filter
688+ .fi
689+ .if n .RE
690+ .RE
691+ .sp
692+ .RS 4
693+ .ie n \{\
694+ \h '-04' 3.\h '+01' \c
695+ .\}
696+ .el \{\
697+ . sp -1
698+ . IP " 3." 4.2
699+ .\}
681700Run only a specific test within a specific integration test:
682701.sp
683702.if n .RS 4
You can’t perform that action at this time.
0 commit comments