# 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.

if(BUILD_TESTING)
  include(CTest)

  # Generic data tests smoke
  if(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)
    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)
    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()
