weston/tests
Pekka Paalanen 924cd948ee tests: introduce struct buffer for client-helper
We are growing more tests that need to handle buffers, both just images
and wl_buffers. Particularly the screenshooting facility needs these.
Currently everything is in struct surface, which contains more than we
need. It is a bit messy.

Create a new struct buffer to encapsulate the image representation, the
wl_buffer, and enough information to tear it all down (munmap) so we
don't have to leak everything. Some tests might start doing things in
loops, and leaking would accumulate.

Instead of inventing our own image representation, use pixman_image_t.
It is a well-tested library worth using, and we already rely on it in
other places.

This makes the tests depend on Pixman, which requires the fix for
building buffer-count, which would otherwise not find pixman.h.

The new create_shm_buffer_a8r8g8b8() creates an image with an explicit
format, and pixman_image_t keeps track of it. And stride and size and
data. This implementation is still a little hacky due to calling
create_shm_buffer().

A very new thing is buffer_destroy(). Previously we didn't really free
any buffers. It is not a problem when the process will exit soon anyway,
but it may become a problem if tests start iterating things.

Manual memset() on a image is converted to a pixman action, just to show
how to do it properly with pixman.

Stride and pixel format assumptions still linger all around, but those
are for another patch.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-06-29 12:39:30 +03:00
..
reference tests/internal-screenshot: Fix test so it doesn't expect shell surfaces 2015-05-26 11:26:06 +03:00
.gitignore Revert "gitignore: Ignore generated header test files" 2015-05-26 23:22:19 -07:00
bad-buffer-test.c Remove redundant #include path component. 2015-06-15 17:11:09 -07:00
buffer-count-test.c Remove redundant #include path component. 2015-06-15 17:11:09 -07:00
button-test.c tests: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-15 13:04:19 -07:00
config-parser-test.c zunitc: made name of test fixture parameter explicit. 2015-10-23 14:57:09 -07:00
devices-test.c devices-test: Fix typo 'destroyes' in a comment 2015-10-20 08:35:43 -07:00
event-test.c tests: introduce struct buffer for client-helper 2016-06-29 12:39:30 +03:00
internal-screenshot-test.c tests: introduce struct buffer for client-helper 2016-06-29 12:39:30 +03:00
internal-screenshot.ini tests: Add internal test for the weston test screenshot capability 2015-05-21 15:06:11 -07:00
ivi-shell-app-test.c tests: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-15 13:04:19 -07:00
ivi-test.h ivi-shell: implement surface_on_many_layer test 2016-06-29 11:32:23 +03:00
ivi_layout-internal-test.c Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
ivi_layout-test-plugin.c ivi-shell: implement surface_on_many_layer test 2016-06-29 11:32:23 +03:00
ivi_layout-test.c ivi-shell: implement surface_on_many_layer test 2016-06-29 11:32:23 +03:00
keyboard-test.c Coding style fixes 2015-08-07 12:01:22 -07:00
matrix-test.c Remove redundant #include path component. 2015-06-15 17:11:09 -07:00
presentation-test.c tests: introduce struct buffer for client-helper 2016-06-29 12:39:30 +03:00
roles-test.c tests: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-15 13:04:19 -07:00
setbacklight.c tests: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-15 13:04:19 -07:00
subsurface-test.c tests: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-15 13:04:19 -07:00
surface-global-test.c Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
surface-screenshot.c input: Don't test keyboard/pointer/touch pointers 2015-07-31 15:16:09 -07:00
surface-test.c Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
text-test.c Use text input protocol from wayland-protocols 2015-11-19 13:07:10 +02:00
vertex-clip-test.c Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
viewporter-test.c tests: introduce struct buffer for client-helper 2016-06-29 12:39:30 +03:00
weston-test-client-helper.c tests: introduce struct buffer for client-helper 2016-06-29 12:39:30 +03:00
weston-test-client-helper.h tests: introduce struct buffer for client-helper 2016-06-29 12:39:30 +03:00
weston-test-runner.c tests: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-15 13:04:19 -07:00
weston-test-runner.h Moved helper macro to a discrete include file. 2015-06-15 17:11:45 -07:00
weston-test.c Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
weston-tests-env tests: print the command line to log 2016-06-23 18:15:43 +03:00
xwayland-test.c tests: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-15 13:04:19 -07:00