Skip to content

Commit

Permalink
make the build step common among tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maminrayej committed May 31, 2024
1 parent d47a69f commit d202535
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 2 additions & 10 deletions tests/wasix/cwd-to-home/run.sh
Original file line number Diff line number Diff line change
@@ -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
diff -u output expected 1>/dev/null
7 changes: 0 additions & 7 deletions tests/wasix/cwd-to-home/wasmer.toml

This file was deleted.

7 changes: 6 additions & 1 deletion tests/wasix/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit d202535

Please sign in to comment.