From be363e3306fc8c928e8eec3deea95d633a0c2eec Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 22 May 2026 09:55:24 +0000 Subject: [PATCH 1/5] Plan for issue #150 fix --- example.musicxml | 86 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 example.musicxml diff --git a/example.musicxml b/example.musicxml new file mode 100644 index 00000000..b3732d3f --- /dev/null +++ b/example.musicxml @@ -0,0 +1,86 @@ + + + + + Mx Example + + + Matthew James Briggs + Copyright (c) 2019 + + + + Flute + + Flute + + Fl. + + Fl. + + + + wind.flutes.flute + + + 1 + 74 + + + + + + + 4 + + + G + 2 + + + + + D + 1 + 5 + + 8 + 1 + half + sharp + + + + E + 5 + + 2 + 1 + eighth + begin + + + + F + 5 + + 2 + 1 + eighth + end + + + + E + 5 + + 4 + 1 + quarter + + + + From 4dce40ee4c1a231cb0073d1b18fd643645fa915e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 22 May 2026 09:59:02 +0000 Subject: [PATCH 2/5] Redirect root XML outputs to test output dir --- data/testOutput/example.musicxml | 86 +++++++++++++++++++ src/private/mx/examples/Write.cpp | 4 +- .../mxtest/api/DocumentManagerTest.cpp | 4 +- src/private/mxtest/api/RoundTrip.h | 5 +- 4 files changed, 95 insertions(+), 4 deletions(-) create mode 100644 data/testOutput/example.musicxml diff --git a/data/testOutput/example.musicxml b/data/testOutput/example.musicxml new file mode 100644 index 00000000..b3732d3f --- /dev/null +++ b/data/testOutput/example.musicxml @@ -0,0 +1,86 @@ + + + + + Mx Example + + + Matthew James Briggs + Copyright (c) 2019 + + + + Flute + + Flute + + Fl. + + Fl. + + + + wind.flutes.flute + + + 1 + 74 + + + + + + + 4 + + + G + 2 + + + + + D + 1 + 5 + + 8 + 1 + half + sharp + + + + E + 5 + + 2 + 1 + eighth + begin + + + + F + 5 + + 2 + 1 + eighth + end + + + + E + 5 + + 4 + 1 + quarter + + + + diff --git a/src/private/mx/examples/Write.cpp b/src/private/mx/examples/Write.cpp index bd58277a..f9d83063 100644 --- a/src/private/mx/examples/Write.cpp +++ b/src/private/mx/examples/Write.cpp @@ -121,10 +121,10 @@ int main(int argc, const char *argv[]) #endif // write to a file - mgr.writeToFile(documentID, "./example.musicxml"); + mgr.writeToFile(documentID, "./data/testOutput/example.musicxml"); // we need to explicitly delete the object held by the manager mgr.destroyDocument(documentID); return 0; -} \ No newline at end of file +} diff --git a/src/private/mxtest/api/DocumentManagerTest.cpp b/src/private/mxtest/api/DocumentManagerTest.cpp index abb5bac4..af81a2ff 100644 --- a/src/private/mxtest/api/DocumentManagerTest.cpp +++ b/src/private/mxtest/api/DocumentManagerTest.cpp @@ -187,7 +187,9 @@ TEST( sillyTest, DocumentManager ) score.encoding.encodingDate.day = 30; score.copyright = "© 2016 by Matthew James Briggs"; auto documentId = DocumentManager::getInstance().createFromScore( score ); - DocumentManager::getInstance().writeToFile( documentId, "./sillytest.xml" ); + const std::string outputPath = std::string{mxtest::getResourcesDirectoryPath()} + "testOutput" + + FILE_PATH_SEPARATOR + "sillytest.xml"; + DocumentManager::getInstance().writeToFile( documentId, outputPath ); DocumentManager::getInstance().destroyDocument( documentId ); } T_END diff --git a/src/private/mxtest/api/RoundTrip.h b/src/private/mxtest/api/RoundTrip.h index b7458c63..63b27821 100644 --- a/src/private/mxtest/api/RoundTrip.h +++ b/src/private/mxtest/api/RoundTrip.h @@ -7,6 +7,7 @@ #include "mx/api/DocumentManager.h" #include "mxtest/control/CompileControl.h" #include "mxtest/file/MxFileRepository.h" +#include "mxtest/file/Path.h" #include namespace mxtest @@ -21,7 +22,9 @@ inline void roundTrip() auto scoreData = docMgr.getData(docId); docMgr.destroyDocument(docId); docId = docMgr.createFromScore(scoreData); - docMgr.writeToFile(docId, "./output.xml"); + const std::string outputPath = std::string{mxtest::getResourcesDirectoryPath()} + "testOutput" + + FILE_PATH_SEPARATOR + "output.xml"; + docMgr.writeToFile(docId, outputPath); docMgr.destroyDocument(docId); } From eb2aa0dda326bb92284dcbecb6b6caa4ab8357b7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 22 May 2026 10:05:02 +0000 Subject: [PATCH 3/5] Ignore generated example.musicxml in test output --- data/testOutput/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/data/testOutput/.gitignore b/data/testOutput/.gitignore index 3b3c2aba..7d2cf1e8 100644 --- a/data/testOutput/.gitignore +++ b/data/testOutput/.gitignore @@ -1,3 +1,4 @@ *.csv *.txt *.xml +*.musicxml From e86ef2f5f225ea297a166c1f1291bb05351fcdcf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 22 May 2026 10:42:50 +0000 Subject: [PATCH 4/5] Remove checked-in generated example.musicxml artifacts --- data/testOutput/example.musicxml | 86 -------------------------------- example.musicxml | 86 -------------------------------- 2 files changed, 172 deletions(-) delete mode 100644 data/testOutput/example.musicxml delete mode 100644 example.musicxml diff --git a/data/testOutput/example.musicxml b/data/testOutput/example.musicxml deleted file mode 100644 index b3732d3f..00000000 --- a/data/testOutput/example.musicxml +++ /dev/null @@ -1,86 +0,0 @@ - - - - - Mx Example - - - Matthew James Briggs - Copyright (c) 2019 - - - - Flute - - Flute - - Fl. - - Fl. - - - - wind.flutes.flute - - - 1 - 74 - - - - - - - 4 - - - G - 2 - - - - - D - 1 - 5 - - 8 - 1 - half - sharp - - - - E - 5 - - 2 - 1 - eighth - begin - - - - F - 5 - - 2 - 1 - eighth - end - - - - E - 5 - - 4 - 1 - quarter - - - - diff --git a/example.musicxml b/example.musicxml deleted file mode 100644 index b3732d3f..00000000 --- a/example.musicxml +++ /dev/null @@ -1,86 +0,0 @@ - - - - - Mx Example - - - Matthew James Briggs - Copyright (c) 2019 - - - - Flute - - Flute - - Fl. - - Fl. - - - - wind.flutes.flute - - - 1 - 74 - - - - - - - 4 - - - G - 2 - - - - - D - 1 - 5 - - 8 - 1 - half - sharp - - - - E - 5 - - 2 - 1 - eighth - begin - - - - F - 5 - - 2 - 1 - eighth - end - - - - E - 5 - - 4 - 1 - quarter - - - - From 4cc6ee10e4b3a0de5222fc43d3a5fcce267baca0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 22 May 2026 11:24:50 +0000 Subject: [PATCH 5/5] Apply formatter output for RoundTrip header --- src/private/mxtest/api/RoundTrip.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/private/mxtest/api/RoundTrip.h b/src/private/mxtest/api/RoundTrip.h index 63b27821..8170ab41 100644 --- a/src/private/mxtest/api/RoundTrip.h +++ b/src/private/mxtest/api/RoundTrip.h @@ -22,8 +22,8 @@ inline void roundTrip() auto scoreData = docMgr.getData(docId); docMgr.destroyDocument(docId); docId = docMgr.createFromScore(scoreData); - const std::string outputPath = std::string{mxtest::getResourcesDirectoryPath()} + "testOutput" + - FILE_PATH_SEPARATOR + "output.xml"; + const std::string outputPath = + std::string{mxtest::getResourcesDirectoryPath()} + "testOutput" + FILE_PATH_SEPARATOR + "output.xml"; docMgr.writeToFile(docId, outputPath); docMgr.destroyDocument(docId); }