about summary refs log tree commit diff
path: root/tests/ui/instrument-coverage/coverage-options.rs
diff options
context:
space:
mode:
authorZalathar <Zalathar@users.noreply.github.com>2024-03-08 18:07:04 +1100
committerZalathar <Zalathar@users.noreply.github.com>2024-03-13 11:14:10 +1100
commit3407fcc12ee1ace7267611c91b579f6f5cfcb01b (patch)
tree6ee81ed4e245bf6ff65ec5ea43434d3d39a61c85 /tests/ui/instrument-coverage/coverage-options.rs
parent1f544ce305bc207c9d0539938219caf01ea230c9 (diff)
downloadrust-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 'tests/ui/instrument-coverage/coverage-options.rs')
-rw-r--r--tests/ui/instrument-coverage/coverage-options.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/instrument-coverage/coverage-options.rs b/tests/ui/instrument-coverage/coverage-options.rs
new file mode 100644
index 00000000000..a62e0554f76
--- /dev/null
+++ b/tests/ui/instrument-coverage/coverage-options.rs
@@ -0,0 +1,14 @@
+//@ needs-profiler-support
+//@ revisions: branch no-branch bad
+//@ compile-flags -Cinstrument-coverage
+
+//@ [branch] check-pass
+//@ [branch] compile-flags: -Zcoverage-options=branch
+
+//@ [no-branch] check-pass
+//@ [no-branch] compile-flags: -Zcoverage-options=no-branch
+
+//@ [bad] check-fail
+//@ [bad] compile-flags: -Zcoverage-options=bad
+
+fn main() {}