Welcome to the safety net. These tests run in the native PlatformIO
environment so you can check ideas on a laptop before ever touching hardware.
Think of this folder as the detective agency for your audio experiments.
If you want the public framing around proof and trust before diving into test targets:
flowchart TD
Start[Write scenario] --> Cases[test_app/]
Start --> Patterns[test_patterns/]
Start --> Engines[test_engine/]
Cases --> Golden{ENABLE_GOLDEN?}
Patterns --> Golden
Engines --> Golden
Golden -->|yes| Artifacts["/artifacts/ (gitignored)/"]
Golden -->|no| Console["Logs + assertions"]
| Folder | Focus | Why you should care |
|---|---|---|
test_app/ |
Covers AppState, reseeding rituals, display snapshots, and the scripted panel walkthrough. |
Stops UI lies before they hit the OLED and doubles as a front-panel rehearsal. |
test_patterns/ |
Stresses the scheduler, tick math, trigger ordering, plus the BPM/swing golden captures. | Keeps rhythms tight even after wild refactors and documents exactly where each tick lands. |
test_engine/ |
Exercises DSP helpers and seed-to-sound flows, including Euclid/Burst postcard renders. | Generates bite-sized reproducible examples for docs and fixture updates. |
test_util/ |
Utility math, quantizers, and helpers that glue the UI to DSP bits. | Gives reusable primitives regression coverage so experiments stay deterministic. |
native_golden/ |
Deterministic audio renders and manifest checks. | Publishes sonic receipts for every merge. |
Everything uses Unity (the test framework bundled with PlatformIO), which keeps setup light and failure messages readable.
pio test -e nativeThat command is the heartbeat of the project. Run it whenever you touch src/
or include/ code.
Defaults for every switch live in include/SeedBoxConfig.h.
ENABLE_GOLDEN— When set, tests can record fresh comparison data intoartifacts/. Commit the intent in docs, not the raw files, so the repo stays lean. Fire up thenative_goldenPlatformIO env to toggle it without juggling manual build flags. PlatformIO feeds the project path in asSEEDBOX_PROJECT_ROOT_HINT, the harness respects a runtimeSEEDBOX_PROJECT_ROOToverride, and it still walks up the filesystem hunting forplatformio.iniif all else fails. The rendered WAVs always land in<repo>/build/fixtureseven though the binary runs inside.pio/. Override that default withSEEDBOX_FIXTURE_ROOT=/tmp/seedbox-fixturesif you're prototyping somewhere else.QUIET_MODE— Suppresses log spam while still running assertions. Handy when you're generating.wavsnippets intoout/for listening tests.
Hardware-specific branches in tests are still wrapped in SEEDBOX_HW, even if
we mostly run the suite on laptops.
-
Front panel story time:
tests/test_app/test_app.cppnow containstest_scripted_front_panel_walkthrough, a soup-to-nuts rehearsal that hits mode changes, reseeds, locks, and preset recall using nothing but the native board shim. Run it solo with:pio test -e native --filter test_app --test-name test_scripted_front_panel_walkthrough -
Clock goldens:
tests/test_patterns/test_tick_golden.cppcaptures tick logs for 60/90/120 BPM at multiple swing percentages. Regenerate theartifacts/pattern_ticks_*.txtfixtures by flippingENABLE_GOLDEN:pio test -e native_golden --filter test_patterns --test-name test_clock_tick_log_golden -
Engine postcards:
tests/test_engine/test_euclid_burst.cppnow writes Euclid and Burst display snapshots whenENABLE_GOLDENis set. Peek atartifacts/engine_snapshots.txtwhenever you need doc-ready screenshots of the status text. -
Teensy granular probes:
tests/test_hardware/adds the first hardware-only assertions aroundAudioEffectGranular'sbeginPitchShift()fallback and the mixer fan-out wiring. Flash them withpio test -e teensy40 --filter test_hardware, then drop the serial log indocs/hardware/granular_probes/so the scratchpad findings get receipts.
- Narrate your intent with comments. Leave breadcrumbs for the next late-night debugger.
- Use explicit seed values so failures are repeatable.
- If you discover a hardware-only quirk, recreate it here with a mocked
dependency and document the original scenario in
docs/.
Need more narrative? Cross-reference the docs roadmap or the source tour and link the sections you touched right inside your test file comments.
Healthy tests let us stay bold with the music experiments.