mutter/src/tests
Jonas Ådahl 8b8b06e12e tests/clutter/event-delivery: Flush input thread after events
Otherwise the test becomes flaky, due to events not having ended up on
the main thread yet.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2727>
2022-12-13 18:31:14 +00:00
..
clutter tests/clutter/event-delivery: Flush input thread after events 2022-12-13 18:31:14 +00:00
cogl cogl/pipeline/vertend/glsl: Move out unit test to its own file 2022-08-08 21:59:13 +00:00
dbusmock-templates tests/dbusmock/colord: Fix system profile D-Bus path names 2022-09-15 11:22:54 +00:00
icc-profiles tests/color: Add test for night light 2022-09-01 17:52:01 +02:00
kvm tests/kvm: Forward MUTTER_DEBUG to the virtual machine 2022-09-01 14:31:40 +00:00
meta-test Add rudimentary mode setting test 2022-01-14 09:16:09 +00:00
migration tests: Expect <rate> to always have three decimal places (rounded) 2022-08-19 15:28:56 +00:00
monitor-configs tests/monitor-unit-tests: Make serials more unique 2022-09-01 14:31:40 +00:00
ref-tests tests/wayland-fullscreen: Also test toggling fullscreen 2022-10-10 18:16:51 +00:00
share/icc tests: Add duplicate color profile test case 2022-09-15 11:22:54 +00:00
stacking tests: Ensure that restore-size resizes the client before maximize/unmaximize 2022-12-01 20:10:52 +00:00
wayland-test-clients tests: Add Wayland fullscreen test client 2022-10-10 18:16:51 +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 build: Make each executable/library have their own log domain 2022-04-29 18:58:38 +00:00
boxes-tests.h tests: Make testboxes an actual test 2018-11-06 17:17:36 +01:00
clutter-test-utils.c tests/clutter/utils: Add helper to flush input thread 2022-12-13 18:31:14 +00:00
clutter-test-utils.h tests/clutter/utils: Add helper to flush input thread 2022-12-13 18:31:14 +00:00
cogl-test-utils.c tests: Add cogl test utils framework 2022-08-08 21:59:12 +00:00
cogl-test-utils.h tests/cogl: Add unit test framework 2022-08-08 21:59:13 +00:00
color-management-profile-conflict-test.c tests: Add duplicate color profile test case 2022-09-15 11:22:54 +00:00
color-management-tests.c tests/color: Test EDIDs with bogus data 2022-09-29 13:41:17 +00:00
edid-tests.c tests/edid: Test EDID CTA-861 parsing code 2022-07-04 14:54:11 +00:00
headless-start-test.c tests: Move monitor test utils into libmutter-test.so 2022-02-09 09:04:09 +00:00
kms-utils-unit-tests.c backends/native: Add meta_calculate_drm_mode_vblank_duration_us() 2021-07-13 08:09:42 +00:00
meson.build tests: Add Wayland fullscreen test client 2022-10-10 18:16:51 +00:00
meta-backend-test.c tests/backend-test: Wait for stage update in add and remove_device 2022-11-22 20:31:42 +00:00
meta-backend-test.h monitor-unit-tests: Add tests with dynamic orientation changes 2021-09-04 10:04:01 +02:00
meta-context-test.c tests/mock/colord: Add profile mock support 2022-09-01 16:54:04 +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 backend: Move GPU ownership from the monitor manager to the backend 2019-06-20 13:31:55 +00:00
meta-kms-test-utils.c tests/kms-utils: Add helpers for common buffer sizes 2022-01-25 15:47:03 +00:00
meta-kms-test-utils.h tests/kms-utils: Add helpers for common buffer sizes 2022-01-25 15:47:03 +00:00
meta-monitor-manager-test.c Remove meta_is_stage_views_enabled() 2022-09-19 14:46:01 +00:00
meta-monitor-manager-test.h tests/monitor-test-utils: Add way to make the GAMMA_LUT zero sized 2022-09-03 14:41:36 +00:00
meta-monitor-test-utils.c tests/monitor-test-utils: Add way to make the GAMMA_LUT zero sized 2022-09-03 14:41:36 +00:00
meta-monitor-test-utils.h tests/monitor-test-utils: Add way to make the GAMMA_LUT zero sized 2022-09-03 14:41:36 +00:00
meta-ref-test.c tests/wayland: Update documentation for MUTTER_REF_TEST_UPDATE 2022-06-03 09:03:10 +00:00
meta-ref-test.h tests: Move ref test framework to libmutter-test.so 2022-02-09 09:04:09 +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 tests: Add MetaOrientationManager tests via SensorsProxy mock 2021-09-04 10:04:00 +02:00
meta-test-utils-private.h tests/test-utils: Move test client path ensure helper to private header 2021-07-15 11:42:40 +02:00
meta-test-utils.c tests/utils: Add helper to flush the input thread 2022-12-13 18:31:14 +00:00
meta-test-utils.h tests/utils: Add helper to flush the input thread 2022-12-13 18:31:14 +00:00
meta-wayland-test-driver.c tests/wayland-unit: Move out sync point wait helper 2022-09-20 18:47:06 +00:00
meta-wayland-test-driver.h tests/wayland-unit: Move out sync point wait helper 2022-09-20 18:47:06 +00:00
meta-wayland-test-utils.c tests/wayland: Move test client helper into a utils file 2022-02-09 09:04:09 +00:00
meta-wayland-test-utils.h tests/wayland: Move test client helper into a utils file 2022-02-09 09:04:09 +00:00
monitor-config-migration-unit-tests.c tests: Move monitor test utils into libmutter-test.so 2022-02-09 09:04:09 +00:00
monitor-config-migration-unit-tests.h tests: Add monitor config migration tests 2017-08-21 12:23:51 +08:00
monitor-store-unit-tests.c Remove meta_is_stage_views_enabled() 2022-09-19 14:46:01 +00:00
monitor-store-unit-tests.h tests: Add MetaMonitorConfigStore tests 2017-01-25 16:28:56 +08: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 monitor-transform: Add meta_monitor_transform_transform() helper 2020-02-27 09:07:25 +01:00
monitor-unit-tests.c tests/backend-test: Wait for stage update in add and remove_device 2022-11-22 20:31:42 +00:00
monitor-util-tests.c monitor: Add mode spec helper checking resolution similarness 2022-08-15 10:00:25 +00:00
mutter_dbusrunner.py tests/dbus-runner: Add way to launch custom services 2022-11-01 21:04:21 +00:00
mutter-all.test.in tests: Extract D-Bus runner as reusable python module 2022-09-02 17:18:43 +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-headless.c context/test: Add flag to test runner helper 2022-01-14 09:16:09 +00:00
native-kms-device.c kms: Don't enter power saving via updates 2022-01-25 15:47:03 +00:00
native-kms-force-atomic-sanity.c tests/kms: Run tests both using simple and atomic KMS 2022-07-28 23:59:24 +00:00
native-kms-force-simple-sanity.c tests/kms: Run tests both using simple and atomic KMS 2022-07-28 23:59:24 +00:00
native-kms-render.c tests: Add partial-overlapping scanout test 2022-09-20 18:47:06 +00:00
native-kms-updates.c kms: Don't enter power saving via updates 2022-01-25 15:47:03 +00:00
native-persistent-virtual-monitor.c tests: Prefix test plugin name getter with meta_ 2021-07-15 11:42:40 +02:00
native-pointer-constraints.c tests/pointer-constraints: Destroy client after test 2022-08-19 15:02:38 +02:00
native-screen-cast.c tests/screen-cast: Add debug logs to screen cast client 2022-12-13 18:31:14 +00:00
native-screen-cast.h tests: Add tests for virtual screen cast source 2021-03-12 15:09:45 +00:00
native-virtual-monitor.c tests: Add virtual monitor tests 2021-03-12 15:09:45 +00:00
native-virtual-monitor.h tests: Add virtual monitor tests 2021-03-12 15:09:45 +00: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 tests: Move orientation helper to monitor test utils 2022-01-25 16:25:48 +00:00
README docs: Update tests instructions 2019-06-05 14:49:35 -03:00
ref-test-sanity.c build: Make each executable/library have their own log domain 2022-04-29 18:58:38 +00:00
screen-cast-client.c tests/screen-cast: Add debug logs to screen cast client 2022-12-13 18:31:14 +00:00
stage-view-tests.c tests: Wait for windows being mapped after show 2022-12-01 20:10:52 +00:00
test-client.c tests/test-client: Add clipboard-set command 2022-05-31 12:00:54 +00:00
test-runner.c ui: Excise old frames UI 2022-12-01 20:10:53 +00:00
unit-tests.c tests: Split out monitor configuration tests to its own test case 2022-01-25 16:25:48 +00:00
unit-tests.h tests: Move 'wait-for-X11-display' helper to MetaContextTest 2021-07-15 11:42:40 +02:00
wayland-fullscreen-test.c window: Move surface property to it subclasses 2022-11-17 11:30:56 +00:00
wayland-unit-tests.c tests/wayland-unit: Move out sync point wait helper 2022-09-20 18:47:06 +00:00
x11-test.sh tests: Add basic X11 WM test 2022-06-02 17:19:42 +00:00
xwayland-tests.c display: Freeze stack when closing X11 display 2022-11-21 16:30:06 +00: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. This is currently a no-op
 for Wayland, where this capability is not supported in the protocol.

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.