Test & QA
Script di test headless per validare build e gameplay.
Setup
Test 1 — ROM game over (isolato)
Compila una ROM minimale che porta immediatamente al game over, utile per testare la schermata death:
Questo crea un binario che entra direttamente in show_death() con un metasprite GAME OVER. Da testare con screenshot.
Test 2 — ROM finale (isolato)
Stessa idea, ma per la schermata finale:
Va direttamente al finale con la musica. Utile per testare la sequenza audio lunga.
Test 3 — Movimento WRAM
scripts/test_movement.py legge la WRAM via PyBoy e verifica che il movimento cambi le coordinate del player:
Controlla:
- Pressione DPad → player_lx/ly cambiano
- Rilascio → no input
- DAS delay funziona
- Sprint (B) consuma stamina
Test 4 — Screenshot diff
scripts/test_pyboy.py cattura screenshot di ogni schermata e li salva in assets/screenshots/:
Produce:
title.png
gameplay_lv1.png
gameplay_lv2.png
gameplay_lv3.png
gameover.png
Test 5 — Glitch detection (OpenCV)
scripts/opencv_analyze_tiles.py usa OpenCV per rilevare glitch visivi (tile sballati, posizioni sbagliate):
Output: lista di anomalie con coordinate (x, y) e tipo.
Test 6 — ROM size sanity
Test 8 — BGB debugger
Se hai BGB (https://bgb.bircd.org/):
- Apri
build/hello_iso.gb
Window > Tile viewer → controlla i tile in VRAM
Window > Map viewer → controlla il BG map
Window > OAM viewer → controlla gli sprite
Window > IO Map → monitora SCX, SCY, LY, ecc.
Continuous Integration (TODO)
Una CI con GitHub Actions potrebbe:
- Compilare con GBDK
- Verificare dimensione ROM
- Lanciare i test PyBoy in CI container
- Confrontare screenshot con baseline (visual regression)
- Pubblicare release su tag
v*
Per ora i test sono manuali.