feat(cpp): integrar Catch2 en CMake con BUILD_TESTING + add_fn_test helper

cpp/tests/CMakeLists.txt compila Catch2 amalgamated como STATIC libreria
una sola vez. Cada test es su propio executable (CATCH_CONFIG_MAIN por
archivo) y se registra con add_test(). add_fn_test(name srcs...) es el
helper: incluye paths de cpp/functions y cpp/framework, linka catch2.

Tests que necesitan symbols reales (fn_framework, imgui) los anaden
explicitamente con target_link_libraries despues.
This commit is contained in:
2026-04-28 23:42:14 +02:00
parent 0585f851bb
commit 93a964a47d
2 changed files with 60 additions and 0 deletions
+7
View File
@@ -199,3 +199,10 @@ set(_DASH_DIR ${CMAKE_SOURCE_DIR}/../projects/fn_monitoring/apps/registry_dashbo
if(EXISTS ${_DASH_DIR}/CMakeLists.txt)
add_subdirectory(${_DASH_DIR} ${CMAKE_BINARY_DIR}/apps/registry_dashboard)
endif()
# --- Tests (Catch2 amalgamated, ctest-driven) ---
option(BUILD_TESTING "Build C++ tests" ON)
if(BUILD_TESTING)
enable_testing()
add_subdirectory(tests)
endif()