diff --git a/crates/interpreter/test.sh b/crates/interpreter/test.sh index 5c75252b..de800795 100755 --- a/crates/interpreter/test.sh +++ b/crates/interpreter/test.sh @@ -19,7 +19,14 @@ set -e ensure_submodule third_party/WebAssembly/spec -# TODO(cleanup): Make sure we cover all spec/test/core tests using _test_diff. +list_files() { + find ../../third_party/WebAssembly/spec/test/core \ + -maxdepth 1 -name '*.wast' -execdir basename -s .wast {} \; +} +list_tests() { + sed -n 's/^test!(.*, "\([^"]*\)".*);$/\1/p;s/^test!(\([^,]*\).*);$/\1/p' tests/spec.rs +} +diff_sorted tests/spec.rs "$(list_files | sort)" $(list_tests) test_helper diff --git a/scripts/test-helper.sh b/scripts/test-helper.sh index 3c84eaae..89965e86 100644 --- a/scripts/test-helper.sh +++ b/scripts/test-helper.sh @@ -51,6 +51,14 @@ check_software_crypto() { fi } +# diff_sorted .. +# is the name of the list +# is a sorted list after word expansion +# .. is a sorted list +diff_sorted() { + _test_diff "$@" +} + test_helper() { _test_desc | grep -Ev 'cargo (check|(miri )?test) --(lib|(bin|test|example)=[^ ]*)( |$)' \ && e 'Invalid description (invalid commands are listed above).'