mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-25 08:37:13 +09:00
CI: run WASI tests
This commit is contained in:
@@ -168,7 +168,7 @@ jobs:
|
||||
- name: Install Wasmer
|
||||
uses: wasmerio/setup-wasmer@v3.1
|
||||
|
||||
- name: Build for WASI
|
||||
- name: Build for wasi-core
|
||||
run: zig build -Dtarget=wasm32-wasi -Doptimize=ReleaseSafe
|
||||
|
||||
- name: Run tests with Wasmer
|
||||
@@ -177,25 +177,10 @@ jobs:
|
||||
failed=0
|
||||
for wasm in *.wasm; do
|
||||
name="${wasm%.wasm}"
|
||||
exp="../../test/default/${name}.exp"
|
||||
echo "[$name]"
|
||||
if [ -f "$exp" ]; then
|
||||
if ! wasmer run "$wasm" > output.txt 2>&1; then
|
||||
echo "*** [$name] EXECUTION FAILED" >&2
|
||||
cat output.txt
|
||||
failed=1
|
||||
continue
|
||||
fi
|
||||
if ! diff -q output.txt "$exp" > /dev/null 2>&1; then
|
||||
echo "*** [$name] OUTPUT MISMATCH" >&2
|
||||
echo "Expected:"
|
||||
cat "$exp"
|
||||
echo "Got:"
|
||||
cat output.txt
|
||||
failed=1
|
||||
fi
|
||||
else
|
||||
echo "*** [$name] NO .exp file found, skipping validation"
|
||||
if ! wasmer run --dir . "$wasm" 2>&1; then
|
||||
echo "*** [$name] FAILED" >&2
|
||||
failed=1
|
||||
fi
|
||||
done
|
||||
exit $failed
|
||||
|
||||
Reference in New Issue
Block a user