1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 22:27:35 +00:00

LibWasm+Meta: Add test-wasm and optionally test the conformance tests

This only tests "can it be parsed", but the goal of this commit is to
provide a test framework that can be built upon :)
The conformance tests are downloaded, compiled* and installed only if
the INCLUDE_WASM_SPEC_TESTS cmake option is enabled.
(*) Since we do not yet have a wast parser, the compilation is delegated
to an external tool from binaryen, `wasm-as`, which is required for the
test suite download/install to succeed.
This *does* run the tests in CI, but it currently does not include the
spec conformance tests.
This commit is contained in:
Ali Mohammad Pur 2021-05-04 07:36:59 +04:30 committed by Linus Groh
parent ba2fce14d3
commit b3c13c3e8a
11 changed files with 207 additions and 1 deletions

View file

@ -155,6 +155,21 @@ if (BUILD_LAGOM)
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_executable(test-wasm_lagom
../../Tests/LibWasm/test-wasm.cpp
../../Userland/Libraries/LibTest/JavaScriptTestRunnerMain.cpp)
set_target_properties(test-wasm_lagom PROPERTIES OUTPUT_NAME test-wasm)
target_link_libraries(test-wasm_lagom Lagom)
target_link_libraries(test-wasm_lagom stdc++)
target_link_libraries(test-wasm_lagom pthread)
add_test(
NAME WasmParser
COMMAND test-wasm_lagom --show-progress=false
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
set_tests_properties(WasmParser PROPERTIES
ENVIRONMENT SERENITY_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}/../..)
add_executable(disasm_lagom ../../Userland/Utilities/disasm.cpp)
set_target_properties(disasm_lagom PROPERTIES OUTPUT_NAME disasm)
target_link_libraries(disasm_lagom Lagom)