Stop writing example.musicxml to the repo root (fixes #150)#154
Merged
Conversation
Closes #150. The mxwrite example program previously hard-coded its output to "./example.musicxml", which left an untracked file at the repo root every time examples ran (which happens for every make test/test-all run). Fixes: - mxwrite now accepts an optional output path via argv[1] and the Makefile's run_examples helper points it at ./data/testOutput/, which is already a gitignored directory. - data/testOutput/.gitignore now also ignores *.musicxml (it only covered *.xml / *.csv / *.txt before). - Two other writeToFile calls that also dumped XML at the repo root (DocumentManagerTest.cpp sillytest.xml, RoundTrip.h output.xml) now write into data/testOutput via mxtest::getResourcesDirectoryPath(). - README and Write.cpp comments updated to describe the new behavior. Verified locally with make fmt, make check, and make test-all; no example.xml/example.musicxml/sillytest.xml/output.xml are left at the repo root after the run.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #150.
The
mxwriteexample program previously hard-coded its output to./example.musicxml, which left an untracked file at the repo rootevery time examples ran (i.e. for every
make test/make test-allinvocation).
Changes
src/private/mx/examples/Write.cpp\u2014mxwritenow accepts anoptional output path via
argv[1], defaulting to./example.musicxmlso the README's illustrative path still workswhen a user runs the binary by hand.
Makefile\u2014run_examplesnow passes./data/testOutput/example.musicxmltomxwriteand ensures thedirectory exists.
data/testOutput/is already gitignored.data/testOutput/.gitignore\u2014 added*.musicxml(it onlycovered
*.xml,*.csv,*.txtbefore).src/private/mxtest/api/DocumentManagerTest.cppandsrc/private/mxtest/api/RoundTrip.h\u2014 two otherwriteToFilecalls that also dumped XML at the repo root (
sillytest.xmlandoutput.xml) now write intodata/testOutputviamxtest::getResourcesDirectoryPath().README.md\u2014 the example code snippet matches the updatedWrite.cpp.Verification
Ran locally:
make fmt\u2014 cleanmake check\u2014=== check passed ===make test-all\u2014All tests passed (9914 assertions in 2678 test cases)After the full run, no
example.musicxml,example.xml,sillytest.xml, oroutput.xmlremain at the repo root.This supersedes #151.