Struct fuzzcheck::sensors_and_pools::CodeCoverageSensor [−][src]
pub struct CodeCoverageSensor {
pub count_instrumented: usize,
// some fields omitted
}
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
A function to handle the observations made by the code coverage sensor
An observation is a tuple. The first element is the index of a code region. The second element represents the number of times the code region was hit.
Signal to the sensor that it should prepare to record observations
Signal to the sensor that it should stop recording observations
Access the sensor’s observations through the handler