Commit graph

269 commits

Author SHA1 Message Date
Behdad Esfahbod
0ac2bbbf52 Improve test HTML generation:
- Make "make retest" not generate all .log files.
- Format improvements in the generated HTML file.
2006-07-13 11:27:05 -04:00
Behdad Esfahbod
973d3a3d14 More test suite infrastructure improvements:
- Remove cairo_test_expect_failure.  cairo-test.c now checks
  env var CAIRO_XFAIL_TESTS to see if the running test is
  expected to fail.  The reason for expected failure is
  appended to the test description.
- Test description is written out.
- Failed/crashed tests also write a line out to stderr (in red),
  so one can now redirect stdout to /dev/null to only see failures.
- cairo_test() has been changed to not take the draw function
  anymore, instead, draw function is now part of the test struct.
- "make check" doesn't allow limiting backends to test using env
  var anymore.  To limit backends to test, one should use the
  TARGETS variable on the make command line.
- "make check-valgrind" now writes its log to valgrind-log instead
  of valgrind.log, to not interfere with test log file processing.
2006-07-11 22:19:39 -04:00
Behdad Esfahbod
94bdbc15f7 Improve test suite build infrastructure
- Add new target recheck, that checks only failed tests
- Add targets test and retest, and make html after (re)checking
- Make targets html and index.html lazy, only update if any tests changed
- Improve build system such that checking one test (using TESTS=...) doesn't
  build all tests
- Remove pixman-rotate from XFAIL
2006-07-11 17:27:08 -04:00
Behdad Esfahbod
95016b3274 Make CAIRO_TEST_TARGET="" make check pass tests. 2006-07-06 13:48:18 -04:00
Behdad Esfahbod
1cb0bc40a3 Do not use sighandler_t. Bug 7401. 2006-07-05 04:22:32 +02:00
Behdad Esfahbod
01b1f3572c Detect and report crashes in tests. 2006-07-01 02:07:28 +02:00
Carl Worth
80cb0d5ba1 Fix some leaks in the test suite itself. 2006-07-01 00:37:44 +02:00
Carl Worth
14e7883fae Fix a memory leak by removing accidentally duplicated code. 2006-07-01 00:00:43 +02:00
Carl Worth
d2ea21b4ae ft-text-antialias-none: Update reference images and igore list.
Add a new ps reference image due to slightly different rasterization. Also
update pdf and svg backends to ignore this test since those backends do not
support ANTIALIAS_NONE.

Note in ROADMAP that bug 6759 is fixed now.
2006-06-25 11:48:32 +02:00
Carl Worth
a3f2d92f11 PDF: Don't fallback due to CAIRO_ANTIALIAS_NONE
This was a gratuitous thing that was causing excessive fallbacks in
mozilla printing to PDF. The only reason it was ever there was to
get some of the tests that rely on CAIRO_ANTIALIAS_NONE to pass.
Instead we now simply don't run those tests against the PDF backend.
2006-06-19 11:03:32 -07:00
Ian Osgood
6f0a85c8f7 Update the XCB backend for screen sensitivity. 2006-06-16 22:43:49 -07:00
Behdad Esfahbod
bc4a6796f8 Accept CAIRO_TEST_TARGET being empty or containing a list of backends to test.
The list can be separated by any of space, tab, comma, colon, or semicolon.
Moreover, a CAIRO_TEST_TARGET of e.g. "glitz" matches any subtarget like
"glitz-glx".
2006-06-16 19:01:20 -04:00
Carl Worth
b2f274b3e8 New API: Replace cairo_{ps,pdf,svg}_set_dpi with new cairo_surface_set_fallback_resolution.
This just provides the mechanics for storing the value and removing the old
function calls. The new value is still not used anywhere (though nor where
the old values), so there should be no functional change (other than forcing
any programs calling the old API to be updated).
2006-06-09 16:52:17 -07:00
Carl Worth
ef10a0403a Remove initial, final, and duplicate blank lines.
This patch was produced by running git-stripspace on all *.[ch] files
within cairo. Note that this script would have also created all the changes
from the previous commits to remove trailing whitespace.
2006-06-06 15:50:33 -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
Carl Worth
80b8deb1e4 Remove extraneous whitespace from "blank" lines.
This patch was produced with the following (GNU) sed script:

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

run on all *.[ch] files within cairo.
2006-06-06 15:25:49 -07:00
Carl Worth
d0dd3b822e New API: Add new function cairo_surface_get_content
This assumes that the directfb, glitz, and quartz backends
always create surfaces with content of COLOR_ALPHA which might
be totally wrong.
2006-05-24 17:19:00 -07:00
Ian Osgood
57a0242d06 Additional piece of "Fix the XCB backend build for the XCB 0.9 release." 2006-05-04 14:43:03 -07:00
Emmanuel Pacaud
457132fc2b SVG: Don't test rectangle-rounding-error.
This test uses CAIRO_ANTIALIAS_NONE, which is not supported yet by
the SVG backend.
2006-05-04 21:41:36 +02:00
Emmanuel Pacaud
a428f11738 SVG: Fix bug in test suite causing SVG to fail with rgb24 and device offsets.
Same fix as for PDF and PS surfaces.
2006-05-04 14:18:59 +02:00
Carl Worth
a6b1b014bb Implement the device_offset functionality at surface, not gstate layer
This is a mega-patch that has the advantage that the entire test suite
passes both immediately before and immediately after this commit.

The disadvantage of the mega-patch is that it does not reflect the
development history of the device-offset branch, (with its various
fumblings and flailings). To capture that history, we will next merge
in that branch.
2006-05-04 01:45:41 -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
Emmanuel Pacaud
6a33993b15 Merge branch 'origin' 2006-05-01 22:01:38 +02:00
Emmanuel Pacaud
b920dfd3df SVG: Reenable operator tests, and rgb24 surface are meta-surfaces. 2006-05-01 21:59:53 +02: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
Behdad Esfahbod
f1c3754753 Use white on red for failures. 2006-04-25 09:58:48 -04:00
Behdad Esfahbod
9668b6592f Set background color to red for test failures printing on a terminal. 2006-04-25 09:03:26 -04:00
Carl Worth
bef621e870 Augment tests to do better testing of paths/images with alpha.
Add a new cairo_test_paint_checkered function so that tests that draw
with alpha can easily put an easy-to-see checkered background in place
first.

Add new tests caps-joins-alpha and paint-source-alpha that do simple
tests of strokes and image painting with source pattern alpha.

Also, add the checkered background to paint-with-alpha for
consistency.
2006-04-25 01:56:51 -07:00
Christian Biesinger
e0bf137804 Fix create_xcb_surface signature 2006-04-23 21:22:17 +02:00
Emmanuel Pacaud
62d2f7cbf3 SVG: Return UNTESTED for test involving operators.
unbounded-operator, operator-clear, operator-source, clip-operator
2006-04-17 09:54:03 +02:00
Emmanuel Pacaud
714bb88832 SVG: Add support for CAIRO_CONTENT_COLOR in create_similar.
Also add support for testing this feature in test/cairo-test.c
And a bunch of unwanted commit of sgml files.
2006-04-16 15:42:49 +02:00
Emmanuel Pacaud
e952e0aff8 SVG: Add documentation for public API. Fix test filenames and add testing of CAIRO_CONTENT_COLOR 2006-04-14 22:53:58 +02:00
Carl Worth
c81569d2f1 Flesh test-paginated-surface out into a complete surface.
This adds an aactual test_paginated_surface_backend rather than just
having this test surface create a paginated surface around an image
surface. This is a more realistic test of what a paginated surface is
and should be more useful as an example of how to use the paginated
surface, (and in particular the analysis portions).
2006-04-14 11:05:35 -07:00
Carl Worth
b87726ee2a Tweak initial erase so it doesn't trigger fallbacks for every PS test case.
Add an optimization to cairo-ps-surface.c so that it ignores any
CAIRO_OPERATOR_CLEAR drawing operation that occurs on a blank page.
Also change the test suite to erase with OPERATOR_CLEAR instead of
OPERATOR_SOURCE with an all-0 source pattern.

With this change, 32 of the 61 test cases change from all-fallback to
all-native for the ps backend.

Of these 32 test cases, 13 pass the test suite with the original
reference images. Another 18 cases differ only in the single-pixel
boundary of objects due to cairo vs. ghostscript rasterization
differences. We ignore these by adding new ps-specific reference
images, (included in this commit).

Finally, there appears to be one genuine failure, (dash-caps-joins),
in which the PostScript dashes (at least as rendered by ghostscript)
differ significantly from the cairo-rendered dashes.
2006-04-06 09:43:39 -07:00
Carl Worth
c4fc7b06b5 Revert "Use ghostscript's pngalpha rather than png16m target for PS->PNG"
This reverts 3b873c66be commit.

It seemed like a good idea at the time, but...
The pngalpha target only gets the fully transparent regions correct.
But we still need to get the partially translucent regions correct.
The pngalpha target doesn't help here---instead we were already
flattening the reference image during testing. And in that case,
having anything other than alpha==1 in the output png doesn't really
help, (and meanwhile it was tripping up the current buffer_diff code).
2006-04-06 08:54:59 -07:00
Carl Worth
3b873c66be Use ghostscript's pngalpha rather than png16m target for PS->PNG
This target allows the output files to actually be transparent where
there is no PostScript "ink", which allows for much better testing.
2006-04-05 17:09:45 -07:00
Carl Worth
66ed9811cc Merge branch 'cairo-origin' into analysis-surface
With the string-array-stream stuff that this merge picks up, the
analysis-surface branch is now passing all of the test suite again.
2006-04-04 14:58:52 -07:00
Carl Worth
0114393a13 Explicitly remove the output png image before creating it during testing.
What was happening here is that some backends (such as the PS surface
backend) directly generate an output file, and then run a conversion
process to generate the png file. Some bugs were such that a broken
file would successfully be generated, the conversion would fail (the
failure was unnoticed), and the test suite would happily verify the
old image from a previously successful run.

This fix eliminates this source of false positives.
2006-04-04 11:17:25 -07:00
Carl Worth
1dd6e417c1 Add testing for cairo_surface_get_type.
All test targets now list an expected cairo_surface_type_t. Add notes
on current limitations of PDF/PS/meta-surface support that causes
CAIRO_CONTENT_COLOR similar surfaces of PDF and PS surfaces to be
returned as image surfaces.

Add cairo_internal_surface_type_t for the meta, paginated, and various
test surfaces.
2006-02-28 00:55:27 -08:00
Emmanuel Pacaud
9c05d2aab1 fix filename.
shh!
2006-02-02 12:47:58 +00:00
Christian Biesinger
2afe78c0c2 Don't mix declarations and code. This makes the code valid ISO C, fixes a gcc -pedantic warning, and unbreaks the build with the compiler Zeta ships with. 2006-01-21 09:39:10 +00:00
Carl Worth
074f886c00 Rip the cairo_content_t argument out of ps/pdf_surface_create as per discussion on cairo mailing list. Instead these surface will behave as if CONTENT_COLOR_ALPHA had been passed (that is, compositing operators will behave as if destination alpha were available).
This also has the benefit of preserving the API that has been in place for PS/PDF surface since the (experimental) stuff in 1.0.0.
Track API change.
Continue testing PS/PDF surfaces in the CAIRO_CONTENT_COLOR mode but do it by rendering to an intermediate similar surface rather than constructing the target surface differently.
2006-01-19 17:48:22 +00:00
Carl Worth
c634e54775 Change documentation to recommend cairo_paint rather than cairo_rectangle;cairo_fill for clearing a surface.
Add documentation. Add a cairo_content_t argument to PDF surface constructors.
Add documentation. Add a cairo_content_t argument to PS surface constructors.
Track changes in PS/PDF surface constructor API.
2006-01-18 16:40:17 +00:00
Carl Worth
b5c5fb613d Big change to the test infrastructure and supporting internals. The goal now is to test both a COLOR_ALPHA and a COLOR content for each surface backend, (since the semantics are different and we probably need to support both in each backend.
The PS/PDF backends don't allow a content to be passed in right now, so they fail against the rgb24 tests, but the trivial addition to the constructors will allow them to pass all tests with both content values.
And new constructors (currently internal only) to create an image surface with a cairo_content_t rather than a cairo_format_t.
Add a cairo_content_t argument to the constructor.
Add a cairo_content_t to the constructor and use this content value when constructing intermediate image surfaces in acquire_source, show_page, copy_page, and snapshot.
Add image flattening by compositing over white, as is done in cairo-ps-surface.c.
Track changes to cairo-paginates-surface which now requires a cairo_content_t value (no change to public PS/PDF constructors yet).
Track change in meta-surface and paginated-surface interfaces by now accepting a cairo_content_t rather than a cairo_format_t.
Ignore new output files (argb32 from pdf and ps as well as rgb24 from test-fallback, test-meta, and test-paginated).
Add new utility for flattening PNG images in order to generate the -argbf-ref.png images.
Add image_diff_flattened for comparing flattened output from PS and PDF backend with ARGB reference images by first blending the reference images over white.
Get rid of conditional, format-specific background-color initialization before running tests. Now uses ARGB(0,0,0,0) in all cases. Switch from specifying tests with a format value to specifying tests with a content value. Add support for a 'fake' COLOR_ALPHA_FLATTENED content for testing the PS and PDF output against a flattened version of the argb32 reference images (first blended over white).
Track change in cairo_ps_surface_create (now requires cairo_content_t value).
Adjust tests that draw in default (black) to first paint white so that the results are visible.
Adjust ARGB32 reference images for new white background for changed tests.
Adjust RGB24 reference images for new black background due to changed initialization (and the tests themselves being unchanged).
2006-01-17 16:59:08 +00:00
Vladimir Vukicevic
c6cdfc5770 Clamp surface dimensions to a minimum of 1. (_cairo_glitz_surface_get_image): Set the glitz clip to NULL before calling glitz_get_pixels, to return the full surface contents. Restore clip afterwards. (_cairo_glitz_surface_composite_trapezoid): Return UNSUPPORTED if the antialias is anything other than DEFAULT/GRAY.
Try to recover a standard cairo_format_t from given pixman format masks, so that various things that only work with a standard format work correctly.
Remove cairo_glitz_surface_write_to_png, replace with generic cairo_surface_write_to_png (since it works with image-surface create_with_masks fix)
2006-01-03 09:23:48 +00:00
Michael Emmel
23e5e55841 New directfb backend for cairo includes test suite and example to run the test is in the comment at the top of cairo-test-directfb.c enable with
--enable-directfb
2005-12-29 07:17:01 +00:00
Carl Worth
e71e2fc4f1 Add a private cairo_paginated_surface_t which builds on top of the meta surface and is intended to provide an easy interface with common functionality for the various paginated surface types (ps, pdf, etc.).
Add test_paginated_surface_t which is another test surface enabled with --enable-test-surfaces. The test_meta_surface code served as the basis for cairo_paginated_surface_t so that test surface may be entirely superfluous now.
2005-12-21 16:46:44 +00:00
Carl Worth
75b2fe93f0 Use _cairo_surface_paint rather than _cairo_surface_fill_rectangle as only the former is guaranteed to work with all backends.
Refine the comment describing this test surface.
Add new test surface for exercising cairo_meta_surface.
Simplify the image and test_fallback targets by not using create_for_data. Allow for NULL cleanup target functions. Add support for the test_meta_surface.
2005-12-19 22:01:39 +00:00
Emmanuel Pacaud
ec574cd6f0 CAIRO_CAN_TEST_SVG_SURFACE depends on librsvg.
cairo_svg_surface_t owns a xml node, for support of svg_surface_composite. (_cairo_svg_surface_create_for_document): init xml_node. All surfaces except first one are stored in defs node. (emit_composite_image_pattern): returns pattern size, and don't call emit_transform if is_pattern == TRUE. (emit_composite_svg_pattern): do something. (emit_composite_pattern): returns pattern size. (_cairo_svg_surface_composite): xml_node is stored in cairo_svg_surface_t now. (emit_surface_pattern): emit surface pattern width here. Fix property names. (_cairo_svg_path_close_path): don't close path if no current point. (_cairo_svg_surface_fill_rectangles): new. (_cairo_svg_surface_fill): emit fill rule. xml_node is in surface now. (_cairo_svg_surface_composite_trapezoids): xml_node is in surface now. (_cairo_svg_surface_stroke): ditto. (_cairo_svg_surface_intersect_clip_path): ditto. Emit fill rule.
ignore svg2png.
build svg2png utility.
test SVG backend if CAIRO_HAS_SVG_SURFACE && CAIRO_CAN_TEST_SVG_SURFACE.
new.
2005-12-19 13:59:34 +00:00