Make sure that lilypondtimidity and ghcup are available your shell environment (e.g. by adding them to PATH).
Use ghcup to install GHC:
ghcup install 8.10.4
Build the library and examples
$ cabal update
$ cabal build
Testing
Run the test suite:
To run all tests except doctests (see below):
$ cabal test --test-show-details=streaming --test-options=--color=always
To run individual tests:
$ cabal run TEST_NAME -- TEST_ARGS...
e.g.
$ cabal run music-suite-test-xml-parser
Expected output (regression tests)
Some tests have expected output, stored in test/regression.
If the output of these tests have changed, the diff should be manually inspected to assure that the new output is in fact correct. This may be because:
The output is in fact expected to change.
The output has changed in a way that is invisible to the end user, such as a a change to an *.ly output file that does not affect the appearance of the printed music.
To identify the latter it may be necessar to run lilypond or timidity on both the old and new versions of the output file. To do this manually after a failure.
(optional) Re-run regression tests to see that it fails: cabal test music-suite-test-regression --test-options=--color=always
For each failing file, run lilypond (for *.ly files) or timidity (for *.mid files).
Regenerate the expected files: cabal test music-suite-test-regression --test-options=--color=always --test-options=--accept
For each changed file, run lilypond or timidity as before.
Inspect the old/new version side by side.
If all are correct, commit the changes to test/regression.
Note: after running --accept, you can use git diff --name-only test/regression to get a list of changed files, assuming the repo was clean before.
请发表评论