File tree 9 files changed +35
-16
lines changed
9 files changed +35
-16
lines changed Original file line number Diff line number Diff line change @@ -19,9 +19,12 @@ the two dashes (`--`) are passed to the benchmark binaries and thus to
19
19
_ libtest_ (rustc's built in unit-test and micro-benchmarking framework). If
20
20
you are passing arguments to both Cargo and the binary, the ones after ` -- ` go
21
21
to the binary, the ones before go to Cargo. For details about libtest's
22
- arguments see the output of ` cargo bench -- --help ` . As an example, this will
23
- run only the benchmark named ` foo ` (and skip other similarly named benchmarks
24
- like ` foobar ` ):
22
+ arguments see the output of ` cargo bench -- --help ` and check out the rustc
23
+ book's chapter on how tests work at
24
+ < https://doc.rust-lang.org/rustc/tests/index.html > .
25
+
26
+ As an example, this will run only the benchmark named ` foo ` (and skip other
27
+ similarly named benchmarks like ` foobar ` ):
25
28
26
29
cargo bench -- foo --exact
27
30
Original file line number Diff line number Diff line change @@ -19,7 +19,8 @@ dashes (`--`) are passed to the test binaries and thus to _libtest_ (rustc's
19
19
built in unit-test and micro-benchmarking framework). If you're passing
20
20
arguments to both Cargo and the binary, the ones after ` -- ` go to the binary,
21
21
the ones before go to Cargo. For details about libtest's arguments see the
22
- output of ` cargo test -- --help ` .
22
+ output of ` cargo test -- --help ` and check out the rustc book's chapter on
23
+ how tests work at < https://doc.rust-lang.org/rustc/tests/index.html > .
23
24
24
25
As an example, this will filter for tests with ` foo ` in their name and run them
25
26
on 3 threads in parallel:
Original file line number Diff line number Diff line change @@ -15,8 +15,11 @@ DESCRIPTION
15
15
framework). If you are passing arguments to both Cargo and the binary,
16
16
the ones after -- go to the binary, the ones before go to Cargo. For
17
17
details about libtest's arguments see the output of cargo bench --
18
- --help. As an example, this will run only the benchmark named foo (and
19
- skip other similarly named benchmarks like foobar):
18
+ --help and check out the rustc book's chapter on how tests work at
19
+ <https://doc.rust-lang.org/rustc/tests/index.html>.
20
+
21
+ As an example, this will run only the benchmark named foo (and skip
22
+ other similarly named benchmarks like foobar):
20
23
21
24
cargo bench -- foo --exact
22
25
Original file line number Diff line number Diff line change @@ -14,7 +14,9 @@ DESCRIPTION
14
14
(rustc's built in unit-test and micro-benchmarking framework). If you're
15
15
passing arguments to both Cargo and the binary, the ones after -- go to
16
16
the binary, the ones before go to Cargo. For details about libtest's
17
- arguments see the output of cargo test -- --help.
17
+ arguments see the output of cargo test -- --help and check out the rustc
18
+ book's chapter on how tests work at
19
+ <https://doc.rust-lang.org/rustc/tests/index.html>.
18
20
19
21
As an example, this will filter for tests with foo in their name and run
20
22
them on 3 threads in parallel:
Original file line number Diff line number Diff line change @@ -19,9 +19,12 @@ the two dashes (`--`) are passed to the benchmark binaries and thus to
19
19
_ libtest_ (rustc's built in unit-test and micro-benchmarking framework). If
20
20
you are passing arguments to both Cargo and the binary, the ones after ` -- ` go
21
21
to the binary, the ones before go to Cargo. For details about libtest's
22
- arguments see the output of ` cargo bench -- --help ` . As an example, this will
23
- run only the benchmark named ` foo ` (and skip other similarly named benchmarks
24
- like ` foobar ` ):
22
+ arguments see the output of ` cargo bench -- --help ` and check out the rustc
23
+ book's chapter on how tests work at
24
+ < https://doc.rust-lang.org/rustc/tests/index.html > .
25
+
26
+ As an example, this will run only the benchmark named ` foo ` (and skip other
27
+ similarly named benchmarks like ` foobar ` ):
25
28
26
29
cargo bench -- foo --exact
27
30
Original file line number Diff line number Diff line change @@ -19,7 +19,8 @@ dashes (`--`) are passed to the test binaries and thus to _libtest_ (rustc's
19
19
built in unit-test and micro-benchmarking framework). If you're passing
20
20
arguments to both Cargo and the binary, the ones after ` -- ` go to the binary,
21
21
the ones before go to Cargo. For details about libtest's arguments see the
22
- output of ` cargo test -- --help ` .
22
+ output of ` cargo test -- --help ` and check out the rustc book's chapter on
23
+ how tests work at < https://doc.rust-lang.org/rustc/tests/index.html > .
23
24
24
25
As an example, this will filter for tests with ` foo ` in their name and run them
25
26
on 3 threads in parallel:
Original file line number Diff line number Diff line change @@ -94,12 +94,14 @@ There are two styles of tests within a Cargo project:
94
94
access to its * public* API.
95
95
96
96
Tests are run with the [ ` cargo test ` ] command. By default, Cargo and ` rustc `
97
- use the libtest harness which is responsible for collecting functions
97
+ use the [ libtest harness] which is responsible for collecting functions
98
98
annotated with the [ ` #[test] ` attribute] [ test-attribute ] and executing them in
99
99
parallel, reporting the success and failure of each test. See [ the ` harness `
100
100
field] ( #the-harness-field ) if you want to use a different harness or test
101
101
strategy.
102
102
103
+ [ libtest harness ] : ../../rustc/tests/index.html
104
+
103
105
#### Integration tests
104
106
105
107
Files located under the [ ` tests ` directory] [ package layout ] are integration
Original file line number Diff line number Diff line change @@ -15,9 +15,12 @@ the two dashes (\fB\-\-\fR) are passed to the benchmark binaries and thus to
15
15
\fI libtest \fR (rustc's built in unit\- test and micro\- benchmarking framework). If
16
16
you are passing arguments to both Cargo and the binary, the ones after \fB \-\- \fR go
17
17
to the binary, the ones before go to Cargo. For details about libtest's
18
- arguments see the output of \fB cargo bench \-\- \-\- help \fR \& . As an example, this will
19
- run only the benchmark named \fB foo \fR (and skip other similarly named benchmarks
20
- like \fB foobar \fR ):
18
+ arguments see the output of \fB cargo bench \-\- \-\- help \fR and check out the rustc
19
+ book's chapter on how tests work at
20
+ <https://doc.rust\- lang.org/rustc/tests/index.html>\& .
21
+ .sp
22
+ As an example, this will run only the benchmark named \fB foo \fR (and skip other
23
+ similarly named benchmarks like \fB foobar \fR ):
21
24
.sp
22
25
.RS 4
23
26
.nf
Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ dashes (\fB\-\-\fR) are passed to the test binaries and thus to \fIlibtest\fR (r
15
15
built in unit\- test and micro\- benchmarking framework). If you're passing
16
16
arguments to both Cargo and the binary, the ones after \fB \-\- \fR go to the binary,
17
17
the ones before go to Cargo. For details about libtest's arguments see the
18
- output of \fB cargo test \-\- \-\- help \fR \& .
18
+ output of \fB cargo test \-\- \-\- help \fR and check out the rustc book's chapter on
19
+ how tests work at <https://doc.rust\- lang.org/rustc/tests/index.html>\& .
19
20
.sp
20
21
As an example, this will filter for tests with \fB foo \fR in their name and run them
21
22
on 3 threads in parallel:
You can’t perform that action at this time.
0 commit comments