update zig wasm test runner script

This commit is contained in:
Folkert 2022-04-08 14:33:10 +02:00
parent 77c9bc193b
commit f587c3b49c
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C

View file

@ -4,6 +4,10 @@ set -euxo pipefail
# Test failures will always point at the _start function
# Make sure to look at the rest of the stack trace!
warning_about_non_native_binary=$(zig test -target wasm32-wasi-musl -O ReleaseFast src/main.zig 2>&1)
wasm_test_binary=$(echo $warning_about_non_native_binary | cut -d' ' -f 3)
# Zig will try to run the test binary it produced, but it is a wasm object and hence your OS won't
# know how to run it. In the error message, it prints the binary it tried to run. We use some fun
# unix tools to get that path, then feed it to wasmer
warning_about_non_native_binary=$(zig test -target wasm32-wasi-musl -O ReleaseFast src/main.zig 2>&1) || true
wasm_test_binary=$(echo $warning_about_non_native_binary | cut -d' ' -f 35 )
wasmer $wasm_test_binary dummyArgForZigTestBinary