Function minicov::capture_coverage
source · pub unsafe fn capture_coverage<Writer: CoverageWriter>(
writer: &mut Writer
) -> Result<(), CoverageWriteError>
Expand description
Captures the coverage data for the current program and writes it into the given sink.
The data should be saved to a file with the .profraw
extension, which can
then be processed using the llvm-profdata
and llvm-cov
tools.
You should call reset_coverage
afterwards if you intend to continue
running the program so that future coverage can be merged with the returned
captured coverage.
Safety
This function is not thread-safe and should not be concurrently called from multiple threads.