summaryrefslogtreecommitdiff
path: root/test/cairo-test.c
Commit message (Collapse)AuthorAgeFilesLines
* Make cairo_tag_begin/end work correctly in groupsAdrian Johnson2023-04-181-2/+6
| | | | Fixes #508
* SVG font test using cairo logoAdrian Johnson2022-12-281-0/+67
|
* Make it easier for cairo-test-suite to find the source dirAdrian Johnson2022-05-191-3/+8
|
* Fix some MinGW warningsAdrian Johnson2021-09-021-0/+4
| | | | | | | | | | | | | | | | | The FT change is because my MinGW build is using a more recent version of FT. Remove the disabled _cairo_win32_scaled_font_text_to_glyphs() code to fix the defined but not used warning. _cairo_win32_scaled_font_text_to_glyphs() was diabled in d9408041aa with the comment: "Currently disable the win32-font text_to_glyphs(), until that one is updated. Or better yet, remove it and implement ucs4_to_index(). It's the toy font API afterall." _cairo_win32_scaled_font_ucs4_to_index() was added in d1c619bc7d.
* Drop the conditional inclusion of config.hEmmanuele Bassi2021-05-011-2/+0
| | | | | | | | | | | | We *always* generate this file, and we depend on its existence. The idea behind HAVE_CONFIG_H was being able to include random files from different projects, back in a time where "libraries" were literally just random files instead of actual shared objects. Since we're not in the '80s any more, and our build system(s) define HAVE_CONFIG_H *and* generate the config.h header file, we don't need a conditional guard around its inclusion.
* Remove stray _GNU_SOURCE definitionsEmmanuele Bassi2021-05-011-2/+0
| | | | | | We define _GNU_SOURCE globally in both the Autotools build, through the use of the AC_USE_SYSTEM_EXTENSIONS macro; and in the Meson build, with add_project_arguments().
* Fix compiler warnings in test suiteSven Neumann2021-01-041-10/+10
| | | | Fix some enum mixups, mostly cairo_status_t vs cairo_test_status_t.
* meson: Fix musl buildGeorge Matsumura2020-09-021-4/+6
| | | | | | | 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>
* record tests: fix when builddir != srcdirMathieu Duponchelle2020-07-181-0/+8
| | | | | When builddir != srcdir, cairo_test_create_pattern_from_png needs a non-NULL ctx to work with.
* Misc. typosluz.paz2019-01-311-1/+1
| | | | | | | Found via `codespell -i 3 -w -I ../cairo-word-whitelist.txt -L tim,ned,uint` Follow up of 12cb59be7da Reviewed-by: Bryce Harrington <bryce@bryceharrington.org>
* test: use CAIRO_MIME_TYPE_UNIQUE_ID with record-text-transformAdrian Johnson2017-11-091-0/+5
| | | | | | The PS output from this test is > 100MB due to the duplicated images. Using CAIRO_MIME_TYPE_UNIQUE_ID reduces the PS output to 650k, runs considerably faster, and now produces correct output.
* test: Always use DejaVu Sans as default fontAndrea Canciani2015-07-271-0/+4
| | | | | | | | | | This makes the results of the test suite more stable across different environments, because it does not rely anymore on CAIRO_FONT_FAMILY_DEFAULT (which on Windows is "Arial", on Mac "Helvetica"). This change should not affect Linux environments, assuming that the default font is already set to "DejaVu Sans".
* Refactor ARRAY_LENGTH macro definitions in test codeBryce Harrington2014-11-201-4/+0
|
* test and util: maintain consistency in the usage of ARRAY_LENGTH macroRavi Nanjundappa2014-04-301-6/+6
| | | | | | | | | | ARRAY_LENGTH macro is used in perf's cairo-perf.h, src's cairoint.h, test's cairo-test.h and in some internal header files of util's directory.So to maintain consistency ARRAY_SIZE is replaced with ARRAY_LENGTH macro. Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com> Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
* test: Make cairo_test_mkdir() usable throughout tests.Bryce W. Harrington2013-09-091-5/+5
| | | | | Signed-off-by: Bryce Harrington <b.harrington@samsung.com> Signed-off-by: Uli Schlachter <psychon@znc.in>
* tests: Add device scale test to "full" testrun similar to offsetsAlexander Larsson2013-09-051-26/+40
|
* test: Fix CAIRO_REF_DIRUli Schlachter2013-03-151-3/+2
| | | | | | | | | | | | 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>
* test: Define optional exception classesUli Schlachter2012-10-161-3/+0
| | | | | | | | | | | | | | 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: Only use alarm() when SIGALRM is also definedMaarten Bosmans2012-04-101-1/+1
| | | | | On some platforms (mingw) the alarm() configure check succeeds, but the alarm function doesn't actually work.
* test: Create output directory even on Win32Andrea Canciani2012-02-161-0/+3
| | | | | This avoids cluttering the test directory with thousands of PNG files and makes the behavior more consistent with other OSes.
* test: Do not open files in non-existing dirsAndrea Canciani2011-11-121-18/+20
| | | | | | | | The output directory should be made before trying to open log files in it. Fixes the bug causing cairo-test-suite to log to stderr on the first run (i.e. when test/output does not exist).
* Remove useless checks for NULL before freeingAndrea Canciani2011-11-121-40/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch has been generated by the following Coccinelle semantic patch: // Remove useless checks for NULL before freeing // // free (NULL) is a no-op, so there is no need to avoid it @@ expression E; @@ + free (E); + E = NULL; - if (unlikely (E != NULL)) { - free(E); ( - E = NULL; | - E = 0; ) ... - } @@ expression E; @@ + free (E); - if (unlikely (E != NULL)) { - free (E); - }
* Use xstrdup instead of xmalloc when possibleAndrea Canciani2011-11-121-8/+2
| | | | Don't open code xstrdup, just use it.
* test: Reuse cairo_test_logv()Andrea Canciani2011-11-121-2/+1
| | | | | cairo_test_log() can be implemented on top of cairo_test_logv() to ensure that their behavior is consistent.
* boilerplate: Remove unused thread id parameterAndrea Canciani2011-11-121-2/+0
| | | | | The thread id is not used anymore (it is always == 0), so it can be removed.
* test: Remove unused thread fieldAndrea Canciani2011-11-121-187/+123
| | | | | 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-184/+0
| | | | This code is unused and can be removed.
* test: Write the individual test logs to output/Chris Wilson2011-09-151-9/+12
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* test: Move all the reference images to their own directoryChris Wilson2011-09-151-6/+6
| | | | | | | With over two thousand references images now, it is starting to make the test directory look cluttered! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* Avoid deprecated functions on win32Andrea Canciani2011-06-201-3/+0
| | | | | Some POSIX functions are deprecated in MSVC and should instead be used with an alternative name beginning with '_'.
* test: Use POSIX-compatible unlinkAndrea Canciani2011-06-141-0/+1
| | | | | | | | | | On Win32, the POSIX-compatible unlink function is named "_unlink". A function named "unlink" exists, but does not have the same behavior as the POSIX-specified one. This function makes the cairo test suite behave incorrectly and immediately terminate with the message: Error: Cannot remove cairo-test-suite.log: No error
* test: Silence gcc warningsAndrea Canciani2011-03-171-8/+11
| | | | | | | | | 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.
* build: Rework pthread detection.M Joonas Pihlaja2010-07-111-3/+3
| | | | | | | | | | Use two levels of pthread support: a minimal level used to build cairo itself, and a full level to build threaded apps which want to use cairo. The minimal level tries to use pthread stubs from libc if possible, but falls back to the full level if that's not possible. We use CFLAGS=-D_REENTRANT LIBS=-lpthread to find a real pthread library since that seems to work on every unix-like test box we can get our hands on.
* test: Move all output below test/output/Chris Wilson2010-06-131-23/+30
| | | | | | make distcheck complains of remanents being left under test/ after a clean, notably the files used to check the capabilities of a similar surface and the fallback-resolution output.
* test: Distinguish tests that throw an error from a normal fail.Chris Wilson2010-06-111-1/+19
| | | | | | | 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: Improve memfault behaviour.Chris Wilson2010-05-031-4/+17
| | | | | Various minor tweaks to convert asserts into error returns and to improve error checking on intermediate surfaces.
* test: Set have_result for image matchesBenjamin Otte2010-04-291-3/+13
| | | | Causes the log to contain information about the reference imagery used.
* test-suite: add image_diff_is_failure() functionBenjamin Otte2010-04-281-6/+3
| | | | | This cleans the code and fixes a boolean logic error where this check was done manually.
* boilerplate: Cleanup the list of backends upon shutdown.Chris Wilson2010-03-231-0/+2
|
* [meta] Rename cairo_meta_surface_t to cairo_recording_surface_t.M Joonas Pihlaja2009-10-221-3/+3
| | | | | | | The new name is more descriptive than the rather opaque meta surface. Discussed with vigour on the mailing list and #cairo: http://lists.cairographics.org/archives/cairo/2009-July/017571.html
* [build] Link against pthread-stubsChris Wilson2009-10-151-3/+3
| | | | | | Avoid pulling in the real pthread library if the application is single threaded and not using pthreads, by linking against pthread-stubs instead.
* [boilerplate/xcb] Check for connection errors during testChris Wilson2009-09-301-43/+43
|
* [test] Compare a failure against the image outputChris Wilson2009-09-091-0/+46
| | | | | | If a backend fails in exactly the same way as the image, then we can safely assume that the failure is systematic and not an error in the backend, so change the result to XFAIL.
* [test] Allow tests to XFAIL by putting the cairo_t into an error state.M Joonas Pihlaja2009-09-031-7/+7
| | | | | | | | The test runner was extra strict about never letting a test put the cairo_t into an error state, and never would it check for the expectedness status of the failure. This patch moves the check for a test being an XFAIL above the check on the cairo_t's final status.
* [test] Use HAVE_FLOCKFILE instead of _POSIX_C_SOURCE.M Joonas Pihlaja2009-08-311-3/+2
| | | | | | The _POSIX_C_SOURCE 2001.. #define requires C99 mode and clang on Solaris is strict about such things. Use configure tests for flockfile() instead.
* [test] Wrap yet another call to get_image_surface() inside a timeout.Chris Wilson2009-07-281-0/+3
| | | | | I missed this call to get_image_surface() that is now being hit having restored the reference image for dash-infinite-loop.
* [test] Add timeouts around finishing and converting surfaces to images.Chris Wilson2009-07-281-4/+10
| | | | | | In order to catch infinite loops whilst replaying and converting vector surfaces to images (via external renderers) we need to also install alarms around the calls to finish() and get_image().
* [test] Trap SIGFPEChris Wilson2009-07-241-0/+7
| | | | Note the crash if we hit a floating-point exception.
* [drm] Add an accelerated image surface.Chris Wilson2009-07-231-1/+1
| | | | | | | | | | | | | | | | | Use the DRM interface to h/w accelerate composition on image surfaces. The purpose of the backend is simply to explore what such a hardware interface might look like and what benefits we might expect. The use case that might justify writing such custom backends are embedded devices running a drm compositor like wayland - which would, for example, allow one to write applications that seamlessly integrated accelerated, dynamic, high quality 2D graphics using Cairo with advanced interaction (e.g. smooth animations in the UI) driven by a clutter framework... In this first step we introduce the fundamental wrapping of GEM for intel and radeon chipsets, and, for comparison, gallium. No acceleration, all we do is use buffer objects (that is use the kernel memory manager) to allocate images and simply use the fallback mechanism. This provides a suitable base to start writing chip specific drivers.
* Remove clip handling from generic surface layer.Chris Wilson2009-07-231-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handling clip as part of the surface state, as opposed to being part of the operation state, is cumbersome and a hindrance to providing true proxy surface support. For example, the clip must be copied from the surface onto the fallback image, but this was forgotten causing undue hassle in each backend. Another example is the contortion the meta surface endures to ensure the clip is correctly recorded. By contrast passing the clip along with the operation is quite simple and enables us to write generic handlers for providing surface wrappers. (And in the future, we should be able to write more esoteric wrappers, e.g. automatic 2x FSAA, trivially.) In brief, instead of the surface automatically applying the clip before calling the backend, the backend can call into a generic helper to apply clipping. For raster surfaces, clip regions are handled automatically as part of the composite interface. For vector surfaces, a clip helper is introduced to replay and callback into an intersect_clip_path() function as necessary. Whilst this is not primarily a performance related change (the change should just move the computation of the clip from the moment it is applied by the user to the moment it is required by the backend), it is important to track any potential regression: ppc: Speedups ======== image-rgba evolution-20090607-0 1026085.22 0.18% -> 672972.07 0.77%: 1.52x speedup ▌ image-rgba evolution-20090618-0 680579.98 0.12% -> 573237.66 0.16%: 1.19x speedup ▎ image-rgba swfdec-fill-rate-4xaa-0 460296.92 0.36% -> 407464.63 0.42%: 1.13x speedup ▏ image-rgba swfdec-fill-rate-2xaa-0 128431.95 0.47% -> 115051.86 0.42%: 1.12x speedup ▏ Slowdowns ========= image-rgba firefox-periodic-table-0 56837.61 0.78% -> 66055.17 3.20%: 1.09x slowdown ▏