pub struct CoverageCollector { /* private fields */ }Expand description
Coverage collector for tracking coverage during test execution
Implementations§
Source§impl CoverageCollector
impl CoverageCollector
Sourcepub fn new(config: CoverageConfig) -> Self
pub fn new(config: CoverageConfig) -> Self
Create a new collector with the given configuration
Sourcepub fn begin_session(&mut self, name: &str)
pub fn begin_session(&mut self, name: &str)
Begin a coverage collection session
Sourcepub fn end_session(&mut self) -> CoverageReport
pub fn end_session(&mut self) -> CoverageReport
End the current session and return the report
Sourcepub fn begin_test(&mut self, name: &str)
pub fn begin_test(&mut self, name: &str)
Begin a test within the session
Sourcepub fn record_hit(&mut self, block: BlockId)
pub fn record_hit(&mut self, block: BlockId)
Record a hit on a block
Sourcepub fn record_violation(&mut self, violation: CoverageViolation)
pub fn record_violation(&mut self, violation: CoverageViolation)
Record a violation
Sourcepub fn is_session_active(&self) -> bool
pub fn is_session_active(&self) -> bool
Check if a session is active
Sourcepub fn is_test_active(&self) -> bool
pub fn is_test_active(&self) -> bool
Check if a test is active
Sourcepub fn current_test(&self) -> Option<&str>
pub fn current_test(&self) -> Option<&str>
Get the current test name
Sourcepub fn config(&self) -> &CoverageConfig
pub fn config(&self) -> &CoverageConfig
Get the configuration
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CoverageCollector
impl RefUnwindSafe for CoverageCollector
impl Send for CoverageCollector
impl Sync for CoverageCollector
impl Unpin for CoverageCollector
impl UnsafeUnpin 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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more