| 1 | #!/bin/sh |
| 2 | # Build and run the compiler fixtures on the released Vinix kernel. |
| 3 | set -eu |
| 4 | export PATH=/bin:/usr/bin:/sbin:/usr/sbin |
| 5 | export HOME=/tmp LC_ALL=C |
| 6 | phase=start |
| 7 | finish() { |
| 8 | rc=$? |
| 9 | if [ "$rc" -ne 0 ]; then printf 'VPAC TOOLCHAIN GUEST FAIL %s %s\n' "$phase" "$rc"; fi |
| 10 | /sbin/poweroff -f |
| 11 | } |
| 12 | trap finish EXIT |
| 13 | mkdir -p /tmp |
| 14 | test "$(uname -o)" = Vinix |
| 15 | arch=$(uname -m) |
| 16 | test "$(gcc -dumpmachine)" = "$arch-linux-musl" |
| 17 | test "$(g++ -dumpmachine)" = "$arch-linux-musl" |
| 18 | mkdir /tmp/vinix-toolchain-test |
| 19 | cp /usr/share/vinix-toolchain-test/* /tmp/vinix-toolchain-test/ |
| 20 | cd /tmp/vinix-toolchain-test |
| 21 | phase=compile-and-run |
| 22 | make -j1 check |
| 23 | if [ -n "${VINIX_TOOLCHAIN_NEXT_FIXTURE:-}" ]; then |
| 24 | echo 'Vinix toolchain compiled and ran all six fixtures' |
| 25 | trap - EXIT |
| 26 | exec /bin/sh "$VINIX_TOOLCHAIN_NEXT_FIXTURE" |
| 27 | fi |
| 28 | echo 'VPAC FIXTURE GUEST PASS' |
| 29 | |