From 824c8cdf69904c2f1fe7e777184bb5fbf1130107 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 4 Jun 2020 10:53:29 +0200 Subject: [PATCH] Backport wavm support --- test/default/wasi-test-wrapper.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/default/wasi-test-wrapper.sh b/test/default/wasi-test-wrapper.sh index 61b1d3bb..06335608 100755 --- a/test/default/wasi-test-wrapper.sh +++ b/test/default/wasi-test-wrapper.sh @@ -2,6 +2,16 @@ MAX_MEMORY_TESTS="67108864" +if command -v wasm-opt >/dev/null; then + wasm-opt -O4 -o "${1}.tmp" "$1" && mv -f "${1}.tmp" "$1" +fi + +if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wavm" ]; then + if command -v wavm >/dev/null; then + wavm run --abi=wasi "$1" && exit 0 + fi +fi + if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasmtime" ]; then if command -v wasmtime >/dev/null; then wasmtime -o --dir=. "$1" && exit 0