[cairo] External cairo-test-suite

Chris Wilson chris at chris-wilson.co.uk
Mon Sep 1 10:57:01 PDT 2008


I've cooked up a patch to compile all the 190 (and rising!) tests into a
single binary. That mammoth is over at
http://gitweb.freedesktop.org/?p=users/ickle/cairo;a=shortlog;h=smoketest
(though in fact it is a net reduction in lines!)

It needs review from everybody interested in the build system, as it
essentially replaces the automake TEST foo with a custom test runner.
If gcc is available, I'm able to use the constuctor attribute to
trivially build the list of tests. Otherwise we have to jump through a
couple of hoops (the make-cairo-test-constructors.pl script) in order to
autogenerate a C file that generates a list of all the tests compiled
in. It works when tested within the automake framework, I'm just not
sure how big a job it is for everyone trying to construct a Visual
Studio solution.

As far as the test suite itself goes, on Unix it forks each individual
test (essentially a fork for every draw routine) which provides even
better test isolation than we had before, and for similar reasons the
granularity of results is equally improved. ... Except on Windows, the
tests are all run in the same process and so it aborts on the first
assert/crash.

Another improvement is that each test is grouped by keywords so that you
can just run all the text tests, or all the clip tests etc. The XFAIL
status is moved to the test itself (and becomes just another keyword) so
that the information is maintained along with the test. Hence
"./cairo-test-suite XFAIL" will execute all the known failures. The
tests are also able to specify required library versions (and as a
special case whether it needs a raster target, again moving the
information from an array inside cairo-test.c into the test itself). At
the moment, the only check carried out is against the cairo version (and
only user-font currently requires a specific version of cairo). The idea
is that this should allow a single binary to run in any environment and
produce comparable results.

So I'm soliciting feedback - especially from Behdad since I've hacked
about the test/Makefile.am quite a bit and from Vlad wrt to the
buildbots. However, everyone feel free to pitch in with ideas and
improvements.
-- 
Chris Wilson



More information about the cairo mailing list