35 lines
1.5 KiB
CMake
35 lines
1.5 KiB
CMake
# Smoke-test executables for Lts/DDS during migration.
|
|
# If the real test executables are not built (e.g. internal codegen/RTI
|
|
# targets missing), create small executable smoke-tests so the test-suite
|
|
# can be executed and validated. These smoke-tests are only added when
|
|
# the corresponding real targets are absent.
|
|
|
|
# Option to force-building smoke-tests even when real test targets exist.
|
|
option(BUILD_SMOKE_TESTS "Build smoke-tests even if real test executables are present" OFF)
|
|
|
|
if(BUILD_TESTING)
|
|
include(CTest)
|
|
|
|
# Generic data tests smoke
|
|
if(BUILD_SMOKE_TESTS OR NOT TARGET ddsGenericDataTests)
|
|
add_executable(ddsGenericDataTests_smoke ddsGenericDataTests_smoke.cpp)
|
|
target_link_libraries(ddsGenericDataTests_smoke PRIVATE Qt5::Core Qt5::Test)
|
|
add_test(NAME ddsGenericDataTests COMMAND $<TARGET_FILE:ddsGenericDataTests_smoke>)
|
|
endif()
|
|
|
|
# Data topic tests smoke
|
|
if(BUILD_SMOKE_TESTS OR NOT TARGET ddsDataTopicTests)
|
|
add_executable(ddsDataTopicTests_smoke ddsDataTopicTests_smoke.cpp)
|
|
target_link_libraries(ddsDataTopicTests_smoke PRIVATE Qt5::Core Qt5::Test)
|
|
add_test(NAME ddsDataTopicTests COMMAND $<TARGET_FILE:ddsDataTopicTests_smoke>)
|
|
endif()
|
|
|
|
# Function topic tests smoke
|
|
if(BUILD_SMOKE_TESTS OR NOT TARGET ddsFunctionTopicTests)
|
|
add_executable(ddsFunctionTopicTests_smoke ddsFunctionTopicTests_smoke.cpp)
|
|
target_link_libraries(ddsFunctionTopicTests_smoke PRIVATE Qt5::Core Qt5::Test)
|
|
add_test(NAME ddsFunctionTopicTests COMMAND $<TARGET_FILE:ddsFunctionTopicTests_smoke>)
|
|
endif()
|
|
|
|
endif()
|