From d202535dd2c75b8efa4aaf82a10fcdcb5c79328c Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 31 May 2024 14:35:17 +0330 Subject: [PATCH] make the build step common among tests --- .gitignore | 2 +- tests/wasix/cwd-to-home/run.sh | 12 ++---------- tests/wasix/cwd-to-home/wasmer.toml | 7 ------- tests/wasix/test.sh | 7 ++++++- 4 files changed, 9 insertions(+), 19 deletions(-) delete mode 100644 tests/wasix/cwd-to-home/wasmer.toml diff --git a/.gitignore b/.gitignore index a5f49e67270..ed9fd0c7e3a 100644 --- a/.gitignore +++ b/.gitignore @@ -15,7 +15,7 @@ api-docs-repo/ /lib/c-api/wasmer.h .xwin-cache wapm.toml -lib/**/wasmer.toml +wasmer.toml *.snap.new # Generated by tests on Android /avd diff --git a/tests/wasix/cwd-to-home/run.sh b/tests/wasix/cwd-to-home/run.sh index 0e47d5f48fe..474bd170e0d 100755 --- a/tests/wasix/cwd-to-home/run.sh +++ b/tests/wasix/cwd-to-home/run.sh @@ -1,13 +1,5 @@ #!/bin/bash -$CC $CFLAGS $LDFLAGS -o main.wasm main.c +$WASMER -q run main.wasm --dir=. > output -$WASMER -q run main.wasm --dir=. > output0 -$WASMER -q run . --dir=. > output1 -$WASMER -q package build --out cwd-to-home.webc . > /dev/null && $WASMER -q run cwd-to-home.webc --dir=. > output2 - -rm cwd-to-home.webc - -diff -u output0 expected 1>/dev/null && \ -diff -u output1 expected 1>/dev/null && \ -diff -u output2 expected 1>/dev/null \ No newline at end of file +diff -u output expected 1>/dev/null \ No newline at end of file diff --git a/tests/wasix/cwd-to-home/wasmer.toml b/tests/wasix/cwd-to-home/wasmer.toml deleted file mode 100644 index 6c9f1600345..00000000000 --- a/tests/wasix/cwd-to-home/wasmer.toml +++ /dev/null @@ -1,7 +0,0 @@ -[[module]] -name = "main" -source = "main.wasm" - -[[command]] -name = "main" -module = "main" \ No newline at end of file diff --git a/tests/wasix/test.sh b/tests/wasix/test.sh index 619b221d558..f3349e46c4a 100755 --- a/tests/wasix/test.sh +++ b/tests/wasix/test.sh @@ -74,7 +74,12 @@ status=0 while read dir; do dir=$(basename "$dir") printf "Testing $dir..." - if bash -c "cd $dir && ./run.sh"; then + + cmd="cd $dir; \ + $CC $CFLAGS $LDFLAGS -o main.wasm main.c; \ + ./run.sh" + + if bash -c "$cmd"; then printf "\rTesting $dir ✅\n" else printf "\rTesting $dir ❌\n"