diff options
author | Daniel Wirtz <dcode@dcode.io> | 2020-08-18 19:56:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-18 10:56:43 -0700 |
commit | 7703caff73f49471f2ef1a1a0a0a0d8aa7ebada7 (patch) | |
tree | a4542e24d2ae79ca72a3137a46193c70a70fbca9 /scripts/fuzz_opt.py | |
parent | 77fe6ded258ce37bd3ea78fd43c8bc0ef639682b (diff) | |
download | binaryen-7703caff73f49471f2ef1a1a0a0a0d8aa7ebada7.tar.gz binaryen-7703caff73f49471f2ef1a1a0a0a0d8aa7ebada7.tar.bz2 binaryen-7703caff73f49471f2ef1a1a0a0a0d8aa7ebada7.zip |
Support fuzzing of out-of-tree builds (#3050)
Can now run scripts/fuzz_opt.py --binaryen-bin build/bin [opts...] to fuzz an
out-of-tree build
Handle positional arguments by looking at shared.requested (with options removed)
instead of raw sys.argv
Diffstat (limited to 'scripts/fuzz_opt.py')
-rwxr-xr-x | scripts/fuzz_opt.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/fuzz_opt.py b/scripts/fuzz_opt.py index d9477a146..bf1f7f409 100755 --- a/scripts/fuzz_opt.py +++ b/scripts/fuzz_opt.py @@ -51,7 +51,7 @@ def in_binaryen(*args): def in_bin(tool): - return os.path.join(shared.options.binaryen_root, 'bin', tool) + return os.path.join(shared.options.binaryen_bin, tool) def random_size(): @@ -877,11 +877,11 @@ if __name__ == '__main__': # instead of the randomly generating one. this can be useful for # reduction. given_wasm = None - if len(sys.argv) >= 2: - given_seed = int(sys.argv[1]) + if len(shared.requested) >= 1: + given_seed = int(shared.requested[0]) print('checking a single given seed', given_seed) - if len(sys.argv) >= 3: - given_wasm = sys.argv[2] + if len(shared.requested) >= 2: + given_wasm = shared.requested[1] print('using given wasm file', given_wasm) else: given_seed = None |