Rust · native source coverage

Rust tests, measured by Rust's own LLVM instrumentation.

The native Rust unit-test run emits source coverage through rustc -C instrument-coverage. Rust's bundled llvm-profdata and llvm-cov produce the published summary, LCOV transport, and detailed HTML—without a coverage crate or Cargo plugin.

Latest published native metrics

Loading Rust coverage…

MetricPercentCovered
Source regions
Executable lines
Functions

Measured scope

The coverage run executes the ten native tests compiled from src/lib.rs and src/bin/cargo-vanilla-test.rs. Their #[cfg(test)] modules share those source files and therefore remain in LLVM's file totals. The run does not merge browser-host adapter checks or aggregate WASM execution into the native percentage.

Keep unlike evidence separate.

Native Rust coverage answers which instrumented Rust regions ran. The browser lane separately proves that the zero-import WASM harness is delivered, instantiated, and returns status 0 in real Chrome.

Reproduce with built-in tools

rustup component add llvm-tools-preview
RUSTFLAGS="-C instrument-coverage" \
LLVM_PROFILE_FILE="target/rust-coverage/%p-%m.profraw" \
cargo test --tests

The CI workflow merges the raw profiles once, then uses the two instrumented test binaries to emit the summary, LCOV, and HTML report. The separate README doctest runs once without instrumentation because stable Rust does not retain its temporary executable for LLVM reporting.

Interpret coverage narrowly

  • Coverage proves execution, not correctness.
  • Rust regions, lines, and functions are LLVM source-coverage metrics; they are not V8 ranges and should not be compared numerically with JavaScript coverage.
  • Doctests and browser-host JavaScript remain separate evidence lanes.
  • The published report is tied to the successful main workflow that produced it.