Add emulated SSD1306 render test#36
Closed
laurb9 wants to merge 1 commit into
Closed
Conversation
Runs the uno_sim firmware on simavr with a virtual SSD1306 attached over
TWI at 0x3C, snapshots VRAM when the firmware prints its completion marker,
and compares the 128x64 framebuffer as ASCII art against a golden baseline
(test/uno-display.txt). Catches rendering regressions the serial-only smoke
test cannot see; the golden shows the voltmeter screen actually rendered.
- test/sim_display/sim_display.c: runner linking jammy's libsimavr 1.6
(elf load, UART marker watch, deterministic snapshot, ASCII dump)
- test/sim_display/ssd1306_virt.{c,h}: vendored verbatim from simavr v1.6
examples/parts (GPLv3 test tooling, never linked into the MIT firmware -
see test/sim_display/README.md)
- test/sim-display-run.sh + make sim-display-test / sim-display-test-update
(pixel-exact compare, no digit stripping)
- devcontainer: gcc, libsimavr-dev, libelf-dev; CI: display test added to
the existing sim-test job
- AGENTS.md + verify skill updated
Verified in devcontainer: display test passes and is deterministic across
runs, mutated-golden negative test fails as expected, sim-test still passes,
all five pio envs build.
Agent: claude-opus-4-8 implement / claude-fable-5 validate,
claude-sonnet-5 verify (claude-code)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Owner
Author
|
Closing per maintainer decision: ssd1306_virt.{c,h} are GPLv3 and this repo is MIT — vendoring license-incompatible source isn't acceptable here, even as test-only tooling. If display-level testing is ever wanted again, two GPL-free-repo approaches exist:
The serial-trace smoke test (make sim-test) is unaffected and remains in place. Agent: claude-fable-5 (claude-code) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #32: the OLED itself is now emulated, so tests verify actual rendered pixels, not just the serial trace.
How it works
A small C runner (
test/sim_display/sim_display.c, linked against Ubuntu jammy'slibsimavr-dev1.6) loads.pio/build/uno_sim/firmware.elf, attaches simavr's ssd1306_virt part over TWI at 0x3C, and steps the CPU until the firmware printssim: TESTS COMPLETE— which lands right after the 5thdisplay.display(), making the framebuffer snapshot deterministic. VRAM is dumped as 64x128 ASCII art ('#'/'.') and compared pixel-for-pixel against the goldentest/uno-display.txt(which is git-diffable and human-reviewable — it clearly shows the rendered voltmeter screen).Licensing note
ssd1306_virt.{c,h}are vendored verbatim from simavr v1.6 examples/parts and are GPLv3 — test tooling only, compiled solely into the host-side runner, never linked into the MIT firmware. Documented intest/sim_display/README.md.Changes
test/sim_display/(runner + vendored part + README),test/sim-display-run.sh, golden baselinegcc libsimavr-dev libelf-dev; display test added to the existing CI sim-test job (no duplicate pio builds)Verification (devcontainer)
make sim-display-testpasses; second run identical (deterministic)make sim-teststill passes; all 5 pio envs build; devcontainer image buildsFound in passing: the
MODE_BUTTON_PIN redefinedwarning in PlatformIO build logs is an artifact of PIO's .ino conversion pass (it registers all#defines while passing conditionals through unevaluated) — the compiled code is correct on every board. Cosmetic fix in a separate PR.Agent: claude-opus-4-8 implement / claude-fable-5 validate, claude-sonnet-5 verify (claude-code)
🤖 Generated with Claude Code