Commit graph

9 commits

Author SHA1 Message Date
Andrea Canciani
75fea162d9 test: Cleanup macros
The ARRAY_LENGTH macro is used by many tests, although sometimes it is
named ARRAY_SIZE. Define it just once in cairo-test.h and reuse it.

In a similar way, MAX() and MIN() are currently defined in some
specific tests, while they could be reused.
2011-03-17 17:45:57 +01:00
Benjamin Otte
937465b15e tests: Fix gcc complaint
warning: ‘static’ is not at beginning of declaration
2011-02-17 18:09:22 +01:00
Andrea Canciani
ada6057b8c test: New radial-gradient tests
The old radial gradient tests were actually drawing the same gradients
with different operators (OVER/SOURCE) and operations (paint/mask).

It is possible to refactor them to share the gradient construction
code. This makes it easy to change the gradient shape in all of them
to test more interesting combinations.

Instead of testing 16 generic positions we are now testing just 7
cases, which correspond to every possible combination of the relative
size and position of the two circles defining the gradient. In
particular we are now testing a constant radius gradient and gradients
with tangent circles.
2011-01-02 18:31:35 +01:00
Chris Wilson
4dc62bbedc [test] Extend radial gradients to check r2 < r1
Include additional gradients to cover the cases where r1 > r2, as a pixman
bug was exposed by:
   [Bug 22908] Invalid output of radial gradient
   http://bugs.freedesktop.org/show_bug.cgi?id=22908
2009-07-24 10:44:03 +01: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
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
Carl Worth
40b6d8842e Remove radial-gradient test from XFAIL list
This test has not been failing since the fix in:

	772edc9133

So get rid of the '1 unexpected passes' complaint.
2007-03-14 15:06:36 -07:00
Carl Worth
2f4ddc85a5 Mark 5 tests that are currently failing as XFAIL (that is, not to be fixed before 1.4)
The 5 additional bugs that will be shipped with 1.4 are

	ft-text-vertical-layout-type1
	radial-gradient
	surface-pattern
	surface-pattern-scale-down
	surface-pattern-scale-up

Most of these are non-issues, (unbundled font for
ft-text-vertical-layout-type1), or very minor issues (radial-gradient
and surface-pattern). The only things in here that look like a real
bug are the surface-pattern-scale-down and surface-pattern-scale-up
tests where the xlib backend results have some non-1.0 alpha that is
very unexpected.
2007-03-05 22:48:27 -08:00
Carl Worth
d65455ed38 Add radial-gradient test case
Embarrassingly enough, the test suite previously never called
into cairo_pattern_create_radial at all. Unsurprisingly, this
has led to bugs creeping into the radial gradient implementation.
2007-03-01 13:16:38 -08:00