cairo/test
Keith Packard 45a966f695 Replace nesting-only surface clipping with gstate contained serial-number tracked clipping sets that are loaded into the surface on demand just before each rendering operation. This permits multiple cairo_t contexts to reference a surface without regard to ordering of operations among the contexts.
Also in this patch is a change to the xlib surface that creates two separate Pictures, one for source and one for destination operands which separates the source clipping from destination clipping. Cairo now specifies that sources are never clipped by any clipping applied to them as destinations.
Move cairo_clip_t (renamed from cairo_clip_rec_t) from cairoint.h to cairo-gstate-private.h. Eliminate stack of clip state from surfaces. Add new surface clipping API.
Manage clip objects entirely within the gstate, loading the whole thing into the surface just before drawing.
Source surfaces need not have clipping modified as the surface interface now specifies that source surfaces are always unclipped.
Eliminate nested clipping contexts, leaving clip management entirely to the gstate. Create new clip API for the gstate which uses per-surface serial numbers to match gstate clipping against current surface clipping values.
Surfaces no longer track clipping regions at all, so the old _cairo_surface_get_clip_extents has been replaced with _cairo_surface_get_extents. For PDF/PS surfaces, this function is expected to return a rectangle covering the entire fixed point coordinate space to leave rendering unclipped by the surface.
Region clipping capability is now signalled by a non-NULL function pointer in set_clip_region.
Each surface now contains two Pictures, one for source and one for destination operands so that source operands are never clipped by destination clipping.
CAIRO_STATUS_BAD_NESTING removed
self-copy now passes (Xlib only, until libpixman changes land)
reviewed by: krh, otaylor, cworth
2005-05-26 11:35:44 +00:00
..
.cvsignore Add simple test for ps surface backend (modeled after pdf-surface.c). 2005-05-17 01:05:35 +00:00
buffer-diff.c Removing mucking around with stderr and add a cairo_test_log function instead. 2005-05-10 20:25:38 +00:00
buffer-diff.h Add support for testing multiple backends, courtesy of cairo_surface_write_to_png. Currently, only image and xlib backends are fullk hooked-up, but other backends should be quite easy to add for anyone skilled in the appropriate art. 2005-04-27 13:33:25 +00:00
cairo-test.c Update cairo-xcb.h to provide the same style of interface as cairo-xlib.h. 2005-05-17 06:11:32 +00:00
cairo-test.h Brush the dust off the XCB backend and get it compiling and working again. This patch makes the XCB surface API match that of the Xlib surface API as of yesterday. But, it's already stale as the Xlib API changed again. So we'll need one more revision of the XCB backend before the next snapshot. 2005-05-14 14:01:46 +00:00
clip-nesting-ref.png src/cairo-surface.c src/cairoint.h: Add _cairo_surface_begin/end to save and restore the clip state of a surface. Copy and store clip regions set on a surface so that we can save and restore them. 2005-05-02 13:39:30 +00:00
clip-nesting.c Remove cairo_set_target_surface and all other backend-specific cairo_set_target functions. Require a cairo_surface_t* to call cairo_create. 2005-05-06 13:23:41 +00:00
clip-twice-ref.png Update these two once again, this time generated using libpixman-0.1.3 without leaky circles. 2005-01-27 12:28:17 +00:00
clip-twice.c and delete: 2005-04-14 14:42:26 +00:00
create-for-png-ref.png Change type of data parameter from char* to unsigned char*. 2005-04-04 09:47:12 +00:00
create-for-png.c Removing mucking around with stderr and add a cairo_test_log function instead. 2005-05-10 20:25:38 +00:00
create-from-png-ref.png Change type of data parameter from char* to unsigned char*. 2005-04-04 09:47:12 +00:00
create-from-png.c Removing mucking around with stderr and add a cairo_test_log function instead. 2005-05-10 20:25:38 +00:00
fill-and-stroke-ref.png Mark a couple of items that are now complete. 2005-04-18 05:25:57 +00:00
fill-and-stroke.c Originally: 2005-04-19 Carl Worth <cworth@cworth.org> 2005-04-26 12:38:06 +00:00
fill-rule-ref.png Update reference images for new rasterization in libpixman 0.1.3. 2005-01-21 11:27:56 +00:00
fill-rule.c and delete: 2005-04-14 14:42:26 +00:00
filter-nearest-offset-ref.png Originally 2005-04-20 Carl Worth <cworth@cworth.org> 2005-05-03 08:33:32 +00:00
filter-nearest-offset.c Originally 2005-04-20 Carl Worth <cworth@cworth.org> 2005-05-03 08:33:32 +00:00
get-and-set.c Originally: 2005-04-19 Carl Worth <cworth@cworth.org> 2005-04-26 12:38:06 +00:00
gradient-alpha-ref.png Make gradient change color in addition to just changing alpha in order to highlight distinction between interpolating in premultiplied vs. non-premultiplied space. 2005-04-14 14:02:03 +00:00
gradient-alpha.c Eliminate the following deprecated functions from cairo's interface: 2005-05-06 13:32:53 +00:00
imagediff.c Fix to return non-zero status on error. 2005-04-07 11:18:40 +00:00
leaky-polygon-ref.png Update reference images for new rasterization in libpixman 0.1.3. 2005-01-21 11:27:56 +00:00
leaky-polygon.c More _/- renames in the test directory. 2005-03-29 00:02:19 +00:00
line-width-ref.png Update reference images for new rasterization in libpixman 0.1.3. 2005-01-21 11:27:56 +00:00
line-width.c and delete: 2005-04-14 14:42:26 +00:00
linear-gradient-ref.png Comment and clean up the gradient computation. (_cairo_linear_pattern_classify): Determine if a linear gradient is horizontal or vertical. (_cairo_pattern_acquire_surface_for_gradient): Optimize horizontal/vertical gradients with a repeating surface. 2005-03-06 12:05:23 +00:00
linear-gradient.c Add new cairo_paint function. 2005-04-19 16:29:04 +00:00
Makefile.am Replace nesting-only surface clipping with gstate contained serial-number tracked clipping sets that are loaded into the surface on demand just before each rendering operation. This permits multiple cairo_t contexts to reference a surface without regard to ordering of operations among the contexts. 2005-05-26 11:35:44 +00:00
mask-ref.png src/cairo.[ch] doc/public/cairo-sections.txt: Add cairo_paint_with_alpha(). 2005-05-06 12:00:22 +00:00
mask.c Eliminate the following deprecated functions from cairo's interface: 2005-05-06 13:32:53 +00:00
move-to-show-surface-ref.png Add initial regression test suite. 2004-10-26 14:38:43 +00:00
move-to-show-surface.c Eliminate the following deprecated functions from cairo's interface: 2005-05-06 13:32:53 +00:00
paint-ref.png Add test to demonstrate bug in cairo_paint when under a non-identity transformation. 2005-04-26 18:56:37 +00:00
paint-with-alpha-ref.png Add new test for bug in cairo_paint_with_alpha not transforming the source. 2005-05-12 11:02:35 +00:00
paint-with-alpha.c Add new test for bug in cairo_paint_with_alpha not transforming the source. 2005-05-12 11:02:35 +00:00
paint.c Add test to demonstrate bug in cairo_paint when under a non-identity transformation. 2005-04-26 18:56:37 +00:00
path-data-ref.png Add reference image. 2005-03-14 11:49:12 +00:00
path-data.c Remove cairo_set_target_surface and all other backend-specific cairo_set_target functions. Require a cairo_surface_t* to call cairo_create. 2005-05-06 13:23:41 +00:00
pdf-surface.c Remove destroy_closure from cairo_output_stream_t interface. 2005-05-17 05:58:01 +00:00
pixman-rotate-ref.png New test case which exposes off-by-one rotation error in pixman. 2005-02-07 09:38:43 +00:00
pixman-rotate.c Remove cairo_set_target_surface and all other backend-specific cairo_set_target functions. Require a cairo_surface_t* to call cairo_create. 2005-05-06 13:23:41 +00:00
ps-surface.c Remove destroy_closure from cairo_output_stream_t interface. 2005-05-17 05:58:01 +00:00
read-png.c Removing mucking around with stderr and add a cairo_test_log function instead. 2005-05-10 20:25:38 +00:00
read-png.h Add initial regression test suite. 2004-10-26 14:38:43 +00:00
README Add paragraph on new features. 2004-10-26 16:31:31 +00:00
rel-path-ref.png Use correct arguments to compute absolute positions. 2005-05-02 12:36:20 +00:00
rel-path.c Use correct arguments to compute absolute positions. 2005-05-02 12:36:20 +00:00
romedalen.png New test case, covering various combinations of pattern types, drawing operations and clipping. Currently fails, for some combinations, coverage-ref.png is just a placeholder. 2005-01-26 13:41:55 +00:00
scale-source-surface-paint-ref.png Originally 2005-04-20 Carl Worth <cworth@cworth.org> 2005-05-03 08:33:32 +00:00
scale-source-surface-paint.c Remove cairo_set_target_surface and all other backend-specific cairo_set_target functions. Require a cairo_surface_t* to call cairo_create. 2005-05-06 13:23:41 +00:00
select-font-no-show-text.c Update to track new CAIRO_OPERATOR names. 2005-05-06 21:19:49 +00:00
self-copy-ref.png src/cairo-surface.c src/cairoint.h: Add _cairo_surface_begin/end to save and restore the clip state of a surface. Copy and store clip regions set on a surface so that we can save and restore them. 2005-05-02 13:39:30 +00:00
self-copy.c Replace nesting-only surface clipping with gstate contained serial-number tracked clipping sets that are loaded into the surface on demand just before each rendering operation. This permits multiple cairo_t contexts to reference a surface without regard to ordering of operations among the contexts. 2005-05-26 11:35:44 +00:00
set-source-ref.png Add set-source test in preparation for upcoming cairo_set_source patch. 2005-04-14 09:13:48 +00:00
set-source.c Eliminate the following deprecated functions from cairo's interface: 2005-05-06 13:32:53 +00:00
source-clip-ref.png src/cairo-surface.c src/cairoint.h: Add _cairo_surface_begin/end to save and restore the clip state of a surface. Copy and store clip regions set on a surface so that we can save and restore them. 2005-05-02 13:39:30 +00:00
source-clip.c Remove cairo_set_target_surface and all other backend-specific cairo_set_target functions. Require a cairo_surface_t* to call cairo_create. 2005-05-06 13:23:41 +00:00
source-surface-scale-paint-ref.png Originally 2005-04-20 Carl Worth <cworth@cworth.org> 2005-05-03 08:33:32 +00:00
source-surface-scale-paint.c Remove cairo_set_target_surface and all other backend-specific cairo_set_target functions. Require a cairo_surface_t* to call cairo_create. 2005-05-06 13:23:41 +00:00
surface-finish-twice.c Set freed pointer to NULL. 2005-04-13 14:51:59 +00:00
surface-pattern-ref.png Add a test of a repeating surface pattern. 2005-04-18 16:26:14 +00:00
surface-pattern.c Remove cairo_set_target_surface and all other backend-specific cairo_set_target functions. Require a cairo_surface_t* to call cairo_create. 2005-05-06 13:23:41 +00:00
testsvg Use the current point to offset just the destination, not the source and destination. With this fix, cairo_show_surface should work with the current point at places other than the origin. 2005-04-02 06:00:32 +00:00
text-cache-crash.c Eliminate the following deprecated functions from cairo's interface: 2005-05-06 13:32:53 +00:00
text-rotate.c Eliminate the following deprecated functions from cairo's interface: 2005-05-06 13:32:53 +00:00
transforms-ref.png Rework the cairo_matrix_t interface in several ways. Expose a struct for cairo_matrix_t. 2005-04-07 10:01:49 +00:00
transforms.c Eliminate the following deprecated functions from cairo's interface: 2005-05-06 13:32:53 +00:00
translate-show-surface-ref.png Add new test demonstrating bug in the sequence: cairo_translate; cairo_show_surface. 2005-04-11 14:04:56 +00:00
translate-show-surface.c Eliminate the following deprecated functions from cairo's interface: 2005-05-06 13:32:53 +00:00
trap-clip-ref.png src/cairoint.h src/cairo-traps.c: Add _cairo_traps_extract_region for converting trapezoids into a pixman region. 2005-04-13 11:23:43 +00:00
trap-clip.c Removing mucking around with stderr and add a cairo_test_log function instead. 2005-05-10 20:25:38 +00:00
user-data.c src/cairo.h src/cairo-font.c src/cairoint.h doc/public/cairo-sections.txt: Add cairo_font_face_set/get_user_data(). 2005-04-08 13:14:17 +00:00
write-png.c Change type of data parameter from char* to unsigned char*. 2005-04-04 09:47:12 +00:00
write-png.h Change type of data parameter from char* to unsigned char*. 2005-04-04 09:47:12 +00:00
xlib-surface.c Rework of cairo_xlib_surface create functions by Keith Packard: 2005-05-17 06:05:13 +00:00
xmalloc.c Removing mucking around with stderr and add a cairo_test_log function instead. 2005-05-10 20:25:38 +00:00
xmalloc.h Add support for testing multiple backends, courtesy of cairo_surface_write_to_png. Currently, only image and xlib backends are fullk hooked-up, but other backends should be quite easy to add for anyone skilled in the appropriate art. 2005-04-27 13:33:25 +00:00

Regression test suite for cairo.

Using this test should be as simple as running:

	make check

assuming that the cairo distribution in the directory above has been
configured and built. The test suite here goes through some effort to
run against the locally compiled library rather than any installed
version.

The test suite needs to be run before any code is committed and before
any release. Here are the rules governing the use of the suite:

Before committing
-----------------

All tests should return a result of PASS or XFAIL. The XFAIL results
indicate known bugs. The final message should be one of the following:

	All XX tests behaved as expected (YY expected failures)
	All XX tests passed

If any tests have a status of FAIL, then the new code has caused a
regression error which should be fixed before the code is committed.

When a new bug is found
-----------------------
A new test case should be added by imitating the style of an existing
test. This means adding the following files:

	new_bug.c
	new_bug-ref.png

Where new_bug.c is a minimal program to demonstrate the bug, following
the style of existing tests. The new_bug-ref.png image should contain
the desired result of new_bug.c if the bug were fixed.

Makefile.am should be edited, adding new_bug.c to both the TESTS and
XFAIL_TESTS lists.

When a new feature is added
---------------------------
It's important for the regression suite to keep pace with development
of the library. So a new test should be added for each new
feature. The work involved is similar the work described above for new
bugs. The only distinction is that the test is expected to pass so it
should not be added to the XFAIL_TESTS list.


When a bug is fixed
-------------------
The fix should be verified by running the test suite which should
result in an "unexpected pass" for the test of interest. Rejoice as
appropriate, then remove the relevant file name from the XFAIL_TESTS
variable in Makefile.am.

Before releasing
----------------
All tests should return a result of PASS meaning all known bugs are
fixed, resulting in the happy message:

	All XX tests passed