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

# --- CodeGen: string helpers, data classes and Grantlee template-context
# --- wrappers (pure logic; the KTextTemplate engine is covered by
# --- GrantleeParserSmoke)
if (TARGET codegen_grantlee)
  ADD_EXECUTABLE(codegen_unit_test codegen_unit_test.cpp)
  TARGET_LINK_LIBRARIES(codegen_unit_test
    codegen_grantlee
    Qt6::Core
    Qt6::Test
  )
  ADD_TEST(NAME codegen_unit_test COMMAND $<TARGET_FILE:codegen_unit_test>)
endif()
