Skip to content

Commit b2e9227

Browse files
authored
Enable auto_initial_contents by default in fuzz_opt.py (#5943)
This setting is useful enough that there is basically no reason not to use it. Turn it on by default to save some typing when running the fuzzer.
1 parent 56ce1ea commit b2e9227

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

scripts/fuzz_opt.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,8 @@ def is_git_repo():
254254
return False
255255

256256
if not is_git_repo() and shared.options.auto_initial_contents:
257-
print('Warning: The current directory is not a git repository, so you cannot use "--auto-initial-contents". Using the manually selected contents.\n')
257+
print('Warning: The current directory is not a git repository, ' +
258+
'so not automatically selecting initial contents.')
258259
shared.options.auto_initial_contents = False
259260

260261
print('- Perenially-important initial contents:')
@@ -1765,8 +1766,8 @@ def get_random_opts():
17651766
shutil.copyfile('a.wasm', original_wasm)
17661767
# write out a useful reduce.sh
17671768
auto_init = ''
1768-
if shared.options.auto_initial_contents:
1769-
auto_init = '--auto-initial-contents'
1769+
if not shared.options.auto_initial_contents:
1770+
auto_init = '--no-auto-initial-contents'
17701771
with open('reduce.sh', 'w') as reduce_sh:
17711772
reduce_sh.write('''\
17721773
# check the input is even a valid wasm file

scripts/test/shared.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ def parse_args(args):
9696
# TODO Allow each script to inherit the default set of options and add its
9797
# own custom options on top of that
9898
parser.add_argument(
99-
'--auto-initial-contents', dest='auto_initial_contents',
100-
action='store_true', default=False,
99+
'--no-auto-initial-contents', dest='auto_initial_contents',
100+
action='store_false', default=True,
101101
help='Select important initial contents automaticaly in fuzzer. '
102102
'Default: disabled.')
103103

0 commit comments

Comments
 (0)