From e42f71d398e8ba16bb3c534c8bb85e4fb37ed633 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Wed, 27 Mar 2024 14:44:49 -0600 Subject: [PATCH] update wasi-libc and fix out-of-date tests This updates the `wasi-libc` submodule to point to `main` and also: - update tests/testcase.sh to use new wasm32-wasip2 target name - update various tests/**/*.expected files to match Wasmtime output Signed-off-by: Joel Dice --- src/wasi-libc | 2 +- tests/general/abort.c.wasm32-wasi.stderr.expected | 6 ++++++ tests/general/abort.c.wasm32-wasip2.stderr.expected | 6 ++++++ tests/general/assert-fail.c.wasm32-wasip2.stderr.expected | 7 +++++++ tests/general/sigabrt.c.wasm32-wasip2.stderr.expected | 6 ++++++ tests/testcase.sh | 2 +- 6 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 tests/general/abort.c.wasm32-wasi.stderr.expected create mode 100644 tests/general/abort.c.wasm32-wasip2.stderr.expected create mode 100644 tests/general/assert-fail.c.wasm32-wasip2.stderr.expected create mode 100644 tests/general/sigabrt.c.wasm32-wasip2.stderr.expected diff --git a/src/wasi-libc b/src/wasi-libc index c9c7d0616..d03829489 160000 --- a/src/wasi-libc +++ b/src/wasi-libc @@ -1 +1 @@ -Subproject commit c9c7d0616e0f7fe4d0d0fa54372b6d1f5689f91d +Subproject commit d03829489904d38c624f6de9983190f1e5e7c9c5 diff --git a/tests/general/abort.c.wasm32-wasi.stderr.expected b/tests/general/abort.c.wasm32-wasi.stderr.expected new file mode 100644 index 000000000..c6ecf6a93 --- /dev/null +++ b/tests/general/abort.c.wasm32-wasi.stderr.expected @@ -0,0 +1,6 @@ +Error: failed to run main module `abort.c.---.wasm` + +Caused by: + 0: failed to invoke command default + 1: error while executing at wasm backtrace: + 2: wasm trap: wasm `unreachable` instruction executed diff --git a/tests/general/abort.c.wasm32-wasip2.stderr.expected b/tests/general/abort.c.wasm32-wasip2.stderr.expected new file mode 100644 index 000000000..26fe376cf --- /dev/null +++ b/tests/general/abort.c.wasm32-wasip2.stderr.expected @@ -0,0 +1,6 @@ +Error: failed to run main module `abort.c.---.wasm` + +Caused by: + 0: failed to invoke `run` function + 1: error while executing at wasm backtrace: + 2: wasm trap: wasm `unreachable` instruction executed diff --git a/tests/general/assert-fail.c.wasm32-wasip2.stderr.expected b/tests/general/assert-fail.c.wasm32-wasip2.stderr.expected new file mode 100644 index 000000000..3702431bd --- /dev/null +++ b/tests/general/assert-fail.c.wasm32-wasip2.stderr.expected @@ -0,0 +1,7 @@ +Assertion failed: false (assert-fail.c: main: 5) +Error: failed to run main module `assert-fail.c.---.wasm` + +Caused by: + 0: failed to invoke `run` function + 1: error while executing at wasm backtrace: + 2: wasm trap: wasm `unreachable` instruction executed diff --git a/tests/general/sigabrt.c.wasm32-wasip2.stderr.expected b/tests/general/sigabrt.c.wasm32-wasip2.stderr.expected new file mode 100644 index 000000000..f437a8214 --- /dev/null +++ b/tests/general/sigabrt.c.wasm32-wasip2.stderr.expected @@ -0,0 +1,6 @@ +raising SIGABRT... +Program received fatal signal: Aborted +Error: failed to run main module `sigabrt.c.---.wasm` + +Caused by: + 0: failed to invoke `run` function diff --git a/tests/testcase.sh b/tests/testcase.sh index b646e2d4a..61c6612e5 100755 --- a/tests/testcase.sh +++ b/tests/testcase.sh @@ -44,7 +44,7 @@ if [ "$runwasi" == "" ]; then exit 0 fi -if [ "$target" == "wasm32-wasi-preview2" -a -n "$adapter" -a -n "$wasm_tools" ]; then +if [ "$target" == "wasm32-wasip2" -a -n "$adapter" -a -n "$wasm_tools" ]; then "$wasm_tools" component new --adapt "$adapter" "$wasm" -o "$wasm" run_args="--wasm component-model" fi