feat(registry): index cpp/apps/* + e2e test infrastructure

registry/indexer.go ahora escanea <lang>/apps/*/app.md ademas de apps/ y
projects/*/apps/. cpp/apps/chart_demo y cpp/apps/shaders_lab pasan a estar
en registry.db con sus manifests.

Infraestructura de tests e2e (opt-in con -DFN_BUILD_TESTS=ON):
- vendor de Dear ImGui Test Engine (personal/open-source license).
- chart_demo_tests target con tests/chart_demo_tests.cpp.
- /e2e-cpp slash command para crear y ejecutar tests e2e.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-04 11:51:38 +02:00
parent bf94893032
commit ab6ce8f822
37 changed files with 18370 additions and 8 deletions
+44
View File
@@ -7,6 +7,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# --- Options ---
option(TRACY_ENABLE "Enable Tracy profiling" OFF)
option(FN_BUILD_TESTS "Build C++ e2e tests with Dear ImGui Test Engine" OFF)
# --- Vendor: Dear ImGui ---
set(IMGUI_DIR ${CMAKE_CURRENT_SOURCE_DIR}/vendor/imgui)
@@ -24,6 +25,44 @@ target_include_directories(imgui PUBLIC
${IMGUI_DIR}/backends
)
# When tests are enabled, imgui must be compiled with hooks for the test engine.
# The hooks compile to no-ops if the engine is never started, so this is safe to
# leave on but we still gate it to keep release builds identical to today.
if(FN_BUILD_TESTS)
target_compile_definitions(imgui PUBLIC IMGUI_ENABLE_TEST_ENGINE)
endif()
# --- Vendor: Dear ImGui Test Engine (opt-in via FN_BUILD_TESTS) ---
# Personal/open-source license (see vendor/imgui_test_engine/LICENSE.txt).
if(FN_BUILD_TESTS)
set(IMTE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/vendor/imgui_test_engine)
add_library(imgui_test_engine STATIC
${IMTE_DIR}/imgui_te_engine.cpp
${IMTE_DIR}/imgui_te_context.cpp
${IMTE_DIR}/imgui_te_coroutine.cpp
${IMTE_DIR}/imgui_te_exporters.cpp
${IMTE_DIR}/imgui_te_perftool.cpp
${IMTE_DIR}/imgui_te_ui.cpp
${IMTE_DIR}/imgui_te_utils.cpp
${IMTE_DIR}/imgui_capture_tool.cpp
)
target_include_directories(imgui_test_engine PUBLIC
${IMTE_DIR}
${IMTE_DIR}/thirdparty
)
# Use std::thread for coroutines so apps don't have to provide their own.
target_compile_definitions(imgui_test_engine PUBLIC
IMGUI_ENABLE_TEST_ENGINE
IMGUI_TEST_ENGINE_ENABLE_COROUTINE_STDTHREAD_IMPL=1
IMGUI_TEST_ENGINE_ENABLE_STD_FUNCTION=1
)
target_link_libraries(imgui_test_engine PUBLIC imgui)
if(UNIX)
find_package(Threads REQUIRED)
target_link_libraries(imgui_test_engine PUBLIC Threads::Threads)
endif()
endif()
# --- Vendor: ImPlot ---
set(IMPLOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/vendor/implot)
add_library(implot STATIC
@@ -173,6 +212,11 @@ target_link_libraries(fn_framework PUBLIC imgui implot implot3d SQLite::SQLite3)
if(TRACY_ENABLE)
target_link_libraries(fn_framework PUBLIC tracy)
endif()
if(FN_BUILD_TESTS)
# Public so apps that include fn_framework headers see the same hooks.
target_compile_definitions(fn_framework PUBLIC IMGUI_ENABLE_TEST_ENGINE)
target_link_libraries(fn_framework PUBLIC imgui_test_engine)
endif()
# --- OpenMP (opcional) ---
# Habilita #pragma omp en las funciones del registry que lo declaren bajo