summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xauto_update_tests.py15
-rwxr-xr-xcheck.py18
-rw-r--r--scripts/test/shared.py16
-rw-r--r--test/spec/expected-output/if-label-scope.fail.wast.log1
4 files changed, 32 insertions, 18 deletions
diff --git a/auto_update_tests.py b/auto_update_tests.py
index 8f34e9800..ce4c63745 100755
--- a/auto_update_tests.py
+++ b/auto_update_tests.py
@@ -310,6 +310,20 @@ def update_reduce_tests():
support.run_command(shared.WASM_DIS + ['c.wasm', '-o', expected])
+def update_spec_tests():
+ print('\n[ updating wasm-shell spec testcases... ]\n')
+
+ for t in shared.options.spec_tests:
+ print('..', os.path.basename(t))
+
+ cmd = shared.WASM_SHELL + [t]
+ expected = os.path.join(shared.get_test_dir('spec'), 'expected-output', os.path.basename(t) + '.log')
+ if os.path.isfile(expected):
+ stdout = support.run_command(cmd, stderr=subprocess.PIPE)
+ with open(expected, 'w') as o:
+ o.write(stdout)
+
+
TEST_SUITES = OrderedDict([
('wasm-opt', update_wasm_opt_tests),
('asm2wasm', update_asm_js_tests),
@@ -318,6 +332,7 @@ TEST_SUITES = OrderedDict([
('ctor-eval', update_ctor_eval_tests),
('wasm-metadce', update_metadce_tests),
('wasm-reduce', update_reduce_tests),
+ ('spec', update_spec_tests),
('binaryenjs', update_binaryen_js_tests),
('lld', lld.update_lld_tests),
('wasm2js', wasm2js.update_wasm2js_tests),
diff --git a/check.py b/check.py
index f43c117c7..acf36a16d 100755
--- a/check.py
+++ b/check.py
@@ -278,27 +278,11 @@ def run_wasm_reduce_tests():
def run_spec_tests():
print('\n[ checking wasm-shell spec testcases... ]\n')
- if not shared.options.spec_tests:
- # FIXME we support old and new memory formats, for now, until 0xc, and so can't pass this old-style test.
- BLACKLIST = ['binary.wast']
- # FIXME to update the spec to 0xd, we need to implement (register "name") for import.wast
- spec_tests = shared.get_tests(shared.get_test_dir('spec'), ['.wast'])
- spec_tests = [t for t in spec_tests if os.path.basename(t) not in BLACKLIST]
- else:
- spec_tests = shared.options.spec_tests[:]
-
- for wast in spec_tests:
+ for wast in shared.options.spec_tests:
print('..', os.path.basename(wast))
- # skip checks for some tests
- if os.path.basename(wast) in ['linking.wast', 'nop.wast', 'stack.wast', 'typecheck.wast', 'unwind.wast']: # FIXME
- continue
-
def run_spec_test(wast):
cmd = shared.WASM_SHELL + [wast]
- # we must skip the stack machine portions of spec tests or apply other extra args
- extra = {}
- cmd = cmd + (extra.get(os.path.basename(wast)) or [])
return support.run_command(cmd, stderr=subprocess.PIPE)
def run_opt_test(wast):
diff --git a/scripts/test/shared.py b/scripts/test/shared.py
index bcaffe0b8..9d1fa094e 100644
--- a/scripts/test/shared.py
+++ b/scripts/test/shared.py
@@ -397,6 +397,22 @@ if not has_vanilla_emcc:
warn('no functional emcc submodule found')
+if not options.spec_tests:
+ options.spec_tests = get_tests(get_test_dir('spec'), ['.wast'])
+else:
+ options.spec_tests = options.spec_tests[:]
+
+SPEC_TEST_BLACKLIST = [
+ 'binary.wast', # Cannot parse binary modules
+ 'linking.wast', # No support for 'register' command
+ 'nop.wast', # Stacky code
+ 'stack.wast', # Stacky code
+ 'unwind.wast' # Stacky code
+]
+options.spec_tests = [t for t in options.spec_tests if os.path.basename(t) not
+ in SPEC_TEST_BLACKLIST]
+
+
# check utilities
diff --git a/test/spec/expected-output/if-label-scope.fail.wast.log b/test/spec/expected-output/if-label-scope.fail.wast.log
deleted file mode 100644
index a3e1d79e1..000000000
--- a/test/spec/expected-output/if-label-scope.fail.wast.log
+++ /dev/null
@@ -1 +0,0 @@
-test/if-label-scope.fail.wast:1.26-1.28: syntax error: unknown label $l