Commit graph

825 commits

Author SHA1 Message Date
Robert Mader
68aed0775e tests: client-buffer: Remove llvmpipe workarounds
The issue were fixed in
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34775

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-05-15 15:08:18 +03:00
Leandro Ribeiro
3187999208 tests: add color-math-test
This tests a few mathematical operations that are common to color work.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-05-13 17:36:52 +03:00
Erico Nunes
14d95cd6ce tests: client-buffer: Support must pass list per renderer
This test has only supported the GL renderer, with a must pass list of
formats which matches what the GL renderer advertises and supports.
This commit prepares the test to support other renderers by moving the
must pass list to the test setup declaration, so that it can be defined
per renderer. This is in preparation to add more renderers here as a
followup.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-05-13 17:08:52 +03:00
Erico Nunes
6f6576dec2 tests: client-buffer: Add arguments to fixture setup
Prepare to add more multiple renderer options.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-05-13 17:08:52 +03:00
Erico Nunes
0c84f990d6 tests: output-decorations: Add arguments to fixture setup
Prepare to add more multiple renderer options.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-05-13 17:08:52 +03:00
Marius Vlad
35da5ca5a6 xdg-client-helper: Use a default WINDOW size value
If the shell doesn't provide a configure size, use a default one.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-05-06 15:30:37 +03:00
Marius Vlad
7bb9fc5b62 weston-test-client-helper: Move helpers into weston-test-client-helper
As we can re-use this for other tests make them available.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-05-06 15:27:58 +03:00
Marius Vlad
1296690ede weston-test-client-helper: Use the helper already avaible
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-05-06 15:27:58 +03:00
Marius Vlad
3b7d29f871 tests: Add xdg-client-helper library
And make use of it in kiosk-shell-test. There's no functional change,
this is for other shells to re-use the code here.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-05-06 15:27:58 +03:00
Pekka Paalanen
e57eb5b15d tests: return status from each test definition
Add a status return value to every test definition. There are no
behavioral changes, previously the RESULT_OK was simply assumed.

The benefit of this is that in the future individual tests can also
return RESULT_SKIP, so that we can keep statistics of skipped tests.

ivi-layout-internal-test.c has the only case where a test function may
return early. That one is set to return RESULT_HARD_ERROR to match the
compositor exit code already there.

Also documentation is updated.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-04-30 15:07:35 +03:00
Robert Mader
303d88448a tests: client-buffer: Add dmabuf support
Using the udmabuf allocator which is usually available these days,
both on CI runners and dev mashines. The buffers have the the same
content are tested against the same reference images as in the shm
case.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-04-30 11:39:25 +02:00
Robert Mader
33db73f134 tests: client-helper: Add dmabuf protocol support
Allow querying supported formats and modifiers.
We use version 3 as it is easier to implement and also works
if no main device is present - such as when using llvmpipe.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-04-30 11:13:06 +02:00
Robert Mader
cd35c6c780 gl-renderer: Add YUV422 and YVU422 to yuv_formats
So we can test them on CI. For completeness and because they
are commonly used by SW decoders.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-04-30 11:13:06 +02:00
Robert Mader
d6f1b2a6a4 tests: client-buffer: Preparations for dmabuf support
Add stride alignment support make various cleanups in
order to support both shm and dmabufs. No changes in
test results intended.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-04-30 11:13:06 +02:00
Robert Mader
9f0ac15ce6 tests: Rename shm-buffer to client-buffer
In preparation to also test dmabufs.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-04-30 11:12:38 +02:00
Leandro Ribeiro
52262cb06c shared: add weston_assert_uint32_lt_or_eq()
This will be useful in the next commits.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-04-10 12:43:00 +00:00
Leandro Ribeiro
cb43a086b5 frontend: improve error message
We have the following error message in parse_color_characteristics():

name=%s: reserved name. Do not use ':' character in the name.

It gets confusing when "name" ends with ':'. So rephrase it to clarify
the error message in such case.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-04-03 17:50:02 +03:00
Pekka Paalanen
d3561621e3 tests: change BPC to weston_mat4f
Stop using weston_matrix.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-04-01 15:59:54 +03:00
Pekka Paalanen
adfe772db2 tests: replace lcmsMAT3 with weston_mat3f
Replace an ad hoc 3x3 matrix, that was supposed to match LittleCMS matrix
but did not, with our new consistent weston_mat3f API.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-04-01 15:59:54 +03:00
Pekka Paalanen
3fefb5ba44 libweston, clients, tests: implement weston_matrix in terms of weston_mat4f
This converts weston_matrix and weston_vector to use linalg-types
internally. All direct accesses to members had to be converted
everywhere, mostly in the simplest form possible which leaves some
trivially reducable code around.

The intention is that we can now gradually migrate away from
weston_matrix in the future.

Look like one trailing space got accidentally annihilated in
compositor.c.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-04-01 15:59:54 +03:00
Pekka Paalanen
92d7caa767 tests: add linalg-3 test cases
These are the same as linalg-4 cases, except the matrices have been
generated anew, and checked with Octave that the condition numbers and
determinant values hold.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-04-01 15:59:54 +03:00
Pekka Paalanen
2bbd2e4364 tests: add linalg-4 tests
Ensure our basic computations are correct.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-04-01 15:59:53 +03:00
Loïc Molinari
6bbc6c1256 gl-renderer: Fix SHM RGB888 and BGR888 endianness
The 24 bpp RGB and BGR SHM formats are meant to be stored little
endian, not big endian.

Fixes a regression in commit 815ccaff.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2025-04-01 12:31:51 +02:00
Pekka Paalanen
fbf026653b color-lcms: cmsMAT3 is row-major after all
Found out in https://github.com/mm2/Little-CMS/issues/483

This should be a complete no-op change, but there is one difference.
Previously matrix_inf_norm() summed over rows. Now it sums over columns
as it should be. This shouldn't hurt because it is only used to identify
identity matrices. The bug was actually in is_identity_matrix_stage()
because it deliberately passed what was assumed to be a transpose of the
matrix.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-03-25 08:40:32 +00:00
Pekka Paalanen
a97ccc4a1a tests: add idalloc
Get the realloc() code path executed.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-03-03 15:05:30 +02:00
Loïc Molinari
1b7655636d tests: Don't abort on failure
Setup a custom assertion handler that increases an assertion counter
instead of aborting on failure. This allows to run all the sub tests
defined for a test and to correctly report which sub test failed.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2025-02-26 23:50:45 +01:00
Loïc Molinari
4134685257 tests: Remove NDEBUG catcher
NDEBUG doesn't need to be catched anymore now that the test suite
don't use libc's abort() anymore.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2025-02-26 23:50:45 +01:00
Loïc Molinari
fbe2f27915 tests: Remove zunitc testing framework
This framework isn't used anymore.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2025-02-26 23:50:45 +01:00
Loïc Molinari
9373e76655 shared: Rename NULL and not NULL pointer assertions
Make the NULL assertions more explicit.

weston_assert_ptr_is_null() -> weston_assert_ptr_null()
weston_assert_ptr()         -> weston_assert_ptr_not_null()

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2025-02-26 23:50:45 +01:00
Loïc Molinari
c855bc7af0 tests: Port all test clients to the new test asserts
This commit gets rid of libc's abort() usage in the test suite using
test asserts instead.

Asserts run in the server as plugins aren't converted because they are
shared between server and client.

Co-authored-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2025-02-26 23:50:41 +01:00
Loïc Molinari
d92560a0e4 tests: Port config-parser test to Weston testing framework
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2025-02-26 22:50:51 +01:00
Loïc Molinari
1f169c044c tests: Port timespec test to Weston testing framework
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2025-02-26 22:50:51 +01:00
Loïc Molinari
12819c4151 shared: Let bit asserts take a bit instead of a position
It's much more common to have bits defined as enums than having a
position, so let's just directly take a bit as argument to the bit
asserts. For the few cases where only the position is available, it's
easy to get the right bit using a shift.

The is_pow2_64() helper functions have been added in order to validate
the bit passed as argument and prevent programming errors.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2025-02-26 22:50:51 +01:00
Loïc Molinari
57c3cee7ed tests: Add test asserts based on new Weston assert system
This commit introduces various Weston based asserts for the testing
framework. The goal is to ease test writing and improve readability.

Using custom asserts instead of relying on libc's assert() will also
help providing NDEBUG builds. This is currently not possible because
setting NDEBUG would disable all the asserts in the tests.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2025-02-26 22:50:51 +01:00
Robert Mader
9124a98aec color: update color-management protocol to wp-v1
For a list of changes that got squashed into this commit see
https://gitlab.freedesktop.org/rmader/weston/-/commits/color-management-protocol-wp-v1-bkp

Co-authored-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Signed-off-by: Robert Mader <robert.mader@collabora.com>
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-02-26 10:09:43 -03:00
Loïc Molinari
dd66debd46 tests: Add tests for RGB wl_shm format variants
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2025-02-17 15:54:52 +00:00
Loïc Molinari
d254cb14fc tests: Rename yuv-buffer test to shm-buffer
Next commit will add tests for RGB formats.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2025-02-17 15:54:52 +00:00
Loïc Molinari
89e20bcda6 tests: Add support and tests for 16-bit YUV wl_shm format variants
Fixes the offset issue in gl_renderer_attach_shm().

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2025-02-17 15:54:52 +00:00
Loïc Molinari
73d6c2cc85 tests: Add tests for swizzled YUV wl_shm format variants
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2025-02-17 15:54:52 +00:00
Loïc Molinari
ad85a4a2d1 tests: Ensure wl_shm format support before testing
Tests shouldn't fail on platforms lacking support for a particular
format.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2025-02-17 15:54:52 +00:00
Robert Mader
6394f7d1ca Set default YUV color coefficients and range to BT.709/limited
As most SDR video content uses that instead of BT.601. Crucially, most
KMS drivers use BT.709 as the default for the COLOR_ENCODING value,
making it the effective default for hardware planes we used before we
started setting an explicit value.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-02-04 12:36:12 +00:00
Leandro Ribeiro
c01a1f7c64 tests: add color-management tests for the parametric interface
This adds tests to create image descriptions through color parameters
using the CM&HDR protocol extension.

The code for that was added in commit "color: allow clients to create
image description from parameters".

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-01-20 09:30:46 +00:00
Leandro Ribeiro
06e1241948 color: allow clients to create image description from parameters
Commit "color: add support to the color-management protocol" added
support for the majority of the interfaces from the color-management
protocol.

The missing part was the interface that allows clients to create image
descriptions from parameters. In this patch we do that.

For now this just exercises the mechanical aspects of the protocol, we
still need to write the code to create proper color profiles from that
and make use of them in our codebase.

In the next commits we add a new test file with lots of tests exercising
the creation of image descriptions through parameters.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-01-20 09:30:46 +00:00
Marius Vlad
207fed2710 Revert "shared/helpers.h: Migrate helpers.h to libweston"
This is problematic as we don't have namespacing for these and some of
the macros can interfere with other defines.

This reverts commit 8634c7e349.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-01-17 10:18:26 +02:00
Gyeyoung Baek
483a5a73cb clients/ivi-shell-user-interface.c: Add 'command' config
Previously, commands could only be specified by their path,
so it was not possible to pass arguments.
Use the 'command' config first,
and if it is NULL, fall back to the existing 'path' config.

Signed-off-by: Gyeyoung Baek <gyeyoung976@gmail.com>

Co-authored-by: Michael Olbrich <m.olbrich@pengutronix.de>
2024-12-04 12:36:20 +00:00
Tomek Bury
67253b30e8 tests: fix test build error on older Linux
The linux/input-even-codes.h was split from linux/input.h but it's still
included from linux/input.h

Signed-off-by: Tomek Bury <tomek.bury@gmail.com>
2024-12-03 21:50:33 +00:00
Marius Vlad
8634c7e349 shared/helpers.h: Migrate helpers.h to libweston
As weston_windowed_output_get_api needs ARRAY_LENGTH() move helpers to a
libweston/ so other users can re-use that instead of re-defining these
all over. Easier for other front-ends to make use of them.

With this change windowed-output-api.h also includes the helpers header.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-11-25 11:26:35 +00:00
Tomek Bury
c313543364 tests: fix build warnings when backend-drm is not enabled
Signed-off-by: Tomek Bury <tomek.bury@gmail.com>
2024-11-20 12:10:57 +00:00
James Le Cuirot
9a536962a5
tests: Make some tests dependent on the shell-desktop option
The internal-screenshot and text tests are dependent on the feature and
fail with it disabled.

Signed-off-by: James Le Cuirot <chewi@gentoo.org>
2024-10-14 22:47:13 +01:00
James Le Cuirot
486d96a162
tests: Make the kiosk test dependent on the shell-kiosk option
The test is dependent on the feature and fails with it disabled.

Signed-off-by: James Le Cuirot <chewi@gentoo.org>
2024-10-14 22:46:34 +01:00