Commit graph

12 commits

Author SHA1 Message Date
Chris Wilson
6b7539d96b test/xlib-expose-event: Be kinder to recording surfaces
And only create the source image once.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-13 20:54:24 +01:00
Chris Wilson
80fc2a8e49 test: Expand xlib-expose-event to cover all backends
Use a similar surface to create an equivalent backing surface for
any backend, thus enabling the test to run against any target.

The comment about forcing fallbacks has long since been false.
2010-04-28 09:50:49 +01:00
Benjamin Otte
9672aab6b7 tests: Integrate xlib-expose-event test into usual tests
Previously the test was using the preamble vfunc and generating output
itself. Now it uses the draw function and ignores any but the xlib
backends.
2010-04-26 21:42:47 +02:00
Chris Wilson
992f74d884 [test] Use '.' as the field separator in the names
We frequently use '-' within the test name or format name and so we
encounter confusion as '-' is also used as the field separator. At times
this has caused a new test to break an old test because the new test would
match one of the old test's target specific reference images. So switch
everything over to use '.' between fields (test name, target, format,
subtest, etc.).
2008-10-31 13:50:55 +00:00
Chris Wilson
e90073f7dd [test] Build test suite into single binary.
Avoid calling libtool to link every single test case, by building just one
binary from all the sources.

This binary is then given the task of choosing tests to run (based on user
selection and individual test requirement), forking each test into its own
process and accumulating the results.
2008-10-31 12:30:11 +00:00
Behdad Esfahbod
e51648b601 [test/xlib-expose-event] Save the output image to disk 2008-10-30 04:43:45 -04:00
Chris Wilson
5a822046cc [test/xlib-expose-event] Propagate errors.
Use cairo_get_target() to propagate errors from secondary contexts.
2008-10-21 11:31:12 +01:00
Chris Wilson
17fbb652b1 [test] Avoid redundant writes/reads of test surfaces via png.
As Behdad suggested, we can dramatically speed up the test suite by
short-circuiting the write to a png file, only to then immediately read it
back in. So for the raster based surfaces, we avoid the round-trip through
libpng by implementing a new boilerplate method to directly extract the image
buffer from the test result. A secondary speedup is achieved by caching the
most recent reference image.
2008-08-18 16:18:52 +01:00
Chris Wilson
d56ea9cc87 [test] Set CAIRO_TEST_UNTESTED to 77
77 is the magic exit code used by automake to indicate a skipped test, so
by using it we can get a slightly more informative test log.
2008-08-13 21:55:19 +01:00
Chris Wilson
f85a4aec1f [test] Export a function to check whether a target is enabled.
Allow individuals tests to check whether a test target is enabled -
useful for those tests that circumvent cairo_test() and perform
feature testing.
2008-08-13 21:55:09 +01:00
Chris Wilson
436c0c8be2 [test] Preparatory work for running under memfault.
In order to run under memfault, the framework is first extended to handle
running concurrent tests - i.e. multi-threading. (Not that this is a
requirement for memfault, instead it shares a common goal of storing
per-test data).  To that end all the global data is moved into a per-test
context and the targets are adjusted to avoid overlap on shared, global
resources (such as output files and frame buffers). In order to preserve
the simplicity of the standard draw routines, the context is not passed
explicitly as a parameter to the routines, but is instead attached to the
cairo_t via the user_data.

For the masochist, to enable the tests to be run across multiple threads
simply set the environment variable CAIRO_TEST_NUM_THREADS to the desired
number.

In the long run, we can hope the need for memfault (runtime testing of
error paths) will be mitigated by static analysis. A promising candidate
for this task would appear to be http://hal.cs.berkeley.edu/cil/.
2008-08-13 21:54:59 +01:00
Chris Wilson
28a1dabed8 [test] Add a regression test for bug 10921
This bug first was fixed in 40558cb15e,
but then reintroduced in 9cfd82e87b, which
became part of the 1.6.2 quick release.

As penance to make sure I never repeat this same bug again, I offer this
test case which exercises the XSetClipMask(NULL) path and hopefully
simulates some 'typical' usage of cairo by GUI toolkits.
2008-04-11 23:57:01 +01:00