Skip to content
Phosphoneowiki
Contents

The tests

Phosphoneo is mostly an oracle: its tests are its raison d’être. Here is what they prove, and how to rerun them.

Four kinds of proof

ProofCommandWhat it establishes
Processor oraclemake test-oracle2,540,000 cases, 100% required
Reference screenshotsmake test-goldeneach case’s image and console keep the same fingerprint
Differentialmake test-diffimages pixel-identical to the official emulator (shared cases)
Co-simulationmake test-cosimthe real ARM firmware gives the same result

Around them, about thirty integration scripts check each option: test-break, test-symbols, test-pokes, test-savestate, test-record, test-loadat, test-gdb, test-tui, test-sdl, test-wasm… make test chains them.

The reference screenshots

Each case (tests/golden/cases/*.case) says which program to run, at which cycle to photograph, and possibly which keys to type. tools/golden.sh run replays everything and compares with the manifest’s SHA-256 fingerprints. Rule: a screenshot is never re-baselined to make a test pass, only after being looked at (golden.sh show NAME converts it to PNG).

Version lines (the firmware banner, NeoDOS version …, the reply to VER) are masked in the fingerprints: changing the firmware version does not break every case, only real changes show.

Reusing the script in another project

tools/golden.sh is written to serve any repository: you give it a folder of cases and a manifest. This is what the collective’s ports (AsteroNeo, Wolfenstein 3D) do for their own tests.

Sources in the repository : Makefile, tests/integration/, tools/golden.sh, docs/ACCURACY.md.