From 9e70bc73597931140d42fb23805a443b5129cf2f Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Wed, 18 Oct 2023 15:38:41 -0400 Subject: [PATCH] docs(cargo-bench): `--bench` is passed in unconditionally to bench harnesses --- src/doc/man/cargo-bench.md | 2 +- src/doc/man/generated_txt/cargo-bench.txt | 3 ++- src/doc/src/commands/cargo-bench.md | 2 +- src/etc/man/cargo-bench.1 | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/doc/man/cargo-bench.md b/src/doc/man/cargo-bench.md index a2a602847206..0fe81181e2f3 100644 --- a/src/doc/man/cargo-bench.md +++ b/src/doc/man/cargo-bench.md @@ -34,7 +34,7 @@ Benchmarks are built with the `--test` option to `rustc` which creates a special executable by linking your code with libtest. The executable automatically runs all functions annotated with the `#[bench]` attribute. Cargo passes the `--bench` flag to the test harness to tell it to run -only benchmarks. +only benchmarks, regardless of whether the harness is libtest or a custom harness The libtest harness may be disabled by setting `harness = false` in the target manifest settings, in which case your code will need to provide its own `main` diff --git a/src/doc/man/generated_txt/cargo-bench.txt b/src/doc/man/generated_txt/cargo-bench.txt index 796fbd11b552..3382430c72b9 100644 --- a/src/doc/man/generated_txt/cargo-bench.txt +++ b/src/doc/man/generated_txt/cargo-bench.txt @@ -27,7 +27,8 @@ DESCRIPTION special executable by linking your code with libtest. The executable automatically runs all functions annotated with the #[bench] attribute. Cargo passes the --bench flag to the test harness to tell it to run only - benchmarks. + benchmarks, regardless of whether the harness is libtest or a custom + harness The libtest harness may be disabled by setting harness = false in the target manifest settings, in which case your code will need to provide diff --git a/src/doc/src/commands/cargo-bench.md b/src/doc/src/commands/cargo-bench.md index 45584023eb50..4e172f413473 100644 --- a/src/doc/src/commands/cargo-bench.md +++ b/src/doc/src/commands/cargo-bench.md @@ -30,7 +30,7 @@ Benchmarks are built with the `--test` option to `rustc` which creates a special executable by linking your code with libtest. The executable automatically runs all functions annotated with the `#[bench]` attribute. Cargo passes the `--bench` flag to the test harness to tell it to run -only benchmarks. +only benchmarks, regardless of whether the harness is libtest or a custom harness The libtest harness may be disabled by setting `harness = false` in the target manifest settings, in which case your code will need to provide its own `main` diff --git a/src/etc/man/cargo-bench.1 b/src/etc/man/cargo-bench.1 index 64498c4d602b..e2866096a121 100644 --- a/src/etc/man/cargo-bench.1 +++ b/src/etc/man/cargo-bench.1 @@ -32,7 +32,7 @@ Benchmarks are built with the \fB\-\-test\fR option to \fBrustc\fR which creates special executable by linking your code with libtest. The executable automatically runs all functions annotated with the \fB#[bench]\fR attribute. Cargo passes the \fB\-\-bench\fR flag to the test harness to tell it to run -only benchmarks. +only benchmarks, regardless of whether the harness is libtest or a custom harness .sp The libtest harness may be disabled by setting \fBharness = false\fR in the target manifest settings, in which case your code will need to provide its own \fBmain\fR