#!/usr/bin/env bash # # scripts/tests/test-gfx.sh — automated graphics round-trip test. # # Builds, boots headless, runs the in-kernel gfx self-test and the # status-bar demo, then powers off. # # Usage: ./scripts/tests/test-gfx.sh # Env: SYSTEM_IMG, OVMF, QEMU (see scripts/lib.sh) # set -euo pipefail TNAME="gfx" # shellcheck source=../lib.sh source "$(dirname "$0")/../lib.sh" echo "==> 1/5 build (kernel + bins)" build_all echo "==> 2/5 stage system image" stage_image --force echo "==> 3/5 boot QEMU (headless)" test_boot wait_log "$LOG" "cursor: task " 10 || fail "cursor task did not spawn" echo "==> 4/5 in-kernel pixel self-test (gfx check)" sendkeys "gfx check" wait_log "$LOG" "gfx check: PASS" 30 || fail "gfx check did not run" echo "==> 5/5 gfx demo (draw scene)" sendkeys "gfx" "poweroff" wait_qemu_exit 30 || fail "QEMU did not exit after poweroff" grep -aq "gfx: drew status bar" "$LOG" || fail "gfx demo did not draw" echo "" echo "PASS — gfx round trip"