summaryrefslogtreecommitdiff
path: root/check.py
diff options
context:
space:
mode:
Diffstat (limited to 'check.py')
-rwxr-xr-xcheck.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/check.py b/check.py
index a95c91655..84086a9e9 100755
--- a/check.py
+++ b/check.py
@@ -24,10 +24,10 @@ from scripts.test.support import run_command, split_wast
from scripts.test.shared import (
ASM2WASM, BIN_DIR, EMCC, MOZJS, NATIVECC, NATIVEXX, NODEJS, S2WASM_EXE,
WASM_AS, WASM_CTOR_EVAL, WASM_OPT, WASM_SHELL, WASM_MERGE, WASM_SHELL_EXE,
- WASM_DIS, binary_format_check, delete_from_orbit, fail, fail_with_error,
+ WASM_DIS, WASM_REDUCE, binary_format_check, delete_from_orbit, fail, fail_with_error,
fail_if_not_identical, fail_if_not_contained, has_vanilla_emcc,
has_vanilla_llvm, minify_check, num_failures, options, tests,
- requested, warnings
+ requested, warnings, has_shell_timeout
)
import scripts.test.s2wasm as s2wasm
@@ -321,6 +321,22 @@ for t in os.listdir(os.path.join('test', 'ctor-eval')):
with open(out) as f:
fail_if_not_identical(f.read(), actual)
+if has_shell_timeout():
+ print '\n[ checking wasm-reduce ]\n'
+
+ for t in os.listdir(os.path.join('test', 'reduce')):
+ if t.endswith('.wast'):
+ print '..', t
+ t = os.path.join('test', 'reduce', t)
+ # convert to wasm
+ run_command(WASM_AS + [t, '-o', 'a.wasm'])
+ print run_command(WASM_REDUCE + ['a.wasm', '--command=bin/wasm-opt b.wasm --fuzz-exec', '-t', 'b.wasm', '-w', 'c.wasm'])
+ expected = t + '.txt'
+ run_command(WASM_DIS + ['c.wasm', '-o', 'a.wast'])
+ with open('a.wast') as seen:
+ with open(expected) as correct:
+ fail_if_not_identical(seen.read(), correct.read())
+
print '\n[ checking wasm-shell spec testcases... ]\n'
if len(requested) == 0: