mirror of
https://github.com/sshlien/abcmidi.git
synced 2026-05-30 20:09:29 +00:00
abc2midi: allow %%MIDIdef macros to be defined anywhere (#23)
* abc2midi: allow %%MIDIdef macros to be defined anywhere Fix also some lost CHANGES from previous commit. abc2midi: allow %%MIDIdef macros to be defined anywhere, including before the first X: field (outside any tune). Previously %%MIDIdef was only handled inside event_specific() after the started_parsing check,so macros defined in the file header were silently ignored. The %%MIDIdef handling has been moved before the started_parsing check in event_specific() in store.c since macro definitions are context-independent. * Update the golden test files since X:, R: and C: are now emitted
This commit is contained in:
27
README.md
27
README.md
@@ -61,3 +61,30 @@ Available presets:
|
||||
The CMake build generates `compile_commands.json` for use with
|
||||
clangd and other LSP-based editors.
|
||||
|
||||
### Testing
|
||||
|
||||
The CMake build includes a test suite covering all 8 programs:
|
||||
|
||||
- **Smoke tests** verify each binary runs cleanly with `-ver`.
|
||||
- **Golden-file tests** run each program on a sample input and compare the
|
||||
(normalized) output to a checked-in reference. Binary MIDI outputs are
|
||||
piped through `mftext` to produce diffable text. Volatile lines (version
|
||||
banners, dates, temporary paths) are stripped before comparison.
|
||||
|
||||
```sh
|
||||
# Run all tests
|
||||
ctest --preset debug
|
||||
|
||||
# Run only golden-file tests / only smoke tests
|
||||
ctest --preset debug -L golden
|
||||
ctest --preset debug -L smoke
|
||||
```
|
||||
|
||||
To regenerate the golden files after an intentional behavioural change,
|
||||
review the diff, then commit:
|
||||
|
||||
```sh
|
||||
cmake --build build/debug --target update-golden
|
||||
git diff tests/golden/
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user