summaryrefslogtreecommitdiff
path: root/scripts/test/wasm2js.py
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2020-09-21 16:58:55 -0700
committerGitHub <noreply@github.com>2020-09-21 16:58:55 -0700
commit85e0e50e86797d63912742c1c2aac0332dd2cf40 (patch)
treedb00f614759b1bff6ca3f820f9f979a936195929 /scripts/test/wasm2js.py
parentee00f647750f23e6c24e67424bafab39b244c835 (diff)
downloadbinaryen-85e0e50e86797d63912742c1c2aac0332dd2cf40.tar.gz
binaryen-85e0e50e86797d63912742c1c2aac0332dd2cf40.tar.bz2
binaryen-85e0e50e86797d63912742c1c2aac0332dd2cf40.zip
Remove stale test output (#3157)
These test output files are ignored and so contain stale output that is neither checked during `check.py` not updated during `auto_update_tests.py`. There are three clases to tests here: 1. Spec tests that end in 64.wast are ignored by scripts/test/wasm2js.py 2. Spec tests that are globallyi ignoed by shared.py:SPEC_TESTS_TO_SKIP 3. hello_world.2asm.js.. I cant tell where this came remove it seems like an anomaly.
Diffstat (limited to 'scripts/test/wasm2js.py')
-rw-r--r--scripts/test/wasm2js.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/test/wasm2js.py b/scripts/test/wasm2js.py
index 5ddab0b2b..38a2defd7 100644
--- a/scripts/test/wasm2js.py
+++ b/scripts/test/wasm2js.py
@@ -29,6 +29,19 @@ assert_tests = ['wasm2js.wast.asserts']
wasm2js_blacklist = ['empty_imported_table.wast']
+def check_for_stale_files():
+ # TODO(sbc): Generalize and apply other test suites
+ all_tests = []
+ for t in tests + spec_tests + wasm2js_tests:
+ all_tests.append(os.path.basename(os.path.splitext(t)[0]))
+
+ all_files = os.listdir(shared.get_test_dir('wasm2js'))
+ for f in all_files:
+ prefix = f.split('.')[0]
+ if prefix not in all_tests:
+ shared.fail_with_error('orphan test output: %s' % f)
+
+
def test_wasm2js_output():
for opt in (0, 1):
for t in tests + spec_tests + wasm2js_tests:
@@ -124,6 +137,7 @@ def test_asserts_output():
def test_wasm2js():
print('\n[ checking wasm2js testcases... ]\n')
+ check_for_stale_files()
if shared.skip_if_on_windows('wasm2js'):
return
test_wasm2js_output()