Changeset View
Changeset View
Standalone View
Standalone View
TESTING.md
1 | # Testing in KWin | 1 | # Testing in KWin | ||
---|---|---|---|---|---|
2 | KWin provides a unit and integration test suit for X11 and Wayland. The source code for the tests can be found in the subdirectory autotests. The test suite should be run prior to any merge to KWin. | 2 | KWin provides a unit and integration test suit for X11 and Wayland. The source code for the tests can be found in the subdirectory autotests. The test suite should be run prior to any merge to KWin. | ||
3 | 3 | | |||
4 | # Dependencies | 4 | # Dependencies | ||
5 | The following additional software needs to be installed for running the test suite: | 5 | The following additional software needs to be installed for running the test suite: | ||
6 | 6 | | |||
7 | * Xvfb | 7 | * Xvfb | ||
8 | * Xephyr | 8 | * Xephyr | ||
9 | * glxgears | 9 | * glxgears | ||
10 | * DMZ-white cursor theme | 10 | * DMZ-white cursor theme | ||
11 | * breeze window decoration | 11 | * breeze window decoration | ||
12 | 12 | | |||
13 | # Preparing a run of the test suite | 13 | # Preparing OpenGL | ||
14 | In case your system does not support the EGL extension EGL_MESA_platform_surfaceless, | 14 | Some of the tests require OpenGL. The test suite is implemented against Mesa and uses the Mesa specific EGL extension | ||
15 | please load the kernel module "vgem". This is required to provide a virtual OpenGL device. | 15 | EGL_MESA_platform_surfaceless. This extension supports rendering without any real GPU using llvmpipe as software | ||
16 | emulation. This gives the tests a stable base removing variance introduced by different hardware and drivers. | ||||
16 | 17 | | |||
17 | sudo modprobe vgem | 18 | Users of non-Mesa drivers (e.g. proprietary NVIDIA driver) need to ensure that Mesa is also installed. If your system | ||
18 | 19 | uses libglvnd this should work out of the box, if not you might need to tune LD_LIBRARY_PATH. | |||
19 | Furthermore the user executing the test suite must be able to read and write to the dri device created by vgem. | | |||
20 | 20 | | |||
21 | # Running the test suite | 21 | # Running the test suite | ||
22 | The test suite can be run from the build directory. Best is to do: | 22 | The test suite can be run from the build directory. Best is to do: | ||
23 | 23 | | |||
24 | cd path/to/build/directory | 24 | cd path/to/build/directory | ||
25 | xvfb-run ctest | 25 | xvfb-run ctest | ||
26 | 26 | | |||
27 | # Running individual tests | 27 | # Running individual tests | ||
28 | All tests executables are created in the directory "bin" in the build directory. Each test can be executed by just starting it from within the test directory. To prevent side effects with the running session it is recommended to start a dedicated dbus session: | 28 | All tests executables are created in the directory "bin" in the build directory. Each test can be executed by just starting it from within the test directory. To prevent side effects with the running session it is recommended to start a dedicated dbus session: | ||
29 | 29 | | |||
30 | cd path/to/build/directory/bin | 30 | cd path/to/build/directory/bin | ||
31 | dbus-run-session ./testFoo | 31 | dbus-run-session ./testFoo | ||
32 | 32 | | |||
33 | For tests relying on X11 one should also either start a dedicated Xvfb and export DISPLAY or use xvfb-run as described above. | 33 | For tests relying on X11 one should also either start a dedicated Xvfb and export DISPLAY or use xvfb-run as described above. |