summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)AuthorFilesLines
2013-09-09svg, test: Refer to output filename by variable, not a hardcoded valueHEADmasterBryce W. Harrington1-1/+1
Signed-off-by: Bryce Harrington <b.harrington@samsung.com> Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-09-09test: Ensure output dirs exist, falling back to current dir if neededBryce W. Harrington13-55/+66
This change makes several tests behave more like ps-eps.c, et al by making them attempt to mkdir "output", and in case of trouble use "." instead. filenames are now allocated at runtime due to this change, so ensure the corresponding free()'s are in place as well. This should facilitate running the test suite with a relative path outside cairo's source tree, such as when employing the CAIRO_REF_DIR environment variable. Signed-off-by: Bryce Harrington <b.harrington@samsung.com> Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-09-09test: Make cairo_test_mkdir() usable throughout tests.Bryce W. Harrington2-5/+8
Signed-off-by: Bryce Harrington <b.harrington@samsung.com> Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-09-09test: Fix several tests to place output files in the output directoryBryce W. Harrington11-17/+30
The standard location for test output is cairo/test/output. The harness itself was updated to write automatically generated images in this directory, however a number of tests generate their own local output files. This patch updates these tests to write their output into CAIRO_TEST_OUTPUT_DIR (which defaults to cairo/test/output) as well, in the interest of decluttering the test directory. Signed-off-by: Bryce Harrington <b.harrington@samsung.com> Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-09-09test: Don't ignore test output files left in test directoryBryce W. Harrington1-4/+0
Tests should be placing output files in the output/ directory now, although not all tests follow this standard practice. Drop the "*.out.*" from .gitignore to make improper test behavior more evident. Signed-off-by: Bryce Harrington <b.harrington@samsung.com> Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-09-05test: Allow CAIRO_TEST_MODE to independently enable extended testingChris Wilson1-4/+18
Such as CAIRO_TEST_MODE=scale for testing application of cairo_surface_set_device_offset. CAIRO_TEST_MODE=similar - test rendering through similar surfaces CAIRO_TEST_MODE=offset - test rendering with a device offset CAIRO_TEST_MODE=scale - test rendering with a device scale
2013-09-05tests: Add device scale test to "full" testrun similar to offsetsAlexander Larsson3-57/+77
2013-08-19gl: Return surface in error when creating oversized texture surfacesMartin Robinson2-0/+89
When creating a texture surface that is larger than the maximum framebuffer or texture dimensions of the context, return a surface in error. Previously the code failed an assertion, but this prevents an application from easily detecting when to fall back. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-13api-special-cases: Also test contextsUli Schlachter1-21/+1153
This adds code to the api-special-cases test which also tests the behavior of cairo when the cairo context or the surface that is target is in an error state or finished. These new tests call into all public entry points defined in cairo.h which receive a cairo_t * as their first argument. Currently this causes a new crash in the testsuite: cairo-surface.c:394: _cairo_surface_begin_modification: Assertion `! surface->finished' failed. Reported-by: christophe.troestler@umons.ac.be References: https://bugs.freedesktop.org/show_bug.cgi?id=68014 Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-07-04Add new test for bug 61592Uli Schlachter3-1/+62
This test exercises some clipping-related failure that Seongwon Cho reported. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61592 Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-07-04Fix caps-tails-curve reference imagesUli Schlachter3-0/+0
Commit d7f5a1bec fixed a bug. This caused 12 new test failures for the test-traps test target: caps-tails-curve degenerate-arc degenerate-path joins subsurface subsurface-scale twin twin-antialias-gray twin-antialias-mixed twin-antialias-none twin-antialias-subpixel user-font Most of these are indeed (new?) bugs. However, caps-tails-curve actually started producing the expected result and the reference image just wrongly captures the old state of things. At the time of that commit, just taking the output from test-traps as the new reference image works fine for all backends. However, with current git, something introduced more antialiasing noise and now test-traps changed again while cairo-xcb stayed with the old result. Thus, we also need a new reference image to fix this test. (The wrong reference images come from commit 8488ae02 which turned test-traps' results into reference images) Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-07-04test: Amend check-refs.sh to support out-of-tree buildsChris Wilson2-17/+6
2013-07-04test: Remove conflicting .ref.png, .argb32.ref.png, .rgb24.ref.pngChris Wilson157-0/+0
Where a content specific reference image exists, prefer to have both content reference images (i.e. both argb32.ref and rgb24.ref) rather than a mix of .ref and argb32/rgb24.
2013-07-04test: Add a few reference images found lurking on my machineChris Wilson4-0/+0
2013-07-04test: Remove all identical (cmp & pdiff) reference imagesChris Wilson1477-0/+0
Courtesy of the improved check-ref-dups written by Bryce Harrington: Running make check on the codebase (with default configuration) with the redundant images removed produces essentially the same test results: Before ------ Tests run: 13687 Passed: 9216 Failed: 3566 Expected Failed: 312 Error: 1 Crashed: 17 Untested: 575 Total: 13687 After ----- Tests run: 13689 Passed: 9216 Failed: 3566 Expected Failed: 312 Error: 1 Crashed: 19 Untested: 575 Total: 13689 (with the exception being the pthread tests misbehaving between runs)
2013-07-04test: Add special cases for create-from-png and fallback-resolutionBryce W. Harrington3-0/+16
These tests use reference images somewhat differently from other tests, so treat them as special cases and avoid recommending deleting any of their files. Add TODO's to each test to rework them to be more consistent with other tests. Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-07-04pdiff: Drop unused variableBryce W. Harrington1-1/+1
Fixes: perceptualdiff.c:35:24: warning: unused variable ‘dim’ [-Wunused-variable] Signed-off-by: Bryce Harrington <bryce@bryceharrington.org> Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-07-04pdiff: Quell warning about signed/unsigned comparisonsBryce W. Harrington1-2/+2
perceptualdiff.c:55:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] perceptualdiff.c:60:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-07-04test: Make check-ref-dups utilize perceptualdiff for comparisonsBryce W. Harrington1-4/+9
The current sha1sum-based file checker does a blanket comparison of all files with each other, which is fast but not directly helpful since it doesn't distinguish between sibling files (which are allowable to be duplicates). Also, it ignores files that may have byte differences (such as PNG header differences) but are otherwise pixel-identical. This patch replaces the sha1sum-based checker with one that accounts for the default fallback path and uses perceptualdiff to compare files that are bytewise different and verify whether they actually are different. The intention is that the output of this command can be directly used to remove redundant files, e.g.: cd test make check-ref-dups | cut -d' ' -f2 | \ while read f; do git rm "reference/$f"; done This should have no impact on make check's results (modulo any tests that behave erratically), and will help trim down the size of the tarball. Signed-off-by: Bryce Harrington <b.harrington@samsung.com> [ickle: rebase and add the suggested command to the Makefile]
2013-07-04test: Use cmp to catch byte-by-byte identical filesBryce W. Harrington1-8/+12
cmp runs faster than perceptualdiff, and catches files that are exact copies of the reference image. We still use perceptualdiff for catching files that aren't bytewise identical, but are still identical at the pixel level. Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-07-04test: Add script to check for redundant reference imagesBryce W. Harrington2-0/+61
This script requires the perceptualdiff program, which can be built as follows: cd test/pdiff && make perceptualdiff The script's output provides a list of target-specific or format-specific images that are identical to their more generic reference files, and thus are redundant and can be safely removed from the archive without altering any test behaviors. Signed-off-by: Bryce Harrington <b.harrington@samsung.com> [ickle: applied Behdad's suggestion of renaming the script check-refs.sh]
2013-07-04test: Fix make check-ref-dups due to move of ref images to reference/Bryce W. Harrington1-1/+1
The check-ref-dups target in Makefile.am was not updated with the new path when the reference images were moved from test/ to test/reference/. Now it produces output properly again. Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-06-20test/get-path-extents: Check exact matches within toleranceChris Wilson1-9/+21
When we refine geometry, we do so to a tolerance as specified by the user. This means that we can not expect tessellated results to have exact results, but always they should match within the specified tolerance. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-20test: Note naming scheme for XFAIL images in READMEBryce W. Harrington1-2/+3
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-06-08test: Fix typo in sample_horizontal to use horizontal, not vertical.Bryce W. Harrington1-1/+1
Triggers the following warning during build: sample.c:61:1: warning: ‘horizontal’ defined but not used [-Wunused-function] Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-06-04test: Extend testing of joins for fine linesChris Wilson7-4/+51
2013-06-04test: Expand testing of caps for fine strokesChris Wilson7-3/+54
2013-03-18[test] Set font sizeBehdad Esfahbod1-0/+1
Previously this test was working because we were not scaling bitmap fonts. We do now, so adjust test.
2013-03-15test: Fix CAIRO_REF_DIRUli Schlachter2-4/+3
Ever since the test output was moved from test/ to test/output/, using CAIRO_REF_DIR to make the test suite succeed no longer works. The test suite was looking for the wrong file names. This patch makes this work again. However, I am not sure that this really is the correct fix. It just seems to work. :-) Reported-by: Darxus <darxus@chaosreigns.com> Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-02-12test: Exercise replaying a recording surface through a flip matrixChris Wilson11-0/+494
2013-02-10tests: Update reference images after adjustments to polygon line clippingChris Wilson11-0/+0
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-31test: Refresh refs for aa noise following reduction of the 2-stage compositingChris Wilson34-0/+0
A side effect of commit c986a7310bb06582b7d8a566d5f007ba4e5e75bf Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Thu Jan 24 08:55:54 2013 +0000 image: Enable inplace compositing with opacities for general routines is that we should in theory be reducing the rounding errors when compositing coverage. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-08gl: Do less work when acquiring and releasing devicesMartin Robinson2-0/+183
After acquiring a GL device and the same GL context, surface, and display combination is already active outside of Cairo, do not ask EGL or GLX to change the current context as that may cause a flush on some drivers. Also do not unset the context when releasing the device for the same reason.
2012-12-17test: Add xcb-huge-subimageUli Schlachter3-0/+82
This creates an image surface with a non-natural stride and paints it to a similar surface. In the xcb backend, this causes a call to _cairo_xcb_connection_put_subimage() which tries to send a huge PutImage request. As a result, xcb kills the X11 connection. Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-02test: Add stroke-clippedChris Wilson3-0/+55
Exercise a bug in the determine of clip-bounds when stroking, as reported by ed44. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-31pen: First check whether the in/out edges lie within the single pen vertexChris Wilson3-0/+0
In order to prevent underflow when searching for the closing pen vertex, we first need to be sure that it does not simply lie next to the opening pen vertex. As a result we were missing many cases that should have been a bevel (in == out) and generating almost complete round caps instead. Reported-by: Dominik Röttsches <dominik.rottsches@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56432 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-16test: Define optional exception classesUli Schlachter3-7/+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>
2012-10-05test: Refresh reference images for slight alteration of curvesChris Wilson347-0/+0
2012-09-27test: Refresh reference image for clip-disjoint-quadChris Wilson2-0/+0
Rather than using the traps reference for all target as this then generates false negatives with the spans compositor. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-27test: Add clip-disjoint-quadChris Wilson3-0/+84
Exercises a bug in the polygon intersection code demonstrated by Søren Sandmann. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-10test: Add degenerate closed path case to get-path-extentsAndrea Canciani1-0/+8
This is a testcase to ensure that we do not regress https://bugs.freedesktop.org/show_bug.cgi?id=54549 (which is already fixed by b0c466e27afcec230b2c9436eeb924c05123a544).
2012-08-20tests: Add outline-toleranceChris Wilson3-0/+53
From https://bugs.freedesktop.org/show_bug.cgi?id=53841: "Rectangle drawn incorrectly when it has zero height and miter limit greater than 1.414" Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-09test: Add example from bug-51910Chris Wilson3-0/+92
The calculation of the required source extents blows up under xlib. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-09test: Add a simple exercise for raster sampling of subpixel geometryChris Wilson5-0/+118
Test that the rasteriser doesn't incorrectly merge disjoint geometry at the subpixel level. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-24test: Exercise bug in joining together spline segments around cuspsChris Wilson3-0/+97
Carl Worth demonstrated a glaring bug in the new stroking code, introduced in commit 545f30856aac98199 (stroke: Convert the outlines into contour and then into a polygon), whereby only a bevel join was being used to connect segments around a sharp inflection point. This adds the two examples he reported to the test suite.
2012-05-31test: Restore bug-seams referenceChris Wilson2-0/+0
An overzealous update after converting antialiasing missed the object of this test was exactly to point out an error due to the antialiasing. So restore it back to the prestine reference and mark the image backend as failing. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-26png: Implement conversion of CAIRO_FORMAT_RGB30 to stringAndrea Canciani1-0/+1
Fixes png.c:55: warning: enumeration value ‘CAIRO_FORMAT_RGB30’ not handled in switch
2012-05-23test: Increase surface size for get-path-extentsChris Wilson1-1/+1
Whilst generating a glyph run from a string, any glyphs that are far outside the surface (including a substantial guard region) are culled. This affects the path extents. Workaround this by increasing the surface size. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-23test/record90: Rotate the reference so that it is wholly visibleChris Wilson4-1/+1
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-23test: Refresh unbounded-operatorChris Wilson2-0/+0
Apparently this too suffered from bug-bo-collins and is fixed by (bo-rectangular: Emit subsummed boxes for overlapping edges). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>