Commit graph

226 commits

Author SHA1 Message Date
M Joonas Pihlaja
feaf38d0cd [test] Use HAVE_FLOCKFILE instead of _POSIX_C_SOURCE.
The _POSIX_C_SOURCE 2001.. #define requires C99 mode and
clang on Solaris is strict about such things. Use configure
tests for flockfile() instead.
2009-08-31 16:25:08 +03:00
Chris Wilson
19f4498234 [test] Wrap yet another call to get_image_surface() inside a timeout.
I missed this call to get_image_surface() that is now being hit having
restored the reference image for dash-infinite-loop.
2009-07-28 12:58:07 +01:00
Chris Wilson
24b5ac6377 [test] Add timeouts around finishing and converting surfaces to images.
In order to catch infinite loops whilst replaying and converting vector
surfaces to images (via external renderers) we need to also install
alarms around the calls to finish() and get_image().
2009-07-28 08:41:50 +01:00
Chris Wilson
596dec9561 [test] Trap SIGFPE
Note the crash if we hit a floating-point exception.
2009-07-24 10:44:03 +01:00
Chris Wilson
c3f2db4f73 [drm] Add an accelerated image surface.
Use the DRM interface to h/w accelerate composition on image surfaces.
The purpose of the backend is simply to explore what such a hardware
interface might look like and what benefits we might expect.  The
use case that might justify writing such custom backends are embedded
devices running a drm compositor like wayland - which would, for example,
allow one to write applications that seamlessly integrated accelerated,
dynamic, high quality 2D graphics using Cairo with advanced interaction
(e.g. smooth animations in the UI) driven by a clutter framework...

In this first step we introduce the fundamental wrapping of GEM for intel
and radeon chipsets, and, for comparison, gallium. No acceleration, all
we do is use buffer objects (that is use the kernel memory manager) to
allocate images and simply use the fallback mechanism. This provides a
suitable base to start writing chip specific drivers.
2009-07-23 16:18:42 +01:00
Chris Wilson
bed2701e1c Remove clip handling from generic surface layer.
Handling clip as part of the surface state, as opposed to being part of
the operation state, is cumbersome and a hindrance to providing true proxy
surface support. For example, the clip must be copied from the surface
onto the fallback image, but this was forgotten causing undue hassle in
each backend. Another example is the contortion the meta surface
endures to ensure the clip is correctly recorded. By contrast passing the
clip along with the operation is quite simple and enables us to write
generic handlers for providing surface wrappers. (And in the future, we
should be able to write more esoteric wrappers, e.g. automatic 2x FSAA,
trivially.)

In brief, instead of the surface automatically applying the clip before
calling the backend, the backend can call into a generic helper to apply
clipping. For raster surfaces, clip regions are handled automatically as
part of the composite interface. For vector surfaces, a clip helper is
introduced to replay and callback into an intersect_clip_path() function
as necessary.

Whilst this is not primarily a performance related change (the change
should just move the computation of the clip from the moment it is applied
by the user to the moment it is required by the backend), it is important
to track any potential regression:

ppc:
Speedups
========
image-rgba         evolution-20090607-0    1026085.22 0.18% -> 672972.07 0.77%:  1.52x speedup
▌
image-rgba         evolution-20090618-0    680579.98 0.12% -> 573237.66  0.16%:  1.19x speedup
▎
image-rgba      swfdec-fill-rate-4xaa-0    460296.92 0.36% -> 407464.63  0.42%:  1.13x speedup
▏
image-rgba      swfdec-fill-rate-2xaa-0    128431.95 0.47% -> 115051.86  0.42%:  1.12x speedup
▏
Slowdowns
=========
image-rgba     firefox-periodic-table-0    56837.61 0.78% -> 66055.17    3.20%:  1.09x slowdown
▏
2009-07-23 15:32:14 +01:00
Chris Wilson
dbaa08e80b [test] Fallback to comparing the base image references
After looking at backend specific images, check against the base image
reference. This is useful to fallback surfaces like xlib-fallback, which
should look closer to the image backend than the xlib backend.
2009-07-20 18:56:10 +01:00
Chris Wilson
164e0d2ea3 [test] Misidentification of XFAIL as NEW
cut'n'paste error compared the image against the known failure instead of
any recorded new failure, when checking for NEW fails.
2009-07-20 18:56:10 +01:00
Chris Wilson
52fa8760ae Add OpenVG backend.
Based on the work by Øyvind Kolås and Pierre Tardy -- many thanks to
Pierre for pushing this backend for inclusion as well as testing and
reviewing my initial patch. And many more thanks to pippin for writing the
backend in the first place!

Hacked and chopped by myself into a suitable basis for a backend. Quite a
few issues remain open, but would seem to be ready for testing on suitable
hardware.
2009-07-17 11:50:02 +01:00
Chris Wilson
655a4dbc36 [test] Track XFAIL using expected results stored as xfail.png
Instead of tagging the sources, which is insensitive to changes, track the
known failure modes by recording the current fail as an xfail.png
reference. (We also introduce a new.png to track a fresh error, so that
they are not lost in the noise of the old XFAILs and hopefully do not
cause everyone to fret).

As we have removed the XFAIL tagging we find, surprise surprise, that some
tests are now working -- so review all the reference images (as also some
.ref.png now should be .xfail.png).

Note: I've only checked image,pdf,ps,svg. The test surfaces report some
failures that probably need to addressed in source. I've not correct the
changes for win32 and quartz. Nor fixed up the experimental backends.
2009-07-13 15:19:51 +01:00
Chris Wilson
758a18b354 [test] Timeout support for tests
Enforce that each test must render within 60 seconds or be considered to
have hit an infinite loop and be reported as a CRASH. The timeout value is
adjustable via CAIRO_TEST_TIMEOUT -- a value of 0 will disable.
2009-06-28 21:10:30 +01:00
Chris Wilson
86624627e4 [test] Add group-unaligned
Test case for:
   Bug 22441 -- Unexpected shift with push_group and pop_group
   https://bugs.freedesktop.org/show_bug.cgi?id=22441

This is a test that demonstrates the error in the pdf backend when using
groups on surfaces with non-integer sizes. In order to create such a
surface, we need to update the boilerplate to use doubles instead of
integers when specifying the surface size.
2009-06-27 17:53:18 +01:00
M Joonas Pihlaja
a2d4fb5009 [test] Fix a typo in the _POSIX_SOURCE version number.
I hope POSIX isn't around in 20000 AD!
2009-06-21 17:34:13 +03:00
Chris Wilson
e5727e20f5 Expose _cairo_null_surface_create() via a test surface
Using a null surface is a convenient method to measure the overhead of the
performance testing framework, so export it although as a test-surface so
that it will only be available in development builds and not pollute
distributed libraries.
2009-06-15 12:03:37 +01:00
Chris Wilson
750c1b5b48 [configure] Check for FcInit() 2009-06-07 19:48:59 +01:00
Chris Wilson
791a6fa399 [memfault] Update macros to avoid namescape collision with memcheck
Basing the macro names of the memfault skin lead to a namespace
collision with memcheck. After updating the headers, update cairo's usage
to match.
2009-05-15 21:31:03 +01:00
Chris Wilson
817589e196 [test] Call FcInit() manually.
Pre-initialise fontconfig whilst memfault is disabled to avoid a lot of
expensive, redundant testing of FcInit() throughout the test suite.
2009-04-20 10:21:24 +01:00
Chris Wilson
ca501d99bb [test] Disable signal handling under valgrind
Capturing and handling the signals prevents valgrind from providing
backtraces for fatal signals -- which is often more useful.
2009-04-16 09:34:01 +01:00
Chris Wilson
b580a4a8d6 [test] Improve fault injection coverage
In order to exercise the meta-surfaces, we need to inject faults into
cairo_surface_finish().
2009-03-31 12:16:01 +01:00
Chris Wilson
322fb00066 [test] Compile again without memfault.
Hide the valgrind macro when not using memfault.
2009-01-29 22:15:21 +00:00
Chris Wilson
3752f690b4 [test] Suppress suppressed memfault report
Check to see if there are any *unsuppressed* memfaults before declaring
unreported faults.
2009-01-29 10:10:40 +00:00
Chris Wilson
163c326c82 [test] Free test name
Adding the missing free for the converted test name.
2009-01-02 15:44:51 +00:00
Chris Wilson
68309481aa [test] Mark targets with is_meta?
Allow tests to skip targets based on whether they are a meta surface or
not.
2008-11-05 08:36:01 +00:00
Adrian Johnson
ed2081d974 Specify a background color for XFAIL text
To improve readability on terminals with a white background.
2008-11-02 15:05:07 +10:30
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
Chris Wilson
ef98eb26f7 [test] Reenable device offset testing.
Restore device offset testing that was temporarily disable in the run up
to the 1.8 release.
2008-10-30 19:23:17 +00:00
Chris Wilson
336eddfdbb [test/get-clip] Check the status on the secondary context.
As we solely use a secondary context, we must manually report NO_MEMORY
errors whilst running under memfault.
2008-10-18 09:55:06 +01:00
Chris Wilson
bccfdf7d93 [test] Add support for memfault.
Add the core support to cairo-test for running the test-suite under a
malloc fault injector. This commit contains the adjustments to
cairo_test_run() to repeat the test if it detects a failure due to fault
injection and complains if it detects unreported faults or memory leaks.
2008-10-17 22:52:47 +01:00
Chris Wilson
7707027081 [test] Use _POSIX_C_SOURCE for flockfile.
From bug 18010 (https://bugs.freedesktop.org/show_bug.cgi?id=18010),
in order to make flockfile() available we need to set _POSIX_C_SOURCE and
according to the man page, the appropriate feature check is
_POSIX_THREAD_SAFE_FUNCTIONS.
2008-10-11 18:12:28 +01:00
Chris Wilson
9841d9d58e Automate error checking for fallback-resolution.
For this we extend the boilerplate get_image() routines to extract a
single page out of a paginated document and then proceed to manually
check each page of the fallback-resolution test.

(Well that's the theory, in practice SVG doesn't support multiple pages
and so we just generate a new surface for each resolution. But the
infrastructure is in place so that we can automate other tests,
e.g. test/multi-pages.)
2008-09-28 14:57:12 +01:00
Chris Wilson
260362e572 [cairo-test] Fix cairo_test_file_is_older().
It did not even compile, so no longer it wasn't deleting cached results
if you updated the reference images.
2008-09-27 19:16:34 +01:00
Chris Wilson
453443d77a [test] Write the OUTPUT filename to the log if we match the vector surface.
If the vector surface matches the output from last time, then the
rasterisation is skipped - but we need to write the expected OUTPUT
filename to the log so that the image is referenced from index.html.
2008-09-25 01:11:50 +01:00
Carl Worth
c3750cf218 Remove the device-offset testing (-25 cases) for the release.
The reasoning behind the -25 testing is that we want to ensure
that cairo provides translation invariance. However, for
many vector backends we use external rasterizers that don't
necessarily provide that translation invariance.

So this testing makes a bunch of failures appear that we don't
really care about, (and we don't even have a mechanism to turn
them off with custom reference images). For the release, I'm
just turning this off.

After the release, I plan to turn this back on, and then we could
fix this by ensuring that the vector output itself is unaffected
by a device offset, or by moving away from external rasterizers,
(see Chris's micro-gs work to test PostScript with cairo-based
rasterization).
2008-09-24 16:32:58 -07:00
Chris Wilson
77b43da99f [test] Fixup potential use of uninitialized test_image.
In the churn of reordering the tests, some of the error paths were left
unaltered - causing potential invalid dereferences.
2008-09-15 16:48:22 +01:00
Chris Wilson
e9e439a7a8 [test] Check for updated reference images.
Delete the results of previous runs if the reference images are more
recent.

There's still potential error if the conversion utility or its required
libraries are modified...
2008-09-11 12:58:48 +01:00
Chris Wilson
140ffa6e27 [test] Fix order of deleting images vs checks.
The early-checks assume that the images are still available - so it helps
not to unlink them before comparing results to the previous run.
2008-09-11 10:00:57 +01:00
Behdad Esfahbod
965b0e51ec [test] Do not include "xmalloc.h" directly
Not needed, it's renamed and included by boilerplate directly.
2008-09-04 23:25:27 -04:00
Behdad Esfahbod
a7951081f1 Move _GNU_SOURCE declarations to where it's used
Such that we don't rely on more GNU extensions accidentally.
2008-09-02 21:54:09 -04:00
Chris Wilson
7b2e8035f2 [cairo-test] Fixup a few memleaks on failure.
Free the test image before jumping to UNWIND_CAIRO.
2008-09-02 10:54:13 +01:00
Chris Wilson
bd21b2f630 [test] Ensure that the output is always saved.
Do the saving of the output first before checking for various failures
with respect to the reference images.
2008-08-26 23:03:08 +01:00
Chris Wilson
17a6d541f8 [test] Explicity save a fail image.
Be explicit about handling cached FAIL images, instead of relying on the
sequences of failed matches as the files are an external resource and we
can not guarantee their individual accessibility.

Note this also changes the filename, so you may want to run:
$ find -name '*-last.*' -print | xargs rm
after this checkout.
2008-08-21 08:45:06 +01:00
Chris Wilson
b9287e6669 [test] Cache last output and compare next time.
Compare the current output against a previous run to determine if there
has been any change since last time, and only run through imagediff if
there has been. For the vector surfaces, we can check the vector output
first and potentially skip the rasterisation. On my machine this reduces
the time for a second run from 6 minutes to 2m30s. As most of the time,
most test output will remain unchanged, so this seems to be a big win. On
unix systems, hard linking is used to reduce the amount of storage space
required - others will see about a three-fold increase in the amount of
disk used.  The directory continues to be a stress test for file selectors.

In order to reduce the changes between runs, the current time is no longer
written to the PNG files (justified by that it only exists as a debugging
aid) and the boilerplate tweaks the PS surface so that the creation date
is fixed. To fully realise the benefits here, we need to strip the
creation time from all the reference images...

The biggest problem with using the caches is that different runs of the
test suite can go through different code paths, introducing potential
Heisenbergs. If you suspect that caching is interfering with the test
results, use 'make -C test clean-caches check'.
2008-08-20 23:56:56 +01:00
Chris Wilson
5712a2c619 [test] Destroy test ouput image on failure.
Add the missing cairo_surface_destroy(). Sigh, less haste more speed.
2008-08-19 15:17:45 +01:00
Chris Wilson
0354457bed [test] Always write the test output to a png.
Always write the test output to a png so that it can be copied and used as
a reference image with CAIRO_REF_DIR.
2008-08-19 15:10:51 +01:00
Chris Wilson
86d221521b [test] Pass extended output name to ref_name_for_test().
Having included some extra details in the test output PNG filename, we
need to pass the extra information to
cairo_ref_name_for_test_target_format() in order to find the match.
2008-08-19 14:58:48 +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
93af67d7fd [test] Pass a 'complete' name to create_surface().
Construct the test name to pass to the boilerplate creation routines such
that it uniquely identifies the test in terms of test, target, content and
pass (similar, offset, thread). This allows the vector targets to create
output different output files for each test, whereas before, later tests
would overwrite existing files making debugging more difficult.
2008-08-13 22:01:51 +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