Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/Lts/Viewer/SituationMap/Tests/CMakeLists.txt
T
torstenandCopilot de6c7a6038 Qt6 Migration: Complete SituationMap module migration with comprehensive tests
Migration Summary:
- Migrated 7 subdirectories: GraphicalObjects, Rubberbands, MathUtils, MapImpl,
  SymbologyImpl, Viewshed3D, and Common
- Applied Qt6 API changes: QTouchEvent, Qt::MiddleButton, QFuture continuations
- Updated ArcGIS SDK v300: include paths, identifyGraphicsOverlaysAsync()
- Fixed QList/QVector unification issues in MathUtils
- Replaced QSharedPointer::use_count() with isNull()/data() comparisons

Test Coverage:
- Created 6 new test files following check_pr_policies.py naming conventions
- test_graphical_objects.cpp, test_rubberbands.cpp, test_mathutils.cpp
- test_mapimpl.cpp, test_symbologyimpl.cpp, test_viewshed3d.cpp
- All tests integrated into CMake and CTest
- 42 SituationMap tests passing (695 total tests)

Build Validation:
- Docker build successful with Qt 6.10.2 via aqtinstall
- Fixed LtsDataView dependency order in CMakeLists.txt
- Fixed test paths to use absolute TESTS_DIR
- Removed duplicate main() functions from test files

Documentation:
- Created MIGRATION_STATUS.md with detailed migration status
- Created TEST_REPORT.md with comprehensive test coverage summary

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-20 02:49:34 +02:00

141 lines
3.3 KiB
CMake
Executable File

#
# $Id$
# $HeadURL$
# $Author$
#
ADD_SUBDIRECTORY(SituationMap)
IF(BUILD_SITMAP_UNIT_TESTS)
# Configure Google Test - required before any test targets
find_package(GTest QUIET)
if(NOT TARGET GTest::gtest_main)
include(FetchContent)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG v1.14.0
)
FetchContent_MakeAvailable(googletest)
endif()
# ADD_SUBDIRECTORY(SitMapTestApp)
ADD_SUBDIRECTORY(exampleSvgRenderer)
ADD_SUBDIRECTORY(LineOfSightEvaluation)
# Qt6 Migration Unit Tests
# Test naming convention per ci/check_pr_policies.py: test_{name}.cpp
# Get absolute path to tests directory
GET_FILENAME_COMPONENT(TESTS_DIR "${CMAKE_SOURCE_DIR}/tests" ABSOLUTE)
# Qt6 API Migrations Test
SET(TEST_QT6_API_SRCS
${TESTS_DIR}/test_qt6_api_migrations.cpp
)
NGL_ADD_EXECUTABLE(WS NO_TRANSLATION test_qt6_api_migrations ${TEST_QT6_API_SRCS})
NGL_TARGET_LINK_LIBRARIES(test_qt6_api_migrations
Qt6::Test
Qt6::Core
Qt6::Gui
Qt6::Concurrent
GTest::gtest
GTest::gtest_main
situationMap
)
ADD_TEST(NAME Qt6ApiMigrationsTest COMMAND test_qt6_api_migrations)
# GraphicalObjects Module Test
SET(TEST_GRAPHICAL_OBJECTS_SRCS
${TESTS_DIR}/test_graphical_objects.cpp
)
NGL_ADD_EXECUTABLE(WS NO_TRANSLATION test_graphical_objects ${TEST_GRAPHICAL_OBJECTS_SRCS})
NGL_TARGET_LINK_LIBRARIES(test_graphical_objects
Qt6::Test
Qt6::Core
Qt6::Gui
GTest::gtest
GTest::gtest_main
situationMapObjects
)
ADD_TEST(NAME GraphicalObjectsTest COMMAND test_graphical_objects)
# Rubberbands Module Test
SET(TEST_RUBBERBANDS_SRCS
${TESTS_DIR}/test_rubberbands.cpp
)
NGL_ADD_EXECUTABLE(WS NO_TRANSLATION test_rubberbands ${TEST_RUBBERBANDS_SRCS})
NGL_TARGET_LINK_LIBRARIES(test_rubberbands
Qt6::Test
Qt6::Core
Qt6::Gui
Qt6::Concurrent
GTest::gtest
GTest::gtest_main
situationMap
)
ADD_TEST(NAME RubberbandsTest COMMAND test_rubberbands)
# MathUtils Module Test
SET(TEST_MATHUTILS_SRCS
${TESTS_DIR}/test_mathutils.cpp
)
NGL_ADD_EXECUTABLE(WS NO_TRANSLATION test_mathutils ${TEST_MATHUTILS_SRCS})
NGL_TARGET_LINK_LIBRARIES(test_mathutils
Qt6::Test
Qt6::Core
Qt6::Gui
GTest::gtest
GTest::gtest_main
situationMap
)
ADD_TEST(NAME MathUtilsTest COMMAND test_mathutils)
# MapImpl Module Test
SET(TEST_MAPIMPL_SRCS
${TESTS_DIR}/test_mapimpl.cpp
)
NGL_ADD_EXECUTABLE(WS NO_TRANSLATION test_mapimpl ${TEST_MAPIMPL_SRCS})
NGL_TARGET_LINK_LIBRARIES(test_mapimpl
Qt6::Test
Qt6::Core
Qt6::Gui
GTest::gtest
GTest::gtest_main
situationMap
)
ADD_TEST(NAME MapImplTest COMMAND test_mapimpl)
# SymbologyImpl Module Test
SET(TEST_SYMBOLOGYIMPL_SRCS
${TESTS_DIR}/test_symbologyimpl.cpp
)
NGL_ADD_EXECUTABLE(WS NO_TRANSLATION test_symbologyimpl ${TEST_SYMBOLOGYIMPL_SRCS})
NGL_TARGET_LINK_LIBRARIES(test_symbologyimpl
Qt6::Test
Qt6::Core
Qt6::Gui
Qt6::Concurrent
GTest::gtest
GTest::gtest_main
advancedSymbology
)
ADD_TEST(NAME SymbologyImplTest COMMAND test_symbologyimpl)
# Viewshed3D Module Test
SET(TEST_VIEWSHED3D_SRCS
${TESTS_DIR}/test_viewshed3d.cpp
)
NGL_ADD_EXECUTABLE(WS NO_TRANSLATION test_viewshed3d ${TEST_VIEWSHED3D_SRCS})
NGL_TARGET_LINK_LIBRARIES(test_viewshed3d
Qt6::Test
Qt6::Core
Qt6::Gui
GTest::gtest
GTest::gtest_main
situationMap
)
ADD_TEST(NAME Viewshed3DTest COMMAND test_viewshed3d)
ENDIF()