aboutsummaryrefslogtreecommitdiff
path: root/test/CMakeLists.txt
diff options
context:
space:
mode:
authorSalanto <62221668+Salanto@users.noreply.github.com>2024-05-18 03:33:43 +0200
committerGitHub <noreply@github.com>2024-05-18 03:33:43 +0200
commit51338e30e046f1a62c84049b34577f0f3b5db6e3 (patch)
tree283c95f8f776ed852d03a816388695afd65c0f73 /test/CMakeLists.txt
parent469e293a1885e49f1d5994d41ac7cfc9f4666952 (diff)
parentf9c7205210fb9f768f583065971ece09e6b5eb03 (diff)
Merge pull request #957 from AttorneyOnline/kaleidoscope
The Kaleidoscope - Hell, it's about time.
Diffstat (limited to 'test/CMakeLists.txt')
-rw-r--r--test/CMakeLists.txt29
1 files changed, 21 insertions, 8 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 393a7537..c78740c1 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1,8 +1,21 @@
-find_package(Qt5 COMPONENTS Core Gui Widgets REQUIRED)
-find_package(Catch2 REQUIRED)
-
-add_executable(test test_aopacket.cpp test_caseloading.cpp test_apng.cpp test_bass.cpp ../include/aopacket.h ../src/aopacket.cpp)
-target_include_directories(test PRIVATE ../include)
-target_link_directories(test PRIVATE ../lib)
-target_link_libraries(test PRIVATE Qt5::Core Qt5::Gui Qt5::Widgets Catch2::Catch2 bass bassmidi bassopus discord-rpc)
-target_compile_definitions(Attorney_Online PRIVATE DISCORD)
+project(tests LANGUAGES CXX C)
+
+find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Test REQUIRED)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+enable_testing(true)
+
+set(SKIP_AUTOMOC ON)
+
+function(ao_declare_test test_id)
+ message(STATUS "Adding test: ${test_id}")
+ message(STATUS "Source files: ${ARGN}")
+ add_executable(${test_id} ${ARGN})
+ target_include_directories(${test_id} PRIVATE ../src src)
+ target_link_directories(${test_id} PRIVATE ../lib)
+ target_link_libraries(${test_id} PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Test)
+ add_test(NAME ${test_id} COMMAND ${test_id})
+endfunction()
+
+ao_declare_test(test_aopacket test_aopacket.cpp ../src/aopacket.cpp)