mutter/src/tests
2023-08-16 15:34:46 +00:00
..
clutter tests: Introduce and use a custom test shell 2023-08-16 15:34:46 +00:00
cogl tests: Introduce and use a custom test shell 2023-08-16 15:34:46 +00:00
dbusmock-templates thread: Support making threads real time scheduled 2023-07-17 21:19:34 +02: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 cleanup: Switch to pragma once 2023-08-07 22:24:36 +00:00
migration tests: Expect <rate> to always have three decimal places (rounded) 2022-08-19 15:28:56 +00:00
monitor-configs wayland/cursor-surface: Update cursor on dispose 2023-04-17 19:53:35 +00:00
protocol wayland: Add wl_global filter manager 2023-02-13 15:34:24 +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: Add test case for restoring focus after overview 2023-08-16 15:34:46 +00:00
wayland-test-clients cleanup: Fix various typos 2023-08-12 20:13:37 +00:00
anonymous-file.c
boxes-tests.c build: Make each executable/library have their own log domain 2022-04-29 18:58:38 +00:00
boxes-tests.h cleanup: Switch to pragma once 2023-08-07 22:24:36 +00:00
clutter-test-utils.c tests/clutter: Use a dummy actor for some interactive tests 2023-01-30 13:17:19 +00:00
clutter-test-utils.h tests: Port faked events to new constructors 2023-08-08 04:02:54 +02:00
cogl-test-utils.c tests: Add cogl test utils framework 2022-08-08 21:59:12 +00:00
cogl-test-utils.h cleanup: Switch to pragma once 2023-08-07 22:24:36 +00:00
color-management-profile-conflict-test.c tests/meta-context-test: Free D-Bus call results 2023-02-01 13:16:29 +00:00
color-management-tests.c tests/color: Assert we saw the expected messages 2023-01-24 13:09:42 +00:00
edid-tests.c edid: Integrate libdisplay-info for edid parsing 2023-05-02 17:37:01 +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 tests/input-capture: Add test for ATK input capture 2023-07-14 22:23:45 +00:00
input-capture-tests.c tests/input-capture: Add test for ATK input capture 2023-07-14 22:23:45 +00:00
kms-utils-unit-tests.c
meson.build tests: Add test case for restoring focus after overview 2023-08-16 15:34:46 +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 tests: Introduce and use a custom test shell 2023-08-16 15:34:46 +00: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
meta-gpu-test.h cleanup: Switch to pragma once 2023-08-07 22:24:36 +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 cleanup: Switch to pragma once 2023-08-07 22:24:36 +00:00
meta-monitor-manager-test.c tests: Add tests for monitor_calculate_mode_scale 2023-02-24 22:42:19 +01:00
meta-monitor-manager-test.h cleanup: Switch to pragma once 2023-08-07 22:24:36 +00:00
meta-monitor-test-utils.c tests: Add tests for monitor_calculate_mode_scale 2023-02-24 22:42:19 +01:00
meta-monitor-test-utils.h cleanup: Switch to pragma once 2023-08-07 22:24:36 +00:00
meta-ref-test.c cleanup: Fix various typos 2023-08-12 20:13:37 +00:00
meta-ref-test.h cleanup: Switch to pragma once 2023-08-07 22:24:36 +00:00
meta-sensors-proxy-mock.c
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 tests/test-shell: Emulate overview grabs 2023-08-16 15:34:46 +00: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: Introduce and use a custom test shell 2023-08-16 15:34:46 +00:00
meta-test-utils.h tests: Introduce and use a custom test shell 2023-08-16 15:34:46 +00:00
meta-thread-impl-test.c tests: Add MetaThread tests 2023-07-17 12:51:35 +02:00
meta-thread-impl-test.h cleanup: Switch to pragma once 2023-08-07 22:24:36 +00:00
meta-thread-test.c tests: Add MetaThread tests 2023-07-17 12:51:35 +02:00
meta-thread-test.h cleanup: Switch to pragma once 2023-08-07 22:24:36 +00:00
meta-wayland-test-driver.c clutter: Pass 'ClutterFrame' in all stage update signals 2023-01-23 15:57:50 +01: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: Add helper to wait for window 2023-02-13 15:34:24 +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 tests: Make tests components have ownership chains as well 2022-12-17 15:13:48 +01: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-manager: Apply switch-config in idle callback 2023-03-18 16:20:49 +00:00
monitor-util-tests.c monitor: Add helper to parse simple mode strings 2023-04-18 18:38:03 +00:00
mutter_dbusrunner.py thread: Support making threads real time scheduled 2023-07-17 21:19:34 +02: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 tests: Make tests components have ownership chains as well 2022-12-17 15:13:48 +01:00
native-kms-cursor-hotplug.c tests: Mark some test cases as skippable 2023-06-28 01:03:35 +00:00
native-kms-device.c tests/kms-device: Add test for scheduled no-ops 2023-07-18 23:51:34 +02: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-kernel-thread-sanity.c tests/kms: Run tests with kernel/user thread too 2023-07-17 12:51:36 +02: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-force-user-thread-sanity.c tests/kms: Run tests with kernel/user thread too 2023-07-17 12:51:36 +02:00
native-kms-headless-start.c tests: Mark some test cases as skippable 2023-06-28 01:03:35 +00:00
native-kms-hotplug.c tests: Mark some test cases as skippable 2023-06-28 01:03:35 +00:00
native-kms-render.c kms/update: Add destroy-notify to result listener user data 2023-07-17 23:42:38 +02:00
native-kms-updates.c kms/update: Add destroy-notify to result listener user data 2023-07-17 23:42:38 +02:00
native-kms.c kms: Use a kernel thread by default 2023-07-17 21:19:34 +02:00
native-persistent-virtual-monitor.c tests: Introduce and use a custom test shell 2023-08-16 15:34:46 +00:00
native-pointer-constraints.c tests/native-pointer-constraints: Remove extra semicolon 2023-02-01 08:40:53 +01:00
native-screen-cast.c tests/screen-cast: Enable 'screen-cast' debug topic 2022-12-13 18:31:14 +00:00
native-screen-cast.h cleanup: Switch to pragma once 2023-08-07 22:24:36 +00:00
native-thread.c thread/impl: Add API to tell whether its realtime scheduled 2023-07-17 21:19:34 +02:00
native-virtual-monitor.c tests: Make tests components have ownership chains as well 2022-12-17 15:13:48 +01:00
native-virtual-monitor.h cleanup: Switch to pragma once 2023-08-07 22:24:36 +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 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 tests/screen-cast-client: Don't process stream on tear down 2023-06-28 01:03:35 +00:00
service-channel-tests.c tests: Add service door Wayland test case 2023-02-13 15:34:24 +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 tests/stage-view-tests: Unref clutter timelines 2023-06-20 23:19:28 +00: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/test-runner: Add toggle_overview command 2023-08-16 15:34:46 +00:00
unit-tests.c tests: Add tests for HDR Static Metadata encoding/decoding and equality 2023-03-04 09:30:41 +00:00
unit-tests.h cleanup: Switch to pragma once 2023-08-07 22:24:36 +00:00
wayland-client-tests.c tests: Add MetaWaylandClient test cases 2023-02-13 15:34:24 +00:00
wayland-fractional-scale-test.c tests/wayland: Add test for fractional-scale protocol 2023-03-04 22:13:45 +01:00
wayland-fullscreen-test.c tests: Make tests components have ownership chains as well 2022-12-17 15:13:48 +01:00
wayland-unit-tests.c tests/wayland: Move out window finder helper to helper file 2023-02-13 15:34:24 +00:00
wayland-x11-interop-tests.c wayland: Add X11 interop service client protocol 2023-02-13 15:34:24 +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 tests: Add check for compositor state on XWayland startup 2023-05-15 19:05:00 +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.