Commit graph

231 commits

Author SHA1 Message Date
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
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