docs(cargo-bench): --bench is passed in unconditionally to bench harnesses

This commit is contained in:
Weihang Lo 2023-10-18 15:38:41 -04:00
parent 16629e6a5a
commit ff376df716
No known key found for this signature in database
GPG Key ID: D7DBF189825E82E7
4 changed files with 5 additions and 4 deletions

View File

@ -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`

View File

@ -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

View File

@ -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`

View File

@ -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