From ab64fe3d094da209842d7b390dd762d29642aa7b Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Sat, 10 Jun 2023 01:56:01 +0900 Subject: [PATCH] ci: test runwasi example as well --- .github/workflows/ci.yml | 10 ++++++++-- test/{test-example-app.sh => test-example.sh} | 9 +++++---- 2 files changed, 13 insertions(+), 6 deletions(-) rename test/{test-example-app.sh => test-example.sh} (73%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 57691029..e171a3e4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -369,10 +369,16 @@ jobs: mkdir -p ${{github.workspace}}/artifacts cp ${{env.builddir}}/*.tgz ${{github.workspace}}/artifacts/ - - name: Test example app with the library we built + - name: Test "app" example with the library we built if: matrix.BUILD_TYPE == 'Release' && matrix.arch == 'native' run: | - ./test/test-example-app.sh ${{env.builddir}}/toywasm-v*.tgz ${{env.builddir}}/spectest.wasm + ./test/test-example.sh app ${{env.builddir}}/toywasm-v*.tgz ${{env.builddir}}/spectest.wasm + + - name: Test "runwasi" example with the library we built + if: matrix.BUILD_TYPE == 'Release' && matrix.arch == 'native' + run: | + wat2wasm wat/wasi/hello.wat + ./test/test-example.sh runwasi ${{env.builddir}}/toywasm-v*.tgz hello.wasm - name: Upload artifacts if: matrix.name != 'noname' diff --git a/test/test-example-app.sh b/test/test-example.sh similarity index 73% rename from test/test-example-app.sh rename to test/test-example.sh index 020662b8..c029dab3 100755 --- a/test/test-example-app.sh +++ b/test/test-example.sh @@ -2,14 +2,15 @@ set -e -TGZ=$1 -MODULE=$2 +APP=$1 +TGZ=$2 +shift 2 DIR=$(mktemp -d) gzip -cd ${TGZ} | (cd ${DIR} && pax -r) -cd examples/app +cd examples/${APP} BUILDDIR=$(mktemp -d) cmake -B ${BUILDDIR} -DCMAKE_INSTALL_PREFIX=${DIR} . cmake --build ${BUILDDIR} -${BUILDDIR}/app ${MODULE} +${BUILDDIR}/${APP} "$@"