Commit graph

15 commits

Author SHA1 Message Date
Chris Wilson
8007618837 [test] Fix compilation of imagediff.
imagediff broke once again.
2008-11-04 13:03:24 +00:00
Benjamin Otte
c647c0bbca [TEST] make imagediff work again
It seems to have bitrotten
2008-10-09 13:22:01 +02: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
Chris Wilson
b47c772934 [test/bufferdiff] Move unused code.
Only imagediff calls png_diff, so it makes sense to move that function out
of the cairo-test and into the utility.
2008-08-20 23:20:09 +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
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
Carl Worth
d1834cca19 test: Ignore single-bit errors for SVG backend.
The interface of the various buffer/image_diff functions is improved to
provide the maximum pixel difference in addition to the number of pixels
that differ. This value can then be used to compare against a per-backend
tolerance.

Currently I've set the SVG backend's tolerance to 1 to handle some issues
we're currently seeing of single-bit differences on different systems, (but
we're not exactly sure why yet).

Also I improved the image_diff routines to properly report a status value
on failure rather than the bogus value of -1 for pixels_changed.
2006-08-31 04:01:10 -07:00
Carl Worth
9547521885 boilerplate: Remove custom read/write-png code in favor of using cairo surfaces
Also combine image_diff and image_diff_flattened into a single function
2006-08-31 01:09:39 -07:00
Carl Worth
5278de0997 Remove all remaining trailing whitespace.
This patch was produced with the following (GNU) sed script:

	sed -i -r -e 's/[ \t]+$//'

run on all *.[ch] files within cairo.

Note that the above script would have also created all the changes
from the previous commits to remove trailing whitespace.
2006-06-06 15:41:31 -07:00
Carl Worth
4670366ede Remove trailing whitespace from lines that look like comments.
This patch was produced with the following (GNU) sed script:

	sed -i -r -e '/^[ \t]*\/?\*/ s/[ \t]+$//'

run on all *.[ch] files within cairo, (though I manually excluded
src/cairo-atsui-font.c which has a code line that appears as a comment
to this script).
2006-06-06 15:35:48 -07:00
Vladimir Vukicevic
b3e2252b94 Augment test framework to test everything under device offsets as well.
[With this change, two tests with gradients exhibit subtle differences
under device offsets. I don't think we actually care about them
though. -cworth]
2006-05-03 23:42:45 -07:00
Carl Worth
7110c168f7 Remove redeundant -rgb24-ref.png images.
In several cases the -rgb24 reference images were identical to the -ref images.
So we change the logic to find the latter if the former doesn't exist, and then
we remove the redundant images.
2006-04-26 12:36:22 -07:00
Carl Worth
945e6c2458 Fix to return non-zero status on error. 2005-04-07 11:18:40 +00:00
Carl Worth
35b9e3c45d More _/- renames in the test directory. 2005-03-29 00:02:19 +00:00
Carl Worth
2a7a9d00cc test/imagediff.c
Add new testsvg script and accompanying imagediff program, (for interim SVG-based test suites while we wait for the standard cairo test suite to mature).
Split buffer_diff out into its own file for the purpose of imagediff.
2005-01-25 14:45:31 +00:00