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

# --- nglcompression: TarFilter (tar stream codec).
# --- TarFilter has no export macro and the tree builds with hidden
# --- visibility, so its symbols are not exported from the nglcompression
# --- shared library - the module source is compiled directly into the test
# --- (same pattern as the LogView test in TetraIF/unit-test).
if (TARGET nglcompression)
  ADD_EXECUTABLE(nglcompression_unit_test
    nglcompression_unit_test.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/../nglcomp_tarfilter.cpp)
  TARGET_LINK_LIBRARIES(nglcompression_unit_test
    nglcompression
    Qt6::Core
    Qt6::Test
  )
  ADD_TEST(NAME nglcompression_unit_test COMMAND $<TARGET_FILE:nglcompression_unit_test>)
endif()
