summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* matrix-test: fix units in reportDerek Foreman2014-09-051-2/+2
| | | | | | | The matrix-test speed tests are calculated in ns but some printed the units as us Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* tests: allow running make check without make installDerek Foreman2014-08-221-0/+2
| | | | | | | | | | | | | desktop shell and weston keyboard both refer to themselves prefixed by LIBEXECDIR, however this is only valid once installed. make check will currently either fail or run pre-existing versions. This patch adds a way to override that location by setting the env var WESTON_BUILD_DIR - which is then set by the test env script so make check will test the versions in the build directory regardless of whether they're installed or not. Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* weston-test: check if resource is not NULLMarek Chalupa2014-08-211-0/+5
| | | | | | and post client_no_memory if is... Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* compositor: keep track of the weston_layer a weston_view is inGiulio Camuffo2014-07-231-3/+3
| | | | | | | | | This introduces a new struct, weston_layer_entry, which is now used in place of wl_list to keep the link for the layer list in weston_view and the head of the list in weston_layer. weston_layer_entry also has a weston_layer*, which points to the layer the view is in or, in the case the entry it's the head of the list, to the layer itself.
* tests: use expect_protocol_error in testsMarek Chalupa2014-07-222-46/+29
| | | | | | Turn FAIL_TESTs to TESTs. FAIL_TESTs are bad... Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
* tests: add frame_callback_wait_nofailMarek Chalupa2014-07-222-5/+10
| | | | | | | | | With expect_protocol_error, we need a possibility to wait for a frame without aborting the test when wl_display_dispatch returns -1; This patch adds function frame_callback_wait_nofail that only returns 1 or 0 (instead of aborting on error). Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
* tests: add expect_protocol_error functionMarek Chalupa2014-07-222-0/+52
| | | | | | | | | | | | | | | | | 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>
* tests: load the right shell pluginPekka Paalanen2014-05-091-0/+3
| | | | | | | Again, load the shell plugin with full path, rather than possibly find an old version from a previous installation. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* tests: load the right xwayland pluginPekka Paalanen2014-05-091-2/+4
| | | | | | | | If we do not specify the full path to xwayland.so, Weston can find an old one installed in a $prefix and use that instead of the freshly built one. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* tests: use --no-configPekka Paalanen2014-05-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Use --no-config to avoid loading arbitrary weston.ini files from unit tests. It may affect the unit test results. I actually hit the following case: [13:34:04.636] Using config file '/home/pq/local/etc/weston.ini' [13:34:04.636] Loading module '/home/pq/git/weston/.libs/headless-backend.so' [13:34:04.637] launching '/home/pq/local/libexec/weston-keyboard' [13:34:04.644] Loading module '/home/pq/local/lib/weston/desktop-shell.so' [13:34:04.644] Loading module '/home/pq/local/lib/weston/xwayland.so' [13:34:04.648] unlinking stale lock file /tmp/.X1-lock [13:34:04.648] xserver listening on display :1 [13:34:04.648] Loading module '/home/pq/git/weston/.libs/./xwayland.so' [13:34:04.648] xserver listening on display :2 [13:34:04.648] Module '/home/pq/local/lib/weston/xwayland.so' already loaded Weston tries to load xwayland module three times, or which twice it succeeds. This might not make the xwayland test end well. Or at all, actually. Adding --no-config should remove one of these loads of xwayland.so. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* tests: fix bad-buffer-testMarek Chalupa2014-04-161-0/+30
| | | | | | | | | bad-buffer-test is FAIL_TEST and every assert() (or even SIGSEGV signal) make it pass. It shouldn't be so for example when assert() is invoked when a client couldn't connect to display. Make sure that only relevant asserts make the test pass and the other make it fail (by returning 0)
* Make sure config.h is included before any system headersAndrew Wedgbury2014-04-0712-0/+25
| | | | | | | | | | | | | | | 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>
* tests: Properly report skipped testsEmilio Pozuelo Monfort2014-02-183-14/+41
| | | | | | | | | | | | We were calling exit(0) when tests were skipped, which counted them as passed instead of skipped. Fix this by properly exiting with 77 (which is what automake expects for skipped tests) from the tests themselves, then returning 77 again from weston-test-runner if all the tests were skipped. Finally the weston-test.so module catches weston-test-runner's exit code and uses it as an exit code, which is what automake will see and use. Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
* tests: use the headless backend to run the test suiteEmilio Pozuelo Monfort2014-02-181-6/+4
| | | | | | | | Other backends can be used by passing BACKEND=some-backend.so, e.g. $ make check BACKEND=x11-backend.so Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
* tests: Skip buffer-count if EGL initialization failsEmilio Pozuelo Monfort2014-02-181-10/+19
| | | | | | | | That is the case when using the headless backend. In the future we may be able to use the mesa null egl platform but for now let's just skip it. Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
* Makefile.am: Fix protocol source files usageQuentin Glidic2014-02-011-5/+0
| | | | Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
* build: Move tests/Makefile.am into toplevel Makefile.amKristian Høgsberg2014-02-012-170/+4
|
* build: Use subdir-objects automake optionKristian Høgsberg2014-01-311-5/+5
| | | | | | | This makes automake place the object files in the same subdir as the source file. For a recursive build system as we have now, there's no difference, but with a non-recursive build system it means that the object files don't all end up in the toplevel directory.
* gitignore: Generated files text-client-protocol.h, text-protocol.cBryce W. Harrington2014-01-171-0/+2
| | | | Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
* tests: fix build on rpi with EGLPekka Paalanen2014-01-081-0/+2
| | | | | | | | | | | | | | This patch fixes the compiler errors: CC weston_test_la-weston-test.lo weston-test.c:34:21: fatal error: EGL/egl.h: No such file or directory CC buffer-count-test.o buffer-count-test.c:30:21: fatal error: EGL/egl.h: No such file or directory On rpi, the EGL headers are not in the standard path. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* tests: Only run buffer-count test on Mesa >= 10.1Pekka Paalanen2014-01-081-2/+2
| | | | | | | | | | | | | Comment #2 in the bug report says Mesa 10.0 branch does not have the fix, and indeed buffer-count test fails on Mesa 10.0.1. Fix the test to require Mesa 10.1 or later. Now I correctly get: mesa version too old (OpenGL ES 3.0 Mesa 10.0.1 (git-12484d2)) https://bugs.freedesktop.org/show_bug.cgi?id=72835 Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* tests: Only run buffer-count test if we have at least mesa 10Kristian Høgsberg2014-01-013-0/+30
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=72835
* build: Move clients libexec_PROGRAMS under BUILD_CLIENTS conditionalKristian Høgsberg2014-01-012-3/+5
| | | | | | | | All the libexec programs are only built when BUILD_CLIENTS is true, so we can just assign libexec_PROGRAMS under the condition. This lets us drop most of the variable assignments and simplify it a bit. https://bugs.freedesktop.org/show_bug.cgi?id=72812
* tests: Test whether a simple EGL main loop uses too many buffersNeil Roberts2013-12-075-2/+215
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove the weston_view.geometry.width/height fieldsJason Ekstrand2013-12-023-6/+9
| | | | | | | | | | This has a couple of additional implications for the internal weston API: 1) weston_view_configure no longer exists. Use weston_view_set_position instead. 2) The weston_surface.configure callback no longer takes a width and height. If you need these, surface.width/height are set before configure is called. If you need to know when the width/height changes, you must track that yourself.
* Remove dependency on <GLES2/gl2.h> by replacing GLfloat with floatTomeu Vizoso2013-11-271-6/+6
|
* configure.ac: Make libdrm optional in weston-launchKristian Høgsberg2013-11-241-0/+1
| | | | | | If libdrm is available, weston-launch and launcer-util.c will support getting the drm device and setting and dropping drm master, otherwise we'll only support getting input devices.
* tests: Remove an unecessary Makefile.am variableKristian Høgsberg2013-11-231-5/+3
|
* tests: Use a helper library for weston-test clientsKristian Høgsberg2013-11-231-32/+25
|
* tests: Use TEST_CLIENT for test client modulesKristian Høgsberg2013-11-231-1/+1
| | | | | | | We abused SIMPLE_CLIENT_LIBS before, but if you disable simple clients, the test suite fails to link. Use test client specific variables instead. https://bugs.freedesktop.org/show_bug.cgi?id=71530
* tests: .gitignore log filesPekka Paalanen2013-11-211-0/+1
|
* tests: allow weston test plugin to keep on runningPekka Paalanen2013-11-211-1/+1
| | | | | | | | | | | | | | | | | | | | If the environment variable WESTON_TEST_CLIENT_PATH is not set, do not quit Weston in the test plugin. This allows one to start Weston with the test plugin manually, and then run any tests also manually, while observing Weston's behaviour over time. This is useful for: - Running a test multiple times and checking if Weston leaks (e.g. with Valgrind) - Running tests manually on a backend that is not x11 or wayland, especially the backends that require weston-launch, and therefore cannot be used with the 'make check' machinery. This change should not affect 'make check' behaviour, because there WESTON_TEST_CLIENT_PATH is always set. Cc: U. Artie Eoff <ullysses.a.eoff@intel.com> Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* tests: add a test causing SIGBUS to the compositorPekka Paalanen2013-11-212-0/+81
| | | | | | | This tests the wl_shm buffer access wrappers, that are supposed to catch the invalid accesses to a memory-mapped file beyond EOF. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* protocol: move sub-surfaces to WaylandPekka Paalanen2013-11-153-8/+1
| | | | | | | | | | | | | | | | | | This reverts commit 2396aec6842c709a714f3825dbad9fd88478f2e6. This exact version of the sub-surface protocol has been copied into Wayland core. Therefore it must be removed from here to avoid build conflicts and useless duplication. No other changes to sub-surface protocol consumers are needed, the identical API is now offered by libwayland-client and libwayland-server. The commit adding sub-surfaces to Wayland is: Author: Pekka Paalanen <pekka.paalanen@collabora.co.uk> protocol: add sub-surfaces to the core Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* weston-test: Always update transform when moving surfaceKristian Høgsberg2013-11-131-2/+1
| | | | | | | | | | | | | | | | weston_view_update_transform() will post damage in the old and new positions of the view and thus make sure we always repaint properly. In particular, in bug 66133, the test suite moves the surface off any output and weston_surface_schedule_repaint() in commit fails to do anything, since the surface is not on any output. After changing view geometry, we have to either call weston_compositor_schedule_repaint(), which is what shell.c typically does, though that repaints all outputs, or call weston_view_update_transform() to force update the transformation and queue repaints on affected outputs. https://bugs.freedesktop.org/show_bug.cgi?id=66133
* tests/.gitignore: Add *.trsJonas Ådahl2013-10-281-0/+1
| | | | Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
* Split the geometry information from weston_surface out into weston_viewJason Ekstrand2013-10-223-29/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The weston_surface structure is split into two structures: * The weston_surface structure storres everything required for a client-side or server-side surface. This includes buffers; callbacks; backend private data; input, damage, and opaque regions; and a few other bookkeeping bits. * The weston_view structure represents an entity in the scenegraph and storres all of the geometry information. This includes clip region, alpha, position, and the transformation list as well as all of the temporary information derived from the geometry state. Because a view, and not a surface, is a scenegraph element, the view is what is placed in layers and planes. There are a few things worth noting about the surface/view split: 1. This is *not* a modification to the protocol. It is, instead, a modification to Weston's internal scenegraph to allow a single surface to exist in multiple places at a time. Clients are completely unaware of how many views to a particular surface exist. 2. A view is considered a direct child of a surface and is destroyed when the surface is destroyed. Because of this, the view.surface pointer is always valid and non-null. 3. The compositor's surface_list is replaced with a view_list. Due to subsurfaces, building the view list is a little more complicated than it used to be and involves building a tree of views on the fly whenever subsurfaces are used. However, this means that backends can remain completely subsurface-agnostic. 4. Surfaces and views both keep track of which outputs they are on. 5. The weston_surface structure now has width and height fields. These are populated when a new buffer is attached before surface.configure is called. This is because there are many surface-based operations that really require the width and height and digging through the views didn't work well. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
* compositor: Remove redundant and not well-defined focus fieldKristian Høgsberg2013-10-221-6/+0
| | | | It was never clear what this field really did.
* weston-test-client-helper: Use wl_fixed_to_double() when printing axis valueKristian Høgsberg2013-10-101-1/+2
|
* weston-test-client-helper.c: Assert on failed allocationsKristian Høgsberg2013-10-101-10/+19
|
* tests: Assert surface creation succeedsKristian Høgsberg2013-10-102-0/+2
|
* config-parser: Make weston_config_parse() tkae a file nameKristian Høgsberg2013-09-211-1/+1
| | | | Take a basename of the config file to parse instead of an fd.
* Added tests for the vertex clipping code.Sam Spilsbury2013-09-162-11/+245
| | | | | | | | | This tests (via the table-driven testing method) that the correct number of vertices and also the correct vertices themselves are generated for an clip box and polygon of up to eight vertices. Also add a libshared-test.la so that we don't have to build weston-test-runner all the time
* Add support for table-driven testing.Sam Spilsbury2013-09-132-63/+112
| | | | | | | | | | | | The new TEST_P macro takes a function name and a "data" argument to point to an arbitrary array of known size of test data. This allows multiple tests to be run with different datasets. The array is stored as a void * but advanced by a known size on each iteration. The data for each invocation of the test is provided as a "data" argument, it is the responsibility of the test to cast it to something sensible. Also fixed single-test running to only run the tests specified
* Remove AM_LDFLAGS usageSam Spilsbury2013-09-131-2/+6
| | | | We are not building everything here as a module, only the test modules.
* tests: list available tests if an invalid test name is givenPeter Hutterer2013-09-111-0/+1
|
* tests: support -h/--help for the testsPeter Hutterer2013-09-111-0/+18
| | | | Including listing the tests available in that binary
* tests: include config.h in weston-test-runnerPeter Hutterer2013-09-111-0/+1
|
* tests: use variable for test name in weston-tests-envPeter Hutterer2013-09-111-5/+12
| | | | | Slightly more readable and makes it easier to switch to use $2 for something in the future (if that's ever needed).
* tests: always build testsPeter Hutterer2013-09-111-8/+4
| | | | | | check_PROGRAMS and friends are only built during make check. Which is a great way of introducing compiler errors in tests. Always build them, TESTS defines what's being run during make check.