Expand description
The coverage phase: an instrumented test run rendered into
web/static/doc/coverage.
Only the workspace’s crates are instrumented (see wrapper), so wasmtime
and cranelift run at full speed and leave no profiles to merge or export.
grcov can read the raw profiles itself, but it then holds every binary’s
results at once and runs one llvm-cov per CPU — about 13 GiB for this
workspace, enough to OOM-kill the job on an 8 GiB CI node. So the profiles
are merged here, each test executable and binary is exported to lcov on its
own, a few at a time, and grcov only renders. Exporting per object keeps
grcov’s numbers: one export over every object discards the counters of
functions compiled differently in different binaries.
Unlike grcov, which skips an object llvm-cov cannot export, a failed export fails the phase: every exported object carries a real coverage map, so a failure means a broken build, and a quietly lower percentage would hide it.
Modules§
- elf 🔒
- Reading the section table of an ELF object, to tell instrumented ones from the rest.
- export 🔒
- Exporting each instrumented object to lcov, several at a time, keeping only the workspace’s own source records.
- objects 🔒
- Finding the objects whose coverage is exported: the test executables and binaries of the workspace, each exactly once.
- wrapper
- The
RUSTC_WRAPPERof the instrumented build.
Constants§
- DEBUG_
LEVEL 🔒 - Coverage mapping needs only line tables, and full debuginfo made the instrumented build and its test binaries much larger.
- INSTRUMENTED_
RUSTFLAGS 🔒 - Runtime checks of every anodized
#[spec]; the macros read it when they compile, so it must reach every crate, not just the instrumented ones. - LCOV_
DIR 🔒 - NEXTEST_
ARGS 🔒 - PROFDATA 🔒
- PROFRAW_
DIR 🔒 - TARGET_
DIR 🔒
Functions§
- instrumented_
env 🔒 - instrumented_
test_ 🔒run - llvm_
bin 🔒 llvm-toolsinstalls its binaries beside the host target’s libdir.- llvm_
bin_ 🔒for - merge_
profiles 🔒 - profile_
pattern 🔒 - render_
html 🔒 - require_
llvm_ 🔒tools - run_
coverage - Instrumented test run, then the HTML report.