mutter/src/tests
Sebastian Wick 8677e36c4c edid: Change HDR Static Metadata luminances to be float
They are float in libdisplay-info and our own EDID parsing also returns
a float but when then converted both to an integer. Especially the min
luminance can be <1.

We also don't need a variable for indicating presence of a CTA Static
Metadata block. The values are all zero if it is absent.

Found by Dor Askayo.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3574>
2024-02-14 21:46:26 +00:00
..
clutter clutter: Make ClutterGrab a GObject 2024-02-13 12:36:26 +01:00
cogl cogl/test: Test 16bpc RGBA UNORM formats 2023-12-20 23:51:14 +00:00
dbusmock-templates tests/dbusmock-templates/rtkit: Add MakeThreadHighPriority 2023-10-11 10:23:02 -04:00
drm-mock cleanup: Switch to pragma once 2023-08-07 22:24:36 +00:00
icc-profiles tests/color: Add test for night light 2022-09-01 17:52:01 +02:00
kvm tests/kvm: Use git fetch --depth=1 2023-07-30 16:29:33 +00:00
meta-test Update license access method 2023-08-30 08:48:23 +02:00
migration tests: Expect <rate> to always have three decimal places (rounded) 2022-08-19 15:28:56 +00:00
monitor-configs monitor-unit-tests: Add basic tests for RGB range 2024-01-30 16:24:52 +00:00
mtk boxes: Move Rectangle.is_adjacent_to to Mtk 2024-01-09 18:47:34 +00:00
protocol wayland: Add wl_global filter manager 2023-02-13 15:34:24 +00:00
ref-tests tests/wayland: Add basic YCbCr ref-tests 2023-12-20 23:51:14 +00:00
share/icc tests: Add duplicate color profile test case 2022-09-15 11:22:54 +00:00
stacking tests/stacking: Add pointer rest and auto raise tests 2023-11-13 14:22:44 +00:00
wayland-test-clients wayland: Switch to stable linux-dmabuf protocol 2024-01-22 14:20:30 +00:00
anonymous-file.c tests/anonymous-file: Skip the rlimit part of the test when running CI 2020-12-03 21:39:13 +00:00
boxes-tests.c tests: Move Mtk specific tests from boxes 2023-08-30 16:46:14 +02:00
boxes-tests.h cleanup: Switch to pragma once 2023-08-07 22:24:36 +00:00
button-transform-tests.c backend: Introduce helpers for turning from/to clutter/evdev buttons 2023-10-13 16:24:43 +00:00
button-transform-tests.h backend: Introduce helpers for turning from/to clutter/evdev buttons 2023-10-13 16:24:43 +00:00
clutter-test-utils.c docs: Migrate remaining content to markdown 2024-01-09 15:23:04 +00:00
clutter-test-utils.h docs: Migrate remaining content to markdown 2024-01-09 15:23:04 +00:00
cogl-test-utils.c cogl: Port Texture* away from CoglObject 2023-10-29 21:16:24 +00:00
cogl-test-utils.h Update license access method 2023-08-30 08:48:23 +02:00
color-management-profile-conflict-test.c Update license access method 2023-08-30 08:48:23 +02:00
color-management-tests.c Update license access method 2023-08-30 08:48:23 +02:00
edid-tests.c edid: Change HDR Static Metadata luminances to be float 2024-02-14 21:46:26 +00:00
hdr-metadata-unit-tests.c tests: Add tests for HDR Static Metadata encoding/decoding and equality 2023-03-04 09:30:41 +00:00
hdr-metadata-unit-tests.h cleanup: Switch to pragma once 2023-08-07 22:24:36 +00:00
input-capture-test-client.c input-capture: Add more barrier tests, mostly for invalid barriers 2023-10-23 06:57:45 +00:00
input-capture-tests.c Update license access method 2023-08-30 08:48:23 +02:00
kms-utils-unit-tests.c backends/native: Add meta_calculate_drm_mode_vblank_duration_us() 2021-07-13 08:09:42 +00:00
logind_helpers.py tests/dbus-runner: Forward logind methods when not in KVM 2023-11-01 10:55:04 +00:00
meson.build build: Make g-ir-scanner warnings fatal when -werror is set 2024-01-17 09:26:00 +00:00
meta-backend-test.c tests: Port faked events to new constructors 2023-08-08 04:02:54 +02:00
meta-backend-test.h cleanup: Switch to pragma once 2023-08-07 22:24:36 +00:00
meta-context-test.c Update license access method 2023-08-30 08:48:23 +02:00
meta-dbus-runner.py tests: Extract D-Bus runner as reusable python module 2022-09-02 17:18:43 +00:00
meta-gpu-test.c backend: Move GPU ownership from the monitor manager to the backend 2019-06-20 13:31:55 +00:00
meta-gpu-test.h cleanup: Switch to pragma once 2023-08-07 22:24:36 +00:00
meta-kms-test-utils.c tests/kms: Use test helper for finding planes 2023-12-18 13:35:09 +00:00
meta-kms-test-utils.h tests/kms: Use test helper for finding planes 2023-12-18 13:35:09 +00:00
meta-monitor-manager-test.c monitor-config-manager: Allow backends to assign extra data 2023-12-18 13:35:09 +00:00
meta-monitor-manager-test.h cleanup: Switch to pragma once 2023-08-07 22:24:36 +00:00
meta-monitor-test-utils.c monitor-unit-tests: Add basic tests for RGB range 2024-01-30 16:24:52 +00:00
meta-monitor-test-utils.h monitor-unit-tests: Add basic tests for RGB range 2024-01-30 16:24:52 +00:00
meta-ref-test.c tests/ref-test: Inhibit direct scanout for ref-tests 2023-12-13 10:43:31 +00:00
meta-ref-test.h cleanup: Switch to pragma once 2023-08-07 22:24:36 +00:00
meta-sensors-proxy-mock.c tests: Add MetaOrientationManager tests via SensorsProxy mock 2021-09-04 10:04:00 +02:00
meta-sensors-proxy-mock.h cleanup: Switch to pragma once 2023-08-07 22:24:36 +00:00
meta-test-monitor.c tests: Add public test monitor API 2023-02-03 15:29:28 +00:00
meta-test-shell.c mutter: Completely replace MetaRectangle with MtkRectangle 2023-08-30 16:46:14 +02:00
meta-test-shell.h tests: Introduce and use a custom test shell 2023-08-16 15:34:46 +00:00
meta-test-utils-private.h cleanup: Switch to pragma once 2023-08-07 22:24:36 +00:00
meta-test-utils.c tests/test-utils: Allow calling set_custom_monitor_config outside tests 2023-12-13 10:43:31 +00:00
meta-test-utils.h tests/utils: Add helper for waiting for monitor reconfigurations 2023-11-30 12:13:26 +01:00
meta-thread-impl-test.c Update license access method 2023-08-30 08:48:23 +02:00
meta-thread-impl-test.h Update license access method 2023-08-30 08:48:23 +02:00
meta-thread-test.c Update license access method 2023-08-30 08:48:23 +02:00
meta-thread-test.h Update license access method 2023-08-30 08:48:23 +02:00
meta-wayland-test-driver.c wayland/surface: Make MetaWaylandSurface public 2023-11-04 01:12:11 +00:00
meta-wayland-test-driver.h cleanup: Switch to pragma once 2023-08-07 22:24:36 +00:00
meta-wayland-test-utils.c tests/wayland-test-utils: Keep track of process exit 2023-11-03 10:34:27 +00:00
meta-wayland-test-utils.h cleanup: Switch to pragma once 2023-08-07 22:24:36 +00:00
monitor-config-migration-unit-tests.c tests: Make tests components have ownership chains as well 2022-12-17 15:13:48 +01:00
monitor-config-migration-unit-tests.h cleanup: Switch to pragma once 2023-08-07 22:24:36 +00:00
monitor-store-unit-tests.c monitor-unit-tests: Add basic tests for RGB range 2024-01-30 16:24:52 +00:00
monitor-store-unit-tests.h cleanup: Switch to pragma once 2023-08-07 22:24:36 +00:00
monitor-transform-tests.c monitor-transform: Fix transform() and drop relative_transform() 2022-07-26 18:41:43 +00:00
monitor-transform-tests.h cleanup: Switch to pragma once 2023-08-07 22:24:36 +00:00
monitor-unit-tests.c monitor-unit-tests: Add basic tests for RGB range 2024-01-30 16:24:52 +00:00
monitor-util-tests.c Update license access method 2023-08-30 08:48:23 +02:00
mutter_dbusrunner.py tests/dbus-runner: Detect nested invocations to skip mocking 2023-11-01 10:55:04 +00:00
mutter-installed-dbus-session.py.in tests: Extract D-Bus runner as reusable python module 2022-09-02 17:18:43 +00:00
native-bezier-tests.c backends/native: Change the MetaBezier API to sampling and lookup 2024-01-05 10:21:42 +00:00
native-bezier-tests.h backends/native: Change the MetaBezier API to sampling and lookup 2024-01-05 10:21:42 +00:00
native-headless.c backends/native: Change the MetaBezier API to sampling and lookup 2024-01-05 10:21:42 +00:00
native-kms-cursor-hotplug.c monitor-manager: Reload monitor manager in idle callback 2023-11-30 12:22:52 +01:00
native-kms-device.c tests/kms: Use test helper for finding planes 2023-12-18 13:35:09 +00:00
native-kms-force-atomic-sanity.c Update license access method 2023-08-30 08:48:23 +02:00
native-kms-force-kernel-thread-sanity.c Update license access method 2023-08-30 08:48:23 +02:00
native-kms-force-simple-sanity.c Update license access method 2023-08-30 08:48:23 +02:00
native-kms-force-user-thread-sanity.c Update license access method 2023-08-30 08:48:23 +02:00
native-kms-headless-start.c mutter: Completely replace MetaRectangle with MtkRectangle 2023-08-30 16:46:14 +02:00
native-kms-hotplug.c monitor-manager: Reload monitor manager in idle callback 2023-11-30 12:22:52 +01:00
native-kms-render.c cogl: Turn CoglScanout into an object 2024-02-10 17:41:12 +00:00
native-kms-updates.c tests/kms: Use test helper for finding planes 2023-12-18 13:35:09 +00:00
native-kms.c Update license access method 2023-08-30 08:48:23 +02:00
native-persistent-virtual-monitor.c mutter: Completely replace MetaRectangle with MtkRectangle 2023-08-30 16:46:14 +02:00
native-pointer-constraints.c Update license access method 2023-08-30 08:48:23 +02:00
native-screen-cast.c Update license access method 2023-08-30 08:48:23 +02:00
native-screen-cast.h Update license access method 2023-08-30 08:48:23 +02:00
native-thread.c Update license access method 2023-08-30 08:48:23 +02:00
native-virtual-monitor.c Update license access method 2023-08-30 08:48:23 +02:00
native-virtual-monitor.h Update license access method 2023-08-30 08:48:23 +02:00
orientation-manager-unit-tests.c tests: Move monitor test utils into libmutter-test.so 2022-02-09 09:04:09 +00:00
orientation-manager-unit-tests.h cleanup: Switch to pragma once 2023-08-07 22:24:36 +00:00
README tests: Update README 2023-03-04 09:07:44 +00:00
ref-test-sanity.c tests: Make tests components have ownership chains as well 2022-12-17 15:13:48 +01:00
screen-cast-client.c Update license access method 2023-08-30 08:48:23 +02:00
service-channel-tests.c wayland/surface: Make MetaWaylandSurface public 2023-11-04 01:12:11 +00:00
stacking.test.in tests: Break up stacking installed-tests into more, smaller tests 2023-01-30 14:39:39 +00:00
stage-view-tests.c mutter: Replace cairo_rectangle_int_t with MtkRectangle 2023-08-30 16:46:13 +02:00
test-client.c tests/test-client: Use proper style for main arguments 2023-05-15 19:06:39 +02:00
test-runner.c tests/stacking: Add pointer rest and auto raise tests 2023-11-13 14:22:44 +00:00
unit-tests.c boxes: Move Rectangle.is_adjacent_to to Mtk 2024-01-09 18:47:34 +00:00
unit-tests.h cleanup: Switch to pragma once 2023-08-07 22:24:36 +00:00
wayland-client-tests.c test/wayland: Don't double-free GThreads 2023-09-01 23:17:06 +00:00
wayland-fractional-scale-test.c wayland/surface: Make MetaWaylandSurface public 2023-11-04 01:12:11 +00:00
wayland-fullscreen-test.c tests/wayland: Create native backends for KVM/tty tests 2023-12-13 10:43:31 +00:00
wayland-unit-tests.c tests/wayland: Add basic YCbCr ref-tests 2023-12-20 23:51:14 +00:00
wayland-x11-interop-tests.c tests/wayland-test-client-utils: Sync event serial in same dispatch 2023-11-03 12:02:29 +00:00
x11-compositor-checker.c tests: Add check for compositor state on XWayland startup 2023-05-15 19:05:00 +02:00
x11-test.sh tests: Use a more interoperable path to bash 2023-03-22 15:16:06 +00:00
xwayland-tests.c Update license access method 2023-08-30 08:48:23 +02:00

This directory implements a framework for automated tests of Mutter. The basic
idea is that mutter-test-runner acts as the window manager and compositor, and
forks off instances of mutter-test-client to act as clients.

There's a simple scripting language for tests. A very small test would look like:

---
# Start up a new X11 client with the client id 1 (doesn't have to be an integer)
# Windows for this client will be referred to as 1/<window-id>
new_client 1 x11

# Create and show two windows - again the IDs don't have to be integers
create 1/1
show 1/1
create 1/2
show 1/2

# Wait for the commands we've executed in the clients to reach Mutter
wait

# Check that the windows are in the order we expect
assert_stacking 1/1 1/2
---

Running
=======

The tests are installed according to:

https://wiki.gnome.org/Initiatives/GnomeGoals/InstalledTests

if -Dtests=true is passed to `meson configure`. You can run them uninstalled with:

 ninja test

Command reference
=================

The following commands are supported. Quoting and comments follow shell rules.

new_client <client-id> [wayland|x11]
 Starts a client, connecting by either Wayland or X11. The client
 will subsequently be known with the given client-id (an arbitrary
 string)

quit_client <client-id>
 Destroys all windows for the client, waits for that to be processed,
 then instructs the client to exit.

create <client-id>/<window-id> [override|csd]
 Creates a new window. For the X11 backend, the keyword 'override'
 can be given to create an override-redirect and the keyword 'csd'
 can be given to create a client-side decorated window.

show <client-id>/<window-id>
hide <client-id>/<window-id>
 Ask the client to show (map) or hide (unmap) the given window

activate <client-id>/<window-id>
 Ask the client to raise and focus the given window.

local_activate <client-id>-<window-id>
  The same as 'activate', but the operation is done directly inside Mutter
  and works for both backends

raise <client-id>/<window-id>
lower <client-id>/<window-id>
  Ask the client to raise or lower the given window ID. This is a no-op
  for Wayland clients. (It's also considered discouraged, but supported, for
  non-override-redirect X11 clients.)

minimize <client-id>/<window-id>
unminimize <client-id>/<window-id>
  Ask the client to minimize or unminimize the given window ID. This older
  term for this operation is "iconify".

destroy <client-id>/<window-id>
  Destroy the given window

wait
  Wait until all requests sent by Mutter to clients have been received by Mutter,
  and then wait until all requests by Mutter have been processed by the X server.

assert_stacking <client-id>/<window-id> <client-id>/<window-id> ...
  Assert that the list of client windows known to Mutter is as given and in
  the given order, bottom to top. The character '|' can be present in the
  list of windows to indicate the guard window that separates hidden and
  visible windows. If '|' isn't present, the guard window is asserted to
  be below all client windows.

  This function also queries the X server stack and verifies that Mutter's
  expectation of the X server stack matches reality.