1This directory implements a framework for automated tests of Mutter. The basic
2idea is that mutter-test-runner acts as the window manager and compositor, and
3forks off instances of mutter-test-client to act as clients.
4
5There's a simple scripting language for tests. A very small test would look like:
6
7---
8# Start up a new X11 client with the client id 1 (doesn't have to be an integer)
9# Windows for this client will be referred to as 1/<window-id>
10new_client 1 x11
11
12# Create and show two windows - again the IDs don't have to be integers
13create 1/1
14show 1/1
15create 1/2
16show 1/2
17
18# Wait for the commands we've executed in the clients to reach Mutter
19wait
20
21# Check that the windows are in the order we expect
22assert_stacking 1/1 1/2
23---
24
25Running
26=======
27
28The tests are installed according to:
29
30https://wiki.gnome.org/Initiatives/GnomeGoals/InstalledTests
31
32if -Dtests=true is passed to `meson configure`. You can run them uninstalled with:
33
34 ninja test
35
36Command reference
37=================
38
39The following commands are supported. Quoting and comments follow shell rules.
40
41new_client <client-id> [wayland|x11]
42 Starts a client, connecting by either Wayland or X11. The client
43 will subsequently be known with the given client-id (an arbitrary
44 string)
45
46quit_client <client-id>
47 Destroys all windows for the client, waits for that to be processed,
48 then instructs the client to exit.
49
50create <client-id>/<window-id> [override|csd]
51 Creates a new window. For the X11 backend, the keyword 'override'
52 can be given to create an override-redirect and the keyword 'csd'
53 can be given to create a client-side decorated window.
54
55show <client-id>/<window-id>
56hide <client-id>/<window-id>
57 Ask the client to show (map) or hide (unmap) the given window
58
59activate <client-id>/<window-id>
60 Ask the client to raise and focus the given window. This is currently a no-op
61 for Wayland, where this capability is not supported in the protocol.
62
63local_activate <client-id>-<window-id>
64  The same as 'activate', but the operation is done directly inside Mutter
65  and works for both backends
66
67raise <client-id>/<window-id>
68lower <client-id>/<window-id>
69  Ask the client to raise or lower the given window ID. This is a no-op
70  for Wayland clients. (It's also considered discouraged, but supported, for
71  non-override-redirect X11 clients.)
72
73minimize <client-id>/<window-id>
74unminimize <client-id>/<window-id>
75  Ask the client to minimize or unminimize the given window ID. This older
76  term for this operation is "iconify".
77
78destroy <client-id>/<window-id>
79  Destroy the given window
80
81wait
82  Wait until all requests sent by Mutter to clients have been received by Mutter,
83  and then wait until all requests by Mutter have been processed by the X server.
84
85assert_stacking <client-id>/<window-id> <client-id>/<window-id> ...
86  Assert that the list of client windows known to Mutter is as given and in
87  the given order, bottom to top. The character '|' can be present in the
88  list of windows to indicate the guard window that separates hidden and
89  visible windows. If '|' isn't present, the guard window is asserted to
90  be below all client windows.
91
92  This function also queries the X server stack and verifies that Mutter's
93  expectation of the X server stack matches reality.
94