diff --git a/DEV.md b/DEV.md index 7581d77..3924439 100644 --- a/DEV.md +++ b/DEV.md @@ -86,14 +86,3 @@ ninja ## Build for microcontrollers In `./platforms/` folder you can find projects for different targets. Some of them are using Platformio, so you can follow the regular pio build process. Others have custom instructions in respective `README.md` files. - -## Running WebAssembly spec tests - -To run spec tests, you need `python3` and `WABT` (The WebAssembly Binary Toolkit). - -```sh -cd test -python3 ./run-spec-test.py -``` - -It will automatically download, extract, preprocess the WebAssembly core test suite. diff --git a/test/README.md b/test/README.md new file mode 100644 index 0000000..6e9b60e --- /dev/null +++ b/test/README.md @@ -0,0 +1,33 @@ +# Wasm3 tests + +## Running WebAssembly spec tests + +To run spec tests, you need `python3` + +```sh +cd test +python3 ./run-spec-test.py +``` + +It will automatically download, extract, run the WebAssembly core test suite. + +## Running WASI test + +Wasm3 comes with a set of benchmarks and test programs (prebuilt as `WASI` apps) including `CoreMark`, `C-Ray`, `Brotli`, `mandelbrot`, `smallpt` and `wasm3` itself. + +This test will run all of them and verify the output: + +```sh +./run-wasi-test.py +``` + +It can be run against other engines as well: + +```sh +./run-wasi-test.py --exec wasmtime # [PASS] +./run-wasi-test.py --exec "wavm run" # [PASS] +./run-wasi-test.py --exec "wasmer run" # [PASS] +./run-wasi-test.py --exec "wasmer-js run" # [PASS] +./run-wasi-test.py --exec $WAMR/iwasm --timeout=300 # [PASS, but very slow] +./run-wasi-test.py --exec $WAC/wax --timeout=300 # [FAIL, crashes on most tests] +``` diff --git a/test/run-wasi-test.py b/test/run-wasi-test.py index 7db36e2..d642499 100755 --- a/test/run-wasi-test.py +++ b/test/run-wasi-test.py @@ -64,12 +64,12 @@ commands = [ "name": "Simple WASI test", "wasm": "./wasi/test.wasm", "args": ["args", "test"], - "expect_pattern": "Hello world*Constructor OK*Args: *test.wasm; args; test;*fib(20) = 6765*[* ms]*=== done ===*" + "expect_pattern": "Hello world*Constructor OK*Args: *; args; test;*fib(20) = 6765*[* ms]*=== done ===*" }, { "name": "Simple WASI test (wasm-opt -O3)", "wasm": "./wasi/test-opt.wasm", "args": ["args", "test"], - "expect_pattern": "Hello world*Constructor OK*Args: *test-opt.wasm; args; test;*fib(20) = 6765*[* ms]*=== done ===*" + "expect_pattern": "Hello world*Constructor OK*Args: *; args; test;*fib(20) = 6765*[* ms]*=== done ===*" }, { "name": "mandelbrot", "wasm": "./benchmark/mandelbrot/mandel.wasm",