Struct fuzzcheck::sensors_and_pools::CodeCoverageSensor
source · [−]pub struct CodeCoverageSensor {
pub count_instrumented: usize,
/* private fields */
}
Expand description
A sensor that automatically records the code coverage of the program through an array of counters.
This is the default sensor used by fuzzcheck. It can filter the recorded code coverage so that only some files influence the fuzzer.
By default, coverage is recorded only for the files whose given paths are relative to the current directory.
This is a heuristic to observe only the crate being tested. However, this behaviour can be changed.
When creating a new CodeCoverageSensor
, you can pass a function that determines whether coverage is
recorded for a file with a given path.
use fuzzcheck::sensors_and_pools::CodeCoverageSensor;
let sensor = CodeCoverageSensor::new(|path| path.is_relative() == true);
Fields
count_instrumented: usize
The number of code regions observed by the sensor
Implementations
Trait Implementations
sourceimpl Sensor for CodeCoverageSensor
impl Sensor for CodeCoverageSensor
type Observations = Vec<(usize, u64), Global>
sourcefn start_recording(&mut self)
fn start_recording(&mut self)
Signal to the sensor that it should prepare to record observations
sourcefn stop_recording(&mut self)
fn stop_recording(&mut self)
Signal to the sensor that it should stop recording observations
sourcefn get_observations(&mut self) -> Self::Observations
fn get_observations(&mut self) -> Self::Observations
Access the sensor’s observations
Auto Trait Implementations
impl RefUnwindSafe for CodeCoverageSensor
impl !Send for CodeCoverageSensor
impl !Sync for CodeCoverageSensor
impl Unpin for CodeCoverageSensor
impl UnwindSafe for CodeCoverageSensor
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more