From d348e6918561a2e8d97ae47c6d410f13c211adb0 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Fri, 5 Jan 2024 10:00:24 -0700 Subject: [PATCH] test all three targets Signed-off-by: Joel Dice --- .github/workflows/main.yml | 3 ++- tests/run.sh | 4 +--- tests/testcase.sh | 8 +++++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1172890..7489419 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,8 +39,9 @@ jobs: 0-cache-macos-latest if: matrix.os == 'macos-latest' - name: Install wasmtime for tests + # TODO: switch to Wasmtime 17 once it's released, which will include https://github.com/bytecodealliance/wasmtime/pull/7750 run: | - curl -f -L --retry 5 https://wasmtime.dev/install.sh | bash -s -- --version v16.0.0 + curl -f -L --retry 5 https://wasmtime.dev/install.sh | bash -s -- --version dev ~/.wasmtime/bin/wasmtime --version curl -f -L --retry 5 -o ~/.wasmtime/bin/wasi_snapshot_preview1.command.wasm https://github.com/bytecodealliance/wasmtime/releases/download/v16.0.0/wasi_snapshot_preview1.command.wasm if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then diff --git a/tests/run.sh b/tests/run.sh index 9af3ab1..62d05e9 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -44,9 +44,7 @@ echo $CC echo $CXX echo "SDK: $wasi_sdk" -# TODO: `wasm32-wasi-threads` should be in this list, but as of this writing the -# `signal.c` test is failing due to https://github.com/bytecodealliance/wasmtime/issues/7745 -for target in wasm32-wasi-preview2 wasm32-wasi; do +for target in wasm32-wasi wasm32-wasi-threads wasm32-wasi-preview2; do echo "===== Testing target $target =====" cd $testdir/compile-only for options in -O0 -O2 "-O2 -flto"; do diff --git a/tests/testcase.sh b/tests/testcase.sh index fd42b0d..d7368e0 100755 --- a/tests/testcase.sh +++ b/tests/testcase.sh @@ -28,10 +28,16 @@ else file_options= fi +if [ "$target" == "wasm32-wasi-threads" ]; then + pthread_options="-pthread" +else + pthread_options= +fi + echo "Testing $input..." # Compile the testcase. -$compiler --target=$target $options $file_options "$input" -o "$wasm" +$compiler --target=$target $pthread_options $options $file_options "$input" -o "$wasm" # If we don't have a runwasi command, we're just doing compile-only testing. if [ "$runwasi" == "" ]; then