Lines Matching +full:libinput +full:- +full:test +full:- +full:suite +full:- +full:pointer
1 .. _test-suite:
4 libinput test suite
7 libinput's primary test suite can be invoked with
11 $ sudo ./builddir/libinput-test-suite
13 When developing libinput, the ``libinput-test-suite`` should always be
15 the number of tests to run can be filtered, see :ref:`test-filtering`.
17 touchpad tap-to-click) while hacking on that specific feature and only run
18 the full suite when development is done finished.
20 .. note:: The test suite relies on udev and the kernel, specifically uinput.
22 interfere with your running session. The test suite is not suitable
25 In addition, libinput ships with a set of (primarily janitorial) tests that
27 ``meson test -C builddir`` (or ``ninja test``). The ``libinput-test-suite`` is
28 part of that test set by default.
30 The upstream CI runs all these tests but not the ``libinput-test-suite``.
33 .. _test-job-control:
35 ------------------------------------------------------------------------------
36 Job control in the test suite
37 ------------------------------------------------------------------------------
39 The test suite runner has a make-like job control enabled by the ``-j`` or
40 ``--jobs`` flag and will fork off as many parallel processes as given by this
41 flag. The default if unspecified is 8. When debugging a specific test case
42 failure it is recommended to employ test filtures (see :ref:`test-filtering`)
43 and disable parallel tests. The test suite automatically disables parallel
46 .. _test-config:
48 ------------------------------------------------------------------------------
50 ------------------------------------------------------------------------------
52 uinput devices created by the test suite are usually recognised by X as
56 Copy the file ``$srcdir/test/50-litest.conf`` into your ``/etc/X11/xorg.conf.d``
60 .. _test-root:
62 ------------------------------------------------------------------------------
64 ------------------------------------------------------------------------------
69 root, the test suite runner will exit with status 77, an exit status
72 .. _test-filtering:
74 ------------------------------------------------------------------------------
76 ------------------------------------------------------------------------------
78 litest's tests are grouped into test groups, test names and devices. A test
79 group is e.g. "touchpad:tap" and incorporates all tapping-related tests for
80 touchpads. Each test function is (usually) run with one or more specific
81 devices. The ``--list`` commandline argument shows the list of suites and
82 tests. This is useful when trying to figure out if a specific test is
88 $ ./builddir/libinput-test-suite --list
90 pointer:left-handed:
93 ms-surface-cover
94 mouse-wheelclickcount
95 mouse-wheelclickangle
96 low-dpi-mouse
97 mouse-roccat
98 mouse-wheel-tilt
100 logitech-trackball
101 cyborg-rat
105 ms-surface-cover
106 mouse-wheelclickcount
107 mouse-wheelclickangle
108 low-dpi-mouse
109 mouse-roccat
110 mouse-wheel-tilt
112 logitech-trackball
113 cyborg-rat
114 litest-magicmouse-device
117 ms-surface-cover
118 mouse-wheelclickcount
119 mouse-wheelclickangle
120 low-dpi-mouse
121 mouse-roccat
122 mouse-wheel-tilt
127 In the above example, the "pointer:left-handed" suite contains multiple
129 name of the test, making it easy to grep for). This particular test is run
134 device for a specific test (though the test itself may
137 The ``--filter-test`` argument enables selective running of tests through
138 basic shell-style function name matching. For example:
143 $ ./builddir/libinput-test-suite --filter-test="*1fg_tap*"
146 The ``--filter-device`` argument enables selective running of tests through
147 basic shell-style device name matching. The device names matched are the
148 litest-specific shortnames, see the output of ``--list``. For example:
153 $ ./builddir/libinput-test-suite --filter-device="synaptics*"
156 The ``--filter-group`` argument enables selective running of test groups
157 through basic shell-style test group matching. The test groups matched are
158 litest-specific test groups, see the output of ``--list``. For example:
163 $ ./builddir/libinput-test-suite --filter-group="touchpad:*hover*"
166 The ``--filter-device`` and ``--filter-group`` arguments can be combined with
167 ``--list`` to show which groups and devices will be affected.
169 .. _test-verbosity:
171 ------------------------------------------------------------------------------
172 Controlling test output
173 ------------------------------------------------------------------------------
175 Each test supports the ``--verbose`` commandline option to enable debugging
182 $ ./builddir/libinput-test-suite --verbose
183 $ LITEST_VERBOSE=1 meson test -C builddir
185 .. _test-installed:
187 ------------------------------------------------------------------------------
188 Installing the test suite
189 ------------------------------------------------------------------------------
191 If libinput is configured to install the tests, the test suite is available
192 as the ``libinput test-suite`` command. When run as installed binary, the
193 behavior of the test suite changes:
195 - the ``libinput.so`` used is the one in the library lookup paths
196 - no system-wide quirks are installed by the test suite, only those specific
197 to the test devices
198 - test device-specific quirks are installed in the system-wide quirks
199 directory, usually ``/usr/share/libinput/``.
201 It is not advisable to run ``libinput test-suite`` on a production machine.
202 Data loss may occur. The primary use-case for the installed test suite is
205 .. note:: The ``prefix`` is still used by the test suite. For verification
206 of a system package, the test suite must be configured with the same prefix.
208 To configure libinput to install the tests, use the ``-Dinstall-tests=true``
211 $ meson setup builddir -Dtests=true -Dinstall-tests=true <other options>
213 .. _test-meson-suites:
215 ------------------------------------------------------------------------------
216 Meson test suites
217 ------------------------------------------------------------------------------
219 This section is primarily of interest to distributors that want to run test
220 or developers working on libinput's CI.
222 Tests invoked by ``meson test`` are grouped into test suites, the test suite
223 names identify when the respective test can be run:
225 - ``valgrind``: tests that can be run under valgrind (in addition to a
227 - ``root``: tests that must be run as root
228 - ``hardware``: tests that require a VM or physical machine
229 - ``all``: all tests, only needed because of
232 The suite names can be provided as filters to ``meson test
233 --suite=<suitename>`` or ``meson test --no-suite=<suitename>``.
234 For example, if running a container-based CI, you may specify the test
239 $ meson test --no-suite=machine # only run container-friendly tests
240 $ meson test --suite=valgrind --setup=valgrind # run all valgrind-compatible tests
241 $ meson test --no-suite=root # run all tests not requiring root