tests: add BUILD_SMOKE_TESTS option to enable smoke-tests in full-builds

This commit is contained in:
torsten committed 2026-07-17 17:15:14 +02:00
1 parent 8ea74a81ad
commit 3d490bea2e
1 file changed
+6 -3
@@ -4,25 +4,28 @@
# 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(NOT TARGET ddsGenericDataTests)
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(NOT TARGET ddsDataTopicTests)
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(NOT TARGET ddsFunctionTopicTests)
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>)