Commit Graph

483 Commits

Author SHA1 Message Date
Pekka Paalanen b5e3ea218b Rename src/ to libweston/
This clarifies what is supposed to be the libweston code.

v2: screen-share.c is already in compositor/ instead.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Tested-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Tested-by: Benoit Gschwind <gschwind@gnu-log.net>
Acked-by: Benoit Gschwind <gschwind@gnu-log.net>
[Pekka: rebased]
2016-06-23 17:44:54 +03:00
Pekka Paalanen 58f98c99f5 Move weston source to compositor/
This is the start of separating weston-the-compositor source files from
libweston source files.

This is moving all the files related to the 'weston' binary. Also the
CMS and systemd plugins are moved.

xwayland plugin is not moved, because it will be turned into a
libweston feature.

To avoid breaking the build, #includes for weston.h are fixed to use
compositor/weston.h. This serves as a reminder that such files may need
further attention: moving to the right directory, or maybe using the
proper -I flags instead.

v2: Move also screen-share.c, and add a note about weston-launch.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Tested-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Tested-by: Benoit Gschwind <gschwind@gnu-log.net>
Acked-by: Benoit Gschwind <gschwind@gnu-log.net>
[Pekka: rebased]
2016-06-23 17:44:54 +03:00
Pekka Paalanen 315bf8c5da tests: check kbd init in the plugin
Check that the keyboard init in weston-test.so plugin succeeds.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
2016-06-23 14:48:38 +03:00
Pekka Paalanen 82d95a6dc5 tests: add wp_viewporter tests
These tests poke the viewporter interface to ensure proper behaviour
from client perspective, without testing the rendering result.

These cases are covered:
- create viewport twice
- source rectangle invalid value errors, and unset
- destination size invalid value errors, and unset
- source causing non-integer destination size
- source inside/outside of buffer with transform, scale
- source outside NULL buffer, then getting real buffer
- source outside NULL buffer with inherited NULL
- set_source, set_destination, and destroy after the wl_surface is
  destroyed

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-06-09 11:17:16 +03:00
Giulio Camuffo fba27fbef2 Move the functions launching clients to main.c
They belong in the compositor rather than libweston since they
set signals handlers, and a library should not do that behind its
user's back. Besides, they were using functions in main.c already
so they were not usable by other compositors.

Signed-off-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-06-03 13:16:39 +03:00
Pekka Paalanen fd01ba055d tests: check for NULL surface in keyboard and pointer handlers
When a test destroys a wl_surface, it is still possible to get events
referring to the destroyed surface. The surface in such cases will be
NULL.

Handle NULL surface gracefully in keyboard and pointer enter/leave
handlers. Touch-down handler is already NULL-safe.

This fixes a SEGV in a test I am writing for wp_viewport.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-04-22 10:45:09 +03:00
Ucan, Emre (ADITG/SW1) c49aa5acad ivi-shell: rework configure_surface notification
The add_notification_configure_surface API accepts a simple
wl_listener instead of a ivi-shell specific notification
function. Therefore, the API is renamed to
add_listener_configure_surface.

This change has several advantages:
1. Code cleanup
2. No dynamic memory allocation. Listeners are allocated
   by controller plugins
3. Remove API is not needed. Controller plugins can easily
   remove the listener link.

The remove API is removed too:
- ivi_layout_remove_notification_configure_surface

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-04-05 11:53:48 +03:00
Ucan, Emre (ADITG/SW1) 67f0aa8767 ivi-shell: rework remove_surface notification
The add_notification_remove_surface API accepts a simple
wl_listener instead of a ivi-shell specific notification
function. Therefore, the API is renamed to add_listener_remove_surface.

This change has several advantages:
1. Code cleanup
2. No dynamic memory allocation. Listeners are allocated
   by controller plugins
3. Remove API is not needed. Controller plugins can easily
   remove the listener link.

The remove API is removed too:
- ivi_layout_remove_notification_remove_surface

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-04-05 11:53:48 +03:00
Ucan, Emre (ADITG/SW1) 562f2ecb0c ivi-shell: rework remove_layer notification
The add_notification_remove_layer API accepts a simple
wl_listener instead of a ivi-shell specific notification
function. Therefore, the API is renamed to add_listener_remove_layer.

This change has several advantages:
1. Code cleanup
2. No dynamic memory allocation. Listeners are allocated
   by controller plugins
3. Remove API is not needed. Controller plugins can easily
   remove the listener link.

The remove API is removed too:
- ivi_layout_remove_notification_remove_layer

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-04-05 11:53:48 +03:00
Ucan, Emre (ADITG/SW1) c98f2cf16b ivi-shell: rework create_layer_notification
The add_notification_layer_surface API accepts a simple
wl_listener instead of a ivi-shell specific notification
function. Therefore, the API is renamed to add_listener_layer_surface.

This change has several advantages:
1. Code cleanup
2. No dynamic memory allocation. Listeners are allocated
   by controller plugins
3. Remove API is not needed. Controller plugins can easily
   remove the listener link.

The remove API is removed too:
- ivi_layout_remove_notification_create_layer

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-04-05 11:53:48 +03:00
Ucan, Emre (ADITG/SW1) 970f831588 ivi-shell: rework create_surface notification
The add_notification_create_surface API accepts a simple
wl_listener instead of a ivi-shell specific notification
function. Therefore, the API is renamed to
add_listener_create_surface.

This change has several advantages:
1. Code cleanup
2. No dynamic memory allocation. Listeners are allocated
   by controller plugins
3. Remove API is not needed. Controller plugins can easily
   remove the listener link.

The remove API is removed too:
- ivi_layout_remove_notification_create_surface

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-04-05 11:53:48 +03:00
Ucan, Emre (ADITG/SW1) 3750d1b270 ivi-shell: rework layer_add_notification API
The layer_add_notification API accepts a simple
wl_listener instead of a ivi-shell specific notification
function. Therefore, the API is renamed to layer_add_listener.

This change has several advantages:
1. Code cleanup
2. No dynamic memory allocation. Listeners are allocated
   by controller plugins
3. Remove API is not needed. Controller plugins can easily
   remove the listener link.

This patch also remove two APIs which are not needed:
- ivi_layout_layer_remove_notification
- ivi_layout_layer_remove_notification_by_callback

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-04-05 11:53:48 +03:00
Ucan, Emre (ADITG/SW1) 706cb5aa7c ivi-shell: rework surface_add_notification API
The surface_add_notification API accepts a simple
wl_listener instead of a ivi-shell specific notification
function. Therefore, the API is renamed to surface_add_listener.

This change has several advantages:
1. Code cleanup
2. No dynamic memory allocation. Listeners are allocated
   by controller plugins
3. Remove API is not needed. Controller plugins can easily
   remove the listener link.

This patch also remove two APIs which are not needed:
- ivi_layout_surface_remove_notification
- ivi_layout_surface_remove_notification_by_callback

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-04-05 11:53:48 +03:00
Ucan, Emre (ADITG/SW1) 273874e3c7 ivi-shell: use weston_output in public APIs
IVI layout APIs now are called with weston_output pointers,
instead of ivi_layout_screen pointers.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
2016-03-24 11:10:07 +02:00
Ucan, Emre (ADITG/SW1) 3a8521e005 ivi-shell: remove ivi_layout_get_screens API
The compositor data struct already has a list of weston outputs.
Therefore, this API is not required.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
2016-03-24 11:10:07 +02:00
Ucan, Emre (ADITG/SW1) ff6a9f8474 ivi-shell: remove ivi_layout_get_screen_resolution API
The controller plugins can get the screen resolution directly from
weston output. Therefore, this API is not required.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
2016-03-24 11:10:07 +02:00
Ucan, Emre (ADITG/SW1) d56b90d948 ivi-shell: remove ivi_layout_get_id_of_screen API
ivi-screen does not have an id. IVI layout implementation is using
id of weston output. Therefore, this API is unnecessary.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
2016-03-24 11:10:07 +02:00
Bryce Harrington e99e4bf2b9 clients & tests: Unify multiple definitions of x*alloc and related functions
Direct fail_on_null calls now produce output like:

    [weston-info] clients/weston-info.c:714: out of memory

xmalloc, et al produce output on failure like:

    [weston-info] out of memory (-1)

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-17 14:13:13 +02:00
Pekka Paalanen b00c79b587 protocol: migrate to stable presentation-time.xml
Remove the unstable presentation_timing.xml file, and use
presentation-time.xml from wayland-protocols instead to generate all the
Presentation extension bindings.

The following renames are done according to the XML changes:
- generated header includes
- enum constants and macros prefixed with WP_
- interface symbol names prefixed with wp_
- protocol API calls prefixed with wp_

Clients use wp_presentation_interface.name rather than hardcoding the
global interface name: presentation-shm, weston-info, presentation-test.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
[Pekka: updated wayland-protocols dependency to 1.2]
2016-03-07 13:29:27 +02:00
Ucan, Emre \(ADITG/SW1\) 16d1fa156a ivi-shell: remove ivi_layout_layer_set_dimension API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:35 -08:00
Ucan, Emre \(ADITG/SW1\) 45d3942816 ivi-shell: remove ivi_layout_surface_set_dimension API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:34 -08:00
Ucan, Emre \(ADITG/SW1\) e62bfd8d5e ivi-shell: remove ivi_layout_layer_set_position API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:34 -08:00
Ucan, Emre \(ADITG/SW1\) 161da40b06 ivi-shell: remove ivi_layout_surface_set_position API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:34 -08:00
Ucan, Emre \(ADITG/SW1\) 5bb068d16d ivi-shell: remove ivi_layout_layer_get_orientation API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:34 -08:00
Ucan, Emre \(ADITG/SW1\) 4d9001bc49 ivi-shell: remove ivi_layout_surface_get_orientation API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:34 -08:00
Ucan, Emre \(ADITG/SW1\) 18691f0310 ivi-shell: remove ivi_layout_layer_get_dimension API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:34 -08:00
Ucan, Emre \(ADITG/SW1\) c507f67f9e ivi-shell: remove ivi_layout_surface_get_dimension API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:34 -08:00
Ucan, Emre \(ADITG/SW1\) dfc2d76432 ivi-shell: remove ivi_layout_layer_get_position API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:34 -08:00
Ucan, Emre \(ADITG/SW1\) b2ff255792 ivi-shell: remove ivi_layout_surface_get_position API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:34 -08:00
Ucan, Emre \(ADITG/SW1\) c3aee1f67f ivi-shell: remove ivi_layout_layer_get_opacity API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:34 -08:00
Ucan, Emre \(ADITG/SW1\) 995e6fbcd0 ivi-shell: remove ivi_layout_surface_get_opacity API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:34 -08:00
Ucan, Emre \(ADITG/SW1\) 17610f240b ivi-shell: remove ivi_layout_layer_get_visibility API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:34 -08:00
Ucan, Emre \(ADITG/SW1\) c6a138c6f0 ivi-shell: remove ivi_layout_surface_get_visibility API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:27 -08:00
Jon A. Cruz c25f72d8e9 tests: cleanup test runner script.
Cleaned up test runner script to unify sections launching weston.
This makes the sections more legible and differences easier to spot.

Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-02-23 16:08:13 +02:00
Peter Hutterer 87743e9303 Support axis source, axis discrete, frame and axis stop events
[jonas: only send focus wl_pointer.frame if resource supports it]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2016-01-19 12:33:26 +08:00
Chris Michael 2ec5f2a633 cosmetic: Remove use of C++ style comments
Patch updated to remove dead lines as suggested by Daniel Stone

Signed-off-by: Chris Michael <cp.michael@samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2015-12-03 15:28:53 -08:00
Jonas Ådahl d2510105a6 input: Make pointer grab motion callbacks take an event struct
Instead of only passing absolute pointer coordinates, effectively
loosing motion event data, pass a struct that can potentially contain
different types of motion events, currently being absolute and relative.

A helper function to get resulting absolute coordinates was added for
when previous callbacks simply used the (x, y) coordinates.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
2015-11-20 11:44:56 +08:00
Jonas Ådahl 3bcba347a2 Use text input protocol from wayland-protocols
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Mariusz Ceier <mceier+wayland@gmail.com>
Reviewed-by: Jan Arne Petersen <janarne@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-11-19 13:07:10 +02:00
Ucan, Emre \(ADITG/SW1\) 0c0e51e096 ivi-shell: rename ivi_controller_interface
The name of ivi_controller_interface is changed to ivi_layout_interface
with this patch.

This name is better suited to the interface, because it is implemented
in ivi-layout.c and its methods are linked to ivi_layout* functions.

Furthermore, the controller modules (e.g. hmi-controller) are the users
of this interface and they have their own interfaces,
which are called *_controller_interface,
e.g.: ivi_hmi_controller_interface.

This causes confusion about the software architecture.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
2015-10-29 13:55:16 -07:00
Jon Cruz ecf819b82e zunitc: made name of test fixture parameter explicit.
Instead of using the implicit name 'data', changed the test
with fixture macro ZUC_TEST_F() to use an additional value
to explicitly set the name to use for test data from the
fixture.

Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-10-23 14:57:09 -07:00
Bryce Harrington 33598ffe8d devices-test: Fix typo 'destroyes' in a comment 2015-10-20 08:35:43 -07:00
Derek Foreman bdc8c721e4 cosmetic: Remove a few double semicolons
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
2015-10-07 11:22:03 -07:00
Bryce Harrington 892122ed64 tests: Migrate screenshot code from internal test to client helpers
These routines provide test cases an ability to capture screen images
for rendering verification.

This commit is a no-change refactoring, except for making the routines
non-static.  Makefile rules are also updated; most notably, this links
test clients against the cairo libraries now.

v2: Fix pointer code styling, suggested in review

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
2015-09-25 11:23:08 -07:00
Seedo Eldho Paul 43af680abf tests: Convert 'xalloc's to 'zalloc's
xalloc terminates the program abruptly if the requested amount of
memory couldn't be allocated. To insure that the errors are handled
cleanly, use zalloc instead.

Signed-off-by: Seedo Eldho Paul <seedoeldhopaul@gmail.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-09-22 18:23:44 -07:00
Dawid Gajownik 74a635b1ec Coding style fixes
- opening braces are on the same line as the if statement
- opening braces are not on the same line as the function name
- space between for/while/if and opening parenthesis

Signed-off-by: Dawid Gajownik <gajownik@gmail.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
2015-08-07 12:01:22 -07:00
Bill Spitzak 2ccd9a2d62 test/ivi: include protocol headers for all used protocols
This seems like a good idea for consistency that the protocol header
is included for any protocols used by the code. This also means the
code will compile with headers generated by wayland-scanner -c.

Fixed to use angle brackets.

Reviewed-by: Daniel Stone <daniels@collabora.com>
2015-08-06 16:24:59 +01:00
Derek Foreman 1281a36e3b input: Don't test keyboard/pointer/touch pointers
Keyboards and pointers aren't freed when devices are removed, so we should
really be testing keyboard_device_count and pointer_device_count in most
cases, not the actual pointers. Otherwise we end up with different
behaviour after removing a device than we had before it was inserted.

This commit renames the touch/keyboard/pointer pointers and adds helper
functions to get them that hide this complexity and return NULL when
*_device_count is 0.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2015-07-31 15:16:09 -07:00
Jon A. Cruz a67c541e27 Converted the config parser test to the new framework.
Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-07-17 13:27:56 +03:00
Derek Foreman 8ae2db5b0c input: Pass the appropriate pointer type to bindings instead of a seat
Normally we need to check if a seat's [device_type]_count is > 0 before
we can use the associated pointer.  However, in a binding you're
guaranteed that the seat has a device of that type.  If we pass in
that type instead of the seat, it's obvious we don't have to test it.

The bindings can still get the seat pointer via whatever->seat if they
need it.

This is preparation for a follow up patch that prevents direct access
to seat->device_type pointers, and this will save us a few tests at
that point.

Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
2015-07-16 19:03:43 -07:00
Nobuhiko Tanibata ffcc452767 tests: test set for ivi-shell notification with bad condition in server side
These tests are implemented on test suite framework, which provides
internal method validation,
Following features are tested,
- add notification of ivi-layer with bad parameter
- add notification of ivi-surface configure with bad parameter
- add notification of creating ivi-layer with bad parameter
- add notification of creating ivi-surface with bad parameter
- add notification of removing ivi-layer with bad parameter
- add notification of removing ivi-surface with bad parameter

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:39:59 +03:00
Nobuhiko Tanibata 0af22d4d77 tests: test set for ivi-shell notification in bad condition with helper client
These tests are implemented on test suite framework, which provides
helper client.
Following features are tested,
- add notfication of ivi-surface with bad condition

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:39:54 +03:00
Nobuhiko Tanibata 495c6efb7f tests: test set for ivi-shell notification normal use case in server side
These tests are implemented on test suite framework, which provides
internal method validation.
Following features are tested,
- notification of adding ivi-layer
- notification of creating ivi-layer
- notification of removing ivi-layer

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:39:50 +03:00
Nobuhiko Tanibata 915303a275 tests: test set for ivi-shell notification normal use case with helper client
These tests are implemented on test suite framework, which provides
helper client.
Following features are tested,
  - notification of adding ivi-surface
  - notification of ivi-surface configure
  - notification of creating ivi-surface
  - notification of removing ivi-surface

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:39:45 +03:00
Nobuhiko Tanibata a10352e5c3 tests: make the test context persistent
The TESTs in ivi_layout-test.c may have several server-side parts
(RUNNER_TEST in ivi_layout-test-plugin.c) each. Sometimes we need to
carry state from one RUNNER_TEST to another within one TEST, but not
across multiple TESTs. The correct lifetime of that state would be the
lifetime (and identity) of the runner_resource, as one TEST creates and
uses at most one weston_test_runner during its lifetime.

However, tests are executed one by one. Take a shortcut, and use a static
global for storing that state. This turns the test_context into a
singleton. To ensure it is not confused between multiple TESTs, add
asserts to verify its identity.

Following patches will add tests for notification callbacks. These will
be using the carried state.

[Pekka: add serialization checks, rename the global, rewrite commit message.]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:39:10 +03:00
Nobuhiko Tanibata 83c20bcbd5 tests: test set for ivi-screen with bad condition in server side
These tests are implemented on test suite framework, which provides
internal method validation,
Following features are tested,
- ivi-screen operation with bad parameter
- render order with bad parameter
- destroy ivi-layer in the ivi-screen and call commit_changes

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:39:05 +03:00
Nobuhiko Tanibata e78a7afb60 tests: test set for ivi-screen normal use case in server side
These tests are implemented on test suite framework, which provides
internal method validation.
Following features are tested,
- ivi-screen id
- ivi-screen resolution
- render order of ivi-layers in ivi-screen

Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:38:59 +03:00
Nobuhiko Tanibata 17d4494224 tests: test set for ivi-layer with bad condition in server side
These tests are implemented on test suite framework, which provides
internal method validation.
Following features are tested for ivi-layer,
- create with bad parameter
- visibility with bad parameter
- opacity with bad parameter
- destination rectangle with bad parameter
- orientation with bad parameter
- dimension with bad parameter
- position with bad parameter
- source rectangle with bad parameter
- properties with bad parameter
- destroy ivi-layer and call set_visibility_commit_changes
- destroy ivi-layer, call set_opacity, and commit_changes
- destroy ivi-layer, call set_orientation, and commit_changes
- destroy ivi-layer, call set_dimension, and commit_changes
- call set_position, destroy ivi-layer, and commit_changes
- call set_source_rectangle, destroy ivi-layer, and commit_changes
- call set_destination_rectangle, destroy ivi-layer, and commit_changes
- create duplicate
- destroy ivi-layer and call get_layer

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:38:54 +03:00
Nobuhiko Tanibata 0671b4d930 tests: test set for ivi-layer bad condition with helper-client
These tests are implemented on test suite framework, which provides
helper client.
Following features are tested,
- bad render order of ivi-surface on ivi-layer
- call commitchanges after a ivi_surface in render order is destoryed

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:38:48 +03:00
Nobuhiko Tanibata 9e992d9aff tests: test set for ivi-layer normal use case in server side
These tests are implemented on test suite framework, which provides
internal method validation.
Following features are tested for ivi-layer,
- create
- visibility
- opacity
- orientation
- dimension
- position
- destination rectangle
- source rectangle

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:38:43 +03:00
Nobuhiko Tanibata d364393fca tests: test set for ivi-layer normal use case with helper client
These test are implemented on test suite framework, which provides
helper client.
Following features are tested,
- render order of ivi-surfaces on ivi-layer

Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:38:37 +03:00
Nobuhiko Tanibata 16ed543f87 tests: test set for ivi-surface with bad condition in server side
These tests are implemented on test suite framework, which provides
internal method validation.
Following features are tested for ivi-surface,
- destination_rectangle with bad parameter
- orientation with bad parameter
- dimension with bad parameter
- position with bad parameter
- source_rectangle with bad parameter
- properties with bad parameter

Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:38:31 +03:00
Nobuhiko Tanibata c74bafa0e9 tests: test set for ivi-surface bad condition with helper client
These tests are implemented on test suite framework, which provides
helper client.
Following features are tested,
- ivi_layout_runner with basic_test_names[]
 - surface with bad opacity
- destroy ivi/wl_surface and call get_surface
- commit_changes_after_properties_set_surface_destroy with
  surface_property_commit_changes_test_names[]
 - call set_visibility, destroy ivi-surface, and commit_changes
 - call set_opacity, destroy ivi-surface, and commit_changes
 - call set_orientation, destroy ivi-surface, and commit_changes
 - call set_dimension, destroy ivi-surface, and commit_changes
 - call set_position, destroy ivi-surface, and commit_changes
 - call set_source_rectangle, destroy ivi-surface, and commit_changes
 - call set_destination_rectangle, destroy ivi-surface, and
  commit_changes

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:38:25 +03:00
Nobuhiko Tanibata 23d95824a5 tests: test set for ivi-surface normal use case with helper client
These tests are implemented on test suite framework, which provides
helper client.
Following features are tested for ivi-surface
- orientation
- dimension
- position
- destination rectangle
- source rectangle

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:38:10 +03:00
Jon Cruz 867d50eea7 Unified multiple definitions of container_of() macro.
Removed duplicate definitions of the container_of() macro and
refactored sources to use the single implementation.

Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-06-15 17:11:58 -07:00
Jon Cruz 35b2eaa989 Moved helper macro to a discrete include file.
To help reduce code duplication and also 'kitchen-sink' includes
the ARRAY_LENGTH macro was moved to a stand-alone file and
referenced from the sources consuming it. Other macros will be
added in subsequent passes.

Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-06-15 17:11:45 -07:00
Jon Cruz 4678bab13c Remove redundant #include path component.
Using the parent '../' path component in #include statements makes
the codebase more rigid and is redundant due to proper -I use.

Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-06-15 17:11:09 -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 97b9b17668 internal-screenshot-test: Fix endian problem
Use bit-shifts to properly generate pixel data.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-06-04 17:13:22 -07:00
Bryce Harrington 5ab3eea4f0 Revert "gitignore: Ignore generated header test files"
This reverts commit 8267056a64.
2015-05-26 23:22:19 -07:00
Bryce Harrington a291fcb949 tests: Drop redundant debug output
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2015-05-26 18:03:34 -07:00
Bryce Harrington 8267056a64 gitignore: Ignore generated header test files 2015-05-26 17:14:57 -07:00
Derek Foreman 35b7f25ae3 tests/internal-screenshot: Fix test so it doesn't expect shell surfaces
We no longer have a race with shell startup because we create our own
colored surface and check that it's properly drawn.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-05-26 11:26:06 +03:00
Derek Foreman 1223fa4be4 tests: Set up the reference image environment variable
make check failed for out of tree builds because we didn't set up
WESTON_TEST_REFERENCE_PATH in weston-tests-env

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Tested-by: Bryce Harrington <bryce@osg.samsung.com>
2015-05-22 16:23:23 -07:00
Bryce Harrington 0ccf8e2238 tests: cleanup whitespace 2015-05-21 15:26:06 -07:00
Bryce Harrington c919883d26 tests: Check that the PNG file's stride matches our internal assumption
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
2015-05-21 15:10:37 -07:00
Bryce Harrington 3835d05c63 tests: Fix code style on path/filename routines
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
2015-05-21 15:10:06 -07:00
Bryce Harrington 111e022e91 tests: Add capture_screenshot_of_output()
Provides a convenience function for JFDI grabbing of a single
screenshot.  Tests that are doing multiple screenshots or other
fanciness probably will bypass this routine and do things more manually,
but this'll provide a reference implementation.  And hopefully there'll
be enough simple cases that this actually is useful.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
2015-05-21 15:06:43 -07:00
Bryce Harrington 39a5be2a1f tests: Add check_surfaces_geometry()
Minor refactoring to simplify initial sanity checks of surfaces.
Conceivably useful for other basic checking.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
2015-05-21 15:06:36 -07:00
Bryce Harrington 198f941ec8 tests: Add load_surface_from_png()
Loads an image from disk via cairo, and copies data into a weston test
surface for internal use.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
2015-05-21 15:06:31 -07:00
Bryce Harrington 2eaf7d78ba tests: Add create_screenshot_surface()
Refactor out the screenshot shm buffer creation code.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
2015-05-21 15:06:26 -07:00
Bryce Harrington 85e65f5fe5 tests: Add write_surface_as_png() helper
And use the helper routine for generating the output filename.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
2015-05-21 15:06:15 -07:00
Bryce Harrington fb9089d4f5 tests: Add internal test for the weston test screenshot capability
This also serves as a proof of concept of the screen capture
functionality and as a demo for snapshot-based rendering verification.
Implements screenshot saving clientside in the test itself.

This also demonstrates use of test-specific configuration files, in this
case to disable fadein animations and background images.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
2015-05-21 15:06:11 -07:00
Bryce Harrington 692275f91f tests: Handle screenshot done event in weston-test
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
2015-05-21 15:06:08 -07:00
Bryce Harrington f280d11274 tests: Add screenshot recording capability to weston-test
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=83981
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
2015-05-21 15:05:59 -07:00
Bryce Harrington ed2c644892 tests: Support --config to enable tests to override config defaults
Implements a simple mechanism to allow tests to customize the
configuration.  For a given <name>-test.c just place a <name>.ini file
at the same location as the test itself.  Alternately, you can generate
a <name>.ini in the same directory that the compiled test is placed
(i.e. the top builddir).  If no configuration file is found, then no
configuration will be used (i.e. --no-config is specified.)

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
2015-05-21 15:05:48 -07:00
Bryce Harrington 273c285fa6 tests: Add surface checks
Introduce helper routines for testing surfaces against specific
conditions.  These allow tests to validate screen captures as displaying
the correct rendering results.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
2015-05-21 15:05:40 -07:00
Bryce Harrington 61a6436ae0 tests: Add an xmalloc helper function
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
2015-05-21 15:05:28 -07:00
Bryce Harrington c1a1d6cecf tests: Add client helper routines for output and reference filenames
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
2015-05-21 15:05:20 -07:00
Bryce Harrington e75e7a5b06 tests: Add error handling for system calls
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
2015-05-21 15:04:58 -07:00
Bryce Harrington a20db38437 tests: Fix Samsung copyright assignment on xwayland test 2015-05-05 11:16:51 -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 46804ca5dd tests: add ivi_layout stand-alone test module
This is the ivi_layout stand-alone test controller module that does not
require any clients to run. Therefore it is much simpler than
ivi_layout-test-plugin.c and does not need a matching part in
ivi_layout-test.c.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
2015-04-09 09:27:47 +03:00
Pekka Paalanen f5b74f7ded tests: ivi_layout test infrastructure
Testing the ivi_layout API requires two things:
- the tests must be written as a controller module to access the API
- the tests need a helper client to create some objects that can then be
  managed via the API

This patch adds all the infrastructure and two different kinds of
example tests.

Internal ivi-shell (ivi_layout) API tests are listed as ivi-*.la files
in TESTS in Makefile.am. Weston-tests-env detects these, and runs Weston
with ivi-shell, and loads the given module as a controller module, not
as a normal plugin.

The test controller module ivi-*.la will launch a helper client. For
ivi-layout-test.la the helper client is ivi-layout.ivi.

The helper client uses the weston-test-runner framework to fork and exec
each TEST with a fresh connection to the compositor.

The actual test is triggered by the weston_test_runner protocol
interface, a new addition to weston-test.xml. The helper client uses
weston_test_runner to trigger a test, and the server side of the
interface is implemented by the test controller module
(ivi-layout-test.la).

The server side of weston_test_runner uses the same trick as
weston-test-runner.h to gather a list of defined tests. A test is
defined with the RUNNER_TEST macro.

If a test defined by RUNNER_TEST succeeds, an event is sent to the
helper client that it can continue (or exit). If a test fails, a fatal
protocol error is sent to the helper client.

Once the helper client has iterated over all of its tests, it signals
the batch success/failure via process exit code. That is cought in the
test controller module, and forwarded as Weston's exit code.

In summary: each ivi_layout test is a combination of a client side
helper/setup and server side actual tests.

v2: Load weston-test.so, because create_client() needs it.

v3: add a comment about IVI_TEST_SURFACE_ID_BASE.

v4: Rebased to upstream weston-tests-env changes.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com> (v2)
2015-04-09 09:27:05 +03:00
Pekka Paalanen 0eb09412b3 tests: add a basic ivi-shell test
This simply tests that Weston starts with ivi-shell, and ivi_application
is present.

Changes in v3:
- Rebased to upstream weston-tests-env changes.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com> (v2)
2015-04-09 09:25:44 +03:00
Bryce Harrington b9ec2be5a1 tests: Prefer bracket form of test command for consistency
Also use variable default assignment to eliminate an if clause

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-04-07 14:29:24 +03:00
Bryce Harrington 69eb737a33 tests: Cleanup test log filenames
The log files were being named like:

	surface-global-test.la-log.txt
	surface-global-test.la-serverlog.txt
	surface-test.la-log.txt
	surface-test.la-serverlog.txt
	text.weston-log.txt
	text.weston-serverlog.txt

For consistency, omit the test filename's extension (.la/.so).

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2015-04-07 12:41:30 +03:00
Bryce Harrington 63b1ee9351 tests: Keep track of basename
basename returns the filename without path information (but with
the file extension).  We can get this more efficiently via shell
variables.

Also, for the socket name, use the test's name without the file
extension.

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
[Pekka: rebased without "tests: Support --config to enable tests to
override config defaults".]
2015-04-07 12:40:02 +03: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
Pekka Paalanen 1ffd4615e8 tests: introduce create_client()
Introduce a new helper create_client(), which creates and initializes
the client struct, but does not create a wl_surface.

This will be useful for ivi-shell tests.

v2: Rebased, and restored the dependency to weston-test.so, since seat
handling requires it.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
2015-04-02 12:54:04 +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
Marek Chalupa 8a5523c3ec tests: implement touch in test-helpers
Let the client bind to wl_touch. Since we have our own seat,
we know that the compositor will have wl_touch capability.

v2: rebased due to changes in previous commit

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
Marek Chalupa c3c3fc411e tests: use special seat
When running on different backends, we don't know what devices
the backend provides. Create new seat for tests that contains
everything what we need. This is also first step in adding
touch support for tests.

v2: do not add devices in wl_seat.name event. Collect first
    all wl_seats and then pick the one that we need and
    destroy the rest. The effect is the same, but this code
    is better understandable.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-03-31 11:11:52 +03:00
Marek Chalupa 643d85f76d tests: fix handling globals
We used hard-coded version 1 for all globals. For testing
newer methods and events we need use the current version
of global. This patch fixes this and adds missing
event handlers (for the events that were added in
versions > 1)

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-03-31 10:12:57 +03:00
Marek Chalupa c8daf77f91 weston-test: add device_{release/add} into protocol
This request simulates device creation/destruction from evdev (libinput)

v2: added support for touch. Touch is not supported yet,
    but better be prepared

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-03-31 10:12:39 +03:00
Pekka Paalanen fb7069ee05 tests: use MODDIR in weston-tests-env
Make a little short-hand for the module directory.

This also cleans up the redefinition of BACKEND in the script.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Reviewed-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-03-27 09:37:56 +02:00
Jonny Lamb abff883d2c platform: rename create_egl_window to create_egl_surface
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-03-26 09:54:49 +02:00
Jonny Lamb 4bdcb5732b clients & tests: use eglCreatePlatformWindowSurfaceEXT when supported
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-03-20 13:57:24 -07:00
Jonny Lamb 51a7ae5f89 clients & tests: use eglGetPlatformDisplayEXT when supported
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-03-20 13:56:38 -07:00
Marek Chalupa a413ff897d tests: use two roundtrips for global events
first is for getting and binding to globals and the other one is for
getting wl_shm.formats that are emitted after binding
to wl_shm

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-03-19 16:17:20 +02:00
Pekka Paalanen 312fe5f445 surface-screenshot: a new manual test module
Add a new Weston plugin under tests/ for manual testing of the
surface-shooting API.

The debug key binding 'h' triggers a surface shot from the surface that
currently has the pointer focus. The shot is written in PAM format into
a file. PAM format was chosen because it is dead-simple to write from
scratch and can carry an RGBA format.

Changes in v2:
- check fprintf calls, fix a malloc without free
- remove stride and format arguments from the API

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
v1 Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2015-02-25 14:48:02 +02:00
Derek Foreman f6a65928a8 tests: Rename wayland-test to weston-test
wayland-test isn't and will never be wayland protocol, it's weston internal.

Renamed wayland-test to weston-test, and wl_test to weston_test.

Also added a Big Fat Warning to the description of weston_test to try to
keep people from thinking it's a good idea to use some of these functions
outside of testing.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Acked-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-02-24 11:26:29 -08:00
Daniel Stone e78977196c tests: Include weston-egl-ext from weston-test
weston-test uses eglBindWaylandDisplayWL and friends, which are defined
either by the EGL implementation, or weston-egl-ext.h as a fallback.
Include weston-egl-ext.h from weston-test, so we can build on systems
whose native EGL implementation doesn't give us the needed defines.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
2015-02-12 19:30:35 -08:00
Derek Foreman 8771a14ff3 xwayland-test: Replace the xwayland-test
The old xwayland-test hasn't worked in a while...

This new test checks that the wayland specific WL_SURFACE_ID atom exists,
checks that the window manager name is "Weston WM" and then maps a window
and waits for an exposure event.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Tested-by: Bryce Harrington <bryce@osg.samsung.com>
2015-01-30 12:21:39 -08:00
Derek Foreman 9bb133990a tests: Skip buffer count test if wl_drm isn't present
This skips the test when running on the headless backend.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
(Presumably) Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2015-01-23 18:16:48 -08:00
Pekka Paalanen 63495864d3 tests, clients: add Presentation feedback flags
Decode the new feedback flags.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Tested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
2015-01-20 17:13:27 -08:00
Bryce Harrington cb50ed226b tests: Fix minor typo 2014-12-10 18:33:47 -08:00
Bryce Harrington 2cd82b7692 tests: Use one shared xzalloc implementation
Since this is an inlined function, move it to a common header file.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
2014-11-28 15:57:55 +02:00
Bryce Harrington 22ea306ce2 tests: Move ARRAY_LENGTH to a shared header for reuse
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
2014-11-28 15:56:45 +02:00
Bryce Harrington a76802685a tests: Cleanup superfluous headers
Mostly remove headers that aren't actually needed for anything.
Add stdint.h to permit dropping xf86drm.h, which is otherwise unneeded.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Acked-by: Marek Chalupa <mchqwerty@gmail.com>
Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-11-28 15:54:31 +02:00
Bryce Harrington 12cc4055ff tests: Include "config.h" as first header
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2014-11-28 15:52:56 +02:00
Derek Foreman 6bef237943 tests: Allow tests to use customized command line parameters
Tests will now return the extra command line parameters they need
when run with --params

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-11-24 12:21:05 +02:00
Pekka Paalanen 3c5f1c76b2 tests: add role conflict sub-surface vs. wl_shell_surface
Add tests for triggering the role conflict when a wl_surface is already
a wl_shell_surface and then attempted to be made into a sub-surface, and
vice versa.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
2014-10-08 13:16:40 +03:00
Pekka Paalanen de7f5c8fda tests: presentation test, simple
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-30 13:02:20 +03:00
Derek Foreman 086b987be4 matrix-test: fix units in report
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>
2014-09-05 11:32:36 +03:00
Derek Foreman c7210434d4 tests: allow running make check without make install
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>
2014-08-22 17:47:33 +03:00
Marek Chalupa 42ebdda446 weston-test: check if resource is not NULL
and post client_no_memory if is...

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-08-21 14:24:39 +03:00
Giulio Camuffo 412e6a59eb compositor: keep track of the weston_layer a weston_view is in
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.
2014-07-23 12:34:33 -07:00
Marek Chalupa cfff312204 tests: use expect_protocol_error in tests
Turn FAIL_TESTs to TESTs. FAIL_TESTs are bad...

Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
2014-07-22 19:16:49 +03:00
Marek Chalupa 1740aa8c85 tests: add frame_callback_wait_nofail
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>
2014-07-22 19:15:28 +03:00
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
Pekka Paalanen c2b74fb849 tests: load the right shell plugin
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>
2014-05-09 15:00:32 -07:00
Pekka Paalanen 6ea0d176d6 tests: load the right xwayland plugin
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>
2014-05-09 15:00:14 -07:00
Pekka Paalanen 412e58a240 tests: use --no-config
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>
2014-05-09 15:00:06 -07:00
Marek Chalupa 06f2fa1a60 tests: fix bad-buffer-test
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)
2014-04-16 22:31:44 -07: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
Emilio Pozuelo Monfort dae8a4b9c5 tests: Properly report skipped tests
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>
2014-02-18 13:50:29 -08:00
Emilio Pozuelo Monfort 943cb12075 tests: use the headless backend to run the test suite
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>
2014-02-18 13:50:24 -08:00
Emilio Pozuelo Monfort 08dbd31c4b tests: Skip buffer-count if EGL initialization fails
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>
2014-02-18 13:49:37 -08:00
Quentin Glidic 088ba5e475 Makefile.am: Fix protocol source files usage
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2014-02-01 21:21:39 -08:00
Kristian Høgsberg 1e80afa36c build: Move tests/Makefile.am into toplevel Makefile.am 2014-02-01 01:04:32 -08:00
Kristian Høgsberg 396a9bb995 build: Use subdir-objects automake option
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.
2014-01-31 23:49:33 -08:00
Bryce W. Harrington d716754cfb gitignore: Generated files text-client-protocol.h, text-protocol.c
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2014-01-17 11:32:01 -08:00
Pekka Paalanen 73e9f86e2c tests: fix build on rpi with EGL
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>
2014-01-08 21:30:20 -08:00
Pekka Paalanen ca6bd745b8 tests: Only run buffer-count test on Mesa >= 10.1
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>
2014-01-08 21:27:53 -08: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
Kristian Høgsberg f3fa832796 build: Move clients libexec_PROGRAMS under BUILD_CLIENTS conditional
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
2014-01-01 13:52:20 -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
Jason Ekstrand 918f2dd4cf Remove the weston_view.geometry.width/height fields
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.
2013-12-02 22:17:58 -08:00
Tomeu Vizoso 0f0a6ffc2e Remove dependency on <GLES2/gl2.h> by replacing GLfloat with float 2013-11-27 22:49:31 -08:00
Kristian Høgsberg d2c9d8af50 configure.ac: Make libdrm optional in weston-launch
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.
2013-11-24 15:16:23 -08:00
Kristian Høgsberg 89eebb7ceb tests: Remove an unecessary Makefile.am variable 2013-11-23 12:59:27 -08:00
Kristian Høgsberg 9ab771d6d5 tests: Use a helper library for weston-test clients 2013-11-23 12:53:16 -08:00
Kristian Høgsberg 8e293a5adb tests: Use TEST_CLIENT for test client modules
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
2013-11-23 12:40:34 -08:00
Pekka Paalanen b9eae3369b tests: .gitignore log files 2013-11-21 21:47:29 -08:00
Pekka Paalanen f72e4797f4 tests: allow weston test plugin to keep on running
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>
2013-11-21 21:47:28 -08:00
Pekka Paalanen f812477fc0 tests: add a test causing SIGBUS to the compositor
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>
2013-11-21 21:47:19 -08:00
Pekka Paalanen a662206e71 protocol: move sub-surfaces to Wayland
This reverts commit 2396aec684.

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>
2013-11-15 16:23:17 -08:00
Kristian Høgsberg ace0a3920e weston-test: Always update transform when moving surface
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
2013-11-13 21:55:57 -08:00
Jonas Ådahl 80511efe43 tests/.gitignore: Add *.trs
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-10-28 14:38:23 -07:00
Jason Ekstrand a7af70436b Split the geometry information from weston_surface out into weston_view
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>
2013-10-22 13:34:11 -07:00
Kristian Høgsberg 10ddd97ecf compositor: Remove redundant and not well-defined focus field
It was never clear what this field really did.
2013-10-22 12:40:54 -07:00
Kristian Høgsberg 4c8ce20ba7 weston-test-client-helper: Use wl_fixed_to_double() when printing axis value 2013-10-10 16:50:18 -07:00
Kristian Høgsberg c1b244f61d weston-test-client-helper.c: Assert on failed allocations 2013-10-10 16:50:18 -07:00
Kristian Høgsberg 3b7d841b7e tests: Assert surface creation succeeds 2013-10-10 16:50:18 -07:00
Kristian Høgsberg 1abe0486bb config-parser: Make weston_config_parse() tkae a file name
Take a basename of the config file to parse instead of an fd.
2013-09-21 23:05:45 -07:00
Sam Spilsbury b42fb52537 Added tests for the vertex clipping code.
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
2013-09-16 21:40:34 -07:00
Sam Spilsbury b502126e19 Add support for table-driven testing.
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
2013-09-13 15:19:35 -07:00
Sam Spilsbury db0eda4abb Remove AM_LDFLAGS usage
We are not building everything here as a module, only the test modules.
2013-09-13 15:13:49 -07:00
Peter Hutterer 9715d4db54 tests: list available tests if an invalid test name is given 2013-09-11 13:41:22 -07:00
Peter Hutterer 534f0a4dd1 tests: support -h/--help for the tests
Including listing the tests available in that binary
2013-09-11 13:41:12 -07:00
Peter Hutterer d8ca89017c tests: include config.h in weston-test-runner 2013-09-11 13:40:34 -07:00
Peter Hutterer 44f719109d tests: use variable for test name in weston-tests-env
Slightly more readable and makes it easier to switch to use $2 for something
in the future (if that's ever needed).
2013-09-11 13:40:01 -07:00
Peter Hutterer 498d5f07cb tests: always build tests
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.
2013-09-11 13:38:03 -07:00
Kristian Høgsberg c7d2c4c147 Add more missing config.h #includes
Now that we use AC_SYS_LARGEFILE, we need to pull in config.h at least
whereever we use mmap().  Fixes at least the test-suite and simple-shm
on 32 bit systems.
2013-08-26 14:59:14 -07:00
Daiki Ueno 3e9df07269 autotools: Don't use wayland-scanner.m4 2013-08-20 11:15:19 -07:00
Peter Hutterer f3d62276d2 malloc + memset -> zalloc
And for clients using the xmalloc helper, use xzalloc.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-08-08 13:46:13 -07:00
Kristian Høgsberg 919cddb0ab Convert to wl_global_create/destroy() 2013-07-09 02:02:11 -04:00
Kristian Høgsberg ac3a8b83fd tests: Fix warnings in config-parser-test 2013-07-09 02:02:11 -04:00
Quentin Glidic d2d70f2aeb tests: Move config-parser.test to tests/
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2013-07-08 18:14:04 -04:00
Quentin Glidic c71cc99c0e tests: Add .weston extension to clients tests
We can then add tests which do not use Weston in the test suite.

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2013-07-08 13:16:00 -04:00
Kristian Høgsberg c1ae40222c tests: Rename xwayland_test to xwayland-test
Consitency.
2013-07-04 02:32:04 -04:00
Kristian Høgsberg 442a5faa84 tests: Fix leftover wl_client_add_versioned_object()
The search and replace missed this one.
2013-07-03 18:13:33 -04:00
Jason Ekstrand a85118c1b8 Use wl_resource_create() for creating resources
This commit sets the version numbers for all added/created objects.  The
wl_compositor.create_surface implementation was altered to create a surface
with the same version as the underlying wl_compositor.  Since no other
"child interfaces" have version greater than 1, they were all hard-coded to
version 1.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-07-03 14:52:06 -04:00
Kristian Høgsberg 8f7f483668 tests: Fix direct access to resource->data in weston-test 2013-06-25 16:18:35 -04:00
Pekka Paalanen 5e9bedb8c4 tests: add a sub-surface nesting loop test
It should not be possible to create a loop by nesting sub-surfaces.
Currently Weston fails this test.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2013-05-17 16:21:59 -04:00
Pekka Paalanen beb080ed85 tests: add sub-surface tree destruction permutations
Add a test for varying the object destruction order in a complex
sub-surface tree.

This test attemps to fuzz the destruction of a sub-surface tree to make
sure the server does not crash on any wl_surface or wl_subsurface
destruction sequence.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2013-05-17 16:21:14 -04:00
U. Artie Eoff 173ff5326d fix module_init signature in module tests
surface-global-test and surface-test did not get updated to
the new module_init(...) signature when it changed in
a50e6e4c50.  Thus, they
failed to compile.  Simply running 'make check' shows the
problem. This patch fixes it.

fixes https://bugs.freedesktop.org/show_bug.cgi?id=64691

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2013-05-17 16:04:49 -04:00
Ossama Othman a50e6e4c50 config-parser: Honor XDG_CONFIG_DIRS
This set of changes adds support for searching for a given config file
in the directories listed in $XDG_CONFIG_DIRS if it wasn't found in
$XDG_CONFIG_HOME or ~/.config.  This allows packages to install custom
config files in /etc/xdg/weston, for example, thus allowing them to
avoid dealing with home directories.

To avoid a TOCTOU race the config file is actually open()ed during the
search.  Its file descriptor is returned and stored in the compositor
for later use when performing subsequent config file parses.

Signed-off-by: Ossama Othman <ossama.othman@intel.com>
2013-05-14 14:36:37 -04:00
Pekka Paalanen e844bf2a58 tests: add sub-surface protocol tests
For testing the protocol behaviour only:
- linking a surface to a parent does not fail
- position and placement requests do not fail
- bad linking and arguments do fail
- passing a surface as a sibling from a different set fails
- different destruction sequences do not crash
- setting a surface as its own parent fails
- nesting succeeds

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-05-10 14:32:58 -04:00
Pekka Paalanen 2396aec684 protocol: add sub-surfaces
Add protocol for sub-surfaces, wl_subcompositor as the global interface,
and wl_subsurface as the per-surface interface extension.

This patch is meant to be reverted, once sub-surfaces are moved into
Wayland core.

Changes in v2:

- Rewrite wl_subcompositor.get_subsurface description, and move mapping
  and commit details into wl_subsurface description. Check the wording
  in wl_subsurface.set_position description.

- Add wl_subsurface.set_commit_mode request, and document it, with the
  commit_mode enum. Add bad_value error code for wl_subsurface.

- Moved the protocol into Weston repository so we can land it upstream
  sooner for public exposure. It is to be moved into Wayland core later.

- Add destroy requests to both wl_subcompositor and wl_subsurface, and
  document them. Experience has showed, that interfaces should always
  have a destructor unless there is a good and future-proof reason to not
  have it.

Changes in v3:

- Specify, that wl_subsurface will become inert, if the corresponding
  wl_surface is destroyed, instead of requiring a certain destruction
  order.

- Replaced wl_subsurface.set_commit_mode with wl_subsurface.set_sync and
  wl_subsurface.set_desync. Parent-cached commit mode is now called
  synchronized, and independent mode is desynchronized. Removed
  commit_mode enum, and bad_value error.

- Added support for nested sub-surfaces.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-05-10 14:05:59 -04:00
Kristian Høgsberg e314875d00 input: Merge wl_seat into weston_seat 2013-05-07 09:07:43 -04:00
Kristian Høgsberg 02bbabbd56 input: Rename wl_pointer to weston_pointer
This is now a weston object.
2013-05-06 22:15:05 -04:00
Kristian Høgsberg 29139d4a45 fold wl_keyboard into weston_keyboard 2013-05-06 21:40:36 -04:00
Jan Arne Petersen 62ece76b1e text: Rename text_input to wl_text_input
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-05-02 17:06:27 -04:00
Jan Arne Petersen 00191c7c4a text: Fix serial handling
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-05-02 16:41:48 -04:00
Jan Arne Petersen 78d00e45cc text: Rename text_model to text_input
Also rename text_model_factory to text_input_manager.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-05-02 16:23:35 -04:00
Jan Arne Petersen 7ef8effca5 text: Order requests and events in a nice way
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-05-02 16:23:14 -04:00
Jan Arne Petersen ece6b5af51 text: Add language and text-direction to protocol
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-05-02 16:21:18 -04:00
Giulio Camuffo 7fe01b18d8 sdk: be C++ friendly
This renames the weston_surface's private member to configure_private
and externs "C" the headers of the SDK.
2013-03-28 14:03:58 -04:00
Pekka Paalanen c3ce738653 compositor: introduce weston_surface_geometry_dirty()
Instead of directly setting the dirty flag on weston_surface geometry,
use a function for that.

This allows us to hook into geometry dirtying in a following patch.

Also add comments to weston_surface fields, whose modification causes
transform state to become outdated.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-03-18 22:19:57 -04:00
Giulio Camuffo 82cb505287 tests: attach the surface's buffer when moving it
move_client() needs to attach the buffer, even if it was attached already,
because since 184df50 configure() will be called only on newly attached
surfaces, but the one that sets the test surface position is the configure
function.
2013-03-04 12:28:42 -05:00
Kristian Høgsberg 068b61c254 compositor: Change notify_motion to take relative motion events 2013-02-28 14:57:01 -05:00
Giulio Camuffo 184df50d3e compositor: call configure on surfaces with a null buffer too
This way the shell can know when a surface has been unmapped by
checking the value returned by weston_surface_is_mapped(surface).
The configure handlers have now width and height parameters, so
they do not need anymore to check manually the buffer size.
If a surface's buffer is NULL the width and height passed to the
configure are both 0.
Configure is now only called after an attach. The variable
weston_surface.pending.newly_attached is set to 1 on attach, and
after the configure call is reset to 0.
2013-02-27 15:32:04 -05:00
Quentin Glidic f14977f854 tests: Use&Fix parallel tests
Also fix automake 1.13 support

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2013-02-22 08:35:22 -05:00
Kristian Høgsberg cb4685bbd1 Pass argc and argv to modules
This lets modules parse options from the command line.
2013-02-20 15:37:49 -05:00
Jan Arne Petersen d5a97ae053 tests: Fix text-test
Updated to changed text protocol.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-20 15:12:34 -05:00
Kristian Høgsberg a1377cf198 Add missing builddir includes for version.h
af4f2aaf19 broke this
2013-02-20 14:47:43 -05:00
Kristian Høgsberg af4f2aaf19 Install header files and pkg-config file for external modules
This patch installs the three header files that define the compositor
plugin interface as well as a pkg-config file.  This allows
building weston plugins outside the weston tree.  We currently don't make
any guarantees about the plugin API/ABI except that within a stable
branch we won't break it.
2013-02-18 15:29:35 -05:00
Jan Arne Petersen a75a789fc1 text: fix weston key bindings with input methods
Add a struct weston_keyboard, to handle the input method grab.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:02:26 -05:00
Pekka Paalanen d1c426eef7 tests: add test for buffer release event
Tests especially, that attach-attach-commit does not result in a release
of the first buffer.

Also tests, that the old buffer is released when a new buffer has been
attached, committed, and displayed (frame callback).

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-02-08 13:38:17 -05: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
Tiago Vignatti 19dadf2617 tests: Add XWayland test
By default enabled but one can disable it by passing --disable-xwayland-test
to the configure script. Also, the weston-tests-env script is trying to load
xwayland.so in either case, but it behaves resilient in the absence of that
meaning all the other tests are still going to be kicked for running.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2013-02-08 12:18:05 -05:00
U. Artie Eoff 209e8f177a tests: fix assignment typo, should be comparison
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2013-02-07 21:18:35 -05:00
Pekka Paalanen 585c27c717 tests: make signal other than ABRT a hard failure
We handle FAIL_TEST tests by simply inverting the success flag. The
problem with this is, that if a FAIL_TEST fails by a SIGSEGV, it will be
interpreted as passed. However, no code should ever cause a SEGV, or any
other signal than ABRT. And even ABRT only in the case of an assert()
that is meant to fail. We would probably need more sophistication for the
FAIL_TEST cases.

For now, just interpret any other signal than ABRT as a hard failure,
regardless whether it is a TEST or FAIL_TEST. At least segfaults do not
cause false passes anymore.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-01-24 16:24:22 -05:00
Rob Bradford c59a33a1e2 tests/setbacklight: Close filedescriptor on return paths 2013-01-10 16:07:08 -05:00
Kristian Høgsberg e565b40569 tests: Pass --backend so the test suite runs with the right modules
Without this we try to load the installed backends, which is nasty for
regular runs, and just doesn't work for make distcheck, which sets
prefix to $PWD/_inst.  This makes sure we load the right backend
and make distcheck pass.  Other modules (xwayland, shells etc) just don't
get loaded for distcheck and for make check we still try to load the
installed modules.
2012-12-14 16:34:00 -05:00
Pekka Paalanen d56d4d5f44 tests: remove test logs on 'make clean'
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-12-13 13:10:06 -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
Pekka Paalanen 07921d791a tests: set client log handler
Otherwise we cannot normally see protocol errors etc. in the test
output.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-12-12 10:38:48 -05:00
Pekka Paalanen c660821918 update git ignores
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-12-12 10:38:45 -05:00
Pekka Paalanen fd51796094 tests: write logs to files
This cleans up the 'make check' output considerably. When all goes well,
you will only see the "PASS" line for each of $TESTS.

Weston logs into a separate file than stdout and stderr, so server logs
end up in one file per test, and other output to another file per test.

'make distclean' does not remove the tests/logs/ directory.

Also changes the weston-tests-env interpreter to bash, since I think &>
and ${1/.la/.so} might be bashisms.
2012-12-12 10:38:38 -05:00
Kristian Høgsberg 15be01ebe6 tests: Convert remaining module tests to not use test-runner.c
The remaining module tests don't need to fork and talk to a test client,
so just convert them to regular modules and let them handle running their
tests themselves.  Then drop test-runner.[ch].
2012-12-11 23:22:16 -05:00
Kristian Høgsberg cbc35ae281 tests: Remove client-test test
This test case is the last user of the test-client code and it only
tests launching the test-client.  In other words it's a minimal test
of the framework we're dropping, so just drop this test.
2012-12-11 23:16:11 -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
Kristian Høgsberg 1f4d8e9def keyboard-test: Use wl_display_roundtrip() instead of yield()
As for button-test, a wl_display_roundtrip is sufficient here.  The
yield() between wl_test_activate_surface() and wl_test_send_key() is
also not needed, since the two requests will arrive at the server in
order, and will activate the surface first, then send a key event.
2012-12-11 22:00:54 -05:00
Kristian Høgsberg f63fab7241 button-test: Use wl_display_roundtrip instead of yield()
A round trip is sufficient here.  We need to make sure that the server
has received the wl_test request and that we've received the event
that the request triggers.  The wl_display_roundtrip() helper does
exactly that: it sends a wl_display.sync request, which will hit the
server after the wl_test requests and thus the wl_callback.done event
will come back after the server has seen all the previous requests and
after we've handled all preceeding event.
2012-12-11 21:58:22 -05:00
Kristian Høgsberg db6dc7d470 weston-test-client-helper: Use a frame callback to flush surface geometry
When moving a test surface, use a frame callback to make sure the
surface has been moved and the geometry updated.  The compositor may
delay updating the transform matrices, but once we get the frame
callback we know the surface has been repainted and the geometry
updated.
2012-12-11 21:50:14 -05:00
U. Artie Eoff 0a7d588740 tests: Convert button-test to new test extension
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=56821

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2012-12-11 15:30:40 -05:00
U. Artie Eoff 84f9db5f90 tests: Convert event-test to new test extension
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=56819

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2012-12-11 15:30:33 -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
U. Artie Eoff 617f478df3 tests: Allow weston-tests-env to process different test types
The weston-tests-env script needs to be able to handle weston
test extension style tests as well as module style tests.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2012-12-11 15:30:05 -05:00
U. Artie Eoff e491b13d0a tests: Rename weston-test to weston-tests-env
Renamed weston-test test environment script to weston-tests-env
to avoid ambiguity with weston-test.c (the weston test extension).

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2012-12-11 15:29:58 -05:00
U. Artie Eoff 65e7e7a65b tests: Define and implement a test protocol extension.
The weston test extension, called weston-test.so, can be loaded
from the "modules" configuration option on the command line
or in the .ini file.

Clients can bind to the "wl_test" interface to interact with
the weston test extension.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2012-12-11 15:29:52 -05:00
Rob Bradford 4a822495fa Move matrix.[ch] to shared
This means it can be used for the calibration tool.
2012-12-06 15:53:03 -05:00
Kristian Høgsberg f3dfe716f3 tests: Remove last GLfloat use
With the EGL/GLES2 types out of compositor.h this now fails to compile.

https://bugs.freedesktop.org/show_bug.cgi?id=57129
2012-11-14 14:42:51 -05:00
Kristian Høgsberg 128ee2c342 test-client: Make sure we process pending eevents before we verify state
Since the send-button-state request comes in on one socket and the
wayland event we're looking for comes in on another socket, the order
that we process the two in is undefined.  Thus, button-test fails
intermittently, depending on which event we process first.

We change wl_display_flush() to wl_display_roundtrip(), to make sure that
we deal with all wayland events before handling test protocol requests.
2012-10-21 22:30:26 -04:00
John Kåre Alsaker 011a1ce350 Remove some dead code. 2012-10-16 11:29:10 -04:00
Kristian Høgsberg d1ecb284ba tests: Update tests to new APIs 2012-10-11 10:07:31 -04:00
John Kåre Alsaker 71c474416a tests: Remove GLfloat usage. 2012-10-04 12:28:04 -04:00
U. Artie Eoff 840d5f975b tests: add keyboard test
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2012-10-04 11:40:57 -04:00
U. Artie Eoff 58990cae31 tests: add button test
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2012-10-04 11:40:04 -04:00
U. Artie Eoff d690175a22 tests: test surface to/from global functions
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2012-10-04 11:39:59 -04:00
U. Artie Eoff 1ae298f9d9 event-test: more aggressive event testing
Test surface pointer enter/leave/motion and surface leave/enter
events more aggressively.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2012-10-04 11:39:55 -04:00
U. Artie Eoff 13dc708ab7 test-client: initialize input instance.
In seat_handle_capabilities, if input->pointer is not properly
initialized, then it will contain an arbitrary value and results
in the wl_pointer listener not getting registered if that value
is not 0/null.  Thus, use calloc to initialize the "input" instance.

This fixes https://bugs.freedesktop.org/show_bug.cgi?id=49937

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2012-09-25 11:24:49 -04:00
Ander Conselvan de Oliveira 231ba171c6 compositor: Always assign an output when updating a surface transform
Also make all the callers of weston_surface_assign_output() update the
transform instead. This makes sure that when the surface is assigned an
output its bouding box is valid.

This fixes a bug where a newly created surface would have a NULL output
assigned. This would cause weston_surface_schedule_repaint() to not
schedule a repaint, preventing the surface to be shown until something
else caused a repaint.
2012-09-14 13:43:08 -04:00
Jan Arne Petersen ce8a4433f5 text: Add support for control keys to the protocol
Add key event to the text_model interface and a key request to the
input_method_context interface. Implement it in the example editor
client and the example keyboard.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2012-09-12 16:52:41 -04:00
Jan Arne Petersen e202bae9d3 text: Add delete_surrounding_text to protocol
Add delete_surrounding_text event in the text_model interface and the
request in the input_method_context interface. Implement it in the
example editor client and in the example keyboard so that the backspace
key works with it.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2012-09-12 16:51:08 -04:00
Jan Arne Petersen 4c26518ad1 text: Remove surface arg in create_text_model
Remove the wl_surface argument from create_text_model request. The
wl_surface is specified as an argument in the activate request instead.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2012-09-12 16:28:04 -04:00