README revision 706f2543
1706f2543Smrg                        X server test suite
2706f2543Smrg
3706f2543SmrgThis suite contains a set of tests to verify the behaviour of functions used
4706f2543Smrginternally to the server. This test suite is based on glib's testing
5706f2543Smrgframework [1].
6706f2543Smrg
7706f2543Smrg= How it works =
8706f2543SmrgThrough some automake abuse, we link the test programs with the same static
9706f2543Smrglibraries as the Xorg binary. The test suites can then call various functions
10706f2543Smrgand verify their behaviour - without the need to start the server or connect
11706f2543Smrgclients.
12706f2543Smrg
13706f2543SmrgThis testing only works for functions that do not rely on a particular state
14706f2543Smrgof the X server. Unless the test suite replicates the expected state, which
15706f2543Smrgmay be difficult.
16706f2543Smrg
17706f2543Smrg= How to run the tests =
18706f2543SmrgRun "make check" the test directory. This will compile the tests and execute
19706f2543Smrgthem in the order specified in the TESTS variable in test/Makefile.am.
20706f2543Smrg
21706f2543SmrgEach set of tests related to a subsystem are available as a binary that can be
22706f2543Smrgexecuted directly. For example, run "xkb" to perform some xkb-related tests.
23706f2543Smrg
24706f2543Smrg== Adding a new test ==
25706f2543SmrgWhen adding a new test, ensure that you add a short description of what the
26706f2543Smrgtest does and what the expected outcome is. If the test reproduces a
27706f2543Smrgparticular bug, using g_test_bug().
28706f2543Smrg
29706f2543Smrg== Misc ==
30706f2543Smrg
31706f2543SmrgThe programs "gtester" and "gtester-report" may be used to generate XML/HTML
32706f2543Smrglog files of tests succeeded and failed.
33706f2543Smrg
34706f2543Smrg---------
35706f2543Smrg
36706f2543Smrg[1] http://library.gnome.org/devel/glib/stable/glib-Testing.html
37