Skip to content

Commit 7664fd6

Browse files
committed
Auto merge of #9477 - ehuss:link-test-chapter, r=alexcrichton
Link to the new rustc tests chapter. There's a new chapter in the rustc book on how the libtest harness works, and the command-line options it offers. This adds a few links to that new chapter in the cargo book.
2 parents 253fab1 + c2e0d75 commit 7664fd6

File tree

9 files changed

+35
-16
lines changed

9 files changed

+35
-16
lines changed

src/doc/man/cargo-bench.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ the two dashes (`--`) are passed to the benchmark binaries and thus to
1919
_libtest_ (rustc's built in unit-test and micro-benchmarking framework). If
2020
you are passing arguments to both Cargo and the binary, the ones after `--` go
2121
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`):
2528

2629
cargo bench -- foo --exact
2730

src/doc/man/cargo-test.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ dashes (`--`) are passed to the test binaries and thus to _libtest_ (rustc's
1919
built in unit-test and micro-benchmarking framework). If you're passing
2020
arguments to both Cargo and the binary, the ones after `--` go to the binary,
2121
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>.
2324

2425
As an example, this will filter for tests with `foo` in their name and run them
2526
on 3 threads in parallel:

src/doc/man/generated_txt/cargo-bench.txt

+5-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ DESCRIPTION
1515
framework). If you are passing arguments to both Cargo and the binary,
1616
the ones after -- go to the binary, the ones before go to Cargo. For
1717
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):
2023

2124
cargo bench -- foo --exact
2225

src/doc/man/generated_txt/cargo-test.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ DESCRIPTION
1414
(rustc's built in unit-test and micro-benchmarking framework). If you're
1515
passing arguments to both Cargo and the binary, the ones after -- go to
1616
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>.
1820

1921
As an example, this will filter for tests with foo in their name and run
2022
them on 3 threads in parallel:

src/doc/src/commands/cargo-bench.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ the two dashes (`--`) are passed to the benchmark binaries and thus to
1919
_libtest_ (rustc's built in unit-test and micro-benchmarking framework). If
2020
you are passing arguments to both Cargo and the binary, the ones after `--` go
2121
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`):
2528

2629
cargo bench -- foo --exact
2730

src/doc/src/commands/cargo-test.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ dashes (`--`) are passed to the test binaries and thus to _libtest_ (rustc's
1919
built in unit-test and micro-benchmarking framework). If you're passing
2020
arguments to both Cargo and the binary, the ones after `--` go to the binary,
2121
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>.
2324

2425
As an example, this will filter for tests with `foo` in their name and run them
2526
on 3 threads in parallel:

src/doc/src/reference/cargo-targets.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,14 @@ There are two styles of tests within a Cargo project:
9494
access to its *public* API.
9595

9696
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
9898
annotated with the [`#[test]` attribute][test-attribute] and executing them in
9999
parallel, reporting the success and failure of each test. See [the `harness`
100100
field](#the-harness-field) if you want to use a different harness or test
101101
strategy.
102102

103+
[libtest harness]: ../../rustc/tests/index.html
104+
103105
#### Integration tests
104106

105107
Files located under the [`tests` directory][package layout] are integration

src/etc/man/cargo-bench.1

+6-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ the two dashes (\fB\-\-\fR) are passed to the benchmark binaries and thus to
1515
\fIlibtest\fR (rustc's built in unit\-test and micro\-benchmarking framework). If
1616
you are passing arguments to both Cargo and the binary, the ones after \fB\-\-\fR go
1717
to the binary, the ones before go to Cargo. For details about libtest's
18-
arguments see the output of \fBcargo bench \-\- \-\-help\fR\&. As an example, this will
19-
run only the benchmark named \fBfoo\fR (and skip other similarly named benchmarks
20-
like \fBfoobar\fR):
18+
arguments see the output of \fBcargo 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 \fBfoo\fR (and skip other
23+
similarly named benchmarks like \fBfoobar\fR):
2124
.sp
2225
.RS 4
2326
.nf

src/etc/man/cargo-test.1

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ dashes (\fB\-\-\fR) are passed to the test binaries and thus to \fIlibtest\fR (r
1515
built in unit\-test and micro\-benchmarking framework). If you're passing
1616
arguments to both Cargo and the binary, the ones after \fB\-\-\fR go to the binary,
1717
the ones before go to Cargo. For details about libtest's arguments see the
18-
output of \fBcargo test \-\- \-\-help\fR\&.
18+
output of \fBcargo 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>\&.
1920
.sp
2021
As an example, this will filter for tests with \fBfoo\fR in their name and run them
2122
on 3 threads in parallel:

0 commit comments

Comments
 (0)