mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 15:04:44 +01:00
Merge bitcoin/bitcoin#29329: fuzz: Print coverage summary after run_once
fab97d81ce
fuzz: Print coverage summary after run_once (MarcoFalke) Pull request description: This can be used to quickly check the coverage effects of a code change or qa-assets change. ACKs for top commit: dergoegge: ACKfab97d81ce
Tree-SHA512: 0ac913c14698f39e76e0e7bf124f182220031796d6443edb34c6e4615e128157cf746da661b216c4640a41964e977249712445ca9c005b1b4a3737adabdb4a7d
This commit is contained in:
commit
759195040a
1 changed files with 14 additions and 2 deletions
|
@ -348,13 +348,18 @@ def run_once(*, fuzz_pool, corpus, test_list, src_dir, build_dir, using_libfuzze
|
||||||
text=True,
|
text=True,
|
||||||
)
|
)
|
||||||
output += result.stderr
|
output += result.stderr
|
||||||
return output, result
|
return output, result, t
|
||||||
|
|
||||||
jobs.append(fuzz_pool.submit(job, t, args))
|
jobs.append(fuzz_pool.submit(job, t, args))
|
||||||
|
|
||||||
|
stats = []
|
||||||
for future in as_completed(jobs):
|
for future in as_completed(jobs):
|
||||||
output, result = future.result()
|
output, result, target = future.result()
|
||||||
logging.debug(output)
|
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:
|
try:
|
||||||
result.check_returncode()
|
result.check_returncode()
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
|
@ -365,6 +370,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}")
|
logging.info(f"Target {result.args} failed with exit code {e.returncode}")
|
||||||
sys.exit(1)
|
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):
|
def parse_test_list(*, fuzz_bin):
|
||||||
test_list_all = subprocess.run(
|
test_list_all = subprocess.run(
|
||||||
|
|
Loading…
Add table
Reference in a new issue