#
# Unit tests for the ngltranslator module.
# One test executable per module, each registered with ctest.
#
if (NOT BUILD_TESTING)
  return()
endif()

# --- ngltranslator: translation catalog, plural/disambiguation and locale.
# --- The Translator class (ngltranslator_p.h) has no export macro and the
# --- tree builds with hidden visibility, so its symbols are not exported
# --- from libngltranslator - the module source is compiled directly into the
# --- test (same pattern as the LogView test in TetraIF/unit-test).
if (TARGET ngltranslator)
  ADD_EXECUTABLE(ngltranslator_unit_test
    ngltranslator_unit_test.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/../ngltranslator.cpp)
  TARGET_LINK_LIBRARIES(ngltranslator_unit_test
    ngltranslator
    Qt6::Core
    Qt6::Test
  )
  ADD_TEST(NAME ngltranslator_unit_test COMMAND $<TARGET_FILE:ngltranslator_unit_test>)
endif()
