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

# --- LogViewer: log table model + sort/filter proxy.
# --- The module is an executable, so the model sources are compiled directly
# --- into the test (same pattern as the LogView test in TetraIF/unit-test).
if (TARGET LogViewer)
  ADD_EXECUTABLE(logviewer_unit_test
    logviewer_unit_test.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/../logviewtablemodel.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/../sortfiltermodel.cpp)
  TARGET_LINK_LIBRARIES(logviewer_unit_test
    NGLLogger
    Qt6::Core
    Qt6::Gui
    Qt6::Test
  )
  ADD_TEST(NAME logviewer_unit_test COMMAND $<TARGET_FILE:logviewer_unit_test>)
endif()
