mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-03 17:54:19 +02:00
contrib: Only print fuzz output on failure
This makes it humanly possible to track progress as only "[N/M]"-lines are printed as long as we succeed. Also, use char (a, b) to indicate run_id instead of u8 (0, 1). Also, use emojis to indicate final success or error. Co-Authored-By: Hodlinator <172445034+hodlinator@users.noreply.github.com>
This commit is contained in:
@@ -71,7 +71,7 @@ fn app() -> AppResult {
|
||||
fn deterministic_coverage(build_dir: &Path, test_exe: &Path, filter: &str) -> AppResult {
|
||||
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> {
|
||||
let run_single = |run_id: char| -> 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)
|
||||
@@ -131,10 +131,10 @@ fn deterministic_coverage(build_dir: &Path, test_exe: &Path, filter: &str) -> Ap
|
||||
}
|
||||
Ok(())
|
||||
};
|
||||
let r0 = run_single(0)?;
|
||||
let r1 = run_single(1)?;
|
||||
let r0 = run_single('a')?;
|
||||
let r1 = run_single('b')?;
|
||||
check_diff(&r0, &r1)?;
|
||||
println!("The coverage was deterministic across two runs.");
|
||||
println!("✨ The coverage was deterministic across two runs. ✨");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ fn main() -> ExitCode {
|
||||
match app() {
|
||||
Ok(()) => ExitCode::SUCCESS,
|
||||
Err(err) => {
|
||||
eprintln!("{}", err);
|
||||
eprintln!("⚠️\n{}", err);
|
||||
ExitCode::FAILURE
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user