about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/coverage/graph.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-01-09 00:19:35 +0100
committerGitHub <noreply@github.com>2024-01-09 00:19:35 +0100
commit867a87d3420324eb41ca88ce25f4e372b70672ed (patch)
treee60933e50cf81939617cc8bcbba558822834205c /compiler/rustc_mir_transform/src/coverage/graph.rs
parente6bc9f063782e54480907e6893b3097943343cdb (diff)
parent957a46fa69db5a67fad317305213b51d27e9df6e (diff)
downloadrust-867a87d3420324eb41ca88ce25f4e372b70672ed.tar.gz
rust-867a87d3420324eb41ca88ce25f4e372b70672ed.zip
Rollup merge of #119681 - Zalathar:anon-branch, r=clubby789
coverage: Anonymize line numbers in branch views

Extracted from #118305, as this is now the only part of that PR that needs to touch compiletest.

---

Coverage tests run the `llvm-cov` tool to generate a coverage report for a test program, and then compare the report against a known-good snapshot.

We use the `anonymize_coverage_line_numbers` function to replace line numbers in coverage reports with `LL`, so that they are less sensitive to lines being added or removed. This PR augments the existing code by making it also support the slightly different line number syntax used when reporting branch regions.

Currently the compiler never emits branch regions, so there is no way to write a coverage test that makes use of this new capability. Instead, I've added a unit test that checks against some sample reports taken from #118305. That unit test can be removed when some form of branch coverage support gets merged, and real branch coverage tests are added to the coverage test suite.

(I have also manually tested this change as part of my draft branch-coverage PR.)
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage/graph.rs')
0 files changed, 0 insertions, 0 deletions