Commit Graph

81 Commits

Author SHA1 Message Date
Pekka Paalanen dd13498862 tests: migrate linux-explicit-synchronization
Moved to the new test harness.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-01-30 10:10:35 +00:00
Pekka Paalanen 701676d8c6 tests: migrate client tests
This migrates all the client tests that have nothing special in them to the new
test harness.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-01-30 10:10:35 +00:00
Pekka Paalanen 3fb67936a9 tests: migrate devices
The devices test was actually using the defaults instead of
weston-test-desktop-shell in meson.build, so this patch keeps it that way.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-01-30 10:10:35 +00:00
Pekka Paalanen af18eb0b5c meson: remove tests_weston_plugin
All plugin tests have been converted to the new harness, so the old definition
can be removed.

The one remaining test surface-screenshot is a manual test, the plugin only
installs a debug key binding. Hence it is open-coded as a normal plugin, not as
a test.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-01-30 10:10:35 +00:00
Pekka Paalanen 99c536db91 tests: migrate surface, surface-global
These are normal plugin tests, moved to the new harness.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-01-30 10:10:35 +00:00
Pekka Paalanen 9615ad8b91 tests: migrate internal-screenshot
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-01-30 10:10:35 +00:00
Pekka Paalanen 431ec067cb tests: migrate ivi-shell-app
Moving to the new test harness.

Carrying the test ini file still just to keep it the same even though I
accidentally noticed the test succeeds also with --no-config.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-01-30 10:10:35 +00:00
Pekka Paalanen ad1a4102fe tests: migrate ivi-layout-internal
Moving to the new harness.

It would be possible to convert every case here into a separate PLUGIN_TEST,
but I did not see the value in that at this time.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-01-30 10:10:35 +00:00
Pekka Paalanen 7f840b721a tests: migrate ivi-layout-test
The ivi-layout-test comprises of two halves: the client and the plugin. This
migrates the test to the new test harness.

In the old harness, the plugin was built as the test in meson.build and it fork
& exec'd the client part. In the new harness client tests start from the client
program which sets up the compositor in-process, so now the client is built as
the test in meson.build and the plugin is just an additional file.

Therefore there is not need for the plugin for fork & exec anything anymore, so
all that code is removed.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-01-30 10:10:34 +00:00
Pekka Paalanen 57a4508ee4 tests: migrate string and vertex-clip
These are the only remaining standalone non-ZUC tests. They do not need any
changes to be built with the new harness - in fact they have already been
running through the new harness.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-01-30 10:10:34 +00:00
Pekka Paalanen 82dd6ce830 tests: stop relying on environment in the new harness
Instead of relying on Meson setting up environment so that Weston and tests
find all their files, build those values into the tests. This way one can
execute a test program successfully wihtout Meson, simply by running it.

The old environment variables are still honoured if set. This might change in
the future.

Baking the source or build directory paths into the tests should not regress
reproducible builds, because the binaries where test-config.h values are used
will not be installed.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-01-30 10:10:34 +00:00
Pekka Paalanen babb3b3bc2 tests: thread-based client harness
This replaces the old test harness with a new one.

The old harness relied on fork()'ing each test which makes tests independent,
but makes debugging them harder. The new harness runs client code in a thread
instead of a new process. A side-effect of not fork()'ing anymore is that any
failure will stop running a test series short. Fortunately we do not have any
tests that are expected to crash or fail.

The old harness executed 'weston' from Meson, with lots of setup as both
command line options and environment variables. The new harness executes
wet_main() instead: the test program itself calls the compositor main function
to execute the compositor in-process. Command line arguments are configured in
the test program itself, not in meson.build. Environment variables aside, you
are able to run a test by simply executing the test program, even if it is a
plugin test.

The new harness adds a new type of iteration: fixtures. For now, fixtures are
used to set up the compositor for tests that need a compositor. If necessary, a
fixture setup may include a data array of arbitrary type for executing the test
series for each element in the array. This will be most useful for running
screenshooting tests with both Pixman- and GL-renderers.

The new harness outputs TAP formatted results into stdout. Meson is not
switched to consume TAP yet though, because it would require a Meson version
requirement bump and would not have any benefits at this time. OTOH outputting
TAP is trivial and sets up a clear precedent of random test chatter belonging
to stderr.

This commit migrates only few tests to actually make use of the new features:
roles is a basic client test, subsurface-shot is a client test that
demonstrates the fixture array, and plugin-registry is a plugin test. The rest
of the tests will be migrated later.

Once all tests are migrated, we can remove the test-specific setup from
meson.build, leaving only the actual build instructions in there.

The not migrated tests and stand-alone tests suffer only a minor change: they
no longer fork() for each TEST(), otherwise they keep running as before.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-01-30 10:10:34 +00:00
Pekka Paalanen 1f3615f3cc tests: test-runner needs wayland-client
weston-test-runner.h includes wayland-util.h, therefore it needs
wayland-client. A partial dependency with just compile_args might have been
enough as it does not seem to use functions from wayland-util.c, but safer this
way and no harm.

Fixes: https://lists.freedesktop.org/archives/wayland-devel/2020-January/041149.html

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-01-27 12:15:20 +02:00
Pekka Paalanen 9722ac62f0 tests: surface-screenshot needs libshared
surface-screenshot-test.c uses file_create_dated() provided by libshared, so it
needs to link libshared.

This was not a problem when unresolved symbols during build were allowed and
the symbols was provided by the weston executable which accidentally exported
all libshared symbols. This would become a problem when we disallow unresolved
symbols project-wide, so fix it.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-10-24 13:40:51 +03:00
Pekka Paalanen 8e7f9501e4 Link Weston plugins to libexec-weston.so
All these plugins use symbols that were exported by the weston executable and
are now exported by libexec-weston.so. Linking these to libexec-weston.so fixes
unresolved symbols.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-10-24 13:40:51 +03:00
Pekka Paalanen 71ff95a544 build: separate deps for int and ext libweston users
We have two kinds of libweston users: internal and external. Weston, the
frontend, counts as an external user, and should not have access to libweston
private headers. The shell plugins are external users as well, because we
intend people to be able to write them. Renderers, backends, and some plugins
are internal users who will need access to private headers.

Create two different Meson dependency objects, one for each kind.

This makes it less likely to accidentally use a private header.

Screen-share is a Weston plugin and therefore counts as an external user, but
it needs the backend API to deliver input. Until we are comfortable exposing
public API for that purpose, let it use internal headers.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-10-24 13:29:33 +03:00
Pekka Paalanen 4f5e360180 build: simplify include_directories
Define common_inc which includes both public_inc and the project root directory.
The project root directory will allow access to config.h and all the shared/
headers.

Replacing all custom '.', '..', '../..', '../shared' etc. include paths with
common_inc reduces clutter in the target definitions and enforces the common
 #include directive style, as e.g. including shared/ headers without the
subdirectory name no longer works.

Unfortunately this does not prevent one from using private libweston headers
with the usual include pattern for public headers.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-10-04 17:14:22 +03:00
Pekka Paalanen b6c7a3020c build: use dependency for matrix.c
matrix.c needs to be built differently for a test program vs. everything else,
so it cannot be in a helper lib. Instead, make a dependency object for it for
easy use which always gets all the paths correct automatically.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-10-04 15:55:55 +03:00
Pekka Paalanen 644eb64a5d tests: build setbacklight
Was missed in the Meson migration.

This is built only if DRM-backend is built, because it exercises a sub-feature
of the DRM-backend.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-05-16 13:32:34 +01:00
Pekka Paalanen 4e952328ca build: turn vertex-clipping.c into a dependency
Making this into a dependency object not only carries the .c files with it, but
it also brings the include directories as well, which means the users can
simply use the object without guessing the paths.

This should help with moving GL-renderer into a new subdirectory.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-04-18 12:50:55 +03:00
Pekka Paalanen ecbdcfd373 Rename zalloc.h to libweston/zalloc.h
It is a public installed header used by libweston.h.

See "Rename compositor.h to libweston/libweston.h" for rationale.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-04-18 12:31:46 +03:00
Pekka Paalanen 96dc449259 Rename matrix.h to libweston/matrix.h
matrix.h is a public installed header and even used by libweston.h.

See "Rename compositor.h to libweston/libweston.h" for rationale.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-04-18 12:31:46 +03:00
Pekka Paalanen c58648b0df meson: IVI plugin tests do not use config
If Weston is not installed, running ivi-layout test would fail on lots of image
files not found which presumably causes the creation of some ivi surfaces to
fail, leading to an assert failure.

Looking at the test setup in weston-tests-env, these IVI plugin tests are
supposed to run with --no-config instead.

Fixes: https://gitlab.freedesktop.org/wayland/weston/issues/195

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-02-15 19:21:26 +00:00
Pekka Paalanen fcd9f67467 meson: set WESTON_DATA_DIR for tests
It seems WESTON_DATA_DIR was missed. If you have already installed Weston, then
the files will be found in the install location, but if not, they were not
found at all.

This caused the xwayland test to SEGV the compositor in
weston_wm_window_create_frame() when frame_crate() returned NULL.

This patch fixes the test suite only.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-02-15 19:21:26 +00:00
Alexandros Frantzis c715c750f6 tests: Add tests for per commit zwp_buffer_release_v1 behavior
Add tests to check that the zwp_buffer_release_v1 events are emitted per
surface commit.

To be able to test this we need to use a renderer that holds the buffer
until the next buffer is committed, hence we use the pixman renderer.

Changes in v7:
  - Remove references to obsolete noop-hold renderer.

Changes in v5:
  - Meson support.

Changes in v4:
  - Use the pixman renderer instead of the (now gone) noop-hold
    renderer.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
2019-02-06 12:21:56 +00:00
Alexandros Frantzis 27d7c395c7 libweston: Introduce zwp_linux_explicit_synchronization_v1
Introduce support for the zwp_linux_explicit_synchronization_unstable_v1
protocol with an implementation of the zwp_linux_explicit_synchronization_v1
interface.

Explicit synchronization provides a more versatile notification
mechanism for buffer readiness and availability, and can be used to
improve efficiency by integrating with related functionality in display
and graphics APIs.

In addition, the per-commit nature of the release events provided by
this protocol potentially offers a solution to a deficiency of the
wl_buffer.release event (see
https://gitlab.freedesktop.org/wayland/wayland/issues/46).

Support for this protocol depends on the capabilities of the backend, so
we don't register it by default but provide a function which each
backend will need to call. In this commit only the headless backend when
using the noop renderer supports this to enable testing.

Note that the zwp_surface_synchronization_v1 interface, which contains
the core functionality of the protocol, is not implemented in this
commit. Support for it will be added in future commits.

Changes in v7:
  - Added some information in the commit message about the benefits of
    the explicit sync protocol.

Changes in v6:
  - Fall back to advertising minor version 1 of the explicit sync protocol,
    although we support minor version 2 features, until the new
    wayland-protocols version is released.

Changes in v5:
  - Meson support.
  - Advertise minor version 2 of the explicit sync protocol.

Changes in v4:
  - Enable explicit sync support in the headless backend for all
    renderers.

Changes in v3:
  - Use wl_resource_get_version() instead of hardcoding version 1.
  - Use updated protocol interface names.
  - Use correct format specifier for resource id.
  - Change test name to 'linux-explicit-synchronization.weston'
    (s/_/-/g).

Changes in v2:
  - Move implementation to separate file so protocol can be registered
    on demand by backends.
  - Register protocol in headless+noop backend for testing purposes.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
2019-02-06 12:21:56 +00:00
Pekka Paalanen 917ecfcb04 meson: better error for test-junit-xml dep
Helps people avoid libxml if they... want to?

Signed-off-by: Pekka Paalanen <pq@iki.fi>
2019-01-09 10:52:10 +00:00
Pekka Paalanen 5605b72e00 meson: better error for tests missing libX11
Helps people avoid libX11 at the cost of disabling Xwayland support.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
2019-01-09 10:52:10 +00:00
Pekka Paalanen 91bf16be7d tests: remove remnants of buffer-count test
The buffer-count test was added in
40c0c3f91e and removed in
4938f93f57, but the removal left around
the dependency to EGL headers in weston-test.c.

Removal of those unneeded includes allows us to drop the EGL dependency
completely from weston-test.c build.

For the Meson build this means that there are no dependency('egl')
directives anymore without the user friendly error message.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
2019-01-07 15:04:21 +02:00
Greg V 0f0409835d build: add missing wayland-client dep in meson
Tests library requires Wayland headers to build.

Signed-off-by: Greg V <greg@unrelenting.technology>
2018-12-20 18:37:34 +00:00
Daniel Stone 8011b0fa03 Add Meson build system
Meson is a build system, currently implemented in Python, with multiple
output backends, including Ninja and Make. The build file syntax is
clean and easy to read unlike autotools. In practise, configuring and
building with Meson and Ninja has been observed to be much faster than
with autotools. Also cross-building support is excellent.

More information at http://mesonbuild.com

Since moving to Meson requires some changes from users in any case, we
took this opportunity to revamp build options. Most of the build options
still exist, some have changed names or more, and a few have been
dropped. The option to choose the Cairo flavour is not implemented since
for the longest time the Cairo image backend has been the only
recommended one.

This Meson build should be fully functional and it installs everything
an all-enabled autotools build does. Installed pkg-config files have
some minor differences that should be insignificant. Building of some
developer documentation that was never installed with autotools is
missing.

It is expected that the autotools build system will be removed soon
after the next Weston release.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Co-authored-by: Pekka Paalanen <pq@iki.fi>
Signed-off-by: Pekka Paalanen <pq@iki.fi>
2018-12-09 14:50:54 +02:00