From 51f6b2df8d598a707a4c2aa44d17eb4bae318a4e Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sat, 17 Dec 2022 21:46:00 +0100 Subject: [PATCH] Add wazero to the list of tested wasm runtimes --- test/default/wasi-test-wrapper.sh | 62 +++++++++++++++++-------------- 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/test/default/wasi-test-wrapper.sh b/test/default/wasi-test-wrapper.sh index 5b77967e..1f55ef9b 100755 --- a/test/default/wasi-test-wrapper.sh +++ b/test/default/wasi-test-wrapper.sh @@ -9,9 +9,20 @@ 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 +if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasmedge" ]; then + if command -v wasmedgec >/dev/null && command -v wasmedge >/dev/null; then + wasmedgec "$1" "${1}.so" && + wasmedge --dir=.:. "${1}.so" && + rm -f "${1}.so" && + exit 0 + fi +fi + + + +if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasmer" ]; then + if command -v wasmer >/dev/null; then + wasmer run "$1" "--${WASMER_BACKEND:-cranelift}" --dir=. && exit 0 fi fi @@ -21,30 +32,9 @@ if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasmtime" ]; then fi fi -if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasmer" ]; then - if command -v wasmer >/dev/null; then - wasmer run "$1" "--${WASMER_BACKEND:-cranelift}" --dir=. && exit 0 - fi -fi - -if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasm3" ]; then - if command -v wasm3 >/dev/null; then - wasm3 "$1" && exit 0 - fi -fi - -if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "iwasm" ]; then - if iwasm | grep -qi wasi >/dev/null 2>&1; then - iwasm "$1" && exit 0 - fi -fi - -if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasmedge" ]; then - if command -v wasmedgec >/dev/null && command -v wasmedge >/dev/null; then - wasmedgec "$1" "${1}.so" && - wasmedge --dir=.:. "${1}.so" && - rm -f "${1}.so" && - exit 0 +if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wavm" ]; then + if command -v wavm >/dev/null; then + wavm run --abi=wasi "$1" && exit 0 fi fi @@ -64,6 +54,24 @@ if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "node" ]; then fi fi +if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasm3" ]; then + if command -v wasm3 >/dev/null; then + wasm3 "$1" && exit 0 + fi +fi + +if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "iwasm" ]; then + if iwasm | grep -qi wasi >/dev/null 2>&1; then + iwasm "$1" && exit 0 + fi +fi + +if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wazero" ]; then + if command -v wazero >/dev/null; then + wazero run -mount .:/ "$1" && exit 0 + fi +fi + if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasmer-js" ]; then if command -v wasmer-js >/dev/null; then wasmer-js run "$1" --dir=. && exit 0