Commit graph

11 commits

Author SHA1 Message Date
Daniel Stone ed97387a4e tests: Use test-desktop-shell for devices-test
It doesn't need to be using desktop-shell; trying to use it is not
sensible as it will try to bind to all the devices we're repeatedly
creating and destroying, sometimes lose the race, and fail the test
because desktop-shell has died too early.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2022-06-29 11:38:36 +00:00
Pekka Paalanen 591fa3b95b tests: fix all leaks in devices-test
This fixes all ASan reported leaks in this test.

This test program has several tests named *_multiple that just run
another test function 30 times. Previously without cleanup all the
created clients would be left lingering, but now they are torn down. Ths
might cause a change in test behaviour, although that was never the
intention:

> It is intentional to run it so many times, but it is not intentional
> to run a hundred clients at a time.  The problem is that currently we
> have no destroy function for client.  However, the clients do not run
> simultaneously but serially, so the effect should be the same as if
> we'd destroy them (after the client finishes its body, it just 'is'
> and does nothing until the process exits)

- the original review discussion in
https://lists.freedesktop.org/archives/wayland-devel/2015-March/020957.html

The intention for the repeat testing is that as the Weston instance
remains from test to another, each test needs to undo its changes to the
devices. Failing to correcntly undo would accumulate devices.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-06-28 14:21:43 +03:00
Pekka Paalanen 3fb67936a9 tests: migrate devices
The devices test was actually using the defaults instead of
weston-test-desktop-shell in meson.build, so this patch keeps it that way.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-01-30 10:10:35 +00:00
Alexandros Frantzis 8b964bca50 tests: Add test for seat destruction and creation
Add a test to check that we can destroy and create the test seat. Since
after test seat destruction the test client releases any associated
input resources, this test also checks that libweston properly handles
release requests for inert input resources.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-02-15 13:14:57 +02:00
Alexandros Frantzis 849b333133 tests: Run devices tests using the test desktop shell
Use the weston-test-desktop-shell to run the devices tests, instead of
the currently used desktop-shell. The test desktop shell doesn't
interact with temporary globals (e.g. wl_seat), thus avoiding an
inherent race in the current wayland protocol when removing globals.
This will allow us to safely add tests which add/remove such globals in
upcoming commits.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-02-15 13:14:53 +02:00
Alexandros Frantzis 468bd0b9c8 tests: Support setting the test client input dynamically
The current test client code waits for all wl_seat globals to arrive
before checking them and deciding which one is the test seat global to
use for the input object. Test code that needs to add/remove test seats
would have to call the client_set_input() function for any seat changes
to take effect. Although we could allow this by making
client_set_input() public, we would be exposing unecessary
implementation details.

This commit applies any seat changes immediately upon arrival of the
seat name, freeing test code from needing to call extra functions like
client_set_input(). To achieve this the call to input_data_devices() is
moved from client_set_input() to the seat name event handler.

This commit also moves the check that all seats have names to an
explicit test. To support this test, inputs corresponding to non-test
seats are not destroyed (unless their seat global is removed), as
was previously the case.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-02-15 13:14:48 +02:00
Bryce Harrington 33598ffe8d devices-test: Fix typo 'destroyes' in a comment 2015-10-20 08:35:43 -07:00
Bryce Harrington 2cc9297aca tests: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-15 13:04:19 -07:00
Derek Foreman 29612053e5 tests: fix typo
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
2015-05-02 08:32:46 -07:00
Pekka Paalanen 4ac06ff97e tests: rename client_create to create_client_and_test_surface
A more descriptive name to not be confused with create_client().

v2: Rebased: fix also devices-test.c.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
2015-04-02 12:54:27 +03:00
Marek Chalupa 5fd814090e tests: add tests for devices handling
Test misc races when adding/releasing devices

v2.: use one roundtrip after releasing devices
     add touch support

v3.: remove useless checks
     add few comments
     repeat tests 30 times instead of 100 times
     (it took too long, 30 is enough)

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-03-31 11:11:59 +03:00