Expand description
§dev-coverage
Test coverage measurement and regression detection for Rust. Part of
the dev-* verification suite.
Wraps cargo-llvm-cov — the modern Rust coverage standard — and emits
results as a dev_report::Report. Compares against a stored
baseline to flag regressions so AI agents and CI gates can decide
whether a PR drops coverage too far.
§Quick example
use dev_coverage::{CoverageRun, CoverageThreshold};
let run = CoverageRun::new("my-crate", "0.1.0");
let result = run.execute().unwrap();
let threshold = CoverageThreshold::min_line_pct(80.0);
let check = result.into_check_result(threshold);§What dev-coverage provides
CoverageRun— builder aroundcargo llvm-cov.CoverageResult— line / function / region percentages plus per-file breakdown.CoverageThreshold— fail when coverage drops below an absolute floor.Baseline+BaselineStore— persist per-commit coverage so the next run can flag regressions.CoverageProducer—dev_report::Producerintegration for pipelines that compose multiple producers viadev-tools.
§Requirements
cargo-llvm-cov must be installed on the system:
cargo install cargo-llvm-covThe crate detects its absence and emits
CoverageError::ToolNotInstalled without panicking.
Re-exports§
pub use baseline::Baseline;pub use baseline::BaselineStore;pub use baseline::JsonFileBaselineStore;
Modules§
- baseline
- Persisted coverage baselines.
Structs§
- Coverage
Diff - Signed deltas between a current
CoverageResultand a storedBaseline. - Coverage
Producer Produceradapter that runs aCoverageRun, compares the result against the configuredCoverageThreshold, and (optionally) flags regressions against a storedBaseline.- Coverage
Result - Result of a coverage run.
- Coverage
Run - Configuration for a coverage run.
- File
Coverage - Coverage measurements for a single source file.
Enums§
- Coverage
Error - Errors that can arise during a coverage run.
- Coverage
Threshold - Threshold defining the minimum acceptable coverage.