One unit-test/ directory per module/target, mirroring the existing TetraIF/unit-test/ layout (one QtTest executable per module, guarded by BUILD_TESTING and the module target, each registered with ctest): Lts/Common/CodeGen codegen_unit_test Lts/Common/LtsCoordinate ltscoordinate_unit_test Lts/Common/LtsSession ltssession_unit_test Lts/DDS/Core ddscore_unit_test Lts/DDS/QosProfile ddsqos_unit_test Lts/Tools/LogViewer logviewer_unit_test Lts/Tools/SqlBrowser sqlbrowser_unit_test Z/src/NGLLogger ngllogger_unit_test Z/src/WMS_Interface wms_json_ds_unit_test Z/src/nglapplication nglcoreapplication_unit_test Z/src/nglcompression nglcompression_unit_test Z/src/nglsettings nglsettings_unit_test Z/src/ngltranslator ngltranslator_unit_test Where a module is built with hidden visibility and has no export macro (LogViewer, SqlBrowser, ngltranslator, NGLLogger, nglcompression, nglsettings), its sources are compiled directly into the test executable, the same pattern as prtcnv_unit_test. ctest baseline in the container (QT_QPA_PLATFORM=offscreen): 20/23 passed (13 new + 7 pre-existing in-scope tests), 3 Not Run as before (nglcomp_test, GrantleeParserSmoke, utils_test). README: ctest baseline table extended to the 23 registered tests and section 2.4 now documents the per-module test layout. ddsview has no unit test (GUI tool, XmlHelper needs the DDS dynamic-xtypes runtime).
164 lines
4.2 KiB
CMake
Executable File
164 lines
4.2 KiB
CMake
Executable File
#
|
|
# $Id$
|
|
# $HeadURL$
|
|
# $Author$
|
|
# Created by Mike Wille, SLSE, 2016-05-15
|
|
#
|
|
|
|
# RTI Connext DDS - uses IMPORTED targets from parent CMakeLists.txt
|
|
# Make ${Qt6_Gui} optional
|
|
if(QT6_GUI_AVAILABLE AND TARGET Qt6::Gui)
|
|
set(Qt6_Gui ${Qt6_Gui})
|
|
else()
|
|
set(Qt6_Gui "")
|
|
endif()
|
|
|
|
# BUILD_RTI is set by parent CMakeLists.txt - do not override here
|
|
# RTI paths are also set by parent and imported targets are available
|
|
|
|
# LtsSessionDataDds (always built, with stub implementation for non-RTI builds)
|
|
SET(LtsSessionDataDds_SRCS
|
|
lts_session_data_dds.cpp
|
|
lts_session_data_dds.h
|
|
)
|
|
NGL_ADD_LIBRARY2(WS LtsSessionDataDds SHARED ${LtsSessionDataDds_SRCS})
|
|
set_target_properties(LtsSessionDataDds PROPERTIES AUTOMOC ON)
|
|
NGL_TARGET_INCLUDE_DIRECTORIES(LtsSessionDataDds
|
|
PUBLIC
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
)
|
|
NGL_TARGET_LINK_LIBRARIES(LtsSessionDataDds
|
|
PRIVATE
|
|
$<$<BOOL:${BUILD_RTI}>:$<IF:$<TARGET_EXISTS:ddsconnector>,ddsconnector,>>
|
|
PUBLIC
|
|
$<$<BOOL:${BUILD_RTI}>:RTI::nddscore>
|
|
$<$<BOOL:${BUILD_RTI}>:ddsQoS>
|
|
# Generated Core type support (topic_type_support<Core::PartitionTime>, ...)
|
|
$<$<BOOL:${BUILD_RTI}>:$<IF:$<TARGET_EXISTS:ddscore>,ddscore,>>
|
|
NGLLogger
|
|
Qt6::Core
|
|
)
|
|
IF(BUILD_RTI)
|
|
NGL_TARGET_INCLUDE_DIRECTORIES(LtsSessionDataDds
|
|
PUBLIC
|
|
${RTI_INCLUDE_DIR}
|
|
${CMAKE_SOURCE_DIR}/Lts
|
|
${CMAKE_SOURCE_DIR}/include
|
|
${CMAKE_BINARY_DIR}/Lts/DDS
|
|
)
|
|
# ddscore target generates core_dtc_types.h
|
|
IF(TARGET ddscore)
|
|
ADD_DEPENDENCIES(LtsSessionDataDds ddscore)
|
|
ENDIF()
|
|
NGL_TARGET_LINK_DIRECTORIES(LtsSessionDataDds
|
|
PRIVATE
|
|
${RTI_LIB_DIR}
|
|
)
|
|
ENDIF()
|
|
IF(BUILD_RTI)
|
|
TARGET_COMPILE_DEFINITIONS(LtsSessionDataDds PUBLIC BUILD_RTI)
|
|
ENDIF()
|
|
|
|
|
|
|
|
# LtsSession (RTI dependencies optional)
|
|
SET(ltssession_SRCS
|
|
lts_session.h
|
|
lts_session.cpp
|
|
lts_session_lock_handler.h
|
|
lts_session_manager.h
|
|
lts_session_manager.cpp
|
|
lts_session_lock_handler.cpp
|
|
)
|
|
|
|
NGL_ADD_LIBRARY2(WS LtsSession SHARED ${ltssession_SRCS})
|
|
NGL_TARGET_INCLUDE_DIRECTORIES(LtsSession
|
|
PUBLIC
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../
|
|
${CMAKE_CURRENT_BINARY_DIR}/../
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../LtsUtils/LtsUtilsGui
|
|
)
|
|
|
|
# Optional external dependencies
|
|
# Prefer the in-tree target: a fresh build tree does not have svcCoreClient
|
|
# installed in /usr/local/lib, and the Core::Interface::Ftc::create symbols
|
|
# referenced at link time live in libsvcCoreClient.so
|
|
IF(TARGET svcCoreClient)
|
|
SET(SVCCORECLIENT_LIBRARY svcCoreClient)
|
|
ELSE()
|
|
FIND_LIBRARY(SVCCORECLIENT_LIBRARY NAMES svcCoreClient PATHS /usr/local/lib /usr/lib NO_DEFAULT_PATH)
|
|
ENDIF()
|
|
FIND_LIBRARY(OHPONLINEHELP_LIBRARY NAMES OhpOnlineHelpViewerGuiPluginInterface PATHS /usr/local/lib /usr/lib NO_DEFAULT_PATH)
|
|
|
|
SET(LtsSession_PRIVATE_LIBS
|
|
Qt6::Network
|
|
LtsMultiMonitor
|
|
LtsSessionData
|
|
LtsUtilsGuiDds # ReqHelpr & for Debug Menu ! TODO: rm on release!
|
|
LtsNotification
|
|
$<IF:$<TARGET_EXISTS:Qt6::Svg>,Qt6::Svg,>
|
|
)
|
|
IF(SVCCORECLIENT_LIBRARY)
|
|
LIST(APPEND LtsSession_PRIVATE_LIBS ${SVCCORECLIENT_LIBRARY})
|
|
ENDIF()
|
|
IF(OHPONLINEHELP_LIBRARY)
|
|
LIST(APPEND LtsSession_PRIVATE_LIBS ${OHPONLINEHELP_LIBRARY})
|
|
ENDIF()
|
|
|
|
NGL_TARGET_LINK_LIBRARIES(LtsSession
|
|
PRIVATE
|
|
${LtsSession_PRIVATE_LIBS}
|
|
PUBLIC
|
|
LtsWidgets
|
|
Qt6::Core
|
|
GuiPluginInterface
|
|
DataPluginInterface
|
|
NGLLogger
|
|
ProjectConfig
|
|
LtsSessionDataDds # Always link, even in stub mode
|
|
)
|
|
IF(BUILD_RTI)
|
|
NGL_TARGET_LINK_LIBRARIES(LtsSession
|
|
PRIVATE
|
|
ddsconnector
|
|
PUBLIC
|
|
RTI::nddscore
|
|
)
|
|
TARGET_COMPILE_DEFINITIONS(LtsSession PUBLIC BUILD_RTI)
|
|
ENDIF()
|
|
|
|
|
|
# LtsSessionData (avoid cross-deps between AppManager, Session and PluginManager)
|
|
SET(LtsSessionData_SRCS
|
|
lts_session_data.cpp
|
|
lts_session_data.h
|
|
)
|
|
|
|
NGL_ADD_LIBRARY2(WS TOOLSSV TOOLSWS LtsSessionData SHARED ${LtsSessionData_SRCS})
|
|
|
|
NGL_TARGET_INCLUDE_DIRECTORIES(LtsSessionData
|
|
PUBLIC
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../
|
|
)
|
|
|
|
if(QT6_GUI_AVAILABLE)
|
|
NGL_TARGET_LINK_LIBRARIES(LtsSessionData
|
|
PUBLIC
|
|
Qt6::Core
|
|
Qt6::Gui # QPixmap as Storage for Profile Picture
|
|
)
|
|
endif()
|
|
IF(BUILD_RTI)
|
|
NGL_TARGET_LINK_LIBRARIES(LtsSessionData
|
|
PUBLIC
|
|
RTI::nddscore
|
|
)
|
|
TARGET_COMPILE_DEFINITIONS(LtsSessionData PUBLIC BUILD_RTI)
|
|
ENDIF()
|
|
|
|
#
|
|
# Unit tests
|
|
#
|
|
ADD_SUBDIRECTORY(unit-test)
|