Extends migration tests for flm and flt services
This commit is contained in:
1 parent
ce47b9236f
commit
501bd2b4b8
7 files changed
+232
-54
No files matched your search
@@ -106,12 +106,29 @@ if(BUILD_TESTING)
|
||||
endif()
|
||||
|
||||
add_executable(migration_tests ${EXISTING_SOURCES})
|
||||
|
||||
|
||||
# FLM/FLT tests include build-tree generated headers (flm_[dtc|ftc|enums],
|
||||
# flt_[dtc|ftc|enums]) - make sure codegen of these services ran first.
|
||||
if(TARGET svcFlmCommon)
|
||||
add_dependencies(migration_tests svcFlmCommon)
|
||||
endif()
|
||||
if(TARGET svcFltCommon)
|
||||
add_dependencies(migration_tests svcFltCommon)
|
||||
endif()
|
||||
|
||||
# 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_17)
|
||||
|
||||
# BEFORE: the root CMakeLists' include_directories() puts include/ early
|
||||
# on the path, so the BUILD_RTI=OFF stub variant of DDS/Generic would
|
||||
# shadow the real DDS framework headers that the generated flm/flt
|
||||
# service headers pull in — same fix the service CMakeLists enforce
|
||||
# with include_directories(BEFORE ${CMAKE_SOURCE_DIR}/Lts).
|
||||
target_include_directories(migration_tests BEFORE PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/Lts
|
||||
)
|
||||
target_include_directories(migration_tests PRIVATE
|
||||
${CMAKE_SOURCE_DIR}
|
||||
${CMAKE_SOURCE_DIR}/include
|
||||
@@ -121,8 +138,29 @@ if(BUILD_TESTING)
|
||||
${CMAKE_BINARY_DIR}/Lts/Common/LtsTimeline
|
||||
${CMAKE_SOURCE_DIR}/Lts/Common/LtsTimelineClassic
|
||||
${CMAKE_BINARY_DIR}/Lts/Services
|
||||
${CMAKE_SOURCE_DIR}/Lts/Services
|
||||
${CMAKE_SOURCE_DIR}/Z/src/NGLLogger
|
||||
)
|
||||
|
||||
# test_flm_dtc_impl_custom.cpp includes flm_dtc_impl_custom.h, which
|
||||
# pulls in the generated flm_dtc_impl.h. Its include guard requires
|
||||
# MAKE_SVCFLMCLIENT_LIB (defined by NGL_ADD_LIBRARY on svcFlmClient,
|
||||
# which compiles flm_dtc_impl_custom.cpp).
|
||||
target_compile_definitions(migration_tests PRIVATE MAKE_SVCFLMCLIENT_LIB)
|
||||
|
||||
# test_CppTopicGeneratorGrantlee.cpp bootstraps the NGL root logger
|
||||
# before constructing the generator. The <NGLLogger/...> headers
|
||||
# resolve via Z/src, the generated ngllogger_export.h via the
|
||||
# library's binary dir.
|
||||
target_include_directories(migration_tests PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/Z/src
|
||||
${CMAKE_BINARY_DIR}/Z/src/NGLLogger
|
||||
)
|
||||
|
||||
# Export-header tests locate generated headers in the build tree.
|
||||
# The directory name is not stable across pipeline stages (build4),
|
||||
# so the path is passed in instead of being hardcoded.
|
||||
target_compile_definitions(migration_tests PRIVATE MIGRATION_TEST_BUILD_DIR="${CMAKE_BINARY_DIR}")
|
||||
|
||||
# Link against Qt6 components (Qt6::Test not needed - using gtest)
|
||||
if(QT6_GUI_AVAILABLE)
|
||||
@@ -174,6 +212,17 @@ endif()
|
||||
if(TARGET nglwidgets AND QT6_GUI_AVAILABLE)
|
||||
target_link_libraries(migration_tests PRIVATE nglwidgets)
|
||||
endif()
|
||||
|
||||
# FLM/FLT service tests include the Q_OBJECT custom headers of the
|
||||
# migrated services (flm_db_impl_custom.h, flm_dtc_impl_custom.h).
|
||||
# Their moc output references the generated bases' staticMetaObject
|
||||
# (DatabaseInterface, DtcImpl) defined in the service libraries.
|
||||
if(TARGET svcFlmCommon)
|
||||
target_link_libraries(migration_tests PRIVATE svcFlmCommon)
|
||||
endif()
|
||||
if(TARGET svcFlmClient)
|
||||
target_link_libraries(migration_tests PRIVATE svcFlmClient)
|
||||
endif()
|
||||
|
||||
# Link against LtsTimelineClassic only if it exists (may not exist with MIGRATE_MODULE)
|
||||
if(TARGET LtsTimelineClassic)
|
||||
|
||||
Reference in new issue
Block a user