feat: enhance CMake configuration for conditional AI test inclusion

- Updated CMakeLists.txt to conditionally include AI GUI controller tests and experimental AI test suites based on the YAZE_ENABLE_AI_RUNTIME flag.
- Added status messages to inform users when AI tests are skipped due to the runtime being disabled, improving clarity in the build process.
- This change ensures that tests related to AI features are only compiled and run when the appropriate runtime is enabled, enhancing modularity and build efficiency.
This commit is contained in:
scawful
2025-11-16 22:17:31 -05:00
parent f90101764b
commit 6c82f39aa6

View File

@@ -141,8 +141,14 @@ if(YAZE_BUILD_TESTS)
e2e/framework_smoke_test.cc
e2e/dungeon_editor_smoke_test.cc
e2e/canvas_selection_test.cc
integration/ai/ai_gui_controller_test.cc
)
if(YAZE_ENABLE_AI_RUNTIME)
list(APPEND GUI_TEST_SOURCES integration/ai/ai_gui_controller_test.cc)
else()
message(STATUS "Skipping AI GUI controller tests (YAZE_ENABLE_AI_RUNTIME=OFF)")
endif()
yaze_add_test_suite(yaze_test_gui "gui;experimental" ON ${GUI_TEST_SOURCES})
# Add a single test entry to run the entire GUI suite headlessly
@@ -153,12 +159,16 @@ if(YAZE_BUILD_TESTS)
)
set_tests_properties(headless_gui_suite PROPERTIES LABELS "headless_gui;experimental")
set(EXPERIMENTAL_TEST_SOURCES
test_utils.cc
integration/ai/test_ai_tile_placement.cc
integration/ai/test_gemini_vision.cc
)
yaze_add_test_suite(yaze_test_experimental "experimental" OFF ${EXPERIMENTAL_TEST_SOURCES})
if(YAZE_ENABLE_AI_RUNTIME)
set(EXPERIMENTAL_TEST_SOURCES
test_utils.cc
integration/ai/test_ai_tile_placement.cc
integration/ai/test_gemini_vision.cc
)
yaze_add_test_suite(yaze_test_experimental "experimental" OFF ${EXPERIMENTAL_TEST_SOURCES})
else()
message(STATUS "Skipping experimental AI suites (YAZE_ENABLE_AI_RUNTIME=OFF)")
endif()
# --- Benchmark Test Suite ---
set(BENCHMARK_TEST_SOURCES