mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
contrib: Print deterministic-coverage runs
This commit is contained in:
parent
fa751639fb
commit
fa7a40d952
2 changed files with 3 additions and 0 deletions
|
@ -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
|
// 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.
|
// their overall coverage trace remains the same across runs and thus remains undetected.
|
||||||
|
println!("Check each fuzz input individually ...");
|
||||||
for entry in entries {
|
for entry in entries {
|
||||||
let entry = entry.path();
|
let entry = entry.path();
|
||||||
if !entry.is_file() {
|
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.
|
// 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
|
// This can catch issues where mutable global state is leaked from one fuzz input execution to
|
||||||
// the next.
|
// the next.
|
||||||
|
println!("Check all fuzz inputs in one go ...");
|
||||||
{
|
{
|
||||||
if !corpus_dir.is_dir() {
|
if !corpus_dir.is_dir() {
|
||||||
Err(format!("{} should be a folder", corpus_dir.display()))?;
|
Err(format!("{} should be a folder", corpus_dir.display()))?;
|
||||||
|
|
|
@ -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 profraw_file = build_dir.join("test_det_cov.profraw");
|
||||||
let profdata_file = build_dir.join("test_det_cov.profdata");
|
let profdata_file = build_dir.join("test_det_cov.profdata");
|
||||||
let run_single = |run_id: u8| -> Result<PathBuf, AppError> {
|
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"));
|
let cov_txt_path = build_dir.join(format!("test_det_cov.show.{run_id}.txt"));
|
||||||
if !Command::new(test_exe)
|
if !Command::new(test_exe)
|
||||||
.env("LLVM_PROFILE_FILE", &profraw_file)
|
.env("LLVM_PROFILE_FILE", &profraw_file)
|
||||||
|
|
Loading…
Add table
Reference in a new issue