Commit graph

10 commits

Author SHA1 Message Date
Marek Chalupa 4d06d46ace tests: add expect_protocol_error function
This function checks if a particular protocol error came in wire.
It's usefull in the cases where we hitherto used FAIL_TEST.
The problem with FAIL_TEST is that *any* assert will pass the test,
but we want only some asserts to pass the test (i. e. we don't
want the test to pass when it, for example, can't connect to display).
FAIL_TESTs are good only for sanity testing.

The expect_protocol_error allows us to turn all FAIL_TESTs to TESTs
as will be introduced in following patches.

v2: fixed white-space error and a mistake in comment

Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
2014-07-22 19:14:54 +03:00
Andrew Wedgbury 9cd661e746 Make sure config.h is included before any system headers
There was an issue recently in screen-share.c where config.h was not
being included, resulting in the wrong definition for off_t being used on
32 bit systems. I checked and I don't think this problem is happening
elsewhere, but to help avoid this sort of problem in the future, I went
through and made sure that config.h is included first whenever system
headers are included.

The config.h header should be included before any system headers, failing
to do this can result in the wrong type sizes being defined on certain
systems, e.g. off_t from sys/types.h

Signed-off-by: Andrew Wedgbury <andrew.wedgbury@realvnc.com>
2014-04-07 10:22:28 -07:00
Kristian Høgsberg 42284f5f9e tests: Only run buffer-count test if we have at least mesa 10
https://bugs.freedesktop.org/show_bug.cgi?id=72835
2014-01-01 17:38:04 -08:00
Neil Roberts 40c0c3f91e tests: Test whether a simple EGL main loop uses too many buffers
This adds a test that tries to simulate a simple game loop that would
be like this:

while (1) {
        draw_something();
        eglSwapBuffers();
}

In this case the test is relying on eglSwapBuffers to throttle to a
sensible frame rate.

The test then verifies that only 2 EGL buffers are used. This is done
via a new request and event in the wayland-test protocol.

Currently this causes 3 buffers to be created because the release
event generated by the swap buffers is not processed by Mesa until it
blocks for the frame complete event in the next swap buffers call, but
that is too late.

This can be fixed in Mesa by issuing a sync request after the swap
buffers and blocking on it before deciding whether to allocate a new
buffer.
2013-12-07 22:26:23 -08:00
Pekka Paalanen 32ac9b9245 tests: export create_shm_buffer() helper
Lets the tests create additional buffers easily.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-02-08 13:38:14 -05:00
Pekka Paalanen 8aaef7d48c tests: add frame callback waiting helpers
To avoid duplicating the code for setting and waiting for a frame
callback, add helpers for it.

Convert move_client() to use the new helpers.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-02-08 13:38:09 -05:00
Pekka Paalanen f2aa64f18a tests: check wl_display_roundtrip() for errors
Add a macro that wraps wl_display_roundtrip() and check for errors. It
is a macro, so that the assert would show the relevant file and line
number.

This will also catch protocol errors, that would go unnoticed otherwise.

All roundtrips in tests are replaced with the check.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-12-12 10:39:01 -05:00
Kristian Høgsberg 1cb3df4e46 tests: Port text-test to new test framework
So much simpler this way and the test suite is now back too 100% pass.
2012-12-11 23:04:14 -05:00
Kristian Høgsberg ba0cfdd284 tests: Drop yield() helper function
Remaining use case was when we move the pointer.  This doesn't change
geometry so we can just use a wl_display_roundtrip() to make sure
we get the request to the server and receive the resulting events.
2012-12-11 22:17:35 -05:00
U. Artie Eoff 1ba9b38ec6 tests: Convert keyboard-test to new test extension
This adds a weston-test-runner for the weston test extension and
some weston test client helper methods.

Converted keyboard-test to use the new test interface, runner,
and helper methods.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=56822

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2012-12-11 15:30:25 -05:00