File tree 3 files changed +44
-8
lines changed
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
21
21
built in unit-test and micro-benchmarking framework). If you're passing
22
22
arguments to both Cargo and the binary, the ones after `--` go to the binary,
23
23
the 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:
26
28
27
29
cargo test foo -- --test-threads 3
28
30
@@ -152,6 +154,10 @@ include::section-exit-status.adoc[]
152
154
153
155
cargo test
154
156
157
+ . Run only tests whose names match against a filter string:
158
+
159
+ cargo test name_filter
160
+
155
161
. Run only a specific test within a specific integration test:
156
162
157
163
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>
22
22
built in unit-test and micro-benchmarking framework). If you’re passing
23
23
arguments to both Cargo and the binary, the ones after < code > --</ code > go to the binary,
24
24
the 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 >
27
30
</ div >
28
31
< div class ="literalblock ">
29
32
< div class ="content ">
@@ -581,6 +584,14 @@ <h2 id="cargo_test_examples">EXAMPLES</h2>
581
584
</ div >
582
585
</ li >
583
586
< 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 >
584
595
< p > Run only a specific test within a specific integration test:</ p >
585
596
< div class ="literalblock ">
586
597
< div class ="content ">
Original file line number Diff line number Diff line change 2
2
.\" Title: cargo-test
3
3
.\" Author: [see the "AUTHOR(S)" section]
4
4
.\" Generator: Asciidoctor 2.0.10
5
- .\" Date: 2020-06-25
5
+ .\" Date: 2020-07-28
6
6
.\" Manual: \ \&
7
7
.\" Source: \ \&
8
8
.\" Language: English
9
9
.\"
10
- .TH "CARGO\- TEST" "1" "2020-06-25 " "\ \& " "\ \& "
10
+ .TH "CARGO\- TEST" "1" "2020-07-28 " "\ \& " "\ \& "
11
11
.ie \n( .g .ds Aq \(aq
12
12
.el .ds Aq '
13
13
.ss \n[ .ss ] 0
@@ -41,8 +41,10 @@ dashes (\fB\-\-\fP) are passed to the test binaries and thus to \fIlibtest\fP (r
41
41
built in unit\- test and micro\- benchmarking framework). If you\(cq re passing
42
42
arguments to both Cargo and the binary, the ones after \fB \-\- \fP go to the binary,
43
43
the 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:
46
48
.sp
47
49
.if n .RS 4
48
50
.nf
@@ -678,6 +680,23 @@ cargo test
678
680
. sp -1
679
681
. IP " 2." 4.2
680
682
.\}
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
+ .\}
681
700
Run only a specific test within a specific integration test:
682
701
.sp
683
702
.if n .RS 4
You can’t perform that action at this time.
0 commit comments