From c9f52b7223685d2e7fca925594171f94dd8c6e3b Mon Sep 17 00:00:00 2001 From: TrickyLeifa Date: Wed, 15 May 2024 00:00:17 +0200 Subject: Ported to CMake, ... * Ported the project to CMake * Android and Mac support dropped for the time being. * Tests, BASS and Discord-RPC are now options * Restructured and reformated the project. * Merged `include` and `src` * Renamed `resource` to `data` * Renamed various files * External libraries headers are no longer included in `src` * Replaced header guards with #pragma once * Multiple refactors (keywords, headers) * Added Qt6 compatibility * Removed various unused functions and headers * Reworked AOPacket * When content is passed to AOPacket, it should be ensured that the content is already decoded. * Encoding/decoding are now static methods. * Fixed various memory leaks * Removed animation code for AOImage * AOImage is always using static images * Simplified ChatLogPiece --- test/CMakeLists.txt | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'test/CMakeLists.txt') diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 393a7537..c6b191e4 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,8 +1,20 @@ -find_package(Qt5 COMPONENTS Core Gui Widgets REQUIRED) +find_package(Qt${QT_VERSION_MAJOR} 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_include_directories(test PRIVATE ../src) 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) +target_link_libraries(test PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets Catch2::Catch2) + +add_executable(test + test_aopacket.cpp + test_caseloading.cpp + test_apng.cpp + ../src/aopacket.h + ../src/aopacket.cpp +) + +if(AO_ENABLE_BASS) + target_compile_definitions(Attorney_Online PRIVATE AO_ENABLE_BASS) + target_link_libraries(Attorney_Online PRIVATE bass bassmidi bassopus) + target_sources(test PRIVATE test_bass.cpp) +endif() -- cgit From 657145035cd66c18ae777e1272fd5221dddca0ef Mon Sep 17 00:00:00 2001 From: TrickyLeifa Date: Fri, 17 May 2024 23:54:41 +0200 Subject: Reimplemented unit tests, ... * Reimplemented unit tests and simplified addition of new tests * Minimal support of Qt is now 5.15 --- test/CMakeLists.txt | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'test/CMakeLists.txt') diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index c6b191e4..4c1d0980 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,20 +1,21 @@ -find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Widgets REQUIRED) -find_package(Catch2 REQUIRED) +project(tests LANGUAGES CXX C) -target_include_directories(test PRIVATE ../src) -target_link_directories(test PRIVATE ../lib) -target_link_libraries(test PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets Catch2::Catch2) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Test REQUIRED) -add_executable(test - test_aopacket.cpp - test_caseloading.cpp - test_apng.cpp - ../src/aopacket.h - ../src/aopacket.cpp -) +set(CMAKE_INCLUDE_CURRENT_DIR ON) -if(AO_ENABLE_BASS) - target_compile_definitions(Attorney_Online PRIVATE AO_ENABLE_BASS) - target_link_libraries(Attorney_Online PRIVATE bass bassmidi bassopus) - target_sources(test PRIVATE test_bass.cpp) -endif() +enable_testing(true) + +set(SKIP_AUTOMOC ON) + +function(ao_declare_test test_id) + message(STATUS "FOOBAR Adding test: ${test_id}") + message(STATUS "FOOBAR 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) -- cgit From f9c7205210fb9f768f583065971ece09e6b5eb03 Mon Sep 17 00:00:00 2001 From: TrickyLeifa Date: Sat, 18 May 2024 03:09:39 +0200 Subject: Clarified test message builder --- test/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/CMakeLists.txt') diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 4c1d0980..c78740c1 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -9,8 +9,8 @@ enable_testing(true) set(SKIP_AUTOMOC ON) function(ao_declare_test test_id) - message(STATUS "FOOBAR Adding test: ${test_id}") - message(STATUS "FOOBAR Source files: ${ARGN}") + 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) -- cgit