X.org testing with Google Test
thomas.voss at canonical.com
Wed Dec 21 08:51:59 PST 2011
-----BEGIN PGP SIGNED MESSAGE-----
my name is Thomas and I'm a software engineer in quality working for
Canonical. Our quality team is currently extending the test coverage
of Canonical's upstream projects. To this end, we are developing a
number of components for providing a unified testing landscape to
One of our focus areas is the headless automated testing of
applications and components that interact with the X display server.
For many testing scenarios, only a dummy X server without any display
capabilities is required and we abstracted/integrated start up and
tear down of such a configuration within a Google Test environment
that is readily usable by developers (see ).
Google Test  is a unit testing framework tailored towards C and
C++. It is lightweight and provides a decent set of functionality for
writing unit tests:
* Automatic test registration: Tests are automatically discovered and
recognized. That is, no manual maintenance for executing tests is
* An extensive set of assertion macros is provided.
* The XML output is compatible with JUnit's XML dialect and can be
integrated easily with continuous integration systems (e.g. Jenkins
* Support for custom test fixtures that unify test setup and cleanup
procedures, thus avoiding boiler plate code within the actual test.
* Support for custom test environments for bundling problem specific
setup and cleanup routines.
Our extension to Google Test defines a custom test environment and a
custom test fixture that take care of starting up and tearing down a
dummy xserver environment (environment.h) as well as opening up a
display connection (test.h). Moreover, a custom main is included
within our extension that extends Google Test's main and makes sure
that our dummy X server testing environment is known to the whole test
suite. Please see  for a usage scenario within utouch-frame and 
for xorg-gtest's doxygen documentation.
As we think that this kind of unified testing architecture might be of
interest to a wider developer audience, we would like to bring it to
your attention by this mail. The project is currently hosted in
cndougla's freedesktop.org place, but we feel a better home would be
on freedesktop.org. It looks like a good landing spot would be in
xorg/test on the git.freedesktop.org page. Is there a formal process
for proposing projects, or should we just create a repository there?
Of course, your feedback is highly appreciated.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
-----END PGP SIGNATURE-----
More information about the xorg-devel