From 6c82f39aa65d3d2445d04bbd70c01c170d8c9845 Mon Sep 17 00:00:00 2001 From: scawful Date: Sun, 16 Nov 2025 22:17:31 -0500 Subject: [PATCH] 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. --- test/CMakeLists.txt | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index c96e6299..2d0d228b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -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