Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions adapters/wasm-micro-runtime.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash

# WARNING: this adapter assumes iwasm from the latest wasm-micro-runtime.
# Namely the change to propagate WASI exit code:
# https://github.com/bytecodealliance/wasm-micro-runtime/pull/1748

TEST_FILE=
ARGS=()
DIR=()
ENV=()

IWASM=iwasm

while [[ $# -gt 0 ]]; do
case $1 in
--version)
${IWASM} --version
exit 0
;;
--test-file)
TEST_FILE="$2"
shift
shift
;;
--arg)
ARGS+=("$2")
shift
shift
;;
--dir)
DIR+=("--dir=$2")
shift
shift
;;
--env)
ENV+=("--env=$2")
shift
shift
;;
*)
echo "Unknown option $1"
exit 1
;;
esac
done

${IWASM} "${DIR[@]}" "${ENV[@]}" ${TEST_FILE} "${ARGS[@]}"