Commit graph

31 commits

Author SHA1 Message Date
Andrea Canciani
5ce6e02793 test: Use fork() on MacOS X
MacOS X 10.7 (and maybe some previous versions, too) can fork()
processes which use CoreGraphics. This makes it possible for
cairo-test-suite to withstand a test crash without killing the whole
suite.

The old behavior is still available using the '-f' (foreground)
option.
2011-12-15 13:04:02 -08:00
Andrea Canciani
603ea229b5 test: Use cairo_test_list_t for the main test list
Instead of embedding the pointer in the test structure, consistently
use the cairo_test_list_t structure for test lists.

This cleans up the code as the reverse-list operation can be reused.

Moreover this makes the code clearer, because each test list is now
independent and has no way to know about other test lists.
2011-11-12 20:49:08 +01:00
Andrea Canciani
c8b5d270f6 Improve the documentation of the flags
Some utilities were providing incorrect or incomplete usage
information.
2011-11-12 20:49:08 +01:00
Andrea Canciani
6a0ba30303 Sort option flags
Keep the option flags in alphabetical order. This makes it easier to
check for collisions or missing handlers.

Avoids an internal error when passing flags -c, -r or -v to
cairo-analyse-trace.
2011-11-12 20:49:08 +01:00
Chris Wilson
5f8ee79b40 test: Write the individual test logs to output/
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-15 14:21:20 +01:00
Paulo Zanoni
ee15e030d8 cairo-test-runner: don't leak argv
If CAIRO_TESTS is set, argv will be replaced by a xmaloc'ed variable. We
need to free it.

This can be easily detected by running:
CAIRO_TESTS=user-font make check-valgrind TARGETS=image

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-09 18:44:18 +01:00
Paulo Zanoni
669242c2c8 test: fix append_argv()
When I ran "CAIRO_TESTS=a1-bug make test", no test executed because of a
bug in append_argv(). The "olen" variable was assuming that we always
only append a single argument to argv and the resulting argc was also
wrong.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-09 18:43:15 +01:00
Andrea Canciani
4ef32a36ba test: Silence gcc warnings
warning: cannot optimize possibly infinite loops

gcc does not detect that the "infinite" loops are actually just one or
two iterations, depending on the has_similar value being FALSE or
TRUE. It realizes it if the iteration variable and the iteration stop
value are both enum values.
2011-03-17 17:35:28 +01:00
Andrea Canciani
d6efb2a0b7 test: Silence gcc warning
cairo-test-runner.c:180: warning: unused variable ‘buf’
2011-03-17 17:04:42 +01:00
Benjamin Otte
f847b3c216 test: Fix gcc complaints about old style definitions 2011-02-19 10:25:22 +01:00
Andrea Canciani
4e064b3a32 test: Make tests run in natural order
When tests are registered, they are prepended to a list.
Reverting the list, we get a list whose order is the same as that
of registration.
2010-10-07 23:09:13 +02:00
Andrea Canciani
cb28e0bfeb test: correct options in getopt call
'k' was missing and 't' was present but unhandled. Options have been
reordered according to the "USAGE" ordering.
2010-06-17 08:42:39 +02:00
Chris Wilson
299263f8c9 test: Disable tests that are too slow to run by default.
Introduce a slow mode [-s] to the runner, and add "slow" to the
requirements for the very long running tests like the coverage stress
tests.
2010-06-12 14:06:06 +01:00
Chris Wilson
53139261c7 test: Use exact matching on test names by default.
Specifying individual tests to run is more common than using a group
chosen from a keyword, so change the default matching mode and introduce
'-k' to select by keyword.
2010-06-12 14:06:06 +01:00
Chris Wilson
bd3d9ef3d1 test: Distinguish tests that throw an error from a normal fail.
Hitting an error in a test case is almost as bad as crashing, and the
severity may be lost amidst "normal" failures. So introduce a new class
of ERROR so that we can immediately spot these during a test run, and
appropriately log them afterwards.
2010-06-11 09:14:16 +01:00
Chris Wilson
4e3c19833e test: Force cairo-test-suite to return SUCCESS
Set the CAIRO_TEST_FORCE_PASS environment variable to run through the
test suite and ignore errors. Useful for forcing distcheck to continue
past a broken test suite.
2010-05-08 18:24:48 +01:00
Chris Wilson
2c68fcace4 test: Embed the list pointer into cairo_test_t
Reduce the amount of output printed by leak-detectors when a test
crashes.
2010-05-04 13:28:36 +01:00
Eric Anholt
9057c4b6be test: Add an option to explicitly specify a test name to the runner. 2010-02-17 12:56:58 -08:00
Chris Wilson
e702df59b0 [test] Attempt to automatically detect running under gdb
A common mistake is to forget to pass the foreground mode to
cairo-test-suite when launching it under the debugger, resulting in the
debugger not attaching to the children and missing the error you were
trying to capture. Under linux, we can inspect the path to our parent's
executable and if that looks like gdb, we assume it is and disable forking
of traces.
2009-08-26 23:51:42 +01:00
Chris Wilson
bf4977b645 [test] Exit on first failure '-x'
Add a command line option to the test suite to cause it to exit after the
first failure. The purpose of this is for integration into 'git bisect run',
where the failing test is unknown and we are looking for any failure. For
example, for use in a regression script to find commits in the midst of as
series that need a refresh of a reference image (or fixing!).
2009-08-26 23:51:42 +01:00
Chris Wilson
809f77a5cb [test] Summarise tests that fail during the preamble.
Some tests only run and check during the preamble phase, and those
failures were being ignored during the summary.
2009-07-20 18:56:10 +01:00
Chris Wilson
655a4dbc36 [test] Track XFAIL using expected results stored as xfail.png
Instead of tagging the sources, which is insensitive to changes, track the
known failure modes by recording the current fail as an xfail.png
reference. (We also introduce a new.png to track a fresh error, so that
they are not lost in the noise of the old XFAILs and hopefully do not
cause everyone to fret).

As we have removed the XFAIL tagging we find, surprise surprise, that some
tests are now working -- so review all the reference images (as also some
.ref.png now should be .xfail.png).

Note: I've only checked image,pdf,ps,svg. The test surfaces report some
failures that probably need to addressed in source. I've not correct the
changes for win32 and quartz. Nor fixed up the experimental backends.
2009-07-13 15:19:51 +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
Chris Wilson
31b7652e1f [test] Never, ever, blame a crashing test on external factors. 2009-06-13 12:19:51 +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
M Joonas Pihlaja
e380beae53 [sdl] Remove new backend.
The SDL backend makes invalid assumptions about SDL_Surface locking
semantics and doesn't deal correctly with the unpremultiplied pixel
format supported by SDL.  Removed as per discussion on the mailing list.

http://lists.cairographics.org/archives/cairo/2009-February/016595.html
2009-02-16 14:01:43 +02:00
Jeff Muizelaar
70297f257d [test] Add crtdbg.h include
crtdbg.h is required for _CrtSetReportMode() and _CrtSetReportFile().
2009-02-10 17:58:28 -05:00
Jeff Muizelaar
18054ef00c [test] Quartz doesn't like being forked
When the cairo-test-suite forks CoreFoundation complains with:
"The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec().
When forked so avoid doing it in the test suite for now. In the future we should investigate
the possibility of a work around.
2008-12-18 18:01:52 -05:00
Paolo Bonzini
993941cfd7 [perf] Fix SDL compilation for MacOS X
The attached patch makes the SDL tests compile under Mac OS X.  The
problem is:

1) that <SDL_main.h> should be included in files that define the main
function for SDL Mac OS X programs (this is not true with the upcoming
SDL 1.3 release).

2) that -lSDLmain, because it is statically linked, needs the Cocoa
framework in the LDADD of the main program.  Again, 1.3 will not require
this.
2008-11-26 16:15:35 +00:00
Chris Wilson
7894abbe6d [test] Support foreground only execution.
Add an option to prevent forking - which makes it difficult to
valgrind/gdb individual tests.
2008-11-19 11:59:20 +00: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