From 7703caff73f49471f2ef1a1a0a0a0d8aa7ebada7 Mon Sep 17 00:00:00 2001 From: Daniel Wirtz Date: Tue, 18 Aug 2020 19:56:43 +0200 Subject: 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 --- scripts/fuzz_opt.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'scripts/fuzz_opt.py') 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 -- cgit v1.2.3