fuzz: Fix test_runner error reporting

This commit is contained in:
MarcoFalke 2024-12-13 14:36:01 +01:00
parent 78f1bff709
commit fa0e30b93a
No known key found for this signature in database

View file

@ -371,10 +371,6 @@ def run_once(*, fuzz_pool, corpus, test_list, src_dir, fuzz_bin, using_libfuzzer
for future in as_completed(jobs): for future in as_completed(jobs):
output, result, target = 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:
@ -382,8 +378,12 @@ def run_once(*, fuzz_pool, corpus, test_list, src_dir, fuzz_bin, using_libfuzzer
logging.info(e.stdout) logging.info(e.stdout)
if e.stderr: if e.stderr:
logging.info(e.stderr) logging.info(e.stderr)
logging.info(f"Target {result.args} failed with exit code {e.returncode}") logging.info(f"⚠️ Failure generated from target with exit code {e.returncode}: {result.args}")
sys.exit(1) sys.exit(1)
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]))
if using_libfuzzer: if using_libfuzzer:
print("Summary:") print("Summary:")