Files
vt1200/apps/termtris/tests/smoke.sh
T
opencode.energia.arti.ee 7a2cef56ad fix(termtris): review pass -- seed, focus/pause, expose, test assertions
- seed the game from the raw 0x1E93C0 counter (now_ms() returns 0 on its
  first call, so the old seed was always zero)
- track pause ourselves: FocusOut pauses once, FocusIn resumes only what we
  paused (game_input('p') is a toggle)
- select ExposureMask so the Expose redraw path actually fires
- play.sh/play_keys.sh rebuild the COFF (OUTNAME=termtris) and assert the
  run: status=0, tick>0, loops/events/quit per mode; render.sh asserts the
  renderer finished; map symbol lookup is column-order independent
- run.sh passes -lightgun -lightgun_device mouse so the pointer drives the
  tablet
- docs: link map addresses, monochrome/reverse wording, honest caption and
  limits text

Verified here: play.sh and input.sh pass. Still open: the MAME driver in the
tree is newer than the installed binary (Oct 30 build, VR150-era geometry),
so the acceptance suite must be re-run after a rebuild.
2026-11-11 17:59:16 +00:00

38 lines
1.3 KiB
Bash
Executable File

#!/bin/sh
# smoke.sh -- Task 1 acceptance. Builds the local Xlib smoke payload, loads it
# into the emulated VT1200 RAM, clicks the window, presses A, and requires a
# real KeyPress + XLookupString('a').
set -eu
DIR=$(cd "$(dirname "$0")" && pwd)
APP=$(cd "$DIR/.." && pwd)
ROOT=$(cd "$APP/../.." && pwd)
M=${MAME:-/home/arti/code/k-space/mame0289/vt1200}
LOG="$APP/build/smoke.log"
mkdir -p "$APP/build"
"$APP/build.sh" "$DIR/smoke.c" "$APP/src/vt1200/xgfix.c" >"$APP/build/smoke-build.log" 2>&1
MARK=$(awk '{for(i=2;i<=NF;i++) if($i=="_mark") print $(i-1)}' "$APP/build/smoke.map" | head -1)
VT1200_SKIP_LEVEL1=1 SMOKE_MARK="0x$MARK" \
LOADER_AT=2500 LOADER_END=3400 \
LOADER_BIN="$ROOT/dwt/loader/build/loader.bin" \
LOADER_COFF="$APP/build/smoke.coff" \
LOADER_OUT="$APP/build" \
"$M" vt1200 -rompath "$ROOT/harness/mame/roms" \
-video none -sound none -nothrottle -skip_gameinfo \
-debug -debugger none \
-autoboot_script "$DIR/smoke.lua" -autoboot_delay 0 \
>"$LOG" 2>&1 || true
grep 'SMOKE:' "$LOG" | tail -5
grep -q 'SMOKE: .*type=2 .*keymark=4B455950' "$LOG" || {
echo "smoke.sh: no real KeyPress (see $LOG)" >&2
exit 1
}
grep -q 'SMOKE: .*lookup_n=1 ch=61 ks=0061' "$LOG" || {
echo "smoke.sh: XLookupString did not return 'a' (see $LOG)" >&2
exit 1
}
echo "smoke: PASS"