contrib: Print deterministic-coverage runs

This commit is contained in:
MarcoFalke 2025-03-15 09:23:12 +01:00
parent fa751639fb
commit fa7a40d952
No known key found for this signature in database
2 changed files with 3 additions and 0 deletions

View File

@ -187,6 +187,7 @@ The coverage was not deterministic between runs.
//
// Also, This can catch issues where several fuzz inputs are non-deterministic, but the sum of
// their overall coverage trace remains the same across runs and thus remains undetected.
println!("Check each fuzz input individually ...");
for entry in entries {
let entry = entry.path();
if !entry.is_file() {
@ -203,6 +204,7 @@ The coverage was not deterministic between runs.
// Finally, check that running over all fuzz inputs in one process is deterministic as well.
// This can catch issues where mutable global state is leaked from one fuzz input execution to
// the next.
println!("Check all fuzz inputs in one go ...");
{
if !corpus_dir.is_dir() {
Err(format!("{} should be a folder", corpus_dir.display()))?;

View File

@ -72,6 +72,7 @@ fn deterministic_coverage(build_dir: &Path, test_exe: &Path, filter: &str) -> Ap
let profraw_file = build_dir.join("test_det_cov.profraw");
let profdata_file = build_dir.join("test_det_cov.profdata");
let run_single = |run_id: u8| -> Result<PathBuf, AppError> {
println!("Run with id {run_id}");
let cov_txt_path = build_dir.join(format!("test_det_cov.show.{run_id}.txt"));
if !Command::new(test_exe)
.env("LLVM_PROFILE_FILE", &profraw_file)