diff options
author | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2024-01-26 17:29:26 +0100 |
---|---|---|
committer | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2024-01-29 15:24:29 +0100 |
commit | fab97d81ce3740509dbbe9270ca67a1b65b00c72 (patch) | |
tree | 4a0843e2aed1768cc16efd61de0d4d73f1938ee4 /test/fuzz | |
parent | e3b68b3b833984973401ceff43930f7c56a83f29 (diff) | |
download | bitcoin-fab97d81ce3740509dbbe9270ca67a1b65b00c72.tar.xz |
fuzz: Print coverage summary after run_once
Diffstat (limited to 'test/fuzz')
-rwxr-xr-x | test/fuzz/test_runner.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/test/fuzz/test_runner.py b/test/fuzz/test_runner.py index bf8d4929c1..13ce136c3f 100755 --- a/test/fuzz/test_runner.py +++ b/test/fuzz/test_runner.py @@ -347,13 +347,18 @@ def run_once(*, fuzz_pool, corpus, test_list, src_dir, build_dir, using_libfuzze text=True, ) output += result.stderr - return output, result + return output, result, t jobs.append(fuzz_pool.submit(job, t, args)) + stats = [] for future in as_completed(jobs): - output, result = future.result() + output, result, target = future.result() logging.debug(output) + if using_libfuzzer: + done_stat = [l for l in output.splitlines() if "DONE" in l] + assert len(done_stat) == 1 + stats.append((target, done_stat[0])) try: result.check_returncode() except subprocess.CalledProcessError as e: @@ -364,6 +369,13 @@ def run_once(*, fuzz_pool, corpus, test_list, src_dir, build_dir, using_libfuzze logging.info(f"Target {result.args} failed with exit code {e.returncode}") sys.exit(1) + if using_libfuzzer: + print("Summary:") + max_len = max(len(t[0]) for t in stats) + for t, s in sorted(stats): + t = t.ljust(max_len + 1) + print(f"{t}{s}") + def parse_test_list(*, fuzz_bin): test_list_all = subprocess.run( |