refactor(cmake): update test configuration for GUI targets

- Removed experimental test option and modular build option from CMakeLists.txt to simplify configuration.
- Added a definition for YAZE_GUI_TEST_TARGET in the test CMakeLists.txt to mark GUI test targets.
- Updated yaze_test.cc to conditionally register E2E tests only for GUI test targets, enhancing clarity in test registration.

Benefits:
- Streamlined CMake configuration for testing.
- Improved organization of test registration logic for GUI targets.
This commit is contained in:
scawful
2025-10-11 23:05:04 -04:00
parent 47cd835e31
commit c54a7dfa8d
3 changed files with 5 additions and 6 deletions

View File

@@ -54,9 +54,7 @@ set(YAZE_INSTALL_LIB OFF)
# Testing and CI Configuration # Testing and CI Configuration
option(YAZE_ENABLE_ROM_TESTS "Enable tests that require ROM files" OFF) option(YAZE_ENABLE_ROM_TESTS "Enable tests that require ROM files" OFF)
option(YAZE_ENABLE_EXPERIMENTAL_TESTS "Enable experimental/unstable tests" ON)
option(YAZE_MINIMAL_BUILD "Minimal build for CI (disable optional features)" OFF) option(YAZE_MINIMAL_BUILD "Minimal build for CI (disable optional features)" OFF)
option(YAZE_USE_MODULAR_BUILD "Use modularized library build system for faster builds" ON)
option(YAZE_UNITY_BUILD "Enable Unity (Jumbo) builds" OFF) option(YAZE_UNITY_BUILD "Enable Unity (Jumbo) builds" OFF)
# Feature Flags - Simplified: Always enabled by default (use wrapper classes to hide complexity) # Feature Flags - Simplified: Always enabled by default (use wrapper classes to hide complexity)

View File

@@ -39,7 +39,8 @@ if(YAZE_BUILD_TESTS)
target_link_libraries(${suite_name} PRIVATE ImGuiTestEngine) target_link_libraries(${suite_name} PRIVATE ImGuiTestEngine)
target_compile_definitions(${suite_name} PRIVATE target_compile_definitions(${suite_name} PRIVATE
IMGUI_ENABLE_TEST_ENGINE=1 IMGUI_ENABLE_TEST_ENGINE=1
IMGUI_TEST_ENGINE_ENABLE_COROUTINE_STDTHREAD_IMPL=1) IMGUI_TEST_ENGINE_ENABLE_COROUTINE_STDTHREAD_IMPL=1
YAZE_GUI_TEST_TARGET=1) # Mark this as a GUI test target
endif() endif()
if(WIN32) if(WIN32)

View File

@@ -311,19 +311,19 @@ int main(int argc, char* argv[]) {
else if (config.test_speed == ImGuiTestRunSpeed_Cinematic) speed_name = "Cinematic"; else if (config.test_speed == ImGuiTestRunSpeed_Cinematic) speed_name = "Cinematic";
std::cout << "Running tests in " << speed_name << " mode" << std::endl; std::cout << "Running tests in " << speed_name << " mode" << std::endl;
// Register smoke test // Register E2E tests only for GUI test targets (they have the source files)
#ifdef YAZE_GUI_TEST_TARGET
ImGuiTest* smoke_test = IM_REGISTER_TEST(engine, "E2ETest", "FrameworkSmokeTest"); ImGuiTest* smoke_test = IM_REGISTER_TEST(engine, "E2ETest", "FrameworkSmokeTest");
smoke_test->TestFunc = E2ETest_FrameworkSmokeTest; smoke_test->TestFunc = E2ETest_FrameworkSmokeTest;
// Register canvas selection test
ImGuiTest* canvas_test = IM_REGISTER_TEST(engine, "E2ETest", "CanvasSelectionTest"); ImGuiTest* canvas_test = IM_REGISTER_TEST(engine, "E2ETest", "CanvasSelectionTest");
canvas_test->TestFunc = E2ETest_CanvasSelectionTest; canvas_test->TestFunc = E2ETest_CanvasSelectionTest;
canvas_test->UserData = &controller; canvas_test->UserData = &controller;
// Register dungeon editor smoke test
ImGuiTest* dungeon_test = IM_REGISTER_TEST(engine, "E2ETest", "DungeonEditorSmokeTest"); ImGuiTest* dungeon_test = IM_REGISTER_TEST(engine, "E2ETest", "DungeonEditorSmokeTest");
dungeon_test->TestFunc = E2ETest_DungeonEditorV2SmokeTest; dungeon_test->TestFunc = E2ETest_DungeonEditorV2SmokeTest;
dungeon_test->UserData = &controller; dungeon_test->UserData = &controller;
#endif
// Main loop // Main loop
bool done = false; bool done = false;