diff --git a/CMakeLists.txt b/CMakeLists.txt index 68d8886..626a3f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,8 +21,8 @@ python_add_library(core MODULE src/symusic.cpp WITH_SOABI) target_link_libraries(core PRIVATE pybind11::headers) if(BUILD_TEST) - add_executable(note_count test/note_count.cpp) - add_executable(dump test/dump.cpp) + add_executable(note_count tests/note_count.cpp) + add_executable(dump tests/dump.cpp) endif() if(NOT MSVC AND NOT ${CMAKE_BUILD_TYPE} MATCHES Debug|RelWithDebInfo) diff --git a/include/Score.hpp b/include/Score.hpp index ca788bd..3ad4fef 100644 --- a/include/Score.hpp +++ b/include/Score.hpp @@ -1485,7 +1485,9 @@ minimidi::file::MidiFile Score::to_midi() const { )); } utils::sort_msgs(msgs); - midi.tracks.emplace_back(std::move(msgs)); + if (!msgs.empty()) { + midi.tracks.emplace_back(std::move(msgs)); + } } for(const auto &track: tracks) {