Skip to content

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

Terminal window
cmake --build build --target GuitarPrometheusTests
ctest --test-dir build --output-on-failure

The Catch2 binary lives at build/tests/GuitarPrometheusTests and accepts the standard Catch2 filter syntax for running subsets:

Terminal window
build/tests/GuitarPrometheusTests "[techniques]"
build/tests/GuitarPrometheusTests "ProfileStore::importFromFile*"

Test Categories

Tests live under tests/ and are grouped by tag:

TagCoverage
[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

  1. Create or extend a *.cpp file under tests/.
  2. Add it to tests/CMakeLists.txt in the add_executable source list.
  3. Use existing tag conventions ([area-of-code][specific-feature]).
  4. Tests must pass before each sub-phase commit. Run ctest before any git 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).