Skip to content

XNU as a loadable kernel module inside Linux (macOS personality for arm64 Linux)

C

tests: preserve the fpcheck PID when collecting its exit status (#36)

jeiel85d311f5d0759e
diff --git a/tests/host/run.sh b/tests/host/run.sh
index d662696..b954762 100755
--- a/tests/host/run.sh
+++ b/tests/host/run.sh
@@ -7,7 +7,7 @@ set -e
cd "$(dirname "$0")"
O=${TMPDIR:-/tmp}
cc -O2 -o $O/fpcheck fpcheck.c && cc -O2 -o $O/memcheck memcheck.c
-$O/fpcheck 0 25 & f=$!
+$O/fpcheck 0 25 & fp_pid=$!
m=0; sudo $O/memcheck 4 25 || m=$?
-f=0; wait $f || f=$?
+f=0; wait "$fp_pid" || f=$?
[ $f = 0 ] && [ $m = 0 ] && echo "host tests: pass" || { echo "host tests: FAIL (fpcheck $f, memcheck $m)"; exit 1; }