Commit graph

269 commits

Author SHA1 Message Date
Chris Wilson
07122e64fa [test] Repeat tests using cairo_push_group().
Test surfaces using similar surfaces with both CONTENT_COLOR and
CONTENT_COLOR_ALPHA, if applicable. This seems justified by the apparent
bugs in the pdf backend when going from an ARGB32 similar surface to
a destination RGB24 surface as well as isolated bugs in the image
backend.

The original goal was to try and trick the test suite into producing
a xlib surface with mismatching Visual/XRenderPictFormat. This succeeds,
although with a little bit of brute force in the xlib backend, but the
search to reproduce a BadMatch error fruitless.
2008-04-08 07:52:46 +01:00
Carl Worth
50d0767c8b Add a1-image-sample and a1-traps-sample tests
Both of these currently fail due to bugs in the way pixman does
its sampling.
2008-01-18 12:41:57 -08:00
Chris Wilson
630536f176 [test/extend-*] Add various cairo_pattern_set_extend() test cases.
Add various test cases to exercise
_cairo_pattern_acquire_surface_for_surface(), most notably using similar
source surfaces to provide coverage of the non-image surface branch.
2008-01-17 17:45:17 +00:00
Chris Wilson
3bf06c3366 [test/*] Create new surfaces using the group target.
cairo_get_target() returns the original surface passed to
cairo_create(), and not the current destination as required when
testing drawing to the same surface using multiple contexts.

For completeness we also use the group target when creating similar
surfaces within the tests (to check that similar surfaces of similar
surfaces also work).
2007-12-20 21:21:32 +00:00
Chris Wilson
14454e12d8 [cairo-test] Wrap test function with cairo_save/restore().
Restore the context to the original state before blitting the
group surface in order to remove any residual state such as a clip path.
2007-12-20 17:51:56 +00:00
Chris Wilson
281b11aef1 [cairo-test] Use CAIRO_OPERATOR_SOURCE when painting the group surface.
To correctly copy a surface onto the destination irrespective of its
content requires the SOURCE operator. Forgetting to do so here causes
uninitialized pixels to be mixed into the result and the failure of
many tests for the similar surface. Oops...
2007-12-20 17:12:08 +00:00
Brian Ewins
77e9b05b2b [test] support using a previous build as a reference
Allow using a previous test output directory as a source of
reference images. To make use of this, set the environment
variable 'CAIRO_REF_DIR' to point at an old test directory,
relative to the current test directory.

This is useful for testing backends when reference images haven't
been created yet, or which the current reference image structure
can't accomodate, like multiple font backends.
2007-11-10 01:34:03 +00:00
Brian Ewins
15fc1bbefb [test] log tested paths so that they can be parsed.
The test logs currently do not record the paths of
image output, the reference images tested against, and
the diffs created. This means that make-html.pl has to
duplicate the policy in cairo-test.c. Fix this by teaching
cairo-test.c to log the paths.
2007-11-10 01:33:47 +00:00
Chris Wilson
483ebe866d [cairo-test] Remove executable flag from source files.
chmod a-x test/cairo-test.[ch]
2007-10-24 19:33:22 +01:00
Chris Wilson
081507a09e [cairo-test] Repeat tests for similar surfaces.
Having noticed strange discrepancies creeping into similar surfaces
whilst working on the xlib backend, I thought it wise to also run
the test harness against similar targets. For consistency, only
targets whose similar surface use the same backend are included.

This can be disabled by exporting CAIRO_TEST_IGNORE_SIMILAR=1.
2007-10-20 00:15:34 +01:00
Behdad Esfahbod
409f973429 [test] If a test target fails, end the test
otherwise cairo is left in a dirty state and further tests are
unreliable.
2007-05-08 14:18:42 -04:00
Chris Wilson
b85920684f [cairo-test] Destroy the check image on failure
If drawing the checker pattern should fail, we need to free the
resources allocated locally.
2007-05-08 16:47:40 +01:00
Behdad Esfahbod
d5535c993b [boilerplate/test] Move vector_ignored_tests from boilerplate/ to test/ 2007-04-20 00:52:02 -04:00
Behdad Esfahbod
157074c794 [boilerplate] Add cairo_boilerplate_get/free_targets
This means, test and perf suites now share the same target handling
code, including parsing CAIRO_TEST_TARGET.
2007-04-18 19:46:30 -04:00
Behdad Esfahbod
47c02a6bd6 [boilerplate] s/_cairo_test_content_name/cairo_boilerplate_content_name/g 2007-04-18 19:15:16 -04:00
Behdad Esfahbod
9f3e0694e6 [test] Allow bypassing all test targets by setting CAIRO_TEST_TARGET=" " 2007-04-18 19:08:54 -04:00
Behdad Esfahbod
f3c8d82d6d [test] If backends are limited and all untested, pass the test
This is necessary to ensure that limiting backends using
CAIRO_TEST_TARGET does not increase the number of tests failing,
which is a desirable invariant.
2007-03-13 16:51:34 -04:00
Carl Worth
8c579ef835 More tightening of test cleanup to avoid valgrind complaints. 2007-03-02 12:30:14 -08:00
Carl Worth
b52dda62fe Augment cairo_test_init with cairo_test_fini to avoid leak
Without this, any tests that were using cairo_test_init rather than
cairo_test would end up leaking a FILE* for the log file. So this
keeps valgrind much more happy with the test suite.
2007-03-02 11:31:13 -08:00
Behdad Esfahbod
07d61af809 [paginated] Automatically issue a final cairo_show_page()
This means, PS/PDF/SVG do not need the final cairo_show_page() anymore.
If there is any drawing in the page, a cairo_show_page() is done
automatically.
2007-02-28 13:46:27 -05:00
Carl Worth
c426e71141 Hook up pdiff to the test suite now that its written in C 2006-12-14 07:58:02 -08:00
Vladimir Vukicevic
e1a8a8b65a [win32] Set win32 assertion failure handlers for tests to stderr
assert() will default to displaying a dialog box, which makes it hard
to run tests automatically.  Set the reporting mode to only report
to stderr in cairo_test(), and in path-data, since that triggers
an early assert.
2006-09-09 23:54:40 -07:00
Carl Worth
aeca64f6cd boilerplate: Allow targets to distinguish between test and perf.
Add a new cairo_boilerplate_mode_t so that the boilerplate targets can
do slightly different things if being tested for correctness vs. being
run for performance.
2006-09-09 17:32:50 -07:00
Carl Worth
195fd5cde6 boilerplate: Rename cairo_test_target_t to cairo_boilerplate_target_t 2006-09-09 16:04:51 -07:00
Carl Worth
bcb7863f00 Move target tolerance to cairo_test_target structure (should let single-pixel SVG errors pass)
Previously we were setting the target tolerance based on the surface
type. But that doesn't work as multiple backends will provide a surface
of type meta. So instead we put the tolerance as a value in the
cairo_test_target data structure.

With this change, some single-pixel errors of 1 in the SVG backend
should now be ignored.
2006-09-05 22:25:21 -07:00
Carl Worth
4915e0baa7 boilerplate: Fix missing include of config.h which was preventing many backends from being tested 2006-08-31 08:36:29 -07: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
d52a1f762d Move test-specific stuff out of boilerplate/ and back into test/
This now gives us two separate libtool convenience libraries,
so they have to have separate names now:
libcairoboilerplate.la and libcairotest.la.
2006-08-31 01:39:06 -07:00
Carl Worth
7f4e83ceeb Split libcairotest files out from test/ and into boilerplate/
The idea here is to setup boilerplate to allow code sharing between
test/ and the upcoming perf/
2006-08-30 15:34:27 -07:00
Behdad Esfahbod
6f8cf53b1e [test] Don't use signals if signal.h is not available 2006-08-17 22:03:36 -04:00
Pavel Roskin
a06af40c35 [test] Fix warnings in tests on 64-bit systems
Cast argiments from size_t to int.  size_t is 64-bit on 64-bit systems,
which causes a warning.  The actual data should fit 32 bit comfortably.
2006-08-13 04:47:11 -04:00
Behdad Esfahbod
cecf396f6f [test] Point out to the test log file on failures 2006-08-10 15:11:46 -04:00
Behdad Esfahbod
15074cbb04 [test] Behave better if no ref image was found for a test 2006-08-10 14:58:33 -04:00
Behdad Esfahbod
67ff765e30 [test] Rename beos_bitmap target to beos-bitmap. Same for directfb-bitmap. 2006-08-10 13:53:24 -04:00
Carl Worth
cb5edb6c35 Eliminate warning due to the test suite's private 'FLATTENEND' format value 2006-08-08 01:39:12 -07:00
Behdad Esfahbod
f089a07679 Fix misplaced volatile keyword 2006-08-08 04:36:13 -04:00
Carl Worth
c3b912d7db Eliminate most compiler warnings from the test suite 2006-08-08 01:16:49 -07:00
Behdad Esfahbod
127704c225 Look for per-target reference image too 2006-08-01 20:39:56 -04:00
Behdad Esfahbod
3d95919fab Switch from ghostscript's png16m driver to pngalpha for PS->PNG again.
We have switched back and forth quite a few times.  This time I'm switching
because with pngalpha we get gray antialiased text and graphics while with
png16m all we get is no antialiasing.  This is definitely a bug in the png16m
driver, but I won't wait until it gets fixed upstream.

Previously Carl Worth switched to pngalpha and reverted it immediately in
commit c4fc7b06b5.  I've now fixed image-diff to
work with the output of pngalpha, so we can switch.  It requires lots of
reference image updates, but still doesn't help with reducing the number of
PS-specific reference images we need.
2006-08-01 15:27:11 -04:00
Behdad Esfahbod
556a4d8405 Add vector_ignored_tests that is tests ignored for ps/pdf/svg
that includes all tests depending on CAIRO_ANTIALIAS_NONE and
CAIRO_ANTIALIAS_SUBPIXEL.
This removes separate pdf_ignored_tests and svg_ignored_tests
arrays that were out of synch and otherwise the same.
2006-08-01 15:16:10 -04:00
Behdad Esfahbod
2fa709d6af Set font options in the test context and make tests not do that
This should help with not requiring many backend-specific reference
images, and some should be removed now.
2006-07-31 15:17:15 -04:00
Behdad Esfahbod
47d3c5a2c6 Flush stdout after writing \r, to remove artifacts. 2006-07-14 20:06:34 -04:00
Behdad Esfahbod
6a5d66f651 Go back to "!!!CRASHED!!!" message now that there's no confusion. 2006-07-13 18:53:25 -04:00
Carl Worth
4b22cb41a9 Use 'FAIL' instead of 'UNEXPECTED FAILURE' in test output.
There's no ambiguity anymore due to duplicated printing, so go
back to the classic, and easier to read wording.
2006-07-13 15:23:06 -07:00
Carl Worth
b2d04d7f1a Rename no_fail_on_stdout to eliminate confusing negative inside a Boolean variable name 2006-07-13 15:21:02 -07:00
Carl Worth
ff1280ce98 cairo-test.c: Prefer FALSE and TRUE for cairo_bool_t values. 2006-07-13 15:17:57 -07:00
Behdad Esfahbod
ebc7367306 Fix test result formatting. 2006-07-13 18:18:08 -04:00
Behdad Esfahbod
b2668e944d Use cairo_bool_t. 2006-07-13 14:02:58 -04:00
Behdad Esfahbod
09dfae5fbf Don't write FAIL messages on stdout if both stdout/err are going to screen. 2006-07-13 13:37:47 -04:00
Carl Worth
f3d45d1790 Eliminate a few simple compiler warnings 2006-07-13 10:14:26 -07:00