Commit graph

142 commits

Author SHA1 Message Date
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
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
f03d3f9f7f [boilerplate] Remove #if VERSION>1.9.0
Remove the obsolete #if statement.
2008-10-30 19:24:29 +00:00
Chris Wilson
cf072c7203 [sdl] Add new backend.
Add a new backend to allow easy interoperability with the Simple
DirectMedia Layer.
2008-10-30 17:04:53 +00:00
Carl Worth
eed6771764 Disable the svg12 target in boilerplate.
This target was added to the boilerplate during 1.8.1. It currently
shows many failures in the test suite. These failures likely fall
into three different classes:

	* Tests needing new svg12-specific reference images

	* Tests exercising bugs in librsvg

	* Tests exercising existing cairo bugs

We haven't gone through the effort to separate these, but even for
the tests that are exercising actual cairo bugs, these are likely
bugs that existed in the cairo 1.8.0 release and not regressions.

Because of that, in this commit I'm conditionally disabling the
testing of the svg12 target. As soon as we increment the cairo
version to 1.9.0 or higher, this target will get re-enabled
automatically and we can begin the work to separate the tests as
described above and also fix the bugs.
2008-10-28 17:12:15 -07:00
Chris Wilson
3ff86a4510 [test] Disable caching of SVG fail/pass surfaces.
As we use cairo to convert SVG files back to an image, that process is
dependent upon changes within our library and so we cannot skip the
conversion if the SVG file happens to match a previous run. Fortunately,
librsvg is quick enough that this is not a major issue.
2008-09-29 09:08:10 +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
e0f2147107 [boilerplate] Add a PS 2 target.
Ensure that we can generate PS2 output when required by creating a PS
level 2 target and using GhostScript for conformance testing.
2008-09-26 17:26:25 +01:00
Chris Wilson
0c030d3b76 [boilerplate] Add svg-1.2 target.
SVG 1.2 is sufficiently different from 1.1 that it has separate code
paths within cairo-svg-surface and so justifies its own boilerplate
target.
2008-09-26 17:11:51 +01:00
Chris Wilson
48099af9fe [boilerplate] Retry conversion in process if first attempt fails.
One possibility for a read failure whilst converting the image is if the
external utility crashed. This information is important for the test suite
as knowing input that causes the converter to crash is just as vital as
identifying a crash within the library.
2008-09-26 13:42:28 +01:00
Chris Wilson
f2c484d73c [test/any2ppm] Handle short reads/writes.
No excuse other than simple laziness - it manifested itself with random
"error whilst reading" failures.
2008-09-26 13:42:28 +01:00
Chris Wilson
2617d68a7b [boilerplate] Restrict number of retries to create an error surface.
Sometimes we just cannot get what we want, so give up - it's only an error
surface after all!
2008-09-15 17:11:36 +01:00
Behdad Esfahbod
7e45937e21 [boilerplate] Add cairo_boilerplate_version[_string]() functions 2008-09-02 21:56:37 -04: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
776844eb9e [boilerplate] Daemonic conversion utility.
In order to achieve substantial speed improvements the external conversion
utilities are rewritten as a daemon that communicates with the test suite
over a local socket. This is faster as it avoids the libtool and dynamic
linker overhead for each invocation, the caches persist between tests and
we no longer require a round trip through libpng.

The daemon is started automatically by the test suite and if communication
cannot be established then it falls back to using a pipe to a normal
conversion utility. The daemon will then persist for 60 seconds waiting
for further connections.

Of course any memory leak (stares at poppler) is exacerbated.
2008-08-19 11:15: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
3dc8e2dd0d [boilerplate] Dead store elimination.
Value stored to 'found' is never read.
2008-08-17 15:29:20 +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
f57100acd4 [test] Handle TEST_CONTENT_COLOR_ALPHA_FLATTENED similar surfaces.
Convert the boilerplate specific flattened content value to the ordinary
CAIRO_CONTENT_COLOR_ALPHA for use with cairo_push_group_with_content() -
otherwise cairo rightfully flags an error and the test harness decides
that the similar surface is not available.
2008-04-11 15:39:11 +01:00
Chris Wilson
968eaf3c44 [cairo-xlib] Fixup --disable-xlib-xrender
Fixup the headers and boilerplate to compile and run correctly when
configured with --disable-xlib-xrender.
2008-01-15 13:08:53 +00:00
Chris Wilson
755a4bb51b [test] Win32 printing backend testing depends upon ghostscript
Using the Win32 printing backend requires ghostscript, so only enable
those tests if we detect 'gs' during configure.
2008-01-10 17:10:41 +00:00
Adrian Johnson
5fa6225045 win32-printing: Add test boilerplate
Testing win32-printing requires setting the default printer to
a PostScript level 3 color printer. The PostScript output is
saved to a file and converted to png using ghostscript.
2007-10-21 23:49:33 +09:30
Adrian Johnson
8520ce31be PS: Add meta surface pattern support 2007-10-13 20:17:43 +09:30
Chris Wilson
dc23ecb619 [cairo-boilerplate] Do not throw an error if an exclude target is not found.
If we fail to exclude a target because it was not in the list of
targets - job done and no need to throw a tantrum.
2007-09-23 21:35:59 +01:00
Adrian Johnson
d24f019101 Add support for PDF meta-surface patterns 2007-09-05 22:26:16 +09:30
Chris Wilson
b60c0a672f [cairo-boilerplate] Introduce CAIRO_TEST_TARGET_EXCLUDE.
As opposed to the CAIRO_TEST_TARGET env var which lists the exact
targets to test, CAIRO_TEST_TARGET_EXCLUDE instead supplies a list of
targets to filter from the testing set. This is useful under
circumstances where the build environment prevents testing of a target,
for example no DirectFB support or the glitz library is broken, but where
you still want to perform the minimal check that the code compiles.
2007-09-03 14:37:16 +01:00
Behdad Esfahbod
d66f1ee82a [boilerplate] Build libcairoboilerplate.la in make check and make test 2007-08-23 14:00:12 -04:00
Carl Worth
d05593a5fb Add a new xlib-fallback target to test xlib using image fallbacks instead of the Render extension 2007-08-21 16:46:40 -07:00
Chris Wilson
7eaba5d5fb [configure] Only run PostScript tests if we have ghostscript.
During configure check for the ghostscript command line tool (gs) before
enabling the PostScript surface tests for make check.
2007-07-05 19:02:11 +01:00
Chris Wilson
efd212bfa2 [cairo-boilerplate] Protect against the nil cairo_scaled_font_t
Beware the NULL pointer deference when trying to adjust the max glyph
cache size...
2007-05-08 16:48:21 +01:00
Behdad Esfahbod
79098c0370 [scaled-font] Get rid of _cairo_scaled_font_test_set_max_glyphs_cached_per_font
in favor of cairo_boilerplate_scaled_font_set_max_glyphs_cached.
2007-04-21 03:43:04 -04:00
Chris Wilson
5135bcf414 cairo-boilerplate - use xmalloc and friends
Prefer to abort gracefully if we run out of memory (or simply to protect
them from memfault).
2007-04-20 19:08:07 +01:00
Behdad Esfahbod
abcd929c57 [boilerplate] Add cairo_boilerplate_format_from_content 2007-04-20 00:52:04 -04:00
Behdad Esfahbod
97624dc488 [boilerplate] Strip test-surfaces boilerplate into cairo-boilerplate-test-surfaces* 2007-04-20 00:52:04 -04:00
Behdad Esfahbod
2e709321d8 [boilerplate] Move xasprintf to xmalloc.c 2007-04-20 00:52:03 -04:00
Behdad Esfahbod
06718b0da6 [boilerplate] Remove leftover call to cairo_test_log 2007-04-20 00:52:03 -04:00
Behdad Esfahbod
99737a60cb [boilerplate] Clean up includes and remove unnecessary ones 2007-04-20 00:52:03 -04:00
Behdad Esfahbod
4b569f13d7 [boilerplate] Strip win32 boilerplate into cairo-boilerplate-win32* 2007-04-20 00:52:03 -04:00
Behdad Esfahbod
0a03d66fff [boilerplate] Rename create_win32_surface to _cairo_boilerplate_win32_create_surface 2007-04-20 00:52:03 -04:00
Behdad Esfahbod
5ee882d394 [boilerplate] Remove empty cleanup_win32 2007-04-20 00:52:03 -04:00
Behdad Esfahbod
23e6abc3fc [boilerplate] Strip glitz boilerplate into cairo-boilerplate-glitz* 2007-04-20 00:52:03 -04:00
Behdad Esfahbod
7d576a3767 [boilerplate] Minor indentation fix 2007-04-20 00:52:03 -04:00
Behdad Esfahbod
06b657ccf1 [boilerplate] Strip xcb boilerplate into cairo-boilerplate-xcb* 2007-04-20 00:52:02 -04:00
Behdad Esfahbod
65f636649d [boilerplate] Strip svg boilerplate into cairo-boilerplate-svg* 2007-04-20 00:52:02 -04:00
Behdad Esfahbod
8c9960675b [boilerplate] Strip pdf boilerplate into cairo-boilerplate-pdf* 2007-04-20 00:52:02 -04:00
Behdad Esfahbod
d9ce7de575 [boilerplate] Rename xcairo_surface_set_user_data to cairo_boilerplate_surface_set_user_data
and make it public.
2007-04-20 00:52:02 -04:00
Behdad Esfahbod
df6b8ecc89 [boilerplate] Strip ps boilerplate into cairo-boilerplate-ps* 2007-04-20 00:52:02 -04:00
Behdad Esfahbod
6461f0d120 [boilerplate] Remove unused variables 2007-04-20 00:52:02 -04:00
Behdad Esfahbod
f2d6275352 [boilerplate] Fix renaming typo 2007-04-20 00:52:02 -04:00
Behdad Esfahbod
d5535c993b [boilerplate/test] Move vector_ignored_tests from boilerplate/ to test/ 2007-04-20 00:52:02 -04:00