[Test] (MG_Test, MG_Test/Backend): pin BackendObject's EGL surface bookkeeping before it moves

- BackendObjectEglStateTest: 90 cases over the display, the surface records, the active surface, each thread's binding, the capability probe, the deferred destroy and the locking, driven through a double with no device; every hook is logged with its thread and the state it saw from inside
- the double reads the base's state only in a few accessors, so moving the bookkeeping re-points them and no case
- checked against 235 hand-made mutants of the bookkeeping: every one is caught except those that cannot change an outcome, one that is undefined behaviour and three that only drop an outer lock
This commit is contained in:
2026-10-17 02:57:00 -04:00
parent 1aa5cf63a6
commit a87732511b
2 changed files with 2576 additions and 0 deletions
File diff suppressed because it is too large Load Diff
+6
View File
@@ -117,6 +117,12 @@ add_executable(GpuHangWatchTest Backend/GpuHangWatchTest.cpp)
target_include_directories(GpuHangWatchTest PRIVATE ${MGL_ROOT}/include ${MGL_ROOT}/MobileGL)
target_link_libraries(GpuHangWatchTest PRIVATE MobileGLTestMain ${LINK_LIBRARIES})
gtest_discover_tests(GpuHangWatchTest DISCOVERY_TIMEOUT 30 PROPERTIES LABELS unit)
# The base class's EGL surface and current-context bookkeeping driven through a test double: no
# device, no EGL driver, no window.
add_executable(BackendObjectEglStateTest Backend/BackendObjectEglStateTest.cpp)
target_include_directories(BackendObjectEglStateTest PRIVATE ${MGL_ROOT}/include ${MGL_ROOT}/MobileGL)
target_link_libraries(BackendObjectEglStateTest PRIVATE MobileGLTestMain ${LINK_LIBRARIES})
gtest_discover_tests(BackendObjectEglStateTest DISCOVERY_TIMEOUT 30 PROPERTIES LABELS unit)
if (ENABLE_INTEGRATION_TESTS)
add_subdirectory(Backend/DirectVulkan)
endif()