mutter/src/tests
2021-11-17 09:42:13 +00:00
..
clutter tests: Drop dependency on click count 2021-10-29 00:27:18 +02:00
dbusmock-templates tests: Run a localed mock implementation on tests 2021-09-04 10:04:01 +02:00
meta-test tests: Make common test code a shared library 2021-07-15 13:40:34 +02:00
migration monitor-config-store: Properly escape monitor spec 2021-01-29 16:49:58 +00:00
monitor-configs monitor-config-store: Properly escape monitor spec 2021-01-29 16:49:58 +00:00
ref-tests tests: Add virtual monitor tests 2021-03-12 15:09:45 +00:00
stacking tests: Add test for unfullscreening followed by immediate strut change 2021-11-17 09:42:13 +00:00
wayland-test-clients tests/wayland: Test reattaching subsurface after parent was destroyed 2021-09-02 21:14:18 +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 Add MetaGravity and replace X11 equivalent with it 2020-02-29 21:01:50 +00:00
boxes-tests.h tests: Make testboxes an actual test 2018-11-06 17:17:36 +01:00
clutter-test-utils.c main: Move MetaX11DisplayPolicy to a new meta-private-enums.h 2021-07-15 11:34:36 +02:00
clutter-test-utils.h tests: Make common test code a shared library 2021-07-15 13:40:34 +02:00
headless-start-test.c tests: Make common test code a shared library 2021-07-15 13:40:34 +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
meson.build tests: Add test for unfullscreening followed by immediate strut change 2021-11-17 09:42:13 +00:00
meta-backend-test.c monitor-unit-tests: Add tests with dynamic orientation changes 2021-09-04 10:04:01 +02: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: Make common test code a shared library 2021-07-15 13:40:34 +02:00
meta-dbus-runner.py tests/dbus-runner: Make sure to tear-down even on test failure 2021-09-22 12:37:23 +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-monitor-manager-test.c monitor-manager: Pass the Logical mode when computing the monitor scale 2021-07-22 13:14:01 +02:00
meta-monitor-manager-test.h tests: Add MetaOrientationManager tests via SensorsProxy mock 2021-09-04 10:04:00 +02:00
meta-ref-test.c tests: Add reference test framework 2021-03-12 15:09:45 +00:00
meta-ref-test.h tests: Add reference test framework 2021-03-12 15:09:45 +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: Make common test code a shared library 2021-07-15 13:40:34 +02:00
meta-test-utils.h monitor-test-utils: Add debug friendly statements during tests 2021-08-04 14:02:16 +00:00
meta-wayland-test-driver.c tests/wayland-test-driver: Add generic "sync point" request 2021-07-06 09:11:10 +00:00
meta-wayland-test-driver.h tests: Move Wayland test driver helper protocol to its own file 2021-07-06 09:11:10 +00:00
monitor-config-migration-unit-tests.c tests/monitor-config: Improve debugging output 2021-01-29 16:49:58 +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 tests/monitor-store-unit-tests: Rename some structs 2020-05-13 08:38:40 +00:00
monitor-store-unit-tests.h tests: Add MetaMonitorConfigStore tests 2017-01-25 16:28:56 +08:00
monitor-test-utils.c monitor-test-utils: Add debug friendly statements during tests 2021-08-04 14:02:16 +00:00
monitor-test-utils.h monitor-test-utils: Add debug friendly statements during tests 2021-08-04 14:02:16 +00:00
monitor-transform-tests.c tests/monitor-transform: Also test invert() 2020-05-13 08:19:42 +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: Make it easier to keep track of where we are 2021-10-22 07:43:19 +00:00
monitor-unit-tests.h tests: Move 'wait-for-X11-display' helper to MetaContextTest 2021-07-15 11:42:40 +02:00
mutter-all.test.in tests: Don't continue if setup commands fail 2021-11-17 09:04:07 +00:00
native-headless.c tests: Make common test code a shared library 2021-07-15 13:40:34 +02:00
native-persistent-virtual-monitor.c tests: Prefix test plugin name getter with meta_ 2021-07-15 11:42:40 +02:00
native-screen-cast.c tests: Add tests for virtual screen cast source 2021-03-12 15:09:45 +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: Add additional debug in wait_for_orientation() 2021-10-22 07:43:19 +00:00
orientation-manager-unit-tests.h tests: Change how we wait for an orientation change 2021-10-22 07:43:19 +00:00
README docs: Update tests instructions 2019-06-05 14:49:35 -03:00
ref-test-sanity.c tests: Make common test code a shared library 2021-07-15 13:40:34 +02:00
screen-cast-client.c tests: Add tests for virtual screen cast source 2021-03-12 15:09:45 +00:00
stage-view-tests.c clutter/actor: First clear all stage views before emitting they changed 2021-11-06 14:25:40 +00:00
test-client.c tests/test-client: Add 'stop_after_next' and 'continue' commands 2021-11-17 09:42:13 +00:00
test-runner.c tests/test-client: Add 'stop_after_next' and 'continue' commands 2021-11-17 09:42:13 +00:00
unit-tests.c tests: Add MetaOrientationManager tests via SensorsProxy mock 2021-09-04 10:04:00 +02:00
unit-tests.h tests: Move 'wait-for-X11-display' helper to MetaContextTest 2021-07-15 11:42:40 +02:00
wayland-unit-tests.c tests/wayland: Test reattaching subsurface after parent was destroyed 2021-09-02 21:14:18 +00:00
wayland-unit-tests.h tests/wayland: Test subsurface commits after parent was reset 2020-01-10 16:01:22 +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.