Commit graph

1368 commits

Author SHA1 Message Date
Chris Wilson
3bad3efaa2 [test] Add cairo-test-trace to .gitignore 2009-06-19 19:09:03 +01:00
Chris Wilson
851c883962 [test] Add group-clip
Larry Ewing found an ancient and nasty bug whereby a path was not
corrected whilst pushing and popping groups.
2009-06-19 19:08:29 +01:00
Chris Wilson
0a34abace7 [test] Experiment with reference targets
Specify another boilerplate target to use as the reference for this
target. We then use this in cairo-test-trace in preference to using the
image surface. Still not perfect, though the framework is improving.
2009-06-19 19:06:17 +01:00
M Joonas Pihlaja
729457b174 [test] Add trap rendered ref images for fill-image.
The fill code path for the xlib and fallback surfaces use trapezoids
rather than spans, so there's lots of differences due to antialising
differences at the edge of the fill.  This patch adds a ref image
for the xlib and test-fallback surfaces.
2009-06-19 02:45:39 +03:00
M Joonas Pihlaja
8e7f667abb [test] Mark scale-offset tests as XFAIL for image, xlib-fallback.
The scale-offset tests trigger a loss-of-precision bug when
converting double matrices from cairo to pixman format.

http://lists.cairographics.org/archives/cairo/2008-November/015671.html
2009-06-19 02:45:38 +03:00
Chris Wilson
5ad64dfda2 [test] Add the sha1sum of the required fonts
(Note, I think these are currently out-of-date... But it will serve as a
useful reminder to verify and update them in future.)
2009-06-19 00:28:59 +01:00
Chris Wilson
6e78c94615 [test] Move calls to the getters from out of the innermost loops.
Tidy the code slightly by removing excess and unsightly calls to
cairo_test_get_context() and cairo_get_scaled_font().
2009-06-19 00:28:58 +01:00
M Joonas Pihlaja
9ecee571c1 [test/build] Don't test Freetype font stuff without Fontconfig.
Most Freetype hitting tests require Fontconfig to find
them some fonts.
2009-06-18 16:09:31 +01:00
M Joonas Pihlaja
742b1ad4b0 [test] Fix checking of the fenv.h include.
This adds a configure check for fenv.h and makes
invalid-matrix.c check for it with HAVE_FENV_H instead
of HAVE_FEDISABLEEXCEPT -- turns out Solaris doesn't
have fedisableexcept(), but it does have feclearexcept().

The same issue appears on OSX and was fixed in
ab86662ab4. This patch
adds some configure magic.
2009-06-18 16:07:56 +01:00
M Joonas Pihlaja
75f1d11d93 [test] Fallback to HUGE_VAL in place of INFINITY in invalid-matrix.c.
GCC 3.4.3 on OpenSolaris does not recognise INFINITY.  Use HUGE_VAL
instead for every compiler instead of just MSVC.
2009-06-18 16:07:56 +01:00
M Joonas Pihlaja
d1994d1ac2 [test/any2ppm] Daemonize without BSD's daemon().
Solaris libc doesn't provide daemon() so implement
any2ppm daemon's detaching without it.
2009-06-18 16:07:38 +01:00
M Joonas Pihlaja
c4c0693169 [test] Make test constructors without perl.
Remove the dependency on perl when building the test suite
by replacing the script which makes cairo-test-constructors.c
with a C program.
2009-06-18 15:41:19 +01:00
M Joonas Pihlaja
cdd27a8d4c [test] Never use gcc __attribute__ magic for constructors.
The configure test for __attribute__((constructor)) succeeds when
compiling with Sun Studio 12 on OpenSolaris but the attribute
is just ignored and has no actual effect.  This causes the test
suite to not run any tests at all.  With this patch we revert to
always using make-cairo-test-constructors.pl.
2009-06-18 15:39:16 +01:00
Nis Martensen
3c5e57e694 [test] Verify current point position after subpath closure
Make sure cairo_close_path always takes the current point where it
should be.
2009-06-17 16:39:00 +01:00
Chris Wilson
e5727e20f5 Expose _cairo_null_surface_create() via a test surface
Using a null surface is a convenient method to measure the overhead of the
performance testing framework, so export it although as a test-surface so
that it will only be available in development builds and not pollute
distributed libraries.
2009-06-15 12:03:37 +01:00
Chris Wilson
216a2e24c7 [test] Minor tweak to cairo-test-trace
Cleanse the code of a couple of redundant pointer manipulations.
2009-06-13 21:40:05 +01:00
Chris Wilson
2ab4245c86 [test] Need SOURCE when copying image data
As cairo-test-trace does not clear the image data before reuse, using
the default OVER operator will cause differing results for each process
when inadvertently alpha blending into the shared memory region. As we
essentially want to just copy the source pixels, be explicit and set the
SOURCE operator.
2009-06-13 21:36:20 +01:00
Chris Wilson
e003d665fe [test] Disable compilation of cairo-test-trace without shm_open()
Remember to only add cairo-test-trace to the list of EXTRA_PROGRAM so long
as we can actually compile it.
2009-06-13 19:18:11 +01:00
Chris Wilson
c092136fe9 [configure] Check for shm_open()
As needed for cairo-test-trace.
2009-06-13 19:07:37 +01:00
Chris Wilson
f298dd92ca [test] Remove dlmalloc
cairo-test-trace's shared memory allocation pattern is much simpler than
anticipated as it allocates a bunch of images and then frees them all,
and so only needs a simple linear allocator.
2009-06-13 19:07:00 +01:00
Chris Wilson
31b7652e1f [test] Never, ever, blame a crashing test on external factors. 2009-06-13 12:19:51 +01:00
Chris Wilson
3dde883b77 [test] Code review after sleep
Review cairo-test-trace.c and rewrite parts to ease understanding and fix
various bugs - such as failure to notice the slaves crashing and not
releasing our shared memory after an interrupt.
2009-06-13 10:38:52 +01:00
Chris Wilson
3b6e4018c6 [test] Add cairo-test-trace
The basic premise is that we feed the trace to multiple backends in
parallel and compare the output at the end of each context (based on
the premise that contexts demarcate expose events, or their logical
equivalents) with that of the image[1] backend. Each backend is
executed in a separate process, for robustness, with the image data
residing in shared memory and synchronising over a socket.

[1] Should be reference implementation, currently the image backend is
    considered to be the reference for all other backends.
2009-06-12 22:28:38 +01:00
Chris Wilson
a41e1275d2 [boilerplate] Make array of targets const.
Protect the boilerplate targets from unexpected modifications.
2009-06-12 22:28:38 +01:00
Chris Wilson
3f474555dd [test] Add jp2.jp2 to EXTRA_DIST
Required by test/mime-data and so triggering failures during distcheck as
it was not packaged.
2009-06-12 11:19:50 +01:00
Chris Wilson
80ba06803b [Makefile] Update list of reference images. 2009-06-12 08:33:24 +01:00
Carl Worth
fb21a0da87 Update CLEANFILES for 'make distcheck'
This is a standard part of the release ritual.
2009-06-11 15:28:02 -07:00
Chris Wilson
ac56371550 [test] Exercise overlapping glyphs
Quite an expensive test that converts an image into a distorted array of
glyphs, using a perspective transformation taking the intensity of the
pixel as depth. This generates a pretty picture and many overlapping
glyphs.
2009-06-09 00:06:08 +01:00
Chris Wilson
055e9b0eb6 [test] Cache resolved scaled-font
The intention is to stress test the solid pattern caches, so we can cheat
and avoid repeatedly resolving the toy font.
2009-06-07 23:35:57 +01:00
Chris Wilson
750c1b5b48 [configure] Check for FcInit() 2009-06-07 19:48:59 +01:00
Andrew Lavin
ab86662ab4 [test] Compile fix for invalid-matrix
Fixed test compile error on OS X that caused fenv.h not to be included.
2009-06-03 09:19:26 +01:00
Chris Wilson
cffb398f5a Add a generic cow-snapshotting framework
Provide a mechanism for backends to attach and remove snapshots. This can
be used by backends to provide a cache for _cairo_surface_clone_similar(),
or by the meta-surfaces to only emit a single pattern for each unique
snapshot.

In order to prevent stale data being returned upon a snapshot operation,
if the surface is modified (via the 5 high level operations, and on
notification of external modification) we break the association with any
current snapshot of the surface and thus preserve the current data for
their use.
2009-06-02 15:13:47 +01:00
Chris Wilson
cfd484cd01 [test] Change test semantics to match new in-fill definition
The in-fill definition has changed to include queries on the edges and
vertices, so update the test case to match.
2009-05-25 22:14:41 +01:00
Chris Wilson
791a6fa399 [memfault] Update macros to avoid namescape collision with memcheck
Basing the macro names of the memfault skin lead to a namespace
collision with memcheck. After updating the headers, update cairo's usage
to match.
2009-05-15 21:31:03 +01:00
Chris Wilson
c897f36a6b [test] Stress the ft from-face cache
Create a set of font faces using the same FT_Face to stress test the
handling of from-face fonts within the backend cache.
2009-05-15 21:31:03 +01:00
Chris Wilson
477df1f550 [test] Clear expected floating point exceptions
test/invalid-matrix deliberately feeds garbage into the API to test our
error detection. This causes FPE to be raised during the course of the
test - so they are deliberately disable for the duration. However, the
exceptions were not being cleared and so the FPE could be triggered on
the next floating point operation. This was being masked during make check,
by the fact that each test is run in its own forked process and was only
observed when multiple tests were run in foreground mode.
2009-05-15 21:31:03 +01:00
Chris Wilson
f47a93ef30 [test] Check text->path with user-fonts (twin)
Check behaviour of user-fonts, twin in particular, when using the text as
a path.
2009-05-15 21:31:02 +01:00
Chris Wilson
669e7ae5c9 [test] Relax APPROX_EQUALS condition
The bounding box of the text is rounded to the nearest pixel boundaries,
so therefore the test must accept a similar level of imprecision.
2009-05-15 21:31:02 +01:00
Chris Wilson
fe7410c6cd [test] Add a note to "Getting the elusive zero failures"
The test suite depends upon many external factors and in order to achieve
a pass, your system must match that upon which the reference images were
generated. Add a note to read test/README in case of failures so that the
casual user is not unduly alarmed by cairo reportedly failing.
2009-05-15 21:31:02 +01:00
Chris Wilson
2f962799a7 [test] Fix typos that excluded backend test sources 2009-05-15 21:31:02 +01:00
Chris Wilson
c25992479a [xlib] Use minimal depth for similar clones.
Damian Frank noted
[http://lists.cairographics.org/archives/cairo/2009-May/017095.html]
a performance problem with an older XServer with an
unaccelerated composite - similar problems will be seen with non-XRender
servers which will trigger extraneous fallbacks. The problem he found was
that painting an ARGB32 image onto an RGB24 destination window (using
SOURCE) was going via the RENDER protocol and not core. He was able to
demonstrate that this could be worked around by declaring the pixel data as
an RGB24 image. The issue is that the image is uploaded into a temporary
pixmap of matching depth (i.e. 32 bit for ARGB32 and 24 bit for RGB23
data), however the core protocol can only blit between Drawables of
matching depth - so without the work-around the Drawables are mismatched
and we either need to use RENDER or fallback.

This patch adds a content mask to _cairo_surface_clone_similar() to
provide the extra bit of information to the backends for when it is
possible for them to drop channels from the clone. This is used by the
xlib backend to only create a 24 bit source when blitting to a Window.
2009-05-15 21:31:02 +01:00
Chris Wilson
c488b33644 [test] Create a new fallback surface to exercise 16-bit paths.
Add a variation of test-fallback-surface that forces the use of a 16-bit
pixman format code instead of the standard 32-bit types. This creates an
image surface akin to the fallbacks used with low bit-depth xservers.
2009-05-05 21:17:11 +01:00
Chris Wilson
817589e196 [test] Call FcInit() manually.
Pre-initialise fontconfig whilst memfault is disabled to avoid a lot of
expensive, redundant testing of FcInit() throughout the test suite.
2009-04-20 10:21:24 +01:00
Chris Wilson
82cccb2672 [test] Handle memfaults during surface-finish-twice
Check and report memory allocation failures.
2009-04-16 09:34:02 +01:00
Chris Wilson
f12d52bfca [test] Use xmalloc() to evade memfault.
Do not use the simple malloc() as memfault will inject allocation failures
(unlike xmalloc() for which faults are excluded) - as this is unnecessary
inside the test harness and thus does not exercise any cairo code paths.
2009-04-16 09:34:02 +01:00
Chris Wilson
ca501d99bb [test] Disable signal handling under valgrind
Capturing and handling the signals prevents valgrind from providing
backtraces for fatal signals -- which is often more useful.
2009-04-16 09:34:01 +01:00
Jeff Muizelaar
2d6336624c [test-win32] Fix static linking of the test suite.
Previously, the test suite needed to be dynamically linked to work.
2009-04-01 11:32:58 -04:00
Chris Wilson
b580a4a8d6 [test] Improve fault injection coverage
In order to exercise the meta-surfaces, we need to inject faults into
cairo_surface_finish().
2009-03-31 12:16:01 +01:00
Chris Wilson
aee71e2063 [test] Memfault checks.
Don't assume an error means the test failed, check for injected allocation
errors.
2009-03-30 13:41:00 +01:00
Chris Wilson
ac30ced613 [test] Check for surface create failure.
If the image surface creation fails, the data pointer will be NULL leading
to a segfault -- so check!
2009-03-24 07:50:58 +00:00