pub struct CoverageProducer { /* private fields */ }Expand description
Producer adapter that runs a CoverageRun, compares the result
against the configured CoverageThreshold, and (optionally) flags
regressions against a stored Baseline.
Subprocess failures map to a failing CheckResult named
coverage::<subject> with Severity::Critical. No panics.
§Example
use dev_coverage::{CoverageProducer, CoverageRun, CoverageThreshold};
use dev_report::Producer;
let producer = CoverageProducer::new(
CoverageRun::new("my-crate", "0.1.0"),
CoverageThreshold::min_line_pct(80.0),
);
let report = producer.produce();
println!("{}", report.to_json().unwrap());Implementations§
Source§impl CoverageProducer
impl CoverageProducer
Sourcepub fn new(run: CoverageRun, threshold: CoverageThreshold) -> Self
pub fn new(run: CoverageRun, threshold: CoverageThreshold) -> Self
Build a producer with a threshold only.
Sourcepub fn with_baseline(self, baseline: Baseline, tolerance_pct: f64) -> Self
pub fn with_baseline(self, baseline: Baseline, tolerance_pct: f64) -> Self
Compare each run against the given baseline. When the current
result regresses by more than tolerance_pct, a separate
coverage::regression check is pushed alongside the threshold check.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CoverageProducer
impl RefUnwindSafe for CoverageProducer
impl Send for CoverageProducer
impl Sync for CoverageProducer
impl Unpin for CoverageProducer
impl UnsafeUnpin for CoverageProducer
impl UnwindSafe for CoverageProducer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more