summaryrefslogtreecommitdiff
path: root/test/cairo-test.h
Commit message (Collapse)AuthorAgeFilesLines
* Make cairo_tag_begin/end work correctly in groupsAdrian Johnson2023-04-181-1/+1
| | | | Fixes #508
* SVG font test using cairo logoAdrian Johnson2022-12-281-0/+5
|
* meson: Fix musl buildGeorge Matsumura2020-09-021-1/+2
| | | | | | | This constitutes few fixes that are necessary to compile correctly and reduce errors when using musl libc. Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
* Fix build on Windows with recent versions of MSVCMathieu Duponchelle2020-07-311-0/+2
| | | | | | | - vsnprintf and snprintf are available since vs2015 - define ISREG if not provided - guard unistd.h include with HAVE_UNISTD_H - isnan() is available after vs2010
* record tests: fix when builddir != srcdirMathieu Duponchelle2020-07-181-0/+3
| | | | | When builddir != srcdir, cairo_test_create_pattern_from_png needs a non-NULL ctx to work with.
* Refactor ARRAY_LENGTH macro definitions in test codeBryce Harrington2014-11-201-4/+0
|
* test: Make cairo_test_mkdir() usable throughout tests.Bryce W. Harrington2013-09-091-0/+3
| | | | | Signed-off-by: Bryce Harrington <b.harrington@samsung.com> Signed-off-by: Uli Schlachter <psychon@znc.in>
* test: Define optional exception classesUli Schlachter2012-10-161-0/+20
| | | | | | | | | | | | | | According to musl libc author: "C99 requires the FE_ macros to be defined if and only if the exception they correspond to is supported" So we define these macros to 0 if they are not supported. Support for these FPU exceptions is not necessary for correct functionality, but makes some tests less effective. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55771 Signed-off-by: Uli Schlachter <psychon@znc.in>
* test: Use cairo_test_list_t for the main test listAndrea Canciani2011-11-121-2/+1
| | | | | | | | | | 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.
* test: Remove unused thread fieldAndrea Canciani2011-11-121-2/+0
| | | | | The multi-threaded test path does not exist anymore and the ctx->thread field is always 0, hence it can be removed.
* test: Remove dead codeAndrea Canciani2011-11-121-4/+0
| | | | This code is unused and can be removed.
* test: Write the individual test logs to output/Chris Wilson2011-09-151-0/+1
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* test: Cleanup macrosAndrea Canciani2011-03-171-0/+12
| | | | | | | | 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.
* test: update font family nameAndrea Canciani2010-06-121-1/+1
| | | | | | Update the name of the test font family to DejaVu, so that backends unable to rely on fontconfig to match font names can find the correct font anyway.
* test: make test font family a defineAndrea Canciani2010-06-121-0/+2
| | | | | | In order to make it easier to change the test font family, add it as a define in the global header and always reference the macro in the tests.
* test: Distinguish tests that throw an error from a normal fail.Chris Wilson2010-06-111-0/+1
| | | | | | | 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.
* test: Embed the list pointer into cairo_test_tChris Wilson2010-05-041-3/+4
| | | | | Reduce the amount of output printed by leak-detectors when a test crashes.
* [test] Track XFAIL using expected results stored as xfail.pngChris Wilson2009-07-131-7/+49
| | | | | | | | | | | | | | | | 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.
* [test] Timeout support for testsChris Wilson2009-06-281-0/+2
| | | | | | Enforce that each test must render within 60 seconds or be considered to have hit an infinite loop and be reported as a CRASH. The timeout value is adjustable via CAIRO_TEST_TIMEOUT -- a value of 0 will disable.
* [test] Add group-unalignedChris Wilson2009-06-271-2/+2
| | | | | | | | | | | Test case for: Bug 22441 -- Unexpected shift with push_group and pop_group https://bugs.freedesktop.org/show_bug.cgi?id=22441 This is a test that demonstrates the error in the pdf backend when using groups on surfaces with non-integer sizes. In order to create such a surface, we need to update the boilerplate to use doubles instead of integers when specifying the surface size.
* [test] Never use gcc __attribute__ magic for constructors.M Joonas Pihlaja2009-06-181-14/+0
| | | | | | | | 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.
* [boilerplate] Make array of targets const.Chris Wilson2009-06-121-1/+1
| | | | Protect the boilerplate targets from unexpected modifications.
* [test] Add cairo_test_NaN and use it in place of strtodJeff Muizelaar2009-02-111-0/+15
| | | | | strtod("NaN") returns 0.0 with the MSVC runtime so we need to generate NaN some other way.
* [test] define isnan() on MSVCJeff Muizelaar2009-02-091-0/+4
| | | | Needed for user-font-rescale.c
* [test] Define INFINITY on MSVCJeff Muizelaar2009-02-091-3/+0
| | | | 1./0. produces a compiler error on MSVC so we'll use HUGEVAL instead.
* [test] Define INFINITY if it hasn't been defined.Jeff Muizelaar2009-02-031-0/+3
| | | | This lets us use more of invalid-matrix on win32
* [boilerplate] Remove CAIRO_BOILERPLATE_LOG()Chris Wilson2009-01-031-1/+0
| | | | | The variadic macro is only used within boilerplate/ so replace it with a simple, and portable, call to fprintf.
* [test] Use '.' as the field separator in the namesChris Wilson2008-10-311-0/+1
| | | | | | | | | We frequently use '-' within the test name or format name and so we encounter confusion as '-' is also used as the field separator. At times this has caused a new test to break an old test because the new test would match one of the old test's target specific reference images. So switch everything over to use '.' between fields (test name, target, format, subtest, etc.).
* [test] Build test suite into single binary.Chris Wilson2008-10-311-34/+65
| | | | | | | | | 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.
* [test/get-clip] Check the status on the secondary context.Chris Wilson2008-10-181-0/+4
| | | | | As we solely use a secondary context, we must manually report NO_MEMORY errors whilst running under memfault.
* [test] Add support for memfault.Chris Wilson2008-10-171-1/+9
| | | | | | | Add the core support to cairo-test for running the test-suite under a malloc fault injector. This commit contains the adjustments to cairo_test_run() to repeat the test if it detects a failure due to fault injection and complains if it detects unreported faults or memory leaks.
* Automate error checking for fallback-resolution.Chris Wilson2008-09-281-0/+12
| | | | | | | | | | | For this we extend the boilerplate get_image() routines to extract a single page out of a paginated document and then proceed to manually check each page of the fallback-resolution test. (Well that's the theory, in practice SVG doesn't support multiple pages and so we just generate a new surface for each resolution. But the infrastructure is in place so that we can automate other tests, e.g. test/multi-pages.)
* [test] Avoid redundant writes/reads of test surfaces via png.Chris Wilson2008-08-181-0/+4
| | | | | | | | | As Behdad suggested, we can dramatically speed up the test suite by short-circuiting the write to a png file, only to then immediately read it back in. So for the raster based surfaces, we avoid the round-trip through libpng by implementing a new boilerplate method to directly extract the image buffer from the test result. A secondary speedup is achieved by caching the most recent reference image.
* [test] Set CAIRO_TEST_UNTESTED to 77Chris Wilson2008-08-131-2/+2
| | | | | 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.
* [test] Export a function to check whether a target is enabled.Chris Wilson2008-08-131-0/+4
| | | | | | Allow individuals tests to check whether a test target is enabled - useful for those tests that circumvent cairo_test() and perform feature testing.
* [test] Preparatory work for running under memfault.Chris Wilson2008-08-131-9/+47
| | | | | | | | | | | | | | | | | | | | 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/.
* [cairo-test] Implement cairo_test_log_path() to dump a cairo_path_t to logsBehdad Esfahbod2008-05-091-0/+3
| | | | Dumping paths is so hard in C. Shouldn't be. At least not when debugging...
* Fix bitmap-font test by using near-equality for double comparisonCarl Worth2008-01-281-0/+2
|
* [cairo-test] Remove executable flag from source files.Chris Wilson2007-10-241-0/+0
| | | | chmod a-x test/cairo-test.[ch]
* [boilerplate] Move xasprintf to xmalloc.cBehdad Esfahbod2007-04-201-1/+1
|
* Augment cairo_test_init with cairo_test_fini to avoid leakCarl Worth2007-03-021-5/+9
| | | | | | 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.
* [win32] Misc win32 compilation fixesVladimir Vukicevic2006-09-091-0/+6
| | | | Fix win32/MSVC defines for snprintf, inline, and M_PI
* perf: Don't measure meta-surface-backed surface types.Carl Worth2006-08-311-8/+0
|
* Move test-specific stuff out of boilerplate/ and back into test/Carl Worth2006-08-311-0/+136
| | | | | | This now gives us two separate libtool convenience libraries, so they have to have separate names now: libcairoboilerplate.la and libcairotest.la.
* Split libcairotest files out from test/ and into boilerplate/Carl Worth2006-08-301-143/+0
| | | | | The idea here is to setup boilerplate to allow code sharing between test/ and the upcoming perf/
* Eliminate most compiler warnings from the test suiteCarl Worth2006-08-081-1/+2
|
* Add prototype for draw in each test file and remove it from the header.Behdad Esfahbod2006-07-131-1/+0
|
* More test suite infrastructure improvements:Behdad Esfahbod2006-07-111-15/+9
| | | | | | | | | | | | | | | | | - 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.
* Detect and report crashes in tests.Behdad Esfahbod2006-07-011-1/+2
|
* Remove all remaining trailing whitespace.Carl Worth2006-06-061-1/+1
| | | | | | | | | | | This patch was produced with the following (GNU) sed script: sed -i -r -e 's/[ \t]+$//' run on all *.[ch] files within cairo. Note that the above script would have also created all the changes from the previous commits to remove trailing whitespace.