Enhance testing framework and CMake integration for YAZE

- Conditionally include Google Test support in the build configuration, allowing for integrated testing when enabled.
- Refactor ImGui Test Engine setup to be conditional based on the YAZE_ENABLE_UI_TESTS flag, improving modularity.
- Update EditorManager to register new test suites, including integrated and performance tests, enhancing test coverage.
- Improve the test dashboard UI with additional options for filtering and viewing test results, providing a better user experience.
- Introduce a new integrated test suite for comprehensive testing of core functionalities, ensuring robustness and reliability.
This commit is contained in:
scawful
2025-09-25 13:29:39 -04:00
parent 41adb1b70e
commit 8ab30dd5ad
8 changed files with 776 additions and 51 deletions

View File

@@ -7,11 +7,24 @@ target_include_directories(ImGui PUBLIC ${SDL2_INCLUDE_DIR})
target_compile_definitions(ImGui PUBLIC
IMGUI_IMPL_OPENGL_LOADER_CUSTOM=<SDL2/SDL_opengl.h> GL_GLEXT_PROTOTYPES=1)
set(IMGUI_TEST_ENGINE_PATH ${CMAKE_SOURCE_DIR}/src/lib/imgui_test_engine/imgui_test_engine)
file(GLOB IMGUI_TEST_ENGINE_SOURCES ${IMGUI_TEST_ENGINE_PATH}/*.cpp)
add_library("ImGuiTestEngine" STATIC ${IMGUI_TEST_ENGINE_SOURCES})
target_include_directories(ImGuiTestEngine PUBLIC ${IMGUI_PATH} ${CMAKE_SOURCE_DIR}/src/lib)
target_link_libraries(ImGuiTestEngine PUBLIC ImGui)
# Set up ImGui Test Engine sources and target conditionally
if(YAZE_ENABLE_UI_TESTS)
set(IMGUI_TEST_ENGINE_PATH ${CMAKE_SOURCE_DIR}/src/lib/imgui_test_engine/imgui_test_engine)
file(GLOB IMGUI_TEST_ENGINE_SOURCES ${IMGUI_TEST_ENGINE_PATH}/*.cpp)
add_library("ImGuiTestEngine" STATIC ${IMGUI_TEST_ENGINE_SOURCES})
target_include_directories(ImGuiTestEngine PUBLIC ${IMGUI_PATH} ${CMAKE_SOURCE_DIR}/src/lib)
target_link_libraries(ImGuiTestEngine PUBLIC ImGui)
# Enable test engine definitions only when UI tests are enabled
add_definitions("-DIMGUI_ENABLE_TEST_ENGINE -DIMGUI_TEST_ENGINE_ENABLE_COROUTINE_STDTHREAD_IMPL=1")
# Make ImGuiTestEngine target available
set(IMGUI_TEST_ENGINE_TARGET ImGuiTestEngine)
else()
# Create empty variables when UI tests are disabled
set(IMGUI_TEST_ENGINE_SOURCES "")
set(IMGUI_TEST_ENGINE_TARGET "")
endif()
set(
IMGUI_SRC
@@ -24,5 +37,3 @@ set(
${IMGUI_PATH}/misc/cpp/imgui_stdlib.cpp
)
# For integration test
add_definitions("-DIMGUI_ENABLE_TEST_ENGINE -DIMGUI_TEST_ENGINE_ENABLE_COROUTINE_STDTHREAD_IMPL=1")