Skip to content

Commit 5fab767

Browse files
committed
Auto merge of #12850 - weihanglo:dashdashbench, r=epage
docs(cargo-bench): `--bench` is passed in unconditionally to bench harnesses
2 parents 0820fa1 + ff376df commit 5fab767

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

Diff for: src/doc/man/cargo-bench.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Benchmarks are built with the `--test` option to `rustc` which creates a
3434
special executable by linking your code with libtest. The executable
3535
automatically runs all functions annotated with the `#[bench]` attribute.
3636
Cargo passes the `--bench` flag to the test harness to tell it to run
37-
only benchmarks.
37+
only benchmarks, regardless of whether the harness is libtest or a custom harness.
3838

3939
The libtest harness may be disabled by setting `harness = false` in the target
4040
manifest settings, in which case your code will need to provide its own `main`

Diff for: src/doc/man/generated_txt/cargo-bench.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ DESCRIPTION
2727
special executable by linking your code with libtest. The executable
2828
automatically runs all functions annotated with the #[bench] attribute.
2929
Cargo passes the --bench flag to the test harness to tell it to run only
30-
benchmarks.
30+
benchmarks, regardless of whether the harness is libtest or a custom
31+
harness.
3132

3233
The libtest harness may be disabled by setting harness = false in the
3334
target manifest settings, in which case your code will need to provide

Diff for: src/doc/src/commands/cargo-bench.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Benchmarks are built with the `--test` option to `rustc` which creates a
3030
special executable by linking your code with libtest. The executable
3131
automatically runs all functions annotated with the `#[bench]` attribute.
3232
Cargo passes the `--bench` flag to the test harness to tell it to run
33-
only benchmarks.
33+
only benchmarks, regardless of whether the harness is libtest or a custom harness.
3434

3535
The libtest harness may be disabled by setting `harness = false` in the target
3636
manifest settings, in which case your code will need to provide its own `main`

Diff for: src/etc/man/cargo-bench.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Benchmarks are built with the \fB\-\-test\fR option to \fBrustc\fR which creates
3232
special executable by linking your code with libtest. The executable
3333
automatically runs all functions annotated with the \fB#[bench]\fR attribute.
3434
Cargo passes the \fB\-\-bench\fR flag to the test harness to tell it to run
35-
only benchmarks.
35+
only benchmarks, regardless of whether the harness is libtest or a custom harness.
3636
.sp
3737
The libtest harness may be disabled by setting \fBharness = false\fR in the target
3838
manifest settings, in which case your code will need to provide its own \fBmain\fR

0 commit comments

Comments
 (0)