pub struct CoverageCollector { /* private fields */ }Expand description
Coverage collector that integrates with various coverage tools
Implementations§
Source§impl CoverageCollector
impl CoverageCollector
pub fn new(tool: CoverageTool) -> Self
Sourcepub fn with_source_dir<P: AsRef<Path>>(self, path: P) -> Self
pub fn with_source_dir<P: AsRef<Path>>(self, path: P) -> Self
Set the source directory for coverage collection
§Examples
use ruchy::quality::{CoverageCollector, CoverageTool};
let collector = CoverageCollector::new(CoverageTool::Tarpaulin)
.with_source_dir("src");Sourcepub fn collect(&self) -> Result<CoverageReport>
pub fn collect(&self) -> Result<CoverageReport>
Collect test coverage by running the appropriate tool
§Examples
use ruchy::quality::{CoverageCollector, CoverageTool};
let collector = CoverageCollector::new(CoverageTool::Tarpaulin);
let report = collector.collect().expect("Failed to collect coverage");
println!("Line coverage: {:.1}%", report.line_coverage_percentage());§Errors
Returns an error if:
- The coverage tool is not installed
- The coverage tool fails to run
- The output cannot be parsed
Sourcepub fn is_available(&self) -> bool
pub fn is_available(&self) -> bool
Check if the coverage tool is available
Auto Trait Implementations§
impl Freeze for CoverageCollector
impl RefUnwindSafe for CoverageCollector
impl Send for CoverageCollector
impl Sync for CoverageCollector
impl Unpin for CoverageCollector
impl UnwindSafe for CoverageCollector
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