summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/test/shared.py60
-rw-r--r--scripts/test/support.py13
2 files changed, 30 insertions, 43 deletions
diff --git a/scripts/test/shared.py b/scripts/test/shared.py
index 68c8b9d94..847dd9de5 100644
--- a/scripts/test/shared.py
+++ b/scripts/test/shared.py
@@ -399,57 +399,33 @@ os.chdir(options.out_dir)
# delete the old file, make sure you rename the corresponding .wast.log file in
# expected-output/ if any.
SPEC_TESTS_TO_SKIP = [
- # Stacky code / notation
- 'block.wast',
- 'call.wast',
- 'float_exprs.wast',
+ # Malformed module accepted
'globals.wast',
- 'loop.wast',
- 'nop.wast',
- 'select.wast',
- 'stack.wast',
- 'unwind.wast',
-
- # Binary module
- 'binary.wast',
'binary-leb128.wast',
- 'custom.wast',
-
- # Empty 'then' or 'else' in 'if'
- 'if.wast',
- 'local_set.wast',
- 'store.wast',
-
- # No module in a file
- 'token.wast',
'utf8-custom-section-id.wast',
'utf8-import-field.wast',
'utf8-import-module.wast',
'utf8-invalid-encoding.wast',
+ 'const.wast',
+ 'address.wast',
+ 'custom.wast', # invalid section ID accepted as Custom, triggering UBSan
- # 'register' command
+ # Unlinkable module accepted
'linking.wast',
- # Misc. unsupported constructs
- 'call_indirect.wast', # Empty (param) and (result)
- 'const.wast', # Unparenthesized expression
- 'data.wast', # Various unsupported (data) notations
- 'elem.wast', # Unsupported 'offset' syntax in (elem)
- 'exports.wast', # Multiple inlined exports for a function
- 'func.wast', # Forward named type reference
- 'skip-stack-guard-page.wast', # Hexadecimal style (0x..) in memory offset
-
- # Untriaged: We don't know the cause of the error yet
- 'address.wast', # wasm2js 'assert_return' failure
- 'br_if.wast', # Validation error
- 'float_literals.wast', # 'assert_return' failure
- 'int_literals.wast', # 'assert_return' failure
- 'local_tee.wast', # Validation failure
- 'memory_grow.wast', # 'assert_return' failure
- 'start.wast', # Assertion failure
- 'type.wast', # 'assertion_invalid' failure
- 'unreachable.wast', # Validation failure
- 'unreached-invalid.wast' # 'assert_invalid' failure
+ # Invalid module accepted
+ 'func.wast',
+ 'type.wast',
+ 'unreached-invalid.wast',
+
+ # WAT parser error
+ 'unwind.wast',
+
+ # WAST parser error
+ 'binary.wast',
+
+ # Test invalid
+ 'elem.wast',
]
options.spec_tests = [t for t in options.spec_tests if os.path.basename(t) not
in SPEC_TESTS_TO_SKIP]
diff --git a/scripts/test/support.py b/scripts/test/support.py
index 3a6ed9bc2..43bd00fe8 100644
--- a/scripts/test/support.py
+++ b/scripts/test/support.py
@@ -14,6 +14,7 @@
import filecmp
import os
+import re
import shutil
import subprocess
import sys
@@ -87,6 +88,9 @@ def untar(tarfile, outdir):
shutil.rmtree(tmpdir)
+QUOTED = re.compile(r'\(module\s*(\$\S*)?\s+(quote|binary)')
+
+
def split_wast(wastFile):
# if it's a binary, leave it as is, we can't split it
wast = None
@@ -124,6 +128,7 @@ def split_wast(wastFile):
return j
i = 0
+ ignoring_quoted = False
while i >= 0:
start = wast.find('(', i)
if start >= 0 and wast[start + 1] == ';':
@@ -141,11 +146,17 @@ def split_wast(wastFile):
break
i = to_end(start + 1)
chunk = wast[start:i]
+ if QUOTED.match(chunk):
+ # There may be assertions after this quoted module, but we aren't
+ # returning the module, so we need to skip the assertions as well.
+ ignoring_quoted = True
+ continue
if chunk.startswith('(module'):
+ ignoring_quoted = False
ret += [(chunk, [])]
elif chunk.startswith('(assert_invalid'):
continue
- elif chunk.startswith(('(assert', '(invoke', '(register')):
+ elif chunk.startswith(('(assert', '(invoke', '(register')) and not ignoring_quoted:
# ret may be empty if there are some asserts before the first
# module. in that case these are asserts *without* a module, which
# are valid (they may check something that doesn't refer to a module