cmake_minimum_required(VERSION 3.10)
project(LinkTest)
# ____
# / ___| ___ _ _ _ __ ___ ___ ___
# \___ \ / _ \| | | | '__/ __/ _ \/ __|
# ___) | (_) | |_| | | | (_| __/\__ \
# |____/ \___/ \__,_|_| \___\___||___/
#
set(link_audio_test_SOURCES
ableton/link_audio/tst_AudioBuffer.cpp
ableton/link_audio/tst_BeatTimeMapping.cpp
ableton/link_audio/tst_ChannelAnnouncements.cpp
ableton/link_audio/tst_ChannelId.cpp
ableton/link_audio/tst_ChannelRequests.cpp
ableton/link_audio/tst_Channels.cpp
ableton/link_audio/tst_Encoder.cpp
ableton/link_audio/tst_PCMCodec.cpp
ableton/link_audio/tst_PeerAnnouncement.cpp
ableton/link_audio/tst_PeerGateways.cpp
ableton/link_audio/tst_Queue.cpp
ableton/link_audio/tst_Receivers.cpp
ableton/link_audio/tst_Resizer.cpp
ableton/link_audio/tst_UdpMessenger.cpp
ableton/link_audio/tst_MainProcessor.cpp
ableton/link_audio/v1/tst_Messages.cpp
)
set(link_discovery_test_SOURCES
ableton/discovery/tst_InterfaceScanner.cpp
ableton/discovery/tst_NetworkByteStreamSerializable.cpp
ableton/discovery/tst_Payload.cpp
ableton/discovery/tst_PeerGateway.cpp
ableton/discovery/tst_PeerGateways.cpp
ableton/discovery/tst_UdpMessenger.cpp
ableton/discovery/v1/tst_Messages.cpp
)
set(link_core_test_SOURCES
ableton/link/tst_Beats.cpp
ableton/link/tst_ClientSessionTimelines.cpp
ableton/link/tst_Controller.cpp
ableton/link/tst_HostTimeFilter.cpp
ableton/link/tst_LinearRegression.cpp
ableton/link/tst_Measurement.cpp
ableton/link/tst_Median.cpp
ableton/link/tst_NodeId.cpp
ableton/link/tst_Peers.cpp
ableton/link/tst_PeerState.cpp
ableton/link/tst_Phase.cpp
ableton/link/tst_PingResponder.cpp
ableton/link/tst_StartStopState.cpp
ableton/link/tst_Tempo.cpp
ableton/link/tst_Timeline.cpp
ableton/tst_Link.cpp
)
set(link_test_SOURCES
ableton/test/catch/CatchMain.cpp
ableton/test/serial_io/SchedulerTree.cpp
)
set(link_util_test_SOURCES
ableton/util/tst_FloatIntConversion.cpp
ableton/util/tst_TripleBuffer.cpp
ableton/test/catch/CatchMain.cpp
)
# ____ ____
# / ___| ___ _ _ _ __ ___ ___ / ___|_ __ ___ _ _ _ __ ___
# \___ \ / _ \| | | | '__/ __/ _ \ | | _| '__/ _ \| | | | '_ \/ __|
# ___) | (_) | |_| | | | (_| __/ | |_| | | | (_) | |_| | |_) \__ \
# |____/ \___/ \__,_|_| \___\___| \____|_| \___/ \__,_| .__/|___/
# |_|
source_group("Link" FILES
${link_core_HEADERS}
)
source_group("Discovery" FILES
${link_discovery_HEADERS}
)
source_group("Audio" FILES
${link_audio_HEADERS}
)
source_group("Platform" FILES
${link_platform_HEADERS}
)
source_group("Util" FILES
${link_util_HEADERS}
)
source_group("Test Utils" FILES
${link_test_HEADERS}
${link_test_SOURCES}
)
# _____ _
# |_ _|_ _ _ __ __ _ ___| |_ ___
# | |/ _` | '__/ _` |/ _ \ __|/ __|
# | | (_| | | | (_| | __/ |_ \__ \
# |_|\__,_|_| \__, |\___|\__||___/
# |___/
function(configure_link_test_executable target)
target_link_libraries(${target} Catch::Catch Ableton::Link)
target_compile_definitions(${target} PRIVATE -DCATCH_CONFIG_ENABLE_BENCHMARKING=1)
endfunction()
# For the LinkCore test suite, we add header dependencies individually so that
# the source groups above are shown correctly to the project. However, most
# other projects integrating Link won't need this functionality, and they should
# should just depend on ${link_HEADERS}.
add_executable(LinkCoreTest
${link_core_HEADERS}
${link_discovery_HEADERS}
${link_platform_HEADERS}
${link_util_HEADERS}
${link_test_HEADERS}
${link_core_test_SOURCES}
${link_test_SOURCES}
)
configure_link_test_executable(LinkCoreTest)
# For the LinkDiscovery test suite, we only add dependencies on the headers
# necessary to compile these tests, since the Discovery feature should not have
# dependencies on the Link core code. Normal targets should always use
# ${link_HEADERS} for their dependencies.
add_executable(LinkDiscoveryTest
${link_discovery_HEADERS}
${link_platform_HEADERS}
${link_util_HEADERS}
${link_test_HEADERS}
${link_discovery_test_SOURCES}
${link_test_SOURCES}
)
configure_link_test_executable(LinkDiscoveryTest)
add_executable(LinkAudioTest
${link_discovery_HEADERS}
${link_platform_HEADERS}
${link_util_HEADERS}
${link_test_HEADERS}
${link_audio_HEADERS}
${link_audio_test_SOURCES}
${link_test_SOURCES}
)
configure_link_test_executable(LinkAudioTest)
add_executable(LinkUtilTest
${link_platform_HEADERS}
${link_util_HEADERS}
${link_test_HEADERS}
${link_util_test_SOURCES}
)
configure_link_test_executable(LinkUtilTest)