Testing
Testing
Guitar Prometheus uses Catch2 for unit + integration tests. Every behaviour that a future regression could silently break has a test — currently 318 tests across the suite.
Running the Suite
cmake --build build --target GuitarPrometheusTestsctest --test-dir build --output-on-failureThe Catch2 binary lives at build/tests/GuitarPrometheusTests and accepts
the standard Catch2 filter syntax for running subsets:
build/tests/GuitarPrometheusTests "[techniques]"build/tests/GuitarPrometheusTests "ProfileStore::importFromFile*"Test Categories
Tests live under tests/ and are grouped by tag:
| Tag | Coverage |
|---|---|
[parser] | Structural cases shared across MusicXml / Gp / Gpx parsers |
[musicxml] [gp] [gpx] | Per-format detection + error paths |
[techniques] [techniqueset] | Technique enum coverage, set arithmetic, encoding round-trips |
[gm-drum-kit] [drum] | GmDrumKit defaults + drum-profile override semantics |
[store] [validator] | ProfileStore load/save, JSON sanitize-and-warn, archive round-trip |
[ks-velocity] [keyswitch] | Per-technique + per-articulation keyswitch velocity, label formatting |
[writer] [tempo] | MidiWriter file output, tempo events, mid-measure overrides |
[injector] | KeyswitchInjector span / per-note / sustained emission |
[transposer] [octave] [inferred] | Manual vs Inferred octave correction, per-part offsets |
[humanizer] [determinism] | Gaussian velocity + uniform timing jitter, seed reproducibility |
[schema] [round-trip] | Project / profile schema migration v1 → current, JSON round-trips |
Fixtures
Reference MusicXML lives under tests/fixtures/. The flagship fixture
lesson-riff-v14.xml exercises every technique the parser knows about and
backs the Phase 3 acceptance counts (572 palm-mutes, 606 letrings, 26
hammer-on spans, etc.).
For technique-detection tests that need a one-off shape (e.g. F9.5’s
<other-technical type="closed-palm-mute"/> cases), use the in-memory
MusicXmlParser::parse(std::string_view) overload — see
tests/TechniqueParserTests.cpp for the synthetic-fixture pattern.
Adding a Test
- Create or extend a
*.cppfile undertests/. - Add it to
tests/CMakeLists.txtin theadd_executablesource list. - Use existing tag conventions (
[area-of-code][specific-feature]). - Tests must pass before each sub-phase commit. Run
ctestbefore anygit commit.
Manual Smoke
Some changes (UI, file dialogs, MIDI export end-to-end) need a manual run
through the app. The current manual smoke checklist lives under each
phase’s plan in the repository’s documentation/agentic-context/implementation-plans/
directory (repo-local; not published to the docs site).