diff options
| author | Zalathar <Zalathar@users.noreply.github.com> | 2024-03-08 18:07:04 +1100 |
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2024-03-13 11:14:10 +1100 |
| commit | 3407fcc12ee1ace7267611c91b579f6f5cfcb01b (patch) | |
| tree | 6ee81ed4e245bf6ff65ec5ea43434d3d39a61c85 /src | |
| parent | 1f544ce305bc207c9d0539938219caf01ea230c9 (diff) | |
| download | rust-3407fcc12ee1ace7267611c91b579f6f5cfcb01b.tar.gz rust-3407fcc12ee1ace7267611c91b579f6f5cfcb01b.zip | |
coverage: Add `-Zcoverage-options` for fine control of coverage
This new nightly-only flag can be used to toggle fine-grained flags that control the details of coverage instrumentation. Currently the only supported flag value is `branch` (or `no-branch`), which is a placeholder for upcoming support for branch coverage. Other flag values can be added in the future, to prototype proposed new behaviour, or to enable special non-default behaviour.
Diffstat (limited to 'src')
| -rw-r--r-- | src/doc/rustc/src/instrument-coverage.md | 8 | ||||
| -rw-r--r-- | src/doc/unstable-book/src/compiler-flags/coverage-options.md | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/doc/rustc/src/instrument-coverage.md b/src/doc/rustc/src/instrument-coverage.md index 23cb1e05ed1..7780f2102ba 100644 --- a/src/doc/rustc/src/instrument-coverage.md +++ b/src/doc/rustc/src/instrument-coverage.md @@ -346,6 +346,14 @@ $ llvm-cov report \ more fine-grained coverage options are added. Using this value is currently not recommended. +## `-Z coverage-options=<options>` + +This unstable option provides finer control over some aspects of coverage +instrumentation. Pass one or more of the following values, separated by commas. + +- `branch` or `no-branch` + - Placeholder for potential branch coverage support in the future. + ## Other references Rust's implementation and workflow for source-based code coverage is based on the same library and tools used to implement [source-based code coverage in Clang]. (This document is partially based on the Clang guide.) diff --git a/src/doc/unstable-book/src/compiler-flags/coverage-options.md b/src/doc/unstable-book/src/compiler-flags/coverage-options.md new file mode 100644 index 00000000000..105dce61511 --- /dev/null +++ b/src/doc/unstable-book/src/compiler-flags/coverage-options.md @@ -0,0 +1,8 @@ +# `coverage-options` + +This option controls details of the coverage instrumentation performed by +`-C instrument-coverage`. + +Multiple options can be passed, separated by commas. Valid options are: + +- `branch` or `no-branch`: Placeholder for future branch coverage support. |
