#!/usr/bin/env bash # Cel gate for Space Taxi: every level cel a recorded ride DISPLAYS must be # in the level's baked manifest (stLevelCelList in stLevelCels.c), or the # real ports build it mid-ride and draw it interpreted -- the "compiling # sprites on the fly" hitch. Runs the same rides gate.sh does with the # stsim census (STSIM_CELS=1) and fails on any MISSING line. # # celGate.sh check every hook level set -u here=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) repo=$(cd "$here/../.." && pwd) levels=$repo/examples/spacetaxi/generated/iigs/levels ticks=4000 pairs="H:08 T:20 W:23 X:24 G:07 I:09 K:11 O:15 Q:17 R:18 U:21 V:22 E:05 J:10 L:12 P:16 S:19" make -C "$here" >/dev/null || { echo "celGate: build failed" >&2; exit 2; } fail=0 for p in $pairs; do l=${p%%:*}; n=${p##*:} out=$(STSIM_CELS=1 "$here/stsim" "$levels/level$n.dat" "$l" "$ticks" 2>&1 >/dev/null | grep -E '^(CEL|CENSUS)') missing=$(echo "$out" | grep -c '^CEL MISSING') census=$(echo "$out" | grep '^CENSUS' | sed 's/^CENSUS //') if [ "$missing" -ne 0 ]; then printf ' %s: *** %s cel(s) shown but not baked *** (%s)\n' "$l" "$missing" "$census" echo "$out" | grep '^CEL MISSING' | sed 's/^/ /' fail=1 else printf ' %s: ok (%s)\n' "$l" "$census" fi done [ $fail -eq 0 ] && echo "celGate: PASS" || echo "celGate: FAIL" exit $fail