diff options
| author | MarcoFalke <[email protected]> | 2019-02-14 15:49:13 -0500 |
|---|---|---|
| committer | MarcoFalke <[email protected]> | 2019-02-14 15:47:08 -0500 |
| commit | fa535af92c179b0ffb9280e0b2dc5acfeb80964a (patch) | |
| tree | ca1a8bebe53395e6774e92d36a78c171c3897216 /test/fuzz/test_runner.py | |
| parent | qa: Add test/fuzz/test_runner.py (diff) | |
| download | discoin-fa535af92c179b0ffb9280e0b2dc5acfeb80964a.tar.xz discoin-fa535af92c179b0ffb9280e0b2dc5acfeb80964a.zip | |
fuzz: test_runner: Better error message when built with afl
Diffstat (limited to 'test/fuzz/test_runner.py')
| -rwxr-xr-x | test/fuzz/test_runner.py | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/test/fuzz/test_runner.py b/test/fuzz/test_runner.py index eb4fe78cd..1869f7175 100755 --- a/test/fuzz/test_runner.py +++ b/test/fuzz/test_runner.py @@ -72,17 +72,22 @@ def main(): logging.error("No fuzz targets selected") logging.info("Fuzz targets selected: {}".format(test_list_selection)) - help_output = subprocess.run( - args=[ - os.path.join(config["environment"]["BUILDDIR"], 'src', 'test', 'fuzz', test_list_selection[0]), - '-help=1', - ], - check=True, - stderr=subprocess.PIPE, - universal_newlines=True, - ).stderr - if "libFuzzer" not in help_output: - logging.error("Must be built with libFuzzer") + 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, + ).stderr + 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( |