Repository Public License
1#!/usr/bin/env bash2# Opens the real PRISM window on a throwaway library, behind other windows and without taking focus, and walks through3# every screen: typing in the composers, a simulated build, every catalog component, every model-built app in4# tests/golden/model-built, sheets and window resizes. Catches what off-screen rendering cannot: live-window layout crashes.5# scripts/ui-walk.sh [debug|release]6set -euo pipefail7cd "$(dirname "$0")/.."8APP="build/${1:-debug}/PRISM.app"9[ -x "$APP/Contents/MacOS/PRISM" ] || { echo "Build first: scripts/build.sh ${1:-debug}" >&2; exit 1; }10log="build/ui-walk.log"11set +e12"$APP/Contents/MacOS/PRISM" --selftest-ui --selftest-blueprints "$PWD/tests/golden/model-built" > "$log" 2>&113code=$?14set -e15steps=$(grep -c '^selftest:' "$log" || true)16if [ "$code" -eq 0 ] && grep -q 'selftest: PASSED' "$log"; then17 echo "ui walk: PASSED ($steps steps, $(grep -c 'walked .*blueprint' "$log") model-built apps)"18else19 echo "ui walk: FAILED (exit $code) after: $(grep '^selftest:' "$log" | tail -1)"20 grep -m1 -A1 'Terminating app' "$log" | cut -c1-400 || true21 exit 122fi23