I was doing
$ mseon setup --wipe
$ meson test
and hit
../../git/weston/tests/constraints-test.c:31:10:
fatal error: pointer-constraints-unstable-v1-client-protocol.h:
No such file or directory
31 | #include "pointer-constraints-unstable-v1-client-protocol.h"
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
In function ‘encode_PAM_comment_line’,
inlined from ‘write_PAM_image_rgba’ at ../../git/weston/tests/surface-screenshot-test.c:85:9,
inlined from ‘trigger_binding’ at ../../git/weston/tests/surface-screenshot-test.c:202:8:
../../git/weston/tests/surface-screenshot-test.c:44:22: error: ‘desc’ may be used uninitialized [-Werror=maybe-uninitialized]
44 | size_t len = strlen(comment);
Fixes: d40af215a3
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
We may break out of the loop if wl_display_dispatch(client->wl_display)
fails and returns -1. So we need to assert that info->done is true after
the loop.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
We've just added support for grayscale output color effect. This adds
test cases for that.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
struct weston_curtain_params is changed to match the new
weston_surface_set_label() API. For now, I did not bother hooking up the
static label flavor.
Part of migration away from get_label().
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
On the quest to delete the get_label() vfunc completely, a temporary
default get_label implementation needs to be plugged in. This would
affect all the code that checks whether the get_label vfunc is NULL.
Let's make get_label vfunc non-NULL always intentionally first. We can
delete all the code that checked for NULL, and the bespoke label
replacements in that case. Now all those different "no label" cases are
unified.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Just for completeness sake, let's commit the image description. This
should poke at the surface state machinery with the image description.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Enhancing the color-manager machinery in the client library to suffice
for color-management-test.c as well, we can remove a copy of the
boilerplate code.
The changes include renaming things, moving parameters from
image_description to image_description_info, deleting the list of image
descriptions and cleaning them up explicitly, and creating the
color-management surface and output objects on-demand.
image_description_get_information() explicitly waits for the done event
instead of relying on a ropund-trip.
Bit operations got helper functions. Gamut parameter printing was
re-written.
In spite of the massive changes, the tests themselves still work exactly
the same.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Turns out that the fail-case code does everything the good-case code
does and more, so we can reduce the code duplication.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
There are two partial implementations of the color-manager
protocol boilerplate, in color-management-test.c and
color-management-parametric-test.c. This patch moves the implementation
from the latter into the client library, and uses the helper bit().
This paves way for moving the other partial implementation as well,
de-duplicating the overlapping code, and allowing new test programs to
poke at color-manager.
The color-manager is initialized on-demand, because mosts tests in the
suite do not need it. This avoids a little of unnecessary work.
In anticipation of wp_color_management_v1 version 2, the interface
version is explicit and ensured.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
weston-test-client-helper.h includes all these generated header files. I
could not figure out what might guarantee that these headers are
generated before compiling anything that includes
weston-test-client-helper.h, maybe we are simply lucky. I could not make
the build fail by building a single test program from a clean builddir.
Yet, this seems like the right thing to do.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
There is no need to special-case this generated header in foreach-tests
if we list it as an order-only dependency implied by dep_test_client.
The viewporter header is already there.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
xdg-client-helper is already built into the dep_test_client library,
there is no need to add the sources again.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
A minor simplification to tests/meson.build. The disabler object
prevents the test from being built or run.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
It was getting difficult to see which files were part of the test
harness and which were actual tests. Moving the harness sources into a
subdirectory helps to see at a glance what is what, and will allow using
shorter file names in the future.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Since commit "xdg-shell: handle xdg_wm_base being destroyed before its
children", we raise a protocol error DEFUNCT_SURFACES for misbehaved
clients.
This adds a test to ensure that DEFUNCT_SURFACES is being posted for
such clients.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
There's no need to use the desktop-shell if the purpose of these tests
is to test our xdg-shell implementation.
In the next commits it will be important to have a simpler shell to
work with, as we'll introduce additional tests for xdg-shell that
trigger leaks that are hard to fix with the desktop-shell.
So let's change this test file to use SHELL_TEST_DESKTOP.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
So far we have had two ways of identifying a weston_surface: by its
memory address "%p", and by its get_label function. The memory address
is not human-friendly and can get recycled. get_label() is not unique,
and in some cases it is client-controllable.
Oh, we also have the protocol object ID, but that does not exist for
internally created weston_surfaces.
We also have weston_surface::s_id, damage_track_id and flow_id. These
are used by some Perfetto instrumentation. s_id comes from a
compositor-wide counter rather than per-client counter, the others are
probably not what I'm looking for.
None of these are really nice for trace and debug prints for identifying
surfaces for human reading. Therefore, let's add one more ID, and with
it, a nice name for each surface.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
GCC 14.2 UBSan complained:
../../git/weston/tests/ivi-layout-test-plugin.c:73:15: runtime error:
load of address 0x7fbfd8d70ec0 with insufficient space for an object of
type 'const struct runner_test'
By printing the addresses, I concluded that the mentioned address is the
second element in the plugin_test_section. I guess UBSan believes that
only the first element exists. Why not, what's to tell what data
actually is inside the section or where it actually ends.
Strangely though, we use the exact same section trick in
weston-test-runner.c to iterate through all tests, and that one is
apparently fine. One difference is that weston-test-runner is built as a
static_library() while ivi-layout-test-plugin.c is a shared_library().
Anyway, ivi-layout-test-plugin is unlikely to see any development, so
let's just fix the problem in an ugly way, and get rid of the section
trickery. If someone were to add a new RUNNER_TEST() instance and forget
to add the magic into the index, the compiler would greet them with a
defined-but-not-used error.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
{width,height}_from_buffer include the transformations from set_buffer_transform
and set_buffer_scale.
Currently {width,height}_from_buffer are only updated when a commit contains a
new buffer but not for commits with only transformation changes.
If a transform/scale change is commited without new buffer, the old values
remain, which results in incorrect rendering or the client is disconnected
because weston_surface_is_pending_viewport_source_valid() fails.
Make sure to update {width,height}_from_buffer for transformation changes only
to avoid this.
Add a test to verify that the transformations are handled correctly. It is
identical to previous test, except that is spits the buffer attachment and
transformation changes into two commits. So it can reuse the existing images for
validation.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
This fixes a huge bug: we were ignoring the return value from
verify_screen_content(), which meant that tests were always passing.
Also, this adds tests for single-pixel solid color buffers, which are
useful to verify that color effects are actually applied in such cases.
Renderers (as the GL-renderer) may simply use glClear() instead of going
through the full rendering pipeline when drawing solid colors, and we
need to ensure that color effects are applied in those cases as well.
Besides that, some refactoring was done to improve the code.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This seems to cause a lot of stir in CI as it was failing for half of the
time.
Mark the test as succeeding for now and include the Mesa assert crash to
follow-up. We use that instead of SKIP to we have
WESTON_TEST_SKIP_IS_FAILURE.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
The protocol requires clients to perform an initial commit before they
receive configure events:
> After creating a role-specific object and setting it up (e.g. by sending
> the title, app ID, size constraints, parent, etc), the client must
> perform an initial commit without any buffer attached. The compositor
> will reply with initial wl_surface state such as
> wl_surface.preferred_buffer_scale followed by an xdg_surface.configure
> event. The client must acknowledge it and is then allowed to attach a
> buffer to map the surface.
Previous to this patch various calls such as set_fullscreen() or
set_maximized() would schedule configure events, resulting in clients
being able skip the initial commit. This again made it possible to write
clients that only work on Weston, in violation of the protocol.
For xdg-popups we already tracked the initial commit status. Move it
to xdg-surface, guard schedule_configure() on it and ensure to run the
later on the initial commit.
Incorporate tests that checks if we get configure events when calling
set_fullscreen/set_maximized and tests that uses the main xdg_surface as
a parent to a sub-surface (which initially triggered this issue).
Signed-off-by: Robert Mader <robert.mader@collabora.com>
For systems where udmabuf is not available.
Fixes: 75d75ac6c (tests: Add color-representation tests for DRM and GL)
Signed-off-by: Robert Mader <robert.mader@collabora.com>
Test the various combinations of:
1. Renderer backends - currently GL only.
2. Renderer modes - plane-offloading/vkms, shaders in Mesa, internal
shaders.
3. Buffer-types - SHM and DMABuf.
4. Coefficient/range combinations.
Signed-off-by: Robert Mader <robert.mader@collabora.com>
Introduce support for the commit-timing protocol to allow applications
to attach a presentation time to a content update.
We use the repaint timer to schedule content updates in advance of
the frame time when they should be displayed.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Add a listener and a roundtrip so test clients using presentation have
access to the presentation clock id.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This fixes a bug in version 1 where we should've been giving a 0 refresh
for VRR, and introduces version 2 where we're allowed to give a compositor
chosen rate for VRR.
We currently chose the mode's native refresh rate.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
GCC 14.2 with debugoptimized build complained:
In file included from ../../git/weston/tests/weston-test-assert.h:32,
from ../../git/weston/tests/string-test.c:36:
In function ‘strtof_conversions’,
inlined from ‘wrapstrtof_conversions’ at ../../git/weston/tests/string-test.c:92:1:
../../git/weston/shared/weston-assert.h:60:12: error: ‘val’ may be used uninitialized [-Werror=maybe-uninitialized]
60 | if (!cond) \
| ^
../../git/weston/tests/weston-test-assert.h:153:34: note: in expansion of macro ‘weston_assert_’
153 | #define test_assert_f32_eq(a, b) weston_assert_(NULL, a, b, float, "%.10g", ==)
| ^~~~~~~~~~~~~~
../../git/weston/tests/string-test.c:97:9: note: in expansion of macro ‘test_assert_f32_eq’
97 | test_assert_f32_eq(val, 0.0);
| ^~~~~~~~~~~~~~~~~~
../../git/weston/tests/string-test.c: In function ‘wrapstrtof_conversions’:
../../git/weston/tests/string-test.c:94:15: note: ‘val’ was declared here
94 | float val;
| ^~~
The debug build did not complain.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
GCC 14.2 with debugoptimized build complained:
../../git/weston/tests/paint-node-test.c: In function ‘get_paint_node_status’:
../../git/weston/tests/paint-node-test.c:105:16: error: ‘changes’ may be used uninitialized [-Werror=maybe-uninitialized]
105 | return changes;
| ^~~~~~~
../../git/weston/tests/paint-node-test.c:87:39: note: ‘changes’ was declared here
87 | enum weston_paint_node_status changes;
| ^~~~~~~
The debug build did not complain.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
GCC 14.2 with debugoptimized build complained:
../../git/weston/tests/fifo-test.c: In function ‘get_surface_width’:
../../git/weston/tests/fifo-test.c:493:16: error: ‘width’ may be used uninitialized [-Werror=maybe-uninitialized]
493 | return width;
| ^~~~~
../../git/weston/tests/fifo-test.c:477:13: note: ‘width’ was declared here
477 | int width;
| ^~~~~
The debug build did not complain.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
GCC 14.2 with debugoptimized build complained:
../../git/weston/tests/client-buffer-test.c: In function ‘y_u_v_create_buffer’:
../../git/weston/tests/client-buffer-test.c:1045:33: error: ‘u_row’ may be used uninitialized [-Werror=maybe-uninitialized]
1045 | x8r8g8b8_to_ycbcr8_bt709(argb, y_row + x,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1046 | u_row + x / pixel_format_hsub(buf->fmt, 1),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1047 | v_row + x / pixel_format_hsub(buf->fmt, 1));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../git/weston/tests/client-buffer-test.c:986:18: note: ‘u_row’ was declared here
986 | uint8_t *u_row;
| ^~~~~
../../git/weston/tests/client-buffer-test.c:1045:33: error: ‘v_row’ may be used uninitialized [-Werror=maybe-uninitialized]
1045 | x8r8g8b8_to_ycbcr8_bt709(argb, y_row + x,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1046 | u_row + x / pixel_format_hsub(buf->fmt, 1),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1047 | v_row + x / pixel_format_hsub(buf->fmt, 1));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../git/weston/tests/client-buffer-test.c:987:18: note: ‘v_row’ was declared here
987 | uint8_t *v_row;
| ^~~~~
The debug build did not complain.
Even though only u_row and v_row were reported, I don't understand why
there is no warning about u_base and v_base, as they are initialized
with a similar switch. So initialize them too, just in case.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This includes a few changes, but given that we still want to bisect
things when they break I'm pulling some of the changes into a bigger change.
Here's a list of most noticeable that I had to address in order to make
this switch:
- added a PACKAGES_SPECIFIC env variable to able to pass different
packages to each version. Some packages basically changed their names
and need to pass a different name
- added USE_DEBIAN_BACKPORTS and use it when adding -backport apt
sources for each Debian version
- llvm-19 now requires some additional packages for trixie
- add imghdr for sphinx for trixie
- had to keep use_tls=0 and modified the notes to point now to Trixie
instead of Bookworm
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Add support for the fifo protocol, which allows an application to submit
a content update that can only be applied after the previous content
update has been active for a display refresh.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>