Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "third_party/googletest"]
path = third_party/googletest
url = https://github.com/google/googletest.git
[submodule "test/spec/testsuite"]
path = test/spec/testsuite
url = https://github.com/WebAssembly/testsuite.git
93 changes: 90 additions & 3 deletions scripts/test/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ def get_tests(test_dir, extensions=[], recursive=False):
if options.spec_tests:
options.spec_tests = [os.path.abspath(t) for t in options.spec_tests]
else:
options.spec_tests = get_tests(get_test_dir('spec'), ['.wast'])
options.spec_tests = get_tests(get_test_dir('spec'), ['.wast'], recursive=True)

os.chdir(options.out_dir)

Expand All @@ -411,12 +411,99 @@ def get_tests(test_dir, extensions=[], recursive=False):
# Test invalid
'elem.wast',
]
SPEC_TESTSUITE_TESTS_TO_SKIP = [
'address.wast',
'align.wast',
'binary-leb128.wast',
'binary.wast',
'block.wast',
'br_table.wast',
'bulk.wast',
'comments.wast',
'const.wast',
'conversions.wast',
'data.wast',
'elem.wast',
'f32.wast',
'f64.wast',
'fac.wast',
'float_exprs.wast',
'float_misc.wast',
'func.wast',
'global.wast',
'if.wast',
'imports.wast',
'linking.wast',
'loop.wast',
'memory.wast',
'annotations.wast',
'id.wast',
'throw.wast',
'try_catch.wast',
'tag.wast',
'throw_ref.wast',
'try_table.wast',
'br_on_non_null.wast',
'br_on_null.wast',
'local_init.wast',
'ref_func.wast',
'ref_is_null.wast',
'ref_null.wast',
'return_call_indirect.wast',
'select.wast',
'table.wast',
'type-equivalence.wast',
'unreached-invalid.wast',
'array.wast',
'array_init_elem.wast',
'br_if.wast',
'br_on_cast.wast',
'br_on_cast_fail.wast',
'extern.wast',
'i31.wast',
'ref_cast.wast',
'ref_test.wast',
'struct.wast',
'type-rec.wast',
'type-subtyping.wast',
'call_indirect.wast',
'memory64.wast',
'table_fill.wast',
'table_get.wast',
'table_grow.wast',
'table_init.wast',
'table_set.wast',
'imports0.wast',
'imports2.wast',
'imports3.wast',
'linking0.wast',
'linking3.wast',
'i16x8_relaxed_q15mulr_s.wast',
'i32x4_relaxed_trunc.wast',
'i8x16_relaxed_swizzle.wast',
'relaxed_dot_product.wast',
'relaxed_laneselect.wast',
'relaxed_madd_nmadd.wast',
'relaxed_min_max.wast',
'simd_address.wast',
'simd_boolean.wast',
'simd_const.wast',
'simd_conversions.wast',
'simd_f32x4.wast',
'simd_f32x4_arith.wast',
'simd_f32x4_rounding.wast',
'simd_f64x2.wast',
'simd_f64x2_arith.wast',
'simd_f64x2_rounding.wast',
'token.wast',
]
options.spec_tests = [t for t in options.spec_tests if os.path.basename(t) not
in SPEC_TESTS_TO_SKIP]

in (SPEC_TESTSUITE_TESTS_TO_SKIP if 'testsuite' in t
else SPEC_TESTS_TO_SKIP)]

# check utilities


def binary_format_check(wast, verify_final_result=True, wasm_as_args=['-g'],
binary_suffix='.fromBinary'):
# checks we can convert the wast to binary and back
Expand Down
9 changes: 6 additions & 3 deletions scripts/test/wasm2js.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
wasm2js_tests = shared.get_tests(shared.get_test_dir('wasm2js'), ['.wast'])
assert_tests = ['wasm2js.wast.asserts']
# These tests exercise functionality not supported by wasm2js
wasm2js_blacklist = ['empty_imported_table.wast']
wasm2js_skipped_tests = [
'empty_imported_table.wast',
'br.wast', # depends on multivalue
]


def check_for_stale_files():
Expand All @@ -52,7 +55,7 @@ def test_wasm2js_output():
for opt in (0, 1):
for t in basic_tests + spec_tests + wasm2js_tests:
basename = os.path.basename(t)
if basename in wasm2js_blacklist:
if basename in wasm2js_skipped_tests:
continue

asm = basename.replace('.wast', '.2asm.js')
Expand Down Expand Up @@ -158,7 +161,7 @@ def update_wasm2js_tests():
if not wasm.endswith('.wast'):
continue

if os.path.basename(wasm) in wasm2js_blacklist:
if os.path.basename(wasm) in wasm2js_skipped_tests:
continue

asm = os.path.basename(wasm).replace('.wast', '.2asm.js')
Expand Down
3 changes: 3 additions & 0 deletions src/tools/wasm2js.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,9 @@ void AssertionEmitter::emit() {
// Skip other action assertions.
continue;
}
} else if (std::get_if<AssertModule>(assn)) {
// Skip module assertions
continue;
} else {
Fatal() << "unsupported assertion on line " << script[i].line;
}
Expand Down
Loading