Commit graph

13 commits

Author SHA1 Message Date
Pekka Paalanen
015d73cb54 tests: bail on dispatch failure
Originally the test-asserts were abort()'ing. Then they were changed to
record the failure but not abort() anymore. These loops were missed,
accidentally turning them into endless loops on Wayland connection
failure, e.g. a protocol error.

When then loops become endless, they will repeatedly print the assertion
failure message. When run as part of the test suite via Meson, Meson
will collect all printouts in memory. Therefore the meson process will
use memory rapidly without bounds.

Break all these loops.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-12-04 18:20:27 +02:00
Pekka Paalanen
338d727d99 tests: drop EOTF from TRANSFER_FN_SRGB_EOTF
The sRGB display uses a power-2.2 transfer characteristic. These enum
values refer to the two-piece sRGB transfer function instead, so they
should not be named "EOTF".

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-03 15:47:20 +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
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
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
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
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
Joan Torres
1b793b7acd color: update color-management protocol to xx-v4
The main differences is the split of cm_surface functionality with
cm_surface and cm_feedback_surface.

There can only be one cm_surface to set, unset image descriptions. When
cm_surface is destroyed, the image description is automatically unset.

There can be multiple feedback_surfaces for one surface though.
Now the "preferred_changed" signal can be an initial event.

Creator params now have a new request: set_luminances.

Signed-off-by: Joan Torres <joan.torres@suse.com>
2024-08-07 13:36:49 +00:00
Leandro Ribeiro
f982e98954 tests: do not assume that the image description is immediately ready
This patch is for our CM&HDR protocol extension test.

According to the protocol, the compositor may take the time it needs
before sending 'ready' or 'failed' for a certain image description that
the client creates through the CM&HDR protocol extension.

In our CM&HDR tests, we are assuming that the image description would
be ready immediately. Do not assume that. Instead, let's wait until
the compositor sends one of the events ('failed' or 'ready').

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2024-04-26 12:11:17 +00:00
Pekka Paalanen
94ccce4e38 tests: replace mat2XYZ
The primaries and the white point are the fundamental definition of the
color spaces in these tests. Instead of hard-coding mat2XYZ, use
LittleCMS to derive the result from the fundamental definition.

This removes derived hard-coded constants, which is a benefit in itself.
How these constants were originally produced was not mentioned in
0c5860fafb but I was able to reproduce
them with python3:

import colour
import numpy as np
x = colour.RGB_COLOURSPACES['sRGB']
w_d50 = np.array([0.34567, 0.35850])
print(x.chromatically_adapt(w_d50, 'D50', 'Bradford'))

It's identical to 3-4 decimals of the hardcoded values, and also for
Adobe RGB. I printed the LittleCMS generated values as well, and they
are the same as with python up to roughly 4 decimals.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2024-04-19 12:19:36 +00:00
Emmanuel Gil Peyrot
677025966b tests: Call open() with the right flag
Build failed on the latest glibc (I think?), which caused this weird error:
/usr/include/bits/fcntl2.h:50:11: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT or O_TMPFILE in second argument needs 3 arguments

In these three calls, open() was being called with 'r' flag, whose hex value is
0x72, and happens to set the O_CREAT flag (0x40) which was causing this error.
The correct flag to pass is O_RDONLY.

This issue exists since the creation of that file, I’m surprised it was working
previously.

Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
2024-04-16 06:37:23 +00:00
Loïc Molinari
343adb2acd tests: Speed up runtime using immediate repaint on capture
The test suite is throttled by the headless backend repaint
timer. This commit uses the headless refresh rate option to speed up
runtime by using the immediate repaint-only-on-capture mode by
default. Tests which don't support that mode yet override the refresh
value to use the highest rate possible.

Fixes #682

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2024-02-22 14:26:32 +00:00
Leandro Ribeiro
0ade70fb6c tests: add tests for the color management protocol implementation
Exercise the color-management protocol mechanics.

This lacks a few test cases that are a bit harder to have, e.g. testing
that a bad ICC file gets rejected. In the future we plan to add them.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2024-02-14 12:13:04 -03:00