Skip to content

Commit fa535af

Browse files
author
MarcoFalke
committed
fuzz: test_runner: Better error message when built with afl
1 parent fa7ca8e commit fa535af

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

test/fuzz/test_runner.py

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,22 @@ def main():
7272
logging.error("No fuzz targets selected")
7373
logging.info("Fuzz targets selected: {}".format(test_list_selection))
7474

75-
help_output = subprocess.run(
76-
args=[
77-
os.path.join(config["environment"]["BUILDDIR"], 'src', 'test', 'fuzz', test_list_selection[0]),
78-
'-help=1',
79-
],
80-
check=True,
81-
stderr=subprocess.PIPE,
82-
universal_newlines=True,
83-
).stderr
84-
if "libFuzzer" not in help_output:
85-
logging.error("Must be built with libFuzzer")
75+
try:
76+
help_output = subprocess.run(
77+
args=[
78+
os.path.join(config["environment"]["BUILDDIR"], 'src', 'test', 'fuzz', test_list_selection[0]),
79+
'-help=1',
80+
],
81+
timeout=1,
82+
check=True,
83+
stderr=subprocess.PIPE,
84+
universal_newlines=True,
85+
).stderr
86+
if "libFuzzer" not in help_output:
87+
logging.error("Must be built with libFuzzer")
88+
sys.exit(1)
89+
except subprocess.TimeoutExpired:
90+
logging.error("subprocess timed out: Currently only libFuzzer is supported")
8691
sys.exit(1)
8792

8893
run_once(

0 commit comments

Comments
 (0)