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.
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.
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>
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>
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>
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>
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>
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>
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>
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>
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.
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.
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.
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>
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>
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>
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>
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.
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>