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:
@@ -141,8 +141,14 @@ if(YAZE_BUILD_TESTS)
|
|||||||
e2e/framework_smoke_test.cc
|
e2e/framework_smoke_test.cc
|
||||||
e2e/dungeon_editor_smoke_test.cc
|
e2e/dungeon_editor_smoke_test.cc
|
||||||
e2e/canvas_selection_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})
|
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
|
# 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_tests_properties(headless_gui_suite PROPERTIES LABELS "headless_gui;experimental")
|
||||||
|
|
||||||
set(EXPERIMENTAL_TEST_SOURCES
|
if(YAZE_ENABLE_AI_RUNTIME)
|
||||||
test_utils.cc
|
set(EXPERIMENTAL_TEST_SOURCES
|
||||||
integration/ai/test_ai_tile_placement.cc
|
test_utils.cc
|
||||||
integration/ai/test_gemini_vision.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})
|
)
|
||||||
|
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 ---
|
# --- Benchmark Test Suite ---
|
||||||
set(BENCHMARK_TEST_SOURCES
|
set(BENCHMARK_TEST_SOURCES
|
||||||
|
|||||||
Reference in New Issue
Block a user