From b77017ac55fcb3e950a8c80b71a9a911542f0af0 Mon Sep 17 00:00:00 2001 From: Cheng Shao Date: Tue, 3 Jan 2023 12:04:55 +0100 Subject: [PATCH] Run tests under wasmtime as part of the CI (#278) --- .github/workflows/main.yml | 4 +++- Makefile | 2 +- tests/general/abort.c.stderr.expected | 4 ++-- tests/general/assert-fail.c.stderr.expected | 4 ++-- tests/general/sigabrt.c.stderr.expected | 6 ++---- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4726adb..4990da3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,6 +38,8 @@ jobs: restore-keys: | 0-cache-macos-latest if: matrix.os == 'macos-latest' + - name: Install wasmtime for tests + run: curl -f -L --retry 5 https://wasmtime.dev/install.sh | bash -s -- --version v2.0.2 - uses: actions/checkout@v1 with: submodules: true @@ -51,7 +53,7 @@ jobs: run: NINJA_FLAGS=-v make package LLVM_CMAKE_FLAGS=-DLLVM_CCACHE_BUILD=ON shell: bash - name: Run the testsuite - run: NINJA_FLAGS=-v make check + run: NINJA_FLAGS=-v make check RUNTIME=~/.wasmtime/bin/wasmtime - name: Upload artifacts uses: actions/upload-artifact@v1 with: diff --git a/Makefile b/Makefile index 1387bd3..08a4b6f 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,7 @@ default: build check: CC="clang --sysroot=$(BUILD_PREFIX)/share/wasi-sysroot" \ CXX="clang++ --sysroot=$(BUILD_PREFIX)/share/wasi-sysroot -fno-exceptions" \ - PATH="$(PATH_PREFIX)/bin:$$PATH" tests/run.sh + PATH="$(PATH_PREFIX)/bin:$$PATH" tests/run.sh $(RUNTIME) clean: rm -rf build $(DESTDIR) diff --git a/tests/general/abort.c.stderr.expected b/tests/general/abort.c.stderr.expected index dbcd5f3..bfba498 100644 --- a/tests/general/abort.c.stderr.expected +++ b/tests/general/abort.c.stderr.expected @@ -1,6 +1,6 @@ Error: failed to run main module `abort.c.---.wasm` Caused by: - 0: failed to invoke `_start` - 1: wasm trap: unreachable, source location: @---- + 0: failed to invoke command default + 1: wasm trap: wasm `unreachable` instruction executed wasm backtrace: diff --git a/tests/general/assert-fail.c.stderr.expected b/tests/general/assert-fail.c.stderr.expected index db6da54..806abf9 100644 --- a/tests/general/assert-fail.c.stderr.expected +++ b/tests/general/assert-fail.c.stderr.expected @@ -2,6 +2,6 @@ Assertion failed: false (assert-fail.c: main: 5) Error: failed to run main module `assert-fail.c.---.wasm` Caused by: - 0: failed to invoke `_start` - 1: wasm trap: unreachable, source location: @---- + 0: failed to invoke command default + 1: wasm trap: wasm `unreachable` instruction executed wasm backtrace: diff --git a/tests/general/sigabrt.c.stderr.expected b/tests/general/sigabrt.c.stderr.expected index edba63e..72c425d 100644 --- a/tests/general/sigabrt.c.stderr.expected +++ b/tests/general/sigabrt.c.stderr.expected @@ -1,8 +1,6 @@ raising SIGABRT... -Program recieved fatal signal: Aborted +Program received fatal signal: Aborted Error: failed to run main module `sigabrt.c.---.wasm` Caused by: - 0: failed to invoke `_start` - 1: wasm trap: unreachable, source location: @---- - wasm backtrace: + 0: failed to invoke command default