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