Skip to content

Commit 5ed6cf1

Browse files
authored
[NFC] Move more logic about unfuzzable tests to a shared location (#7175)
It turns out that #7165 was not enough because we had a second (!?) list of tests to ignore, and also a condition. Move all that to the shared location as well, continuing that PR. Also remove simd.wast from the list, as that issue has been fixed.
1 parent edfd9a1 commit 5ed6cf1

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

scripts/fuzz_opt.py

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,6 @@ def is_git_repo():
309309

310310
all_tests = shared.get_all_tests()
311311

312-
INITIAL_CONTENTS_IGNORE = fuzzing.unfuzzable_tests
313-
314312

315313
def pick_initial_contents():
316314
# if we use an initial wasm file's contents as the basis for the
@@ -334,25 +332,9 @@ def pick_initial_contents():
334332
# no longer exist, and we should just skip it.
335333
if not os.path.exists(test_name):
336334
return
337-
if os.path.basename(test_name) in INITIAL_CONTENTS_IGNORE:
335+
if not fuzzing.is_fuzzable(test_name):
338336
return
339337
assert os.path.exists(test_name)
340-
# tests that check validation errors are not helpful for us
341-
if '.fail.' in test_name:
342-
print('initial contents is just a .fail test')
343-
return
344-
if os.path.basename(test_name) in [
345-
# contains too many segments to run in a wasm VM
346-
'limit-segments_disable-bulk-memory.wast',
347-
# https://github.com/WebAssembly/binaryen/issues/3203
348-
'simd.wast',
349-
# corner cases of escaping of names is not interesting
350-
'names.wast',
351-
# huge amount of locals that make it extremely slow
352-
'too_much_for_liveness.wasm'
353-
]:
354-
print('initial contents is disallowed')
355-
return
356338

357339
if test_name.endswith('.wast'):
358340
# this can contain multiple modules, pick one

scripts/test/fuzzing.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
import os
16+
1517

1618
# Tests that the fuzzers should not operate on.
17-
unfuzzable_tests = [
19+
unfuzzable = [
1820
# Float16 is still experimental.
1921
'f16.wast',
2022
# not all relaxed SIMD instructions are implemented in the interpreter
@@ -73,4 +75,20 @@
7375
'typed_continuations_contnew.wast',
7476
'typed_continuations_contbind.wast',
7577
'typed_continuations_suspend.wast',
78+
# contains too many segments to run in a wasm VM
79+
'limit-segments_disable-bulk-memory.wast',
80+
# https://github.com/WebAssembly/binaryen/issues/7176
81+
'names.wast',
82+
# huge amount of locals that make it extremely slow
83+
'too_much_for_liveness.wasm',
7684
]
85+
86+
87+
def is_fuzzable(name):
88+
name = os.path.basename(name)
89+
90+
# It makes no sense to fuzz things that check validation errors.
91+
if '.fail.' in name:
92+
return False
93+
94+
return name not in unfuzzable

0 commit comments

Comments
 (0)