NetDeck: headless test runner — unit + integration suites, E2E as separate build

- emulator/tests/: harness.h (TEST/EXPECT framework, input + serial +
  framebuffer helpers), shim_globals.cpp (shim externs for test binaries,
  replacing main.cpp ownership)
- unit_tests.h (14): map/door/LOS/BFS/cover/link state machine/trace/
  spike/reinforcement/win/loss/reset — deterministic fixed-seed, sim
  stepped tick by tick
- integration_tests.h (7): keyboard->pollKeyboard->handleKey pipeline,
  beacon clicks -> squad movement, full network journey via clicks,
  hover-sever (incl. safe sever during trace), daemon gating
- e2e_tests.cpp (separate NetDeck-e2e build): real setup()/loop() journeys
  with device-pipeline input injection (boot grace, 0x55 keyboard, GT911
  tap, trackball ISRs), transcript + pixel assertions (HUD, freeze tint)
- shim SerialSim: opt-in transcript ring for test assertions (off by
  default, interactive emulator unchanged)
- make netdeck-test / -unit / -e2e (root) and make test / test-unit /
  test-e2e (emulator/); tests/README.md documents the structure
- STATUS.md: test-structure note

Verified: make netdeck-test -> 14 unit + 7 integration + 3 E2E, 0 failures
This commit is contained in:
Dejvino
2026-11-14 13:02:41 +01:00
parent 383bffc85a
commit a1d0730124
13 changed files with 894 additions and 9 deletions
+19 -2
View File
@@ -2,7 +2,13 @@
# targets (SDL2 emulator + ESP32-S3 firmware), so a change can never leave
# one of them silently broken.
#
# make netdeck build the NetDeck emulator AND the T-Deck firmware
# make netdeck build the NetDeck emulator AND the T-Deck firmware
# make netdeck-test run the full headless test suite:
# unit + integration (fast, deterministic)
# + E2E journeys (separate build, real loop(),
# ~1-2 min wall time)
# make netdeck-test-unit fast layer only
# make netdeck-test-e2e E2E layer only
#
# Firmware builds need platformio: either `pio` on PATH or the default
# ~/.platformio/penv/bin/pio install.
@@ -20,4 +26,15 @@ netdeck:
$(MAKE) --no-print-directory -C emulator APP=NetDeck
@echo "=== both NetDeck targets built OK ==="
.PHONY: netdeck
netdeck-test:
@echo "=== NetDeck tests: unit + integration + E2E ==="
$(MAKE) --no-print-directory -C emulator APP=NetDeck test
$(MAKE) --no-print-directory -C emulator APP=NetDeck test-e2e
netdeck-test-unit:
$(MAKE) --no-print-directory -C emulator APP=NetDeck test
netdeck-test-e2e:
$(MAKE) --no-print-directory -C emulator APP=NetDeck test-e2e
.PHONY: netdeck netdeck-test netdeck-test-unit netdeck-test-e2e