Commit graph

13 commits

Author SHA1 Message Date
Andrea Canciani
e1353f3b85 test: Always use DejaVu Sans as default font
This makes the results of the test suite more stable across different
environments, because it does not rely anymore on
CAIRO_FONT_FAMILY_DEFAULT (which on Windows is "Arial", on Mac
"Helvetica").

This change should not affect Linux environments, assuming that the
default font is already set to "DejaVu Sans".
2015-07-27 12:45:59 +02: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
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
dc176d88ac [test] Trivial leak on error in show-glyphs-many.
Free the allocated glyph array after failure.
2009-03-18 09:44:33 +00:00
Jeff Muizelaar
fe40d3bdb0 [test] Allocate glyph array with malloc
Keeping it on the stack causes a stack overflow of Window's
default 1mb stack.
2009-02-09 23:43:04 -05:00
Chris Wilson
e90073f7dd [test] Build test suite into single binary.
Avoid calling libtool to link every single test case, by building just one
binary from all the sources.

This binary is then given the task of choosing tests to run (based on user
selection and individual test requirement), forking each test into its own
process and accumulating the results.
2008-10-31 12:30:11 +00:00
Chris Wilson
bb05beaab6 [test/show-glyphs-many] Check for NO_MEMORY
As we do a manual status check, we need to perform a full check.
2008-10-18 09:55:06 +01:00
Chris Wilson
02a56a4c84 [test/show-glyphs-many] Exercise xlib boundary conditions.
Within _cairo_xlib_surface_emit_glyphs() there are a number of
complications to do with packing as many glyphs as possible into a
single XRenderCompositeGlyph*() call. Essentially these consist of
choosing the right function and packing for the current glyphs, describing
runs of glyphs and ensuring that we do not exceed the maximum request size
within a single call. So we add to the test case we an attempt to show 64k
2-byte glyphs and an attempt to mix 64k 1-byte and 2-byte glyphs, with the
change-over point chosen to overflow the maximum request size, should
_cairo_xlib_surface_emit_glyphs() naively resize the current request.
2008-09-30 15:29:23 +01:00
Chris Wilson
2a347a92b0 [test/show-glyphs-many] Re-enable test to trigger crash in xlib.
Moral of this story is bugs cluster. If we made a mistake, especially in a
complicated bit of code that is interfacing with another library, then we
are likely to make a similar mistake in future. Disabling this test hid a
regression between 1.4 and 1.6.
2008-09-30 15:28:48 +01: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
cf1b23a4c5 Add prototype for draw in each test file and remove it from the header. 2006-07-13 12:58:24 -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
Carl Worth
34a4ad1e5b test/show-glyphs-many: New test case to demonstrate bug #5528
This demonstrates an Xlib crash when rendering many glyphs. See:

	_XError from XRenderCompositeText8
	https://bugs.freedesktop.org/show_bug.cgi?id=5528

for more details.
2006-03-02 10:32:38 -08:00