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

# --- NGLLogger: bootstrap + logger lookup (Log4Qt-independent; works in
# --- the Log4Qt-less (stub) build).
# --- MurmurHash2 has no export macro and the tree builds with hidden
# --- visibility, so its symbols are not exported from libNGLLogger - the
# --- module source is compiled directly into the test (same pattern as the
# --- LogView test in TetraIF/unit-test).
if (TARGET NGLLogger)
  ADD_EXECUTABLE(ngllogger_unit_test
    ngllogger_unit_test.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/../MurmurHash2.cpp)
  TARGET_LINK_LIBRARIES(ngllogger_unit_test
    NGLLogger
    Qt6::Core
    Qt6::Test
  )
  ADD_TEST(NAME ngllogger_unit_test COMMAND $<TARGET_FILE:ngllogger_unit_test>)
endif()
