Skip to content

Commit f2472f6

Browse files
tests: Improve test runner output in case of target errors
1 parent 733bbec commit f2472f6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

test/fuzz/test_runner.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,15 @@ def run_once(*, corpus, test_list, build_dir, export_coverage, use_valgrind):
168168
result = subprocess.run(args, stderr=subprocess.PIPE, universal_newlines=True)
169169
output = result.stderr
170170
logging.debug('Output: {}'.format(output))
171-
result.check_returncode()
171+
try:
172+
result.check_returncode()
173+
except subprocess.CalledProcessError as e:
174+
if e.stdout:
175+
logging.info(e.stdout)
176+
if e.stderr:
177+
logging.info(e.stderr)
178+
logging.info("Target \"{}\" failed with exit code {}: {}".format(t, e.returncode, " ".join(args)))
179+
sys.exit(1)
172180
if not export_coverage:
173181
continue
174182
for l in output.splitlines():

0 commit comments

Comments
 (0)