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

@@ -39,7 +39,8 @@ if(YAZE_BUILD_TESTS)
target_link_libraries(${suite_name} PRIVATE ImGuiTestEngine)
target_compile_definitions(${suite_name} PRIVATE
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()
if(WIN32)

View File

@@ -311,19 +311,19 @@ int main(int argc, char* argv[]) {
else if (config.test_speed == ImGuiTestRunSpeed_Cinematic) speed_name = "Cinematic";
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");
smoke_test->TestFunc = E2ETest_FrameworkSmokeTest;
// Register canvas selection test
ImGuiTest* canvas_test = IM_REGISTER_TEST(engine, "E2ETest", "CanvasSelectionTest");
canvas_test->TestFunc = E2ETest_CanvasSelectionTest;
canvas_test->UserData = &controller;
// Register dungeon editor smoke test
ImGuiTest* dungeon_test = IM_REGISTER_TEST(engine, "E2ETest", "DungeonEditorSmokeTest");
dungeon_test->TestFunc = E2ETest_DungeonEditorV2SmokeTest;
dungeon_test->UserData = &controller;
#endif
// Main loop
bool done = false;