[client] tests: add framebuffer rendering validation

Add an optional EGL framebuffer capture path for the test transport.
Capture the fully composed frame before presentation and retain its
surface format and HDR state for validation.

Add GoogleTest integration tests which run the production client
under a headless Weston compositor and compare every output pixel
against an independent reference implementation.

The matrix covers BGRA, RGBA, BGR32, RGB24, PQ RGBA10 and scRGB
RGBA16F with full, moving, overlapping, maximum-count, invalid, null
and zero-area damage rectangles. Validate HDR-to-SDR conversion and
native HDR output metadata when supported by the compositor.

Keep tests opt-in through ENABLE_RENDER_TESTS and document how to run
the software and native HDR tiers.
This commit is contained in:
Geoffrey McRae
2026-07-30 14:53:38 +10:00
parent a1fc3d20d3
commit 74ae4f543e
11 changed files with 1172 additions and 6 deletions

View File

@@ -36,6 +36,19 @@ add_feature_info(ENABLE_EGL ENABLE_EGL "EGL renderer.")
option(ENABLE_TEST_TRANSPORT "Enable the test transport" OFF)
add_feature_info(ENABLE_TEST_TRANSPORT ENABLE_TEST_TRANSPORT
"Synthetic frames for graphics-pipeline validation.")
if(ENABLE_TEST_TRANSPORT)
add_definitions(-D ENABLE_TEST_TRANSPORT)
endif()
option(ENABLE_RENDER_TESTS "Build framebuffer rendering integration tests" OFF)
add_feature_info(ENABLE_RENDER_TESTS ENABLE_RENDER_TESTS
"Pixel-accurate EGL rendering tests using the test transport.")
if(ENABLE_RENDER_TESTS AND NOT ENABLE_TEST_TRANSPORT)
message(FATAL_ERROR "ENABLE_RENDER_TESTS requires ENABLE_TEST_TRANSPORT")
endif()
if(ENABLE_RENDER_TESTS AND NOT ENABLE_EGL)
message(FATAL_ERROR "ENABLE_RENDER_TESTS requires ENABLE_EGL")
endif()
option(ENABLE_BACKTRACE "Enable backtrace support on crash" ON)
add_feature_info(ENABLE_BACKTRACE ENABLE_BACKTRACE "Backtrace support.")
@@ -205,6 +218,12 @@ target_link_libraries(looking-glass-client
cimgui
)
if(ENABLE_RENDER_TESTS)
include(CTest)
enable_testing()
add_subdirectory(tests)
endif()
if (ENABLE_PIPEWIRE OR ENABLE_PULSEAUDIO)
add_definitions(-D ENABLE_AUDIO)
add_subdirectory(audiodevs)