Commit graph

27 commits

Author SHA1 Message Date
Michael Haubenwallner
0916d580db test: fix include order for AIX, bug#89354 2015-03-05 17:02:14 -08:00
Chris Wilson
3d499ea901 xlib: Replace obsolete disable-xrender with shiny new device debug interface
As prototyped with xcb.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-22 10:41:37 +00:00
Benjamin Otte
2ce1afa322 test-suite: add image_diff_is_failure() function
This cleans the code and fixes a boolean logic error where this check
was done manually.
2010-04-28 13:15:09 +02: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
d56ea9cc87 [test] Set CAIRO_TEST_UNTESTED to 77
77 is the magic exit code used by automake to indicate a skipped test, so
by using it we can get a slightly more informative test log.
2008-08-13 21:55:19 +01:00
Chris Wilson
f85a4aec1f [test] Export a function to check whether a target is enabled.
Allow individuals tests to check whether a test target is enabled -
useful for those tests that circumvent cairo_test() and perform
feature testing.
2008-08-13 21:55:09 +01:00
Chris Wilson
436c0c8be2 [test] Preparatory work for running under memfault.
In order to run under memfault, the framework is first extended to handle
running concurrent tests - i.e. multi-threading. (Not that this is a
requirement for memfault, instead it shares a common goal of storing
per-test data).  To that end all the global data is moved into a per-test
context and the targets are adjusted to avoid overlap on shared, global
resources (such as output files and frame buffers). In order to preserve
the simplicity of the standard draw routines, the context is not passed
explicitly as a parameter to the routines, but is instead attached to the
cairo_t via the user_data.

For the masochist, to enable the tests to be run across multiple threads
simply set the environment variable CAIRO_TEST_NUM_THREADS to the desired
number.

In the long run, we can hope the need for memfault (runtime testing of
error paths) will be mitigated by static analysis. A promising candidate
for this task would appear to be http://hal.cs.berkeley.edu/cil/.
2008-08-13 21:54:59 +01:00
Behdad Esfahbod
b176b5c29d [test/get-xrender-format.c] Don't fail if DISPLAY is not set 2008-08-11 15:06:31 -04:00
Chris Wilson
9aac5916bc [test/xlib-surface] Check for mismatching Visuals and XRenderPictFormats
Vladimir Vukicevic reported that surfaces were being created with
mismatching Visuals and XRenderPictFormats - and demonstated here.
2008-04-08 07:52:47 +01:00
Chris Wilson
e57ef66fab [test/xlib-surface] Zero pixel buffers before use.
As we only use RGB24 surface data the alpha channel is undefined, so
zero it to prevent valgrind warnings.
2008-04-08 07:52:46 +01:00
Chris Wilson
968eaf3c44 [cairo-xlib] Fixup --disable-xlib-xrender
Fixup the headers and boilerplate to compile and run correctly when
configured with --disable-xlib-xrender.
2008-01-15 13:08:53 +00:00
Behdad Esfahbod
cd72167ede [xlib] Get rid of _cairo_xlib_test_disable_render
in favor of cairo_boilerplate_xlib_surface_disable_render.
2007-04-21 02:08:38 -04:00
Carl Worth
b52dda62fe Augment cairo_test_init with cairo_test_fini to avoid leak
Without this, any tests that were using cairo_test_init rather than
cairo_test would end up leaking a FILE* for the log file. So this
keeps valgrind much more happy with the test suite.
2007-03-02 11:31:13 -08:00
Carl Worth
b50b8db6d7 test: Simplify buffer_diff by handling device offset in advance
In a manner similar to flattening in advance, we now extract the sub-
surface of interest (when testing with device offsets) before calling
into the buffer_diff functions. This allows these functions to accept
a single stride value once again instead of one for each of the three
images.
2006-12-12 02:17:19 -08:00
Carl Worth
d1834cca19 test: Ignore single-bit errors for SVG backend.
The interface of the various buffer/image_diff functions is improved to
provide the maximum pixel difference in addition to the number of pixels
that differ. This value can then be used to compare against a per-backend
tolerance.

Currently I've set the SVG backend's tolerance to 1 to handle some issues
we're currently seeing of single-bit differences on different systems, (but
we're not exactly sure why yet).

Also I improved the image_diff routines to properly report a status value
on failure rather than the bogus value of -1 for pixels_changed.
2006-08-31 04:01:10 -07: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
195b1142e7 Prefix "cairo_*_test_*" symbols with underscore. 2006-06-29 15:22:44 +02:00
Robert O'Callahan
ddead8e061 Surface size getters for xlib
When accessing the underlying drawable etc of an xlib surface, it is
also helpful to be able to get the width and height without a server
round trip. This patch provides those functions.
2006-06-25 11:23:43 +02: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
65b9217cad cairo-xlib-test: Rename cairo_test_xlib function prefix to cairo_xlib_test 2006-05-24 11:37:05 -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
Jeff Muizelaar
594ba3ef69 use the newly added buffer_diff_noalpha for comparing buffers of CAIRO_FORMAT_RGB24. 2005-08-05 11:23:51 +00:00
Carl Worth
c525c684ca New public header file.
New function to reset all static data (eg. caches) to their initial state.
Fix check-valgrind target to depend on the 'all' target.
Add check for a new, proposed, XrmFinalize function.
Add cairo-debug.c.
Move the definition of CAIRO_BEGIN_DECLS to cairo-features.h so that it can be shared between public header files, and so that it doesn't clutter cairo.h
Implement reset_static_data in all modules as required.
Call cairo_debug_reset_static_data and FcFini so that we can have all tests be valgrind-clean with respect to memory leaks and still-reachable data.
2005-08-01 13:33:47 +00:00
Carl Worth
3cd006bb2b Fix to accept a cairo_pattern_t rather than a cairo_surface_t as the primary argument.
Track change in _cairo_pattern_release_surface and also pass the appropriate pattern for each acquired surface. The previous backend mismatch was causing memory leaks.
Remove stale comment.
Add missing fclose to keep valgrind happy about memory leaks.
2005-07-14 15:10:47 +00:00
Carl Worth
0c05b23b31 Rework of cairo_xlib_surface create functions by Keith Packard:
Add cairo_xlib_surface_create_with_render_format.
Reduce Xlib constructors down to two simple forms. Add width, height to constructors and eliminate any synchronous size queries from the implementation.
Update to match new cairo_xlib_surface_t create functions.
2005-05-17 06:05:13 +00:00
Carl Worth
6a1af1999d Cleanup output a bit, move verbose messages to test-specific log file. 2005-05-14 13:51:59 +00:00
Owen Taylor
bef4b13716 src/cairo-xlib-surface.c src/cairo-xlib.h doc/public/cairo-sections.txt: Drop the _for_pixmap() and _for_window() out of the create functions and use some lazy cleverness to sniff the information out as needed.
src/cairo-xlib-surface.c src/cairo-xlib-test.h Makefile.am: add cairo_test_xlib_disable_render() to turn off RENDER for tests.
Test various different types of Xlib surface creation.
Remove left-over include of Xrender.h.
2005-05-13 17:54:43 +00:00