[PATCH weston 00/10] Implement screenshot-based testing with the headless renderer

Bryce Harrington bryce at osg.samsung.com
Wed May 6 17:44:19 PDT 2015


This series adds support for implementing test cases that can check
rendering output without needing connection to a physical output.  It
utilizes the pixman renderer in the headless backend to generate
screenshots at the request of the test client.

The test creates a shm buffer and passes it to the server via the
Weston-Test protocol ('capture_screenshot').  The server then renders
the display contents into the buffer and returns it as a response
('capture_screenshot_done').

The test then loads a corresponding reference PNG from disk as a cairo
surface, and then compares it with the captured screenshot.  Note that
the screenshot includes the current time in the desktop clock, which
will of course be different in the captured screenshot from the
reference image.  So this checks a small clipped out section of each of
the two images to verify congruence.

By default, Wayland fades in the display and will show a patterned
background.  The former feature causes a black or nearly-black image to
be captured (the darkness of which may vary from system to system), and
the latter merely adds noise in our comparison, so both features are
disabled via a test-specific configuration .ini file.


Bryce Harrington (10):
  tests: Add error handling for system calls
  tests: Add client helper routines for output and reference filenames
  tests: Add an xmalloc helper function
  tests: Add surface checks
  tests: Support --config to enable tests to override config defaults
  protocol: Add test screenshot capability
  tests: Add screenshot recording capability to weston-test
  tests: Handle screenshot done event in weston-test
  tests: Add internal test for the weston test screenshot capability
  Refactor pixel copying routines to shared utilities

 Makefile.am                                |  81 ++++++++-----
 protocol/weston-test.xml                   |  16 +++
 shared/pixel-util.c                        |  90 ++++++++++++++
 shared/pixel-util.h                        |  49 ++++++++
 src/screenshooter.c                        |  66 +----------
 tests/internal-screenshot-test.c           | 151 ++++++++++++++++++++++++
 tests/internal-screenshot.ini              |   3 +
 tests/reference/internal-screenshot-00.png | Bin 0 -> 5149 bytes
 tests/weston-test-client-helper.c          | 155 ++++++++++++++++++++++++
 tests/weston-test-client-helper.h          |  38 +++++-
 tests/weston-test.c                        | 181 ++++++++++++++++++++++++++++-
 tests/weston-tests-env                     |  18 ++-
 12 files changed, 743 insertions(+), 105 deletions(-)
 create mode 100644 shared/pixel-util.c
 create mode 100644 shared/pixel-util.h
 create mode 100644 tests/internal-screenshot-test.c
 create mode 100644 tests/internal-screenshot.ini
 create mode 100644 tests/reference/internal-screenshot-00.png

-- 
1.9.1



More information about the wayland-devel mailing list