| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Fixes #508
|
| |
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
| |
When builddir != srcdir, cairo_test_create_pattern_from_png
needs a non-NULL ctx to work with.
|
| |
|
|
|
|
|
| |
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
The multi-threaded test path does not exist anymore and the ctx->thread
field is always 0, hence it can be removed.
|
|
|
|
| |
This code is unused and can be removed.
|
|
|
|
| |
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Reduce the amount of output printed by leak-detectors when a test
crashes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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 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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Protect the boilerplate targets from unexpected modifications.
|
|
|
|
|
| |
strtod("NaN") returns 0.0 with the MSVC runtime so we
need to generate NaN some other way.
|
|
|
|
| |
Needed for user-font-rescale.c
|
|
|
|
| |
1./0. produces a compiler error on MSVC so we'll use HUGEVAL instead.
|
|
|
|
| |
This lets us use more of invalid-matrix on win32
|
|
|
|
|
| |
The variadic macro is only used within boilerplate/ so replace it with a
simple, and portable, call to fprintf.
|
|
|
|
|
|
|
|
|
| |
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.).
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
As we solely use a secondary context, we must manually report NO_MEMORY
errors whilst running under memfault.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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.)
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Allow individuals tests to check whether a test target is enabled -
useful for those tests that circumvent cairo_test() and perform
feature testing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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/.
|
|
|
|
| |
Dumping paths is so hard in C. Shouldn't be. At least not when debugging...
|
| |
|
|
|
|
| |
chmod a-x test/cairo-test.[ch]
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Fix win32/MSVC defines for snprintf, inline, and M_PI
|
| |
|
|
|
|
|
|
| |
This now gives us two separate libtool convenience libraries,
so they have to have separate names now:
libcairoboilerplate.la and libcairotest.la.
|
|
|
|
|
| |
The idea here is to setup boilerplate to allow code sharing between
test/ and the upcoming perf/
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|