set -e
args=()
for arg in "$@"; do
if [[ "$arg" == "--relaxed" ]]; then
export RELAXED_WARNINGS=1
else
args+=("$arg")
fi
done
source "$(dirname "$0")/_env"
if [[ -n "$WASM_LITE_RUNNER" ]]; then
wasm_lite_bin="$WASM_LITE_RUNNER"
else
repository_root="$(cd "$(dirname "$0")/../.." && pwd)"
wasm_lite_bin="$repository_root/../wasm_lite/target/debug/wasm_lite"
if [[ ! -x "$wasm_lite_bin" ]]; then
wasm_lite_bin="$(command -v wasm_lite || true)"
fi
fi
if [[ -z "$wasm_lite_bin" || ! -x "$wasm_lite_bin" ]]; then
echo "error: wasm_lite runner is missing or not executable: ${wasm_lite_bin:-<not found>}" >&2
echo "build it with 'cargo build -p wasm_lite_cli' in a wasm_lite checkout," >&2
echo "install it with 'cargo install wasm_lite_cli'," >&2
echo "or set WASM_LITE_RUNNER to the wasm_lite binary." >&2
exit 1
fi
CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER="$wasm_lite_bin run" RUSTFLAGS="$WASM32_RUSTFLAGS" RUSTDOCFLAGS="$WASM32_RUSTDOCFLAGS" cargo +nightly test --target=wasm32-unknown-unknown --all "${args[@]}"