summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/fuzz_opt.py10
-rw-r--r--scripts/test/wasm_opt.py6
2 files changed, 14 insertions, 2 deletions
diff --git a/scripts/fuzz_opt.py b/scripts/fuzz_opt.py
index 78a706262..00031e3b7 100755
--- a/scripts/fuzz_opt.py
+++ b/scripts/fuzz_opt.py
@@ -791,6 +791,15 @@ class Asyncify(TestCaseHandler):
return all([x in feature_opts for x in ['--disable-exception-handling', '--disable-simd', '--disable-tail-call', '--disable-reference-types', '--disable-multivalue', '--disable-gc']])
+# Check that the text format round-trips without error.
+class RoundtripText(TestCaseHandler):
+ frequency = 0.05
+
+ def handle(self, wasm):
+ run([in_bin('wasm-dis'), wasm, '-o', 'a.wast'])
+ run([in_bin('wasm-opt'), 'a.wast'] + FEATURE_OPTS)
+
+
# The global list of all test case handlers
testcase_handlers = [
FuzzExec(),
@@ -798,6 +807,7 @@ testcase_handlers = [
CheckDeterminism(),
Wasm2JS(),
Asyncify(),
+ RoundtripText()
]
diff --git a/scripts/test/wasm_opt.py b/scripts/test/wasm_opt.py
index d6441bd8d..ab708c636 100644
--- a/scripts/test/wasm_opt.py
+++ b/scripts/test/wasm_opt.py
@@ -57,7 +57,8 @@ def test_wasm_opt():
passes_file = os.path.join(shared.get_test_dir('passes'), passname + '.passes')
if os.path.exists(passes_file):
passname = open(passes_file).read().strip()
- opts = [('--' + p if not p.startswith('O') and p != 'g' else '-' + p) for p in passname.split('_')]
+ passes = [p for p in passname.split('_') if p != 'noprint']
+ opts = [('--' + p if not p.startswith('O') and p != 'g' else '-' + p) for p in passes]
actual = ''
for module, asserts in support.split_wast(t):
assert len(asserts) == 0
@@ -171,7 +172,8 @@ def update_wasm_opt_tests():
passes_file = os.path.join(shared.get_test_dir('passes'), passname + '.passes')
if os.path.exists(passes_file):
passname = open(passes_file).read().strip()
- opts = [('--' + p if not p.startswith('O') and p != 'g' else '-' + p) for p in passname.split('_')]
+ passes = [p for p in passname.split('_') if p != 'noprint']
+ opts = [('--' + p if not p.startswith('O') and p != 'g' else '-' + p) for p in passes]
actual = ''
for module, asserts in support.split_wast(t):
assert len(asserts) == 0