fuzz: test_runner: Better error message when built with afl

This commit is contained in:
MarcoFalke 2019-02-14 15:49:13 -05:00
parent fa7ca8ef58
commit fa535af92c
No known key found for this signature in database
GPG key ID: CE2B75697E69A548

View file

@ -72,11 +72,13 @@ def main():
logging.error("No fuzz targets selected")
logging.info("Fuzz targets selected: {}".format(test_list_selection))
try:
help_output = subprocess.run(
args=[
os.path.join(config["environment"]["BUILDDIR"], 'src', 'test', 'fuzz', test_list_selection[0]),
'-help=1',
],
timeout=1,
check=True,
stderr=subprocess.PIPE,
universal_newlines=True,
@ -84,6 +86,9 @@ def main():
if "libFuzzer" not in help_output:
logging.error("Must be built with libFuzzer")
sys.exit(1)
except subprocess.TimeoutExpired:
logging.error("subprocess timed out: Currently only libFuzzer is supported")
sys.exit(1)
run_once(
corpus=args.seed_dir,