Add drag-and-drop regression test and build targets

This commit is contained in:
Armin 2026-10-04 23:58:44 +02:00
commit f28e4d37c5
7 changed files with 329 additions and 39 deletions

View file

@ -90,6 +90,42 @@ target_link_libraries(Monoslicer
juce::juce_recommended_lto_flags
)
# Drag and drop regression test. Off by default: a console app needs its own copy
# of the JUCE modules, so building it by default would roughly double build time.
# Enable with -DMONOSLICER_BUILD_TESTS=ON, or just use `make test`.
option(MONOSLICER_BUILD_TESTS "Build the test executables" OFF)
if(MONOSLICER_BUILD_TESTS)
juce_add_console_app(MonoslicerDnDTest
PRODUCT_NAME "MonoslicerDnDTest"
)
target_sources(MonoslicerDnDTest PRIVATE
Tests/DragAndDropTest.cpp
Source/PluginProcessor.cpp
Source/PluginEditor.cpp
Source/SliceManager.cpp
Source/WaveformDisplay.cpp
Source/PianoRollDisplay.cpp
)
target_compile_definitions(MonoslicerDnDTest PUBLIC
JUCE_WEB_BROWSER=0
JUCE_USE_CURL=0
JUCE_VST3_CAN_REPLACE_VST2=0
JucePlugin_Name="Monoslicer"
GIT_VERSION="${GIT_VERSION}"
# handleDragDrop() defers filesDropped() via MessageManager::callAsync, so the
# test needs to be able to pump the message loop to observe it.
JUCE_MODAL_LOOPS_PERMITTED=1
)
target_link_libraries(MonoslicerDnDTest
PRIVATE
juce::juce_audio_utils
juce::juce_audio_processors
juce::juce_audio_formats
juce::juce_dsp
)
endif()
# Suppress JUCE / VST3 SDK warnings globally for all targets.
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics")