Commit Graph

119 Commits

Author SHA1 Message Date
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