From 80d73fc3303e06b9af7f9f01348e6d1026c2205a Mon Sep 17 00:00:00 2001 From: Torsten Wierschin Date: Wed, 16 Sep 2026 19:13:40 +0000 Subject: [PATCH] Integrates unittests for Lts/Services/S* into validation step --- ci/check_pr_policies.py | 1 + qt6-after/qt6-migrated-legatus/CMakeLists.txt | 4 ++++ .../Lts/Common/CodeGen/CMakeLists.txt | 2 +- .../Lts/Services/ScreenRecording/CMakeLists.txt | 1 + .../Lts/Services/ServiceManagement/CMakeLists.txt | 9 +++++++-- .../Lts/Services/ServiceMonitor/CMakeLists.txt | 1 + .../Lts/Services/SituationMap/CMakeLists.txt | 1 + .../Lts/Services/SituationReplay/CMakeLists.txt | 10 ++++++++-- .../Services/SituationReplayManagement/CMakeLists.txt | 1 + .../Lts/Services/SoundManagement/CMakeLists.txt | 3 +++ qt6-after/qt6-migrated-legatus/docker_build.sh | 8 +++++++- qt6-after/qt6-migrated-legatus/tests/CMakeLists.txt | 8 +++----- 12 files changed, 38 insertions(+), 11 deletions(-) diff --git a/ci/check_pr_policies.py b/ci/check_pr_policies.py index a89e27a84..57eb7e00b 100644 --- a/ci/check_pr_policies.py +++ b/ci/check_pr_policies.py @@ -9,6 +9,7 @@ TEST_DIRS = [ ROOT / "tests", ROOT / "test", ROOT / "qt6-after" / "qt6-migrated-benchmark" / "tests", + ROOT / "qt6-after" / "qt6-migrated-legatus" / "tests", ] CPP_EXTENSIONS = {".c", ".cc", ".cpp", ".cxx", ".h", ".hh", ".hpp", ".hxx"} ALLOWED_SIGNERS_FILE = ROOT / "ci" / "allowed_signers" diff --git a/qt6-after/qt6-migrated-legatus/CMakeLists.txt b/qt6-after/qt6-migrated-legatus/CMakeLists.txt index 580d4d32a..58ac1ef28 100755 --- a/qt6-after/qt6-migrated-legatus/CMakeLists.txt +++ b/qt6-after/qt6-migrated-legatus/CMakeLists.txt @@ -36,6 +36,10 @@ IF(DEFINED LTS_VERSION_MAJOR AND DEFINED LTS_VERSION_MINOR AND DEFINED LTS_VERSI ENDIF() PROJECT(LTS VERSION ${_ver}) MESSAGE(STATUS "LTS Version: ${LTS_VERSION_MAJOR}.${LTS_VERSION_MINOR}.${LTS_VERSION_PATCH}") + +# Enable CTest integration for unit tests +include(CTest) + function(NGL_ADD_SUBDIR_GUARDED subdir) if(MIGRATE_MODULE STREQUAL "") add_subdirectory(${subdir}) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/CMakeLists.txt b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/CMakeLists.txt index 77c9ff97a..560451a6d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/CMakeLists.txt +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/CMakeLists.txt @@ -114,11 +114,11 @@ IF(BUILD_GRANTLEE AND TARGET KF6::TextTemplate) NGL_TARGET_LINK_LIBRARIES(codegen_grantlee PRIVATE - KF6::TextTemplate NGLLogger ProjectConfig PUBLIC codegen_base + KF6::TextTemplate ) NGL_TARGET_INCLUDE_DIRECTORIES(codegen_grantlee PUBLIC diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/ScreenRecording/CMakeLists.txt b/qt6-after/qt6-migrated-legatus/Lts/Services/ScreenRecording/CMakeLists.txt index f6d78b9c2..7525aa5bf 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/ScreenRecording/CMakeLists.txt +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/ScreenRecording/CMakeLists.txt @@ -23,5 +23,6 @@ NGL_TARGET_INCLUDE_DIRECTORIES(svcScrDummy PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. + ${CMAKE_SOURCE_DIR}/forward-declarations ) NGL_INSTALL_TARGET(svcScrDummy) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/ServiceManagement/CMakeLists.txt b/qt6-after/qt6-migrated-legatus/Lts/Services/ServiceManagement/CMakeLists.txt index 2d131ab43..092f0516c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/ServiceManagement/CMakeLists.txt +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/ServiceManagement/CMakeLists.txt @@ -28,8 +28,10 @@ IF(BUILD_RTI) ENDIF() # Generate *.cpp/*.hpp from idl -RTIDDSGEN(SRCS_common scm_enums.idl) -RTIDDSGEN(SRCS_common scm.idl) +IF(BUILD_RTI) + RTIDDSGEN(SRCS_common scm_enums.idl) + RTIDDSGEN(SRCS_common scm.idl) +ENDIF() # Generate scm_dt[s,c]_types.h, scm_ft[s,c]_types.h IF(BUILD_RTI) @@ -45,6 +47,7 @@ NGL_TARGET_INCLUDE_DIRECTORIES(svcScmCommon PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../ ${CMAKE_CURRENT_BINARY_DIR}/../ + ${CMAKE_SOURCE_DIR}/forward-declarations ) NGL_TARGET_LINK_LIBRARIES(svcScmCommon PRIVATE @@ -73,6 +76,7 @@ NGL_TARGET_INCLUDE_DIRECTORIES(svcScmClient PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../ ${CMAKE_CURRENT_BINARY_DIR}/../ + ${CMAKE_SOURCE_DIR}/forward-declarations ) NGL_TARGET_LINK_LIBRARIES(svcScmClient @@ -101,6 +105,7 @@ NGL_TARGET_INCLUDE_DIRECTORIES(svcScmServer PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../ ${CMAKE_CURRENT_BINARY_DIR}/../ + ${CMAKE_SOURCE_DIR}/forward-declarations ) NGL_TARGET_LINK_LIBRARIES(svcScmServer diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/ServiceMonitor/CMakeLists.txt b/qt6-after/qt6-migrated-legatus/Lts/Services/ServiceMonitor/CMakeLists.txt index d1bf0482d..43be5f84c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/ServiceMonitor/CMakeLists.txt +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/ServiceMonitor/CMakeLists.txt @@ -23,5 +23,6 @@ NGL_TARGET_INCLUDE_DIRECTORIES(svcSmoDummy PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. + ${CMAKE_SOURCE_DIR}/forward-declarations ) NGL_INSTALL_TARGET(svcSmoDummy) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/SituationMap/CMakeLists.txt b/qt6-after/qt6-migrated-legatus/Lts/Services/SituationMap/CMakeLists.txt index 308c9ba8b..0301be17c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/SituationMap/CMakeLists.txt +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/SituationMap/CMakeLists.txt @@ -23,5 +23,6 @@ NGL_TARGET_INCLUDE_DIRECTORIES(svcMapDummy PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. + ${CMAKE_SOURCE_DIR}/forward-declarations ) NGL_INSTALL_TARGET(svcMapDummy) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/SituationReplay/CMakeLists.txt b/qt6-after/qt6-migrated-legatus/Lts/Services/SituationReplay/CMakeLists.txt index f31a3132d..026fe76af 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/SituationReplay/CMakeLists.txt +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/SituationReplay/CMakeLists.txt @@ -28,8 +28,10 @@ IF(BUILD_RTI) ENDIF() # Generate *.cpp/*.hpp from idl -RTIDDSGEN(SRCS_common srp_enums.idl) -RTIDDSGEN(SRCS_common srp.idl) +IF(BUILD_RTI) + RTIDDSGEN(SRCS_common srp_enums.idl) + RTIDDSGEN(SRCS_common srp.idl) +ENDIF() # Generate srp_dt[s,c]_types.h, srp_ft[s,c]_types.h IF(BUILD_RTI) @@ -46,6 +48,7 @@ NGL_TARGET_INCLUDE_DIRECTORIES(svcSrpCommon PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../ ${CMAKE_CURRENT_BINARY_DIR}/../ + ${CMAKE_SOURCE_DIR}/forward-declarations ) NGL_TARGET_LINK_LIBRARIES(svcSrpCommon PRIVATE @@ -74,6 +77,7 @@ NGL_TARGET_INCLUDE_DIRECTORIES(svcSrpClient PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../ ${CMAKE_CURRENT_BINARY_DIR}/../ + ${CMAKE_SOURCE_DIR}/forward-declarations ) NGL_TARGET_LINK_LIBRARIES(svcSrpClient @@ -102,6 +106,7 @@ NGL_TARGET_INCLUDE_DIRECTORIES(svcSrpServer PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../ ${CMAKE_CURRENT_BINARY_DIR}/../ + ${CMAKE_SOURCE_DIR}/forward-declarations ) NGL_TARGET_LINK_LIBRARIES(svcSrpServer @@ -190,6 +195,7 @@ NGL_TARGET_INCLUDE_DIRECTORIES(SituationReplaySqlite PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_BINARY_DIR}/.. + ${CMAKE_SOURCE_DIR}/forward-declarations ) NGL_TARGET_LINK_LIBRARIES(SituationReplaySqlite $,ddsconnector,> diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/SituationReplayManagement/CMakeLists.txt b/qt6-after/qt6-migrated-legatus/Lts/Services/SituationReplayManagement/CMakeLists.txt index db0eb422a..e041d2b28 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/SituationReplayManagement/CMakeLists.txt +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/SituationReplayManagement/CMakeLists.txt @@ -43,6 +43,7 @@ NGL_TARGET_INCLUDE_DIRECTORIES(svcSrmCommon PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../ ${CMAKE_CURRENT_BINARY_DIR}/../ + ${CMAKE_SOURCE_DIR}/forward-declarations ) NGL_TARGET_LINK_LIBRARIES(svcSrmCommon PRIVATE diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/SoundManagement/CMakeLists.txt b/qt6-after/qt6-migrated-legatus/Lts/Services/SoundManagement/CMakeLists.txt index 6740ce899..823e470fb 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/SoundManagement/CMakeLists.txt +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/SoundManagement/CMakeLists.txt @@ -47,6 +47,7 @@ NGL_TARGET_INCLUDE_DIRECTORIES(svcSomCommon PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../ ${CMAKE_CURRENT_BINARY_DIR}/../ + ${CMAKE_SOURCE_DIR}/forward-declarations ) NGL_TARGET_LINK_LIBRARIES(svcSomCommon PRIVATE @@ -75,6 +76,7 @@ NGL_TARGET_INCLUDE_DIRECTORIES(svcSomClient PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../ ${CMAKE_CURRENT_BINARY_DIR}/../ + ${CMAKE_SOURCE_DIR}/forward-declarations ) NGL_TARGET_LINK_LIBRARIES(svcSomClient @@ -104,6 +106,7 @@ NGL_TARGET_INCLUDE_DIRECTORIES(svcSomServer PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../ ${CMAKE_CURRENT_BINARY_DIR}/../ + ${CMAKE_SOURCE_DIR}/forward-declarations ) NGL_TARGET_LINK_LIBRARIES(svcSomServer diff --git a/qt6-after/qt6-migrated-legatus/docker_build.sh b/qt6-after/qt6-migrated-legatus/docker_build.sh index 5b2bbc4b8..d96c247e8 100755 --- a/qt6-after/qt6-migrated-legatus/docker_build.sh +++ b/qt6-after/qt6-migrated-legatus/docker_build.sh @@ -65,5 +65,11 @@ docker run --rm \ -DBUILD_ARCGIS=OFF \ -DCMAKE_CXX_STANDARD=17 - make -j8 ddscore ddsftccore ddsQoS ddsconnector ddsfts 2>&1 | tee build.log + make -j8 ddscore ddsftccore ddsQoS ddsconnector ddsfts migration_tests 2>&1 | tee build.log + + # Run the CTest unit tests as an explicit validation step. + # We are already inside build4 (cd build4 above), so --test-dir is the + # current directory. --output-on-failure surfaces failing test output; a + # non-zero exit propagates through set -e and fails the container validation. + ctest --test-dir . --output-on-failure " diff --git a/qt6-after/qt6-migrated-legatus/tests/CMakeLists.txt b/qt6-after/qt6-migrated-legatus/tests/CMakeLists.txt index eacce98fd..e1f6783a6 100644 --- a/qt6-after/qt6-migrated-legatus/tests/CMakeLists.txt +++ b/qt6-after/qt6-migrated-legatus/tests/CMakeLists.txt @@ -96,14 +96,12 @@ if(BUILD_TESTING) # Enable Qt Meta-Object Compiler for tests with Q_OBJECT set_target_properties(migration_tests PROPERTIES AUTOMOC ON) - target_compile_features(migration_tests PRIVATE cxx_std_23) + target_compile_features(migration_tests PRIVATE cxx_std_17) target_include_directories(migration_tests PRIVATE ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/qt6-after/qt6-migrated-legatus - ${CMAKE_SOURCE_DIR}/qt6-after/qt6-migrated-legatus/include - ${CMAKE_SOURCE_DIR}/qt6-after/qt6-migrated-legatus/DDS + ${CMAKE_SOURCE_DIR}/DDS ${CMAKE_BINARY_DIR}/Lts/Common ${CMAKE_BINARY_DIR}/Lts/Common/CodeGen ${CMAKE_BINARY_DIR}/Lts/Common/LtsTimeline @@ -133,7 +131,7 @@ endif() if(BUILD_GRANTLEE) target_link_libraries(migration_tests PRIVATE codegen_grantlee) target_include_directories(migration_tests PRIVATE - ${CMAKE_SOURCE_DIR}/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen + ${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen ) message(STATUS "Migration tests: Grantlee support enabled") endif()