13 lines
421 B
Bash
Executable File
13 lines
421 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Build every examples/*.wat to a native ELF with wasm2elf and run it.
|
|
set -u
|
|
cd "$(dirname "$0")"
|
|
EXE=_build/native/debug/build/cmd/main/main.exe
|
|
mkdir -p out
|
|
for wat in examples/*.wat; do
|
|
n=$(basename "$wat" .wat)
|
|
wasm-tools parse "$wat" -o "out/$n.wasm" && wasm-tools validate "out/$n.wasm" || continue
|
|
$EXE "out/$n.wasm" "out/$n" >/dev/null || continue
|
|
./out/$n; echo "$n -> exit $?"
|
|
done
|