Merge branch 'master' of ssh+git://git.cairographics.org/git/cairo

This commit is contained in:
Michael Emmel 2006-07-13 12:17:25 -07:00
commit 307a17f78c
93 changed files with 338 additions and 51 deletions

View file

@ -6,6 +6,10 @@ doc:
-$(MAKE) -C doc doc
test:
-$(MAKE) -C test test
retest:
-$(MAKE) -C test retest
recheck:
-$(MAKE) -C test recheck
# libpng is required for our test programs
if CAIRO_HAS_PNG_FUNCTIONS
@ -203,4 +207,4 @@ docs-publish: all
scp $(MANUAL_TAR_FILE) $(RELEASE_UPLOAD_HOST):$(MANUAL_UPLOAD_DIR)
ssh $(RELEASE_UPLOAD_HOST) "cd $(MANUAL_UPLOAD_DIR) && tar xzf $(MANUAL_TAR_FILE) && rm -f manual && ln -s $(MANUAL_DATED) manual && ln -sf $(MANUAL_TAR_FILE) cairo-manual.tar.gz"
.PHONY: release-verify-even-micro release-verify-newer release-remove-old release-cleanup-group-sticky release-check release-upload release-publish docs-publish
.PHONY: release-verify-even-micro release-verify-newer release-remove-old release-cleanup-group-sticky release-check release-upload release-publish docs-publish test retest recheck

View file

@ -3,7 +3,7 @@ exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: @backend_name@
Name: cairo-@backend_name@
Description: @Backend_Name@ backend for cairo graphics library
Version: @VERSION@

View file

@ -2457,6 +2457,8 @@ _cairo_pdf_surface_emit_stroke_style (cairo_pdf_surface_t *surface,
_cairo_output_stream_printf (surface->output, " %f", style->dash[d]);
_cairo_output_stream_printf (surface->output, "] %f d\r\n",
style->dash_offset);
} else {
_cairo_output_stream_printf (surface->output, "[] 0.0 d\r\n");
}
_cairo_output_stream_printf (surface->output,

View file

@ -1722,7 +1722,7 @@ cairo_paint_with_alpha (cairo_t *cr,
*
* A drawing operator that paints the current source
* using the alpha channel of @pattern as a mask. (Opaque
* areas of @mask are painted with the source, transparent
* areas of @pattern are painted with the source, transparent
* areas are not painted.)
*/
void

View file

@ -1167,8 +1167,8 @@ union _cairo_path_data_t {
* @num_data: the number of elements in the data array
*
* A data structure for holding a path. This data structure serves as
* the return value for cairo_copy_path_data() and
* cairo_copy_path_data_flat() as well the input value for
* the return value for cairo_copy_path() and
* cairo_copy_path_flat() as well the input value for
* cairo_append_path().
*
* See #cairo_path_data_t for hints on how to iterate over the

3
test/.gitignore vendored
View file

@ -25,8 +25,9 @@ create-for-stream.svg
create-from-png
create-from-png-stream
dash-caps-joins
dash-scale
dash-no-dash
dash-offset-negative
dash-scale
dash-zero-length
degenerate-path
device-offset

View file

@ -17,8 +17,9 @@ create-for-stream \
create-from-png \
create-from-png-stream \
dash-caps-joins \
dash-scale \
dash-no-dash \
dash-offset-negative \
dash-scale \
dash-zero-length \
degenerate-path \
device-offset \
@ -179,10 +180,11 @@ create-from-png-ref.png \
create-from-png-stream-ref.png \
dash-caps-joins-ref.png \
dash-caps-joins-ps-argb32-ref.png \
dash-scale-ref.png \
dash-scale-ps-argb32-ref.png \
dash-no-dash-ref.png \
dash-offset-negative-ref.png \
dash-offset-negative-ps-argb32-ref.png \
dash-scale-ref.png \
dash-scale-ps-argb32-ref.png \
dash-zero-length-ref.png \
dash-zero-length-rgb24-ref.png \
dash-zero-length-ps-argb32-ref.png \
@ -481,26 +483,37 @@ CLEANFILES = \
check-valgrind:
$(MAKE) check TESTS_ENVIRONMENT='$(TESTS_ENVIRONMENT) $(top_srcdir)/libtool --mode=execute valgrind --tool=memcheck --suppressions=./.valgrind-suppressions --leak-check=yes --show-reachable=yes' 2>&1 | tee valgrind-log
# The following definitions both should work.
#FAILED_TESTS = `grep -l '\<FAIL\>' $(TESTS:=.log) 2>/dev/null | sed -e 's/[.]log$$//' | xargs echo`
FAILED_TESTS = `grep -l '\<FAIL\>' $(TESTS:=.log) 2>/dev/null | tr '\n' ' ' | sed -e 's/[.]log */ /g; s/^ //; s/ $$//'`
recheck = check TESTS="$(FAILED_TESTS)"
# Re-checks all failed tests, i.e. tests with a log file that has a failure
recheck:
@echo Re-checking failed tests
@$(MAKE) check TESTS="`grep -l '\<FAIL\>' *.log | sed 's/[.]log$$//' | tr '\n' ' '`"
@$(MAKE) $(recheck)
# Checks tests and creates index.html.
# Target doesn't fail if tests fail.
test:
@-$(MAKE) check
@$(MAKE) html
@$(MAKE) check; \
$(MAKE) html
# Re-checks tests and creates index.html.
# Target doesn't fail if tests fail.
retest:
@-$(MAKE) recheck
@$(MAKE) html
@TESTS="$(FAILED_TESTS)"; \
$(MAKE) TESTS="$$TESTS" check; \
$(MAKE) TESTS="$$TESTS" html
# Make index.html
html: index.html
# Make index.html containing only the failed tests.
rehtml:
@$(MAKE) TESTS="$(FAILED_TESTS)" html
$(TESTS): $(SUPPORT_PROGS)
@ -512,8 +525,8 @@ NOLOG_TESTS_LOG = $(NOLOG_TESTS:=.log)
$(NOLOG_TESTS_LOG):
echo dummy > $@
index.html: $(TESTS:=.log)
index.html: $(srcdir)/make-html.pl $(TESTS:=.log)
@echo Creating index.html
@perl $(srcdir)/make-html.pl > index.html
@perl $^ > index.html
.PHONY: check-valgrind test recheck retest html
.PHONY: check-valgrind test recheck retest html rehtml

View file

@ -25,6 +25,8 @@
#include "cairo-test.h"
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"a8-mask",
"test masks of CAIRO_FORMAT_A8"

View file

@ -35,6 +35,8 @@
#define FONT "6x13.pcf"
#define TEXT_SIZE 13
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"bitmap-font",
"Test drawing with a font consisting only of bitmaps",

View file

@ -208,7 +208,7 @@ typedef struct _cairo_test_target
void *closure;
} cairo_test_target_t;
static char *
static const char *
_cairo_test_content_name (cairo_content_t content)
{
switch (content) {
@ -1637,7 +1637,7 @@ cairo_test_expecting (cairo_test_t *test,
/* we use volatile here to make sure values are not clobbered
* by longjmp */
volatile int i, j, num_targets;
volatile limited_targets = 0;
volatile cairo_bool_t limited_targets = 0, no_fail_on_stdout = 0;
const char *tname;
void (*old_segfault_handler)(int);
volatile cairo_test_status_t status, ret;
@ -1776,6 +1776,8 @@ cairo_test_expecting (cairo_test_t *test,
if (isatty (2)) {
fail_face = "\033[41m\033[37m\033[1m";
normal_face = "\033[m";
if (isatty (1))
no_fail_on_stdout = 1;
}
#endif
@ -1799,7 +1801,7 @@ cairo_test_expecting (cairo_test_t *test,
while (*tname) {
int found = 0;
char *end = strpbrk (tname, " \t\r\n;:,");
const char *end = strpbrk (tname, " \t\r\n;:,");
if (!end)
end = tname + strlen (tname);
@ -1814,8 +1816,7 @@ cairo_test_expecting (cairo_test_t *test,
}
if (!found) {
*end = '\0';
fprintf (stderr, "Cannot test target '%s'\n", tname);
fprintf (stderr, "Cannot test target '%.*s'\n", end - tname, tname);
exit(-1);
}
@ -1880,7 +1881,8 @@ cairo_test_expecting (cairo_test_t *test,
cairo_test_log ("UNTESTED\n");
break;
case CAIRO_TEST_CRASHED:
printf ("CRASHED\n");
if (!no_fail_on_stdout)
printf ("CRASHED\n");
cairo_test_log ("CRASHED\n");
fprintf (stderr, "%s-%s-%s [%d]:\t%s!!!TEST-CASE CRASH!!!%s\n",
test->name, target->name,
@ -1894,7 +1896,8 @@ cairo_test_expecting (cairo_test_t *test,
printf ("XFAIL\n");
cairo_test_log ("XFAIL\n");
} else {
printf ("FAIL\n");
if (!no_fail_on_stdout)
printf ("FAIL\n");
cairo_test_log ("FAIL\n");
fprintf (stderr, "%s-%s-%s [%d]:\t%sUNEXPECTED FAILURE%s\n",
test->name, target->name,
@ -1935,21 +1938,22 @@ cairo_test_status_t
cairo_test (cairo_test_t *test)
{
cairo_test_status_t expectation = CAIRO_TEST_SUCCESS;
char *xfails;
const char *xfails;
if ((xfails = getenv ("CAIRO_XFAIL_TESTS")) != NULL) {
while (*xfails) {
char *end = strpbrk (xfails, " \t\r\n;:,");
const char *end = strpbrk (xfails, " \t\r\n;:,");
if (!end)
end = xfails + strlen (xfails);
else
*end++ = '\0';
if (0 == strcmp (test->name, xfails)) {
if (0 == strncmp (test->name, xfails, end - xfails) &&
'\0' == test->name[end - xfails]) {
expectation = CAIRO_TEST_FAILURE;
break;
}
if (*end)
end++;
xfails = end;
}
}

View file

@ -72,7 +72,6 @@ typedef enum cairo_test_status {
} cairo_test_status_t;
typedef cairo_test_status_t (cairo_test_draw_function_t) (cairo_t *cr, int width, int height);
static cairo_test_draw_function_t draw;
typedef struct _cairo_test {
const char *name;

View file

@ -30,6 +30,8 @@
#define SIZE (5 * LINE_WIDTH)
#define PAD (2 * LINE_WIDTH)
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"caps-joins-alpha",
"Test caps and joins with some source alpha",

View file

@ -29,6 +29,8 @@
#define SIZE (5 * LINE_WIDTH)
#define PAD (2 * LINE_WIDTH)
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"caps-joins",
"Test caps and joins",

View file

@ -30,6 +30,8 @@
https://bugs.freedesktop.org/show_bug.cgi?id=4205
*/
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"caps-sub-paths",
"Test that sub-paths receive caps.",

View file

@ -28,6 +28,8 @@
#define SIZE 10
#define CLIP_SIZE 2
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"clip-all",
"Test clipping with everything clipped out",

View file

@ -28,6 +28,8 @@
#define PAD 1
#define SIZE 5
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"clip-fill-rule-pixel-aligned",
"Tests interaction of clipping and cairo_set_fill_rule with a pixel-aligned path",

View file

@ -27,6 +27,8 @@
#define STAR_SIZE 20
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"clip-fill-rule",
"Tests interaction of clipping with cairo_set_fill_rule",

View file

@ -31,6 +31,8 @@
#define BORDER 10
#define LINE_WIDTH 20
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"clip-nesting",
"Test clipping with multiple contexts for the same surface",

View file

@ -130,6 +130,8 @@ static void (*draw_funcs[])(cairo_t *cr, int x, int y) = {
#define IMAGE_WIDTH (N_OPERATORS * (WIDTH + PAD) + PAD)
#define IMAGE_HEIGHT (ARRAY_SIZE (draw_funcs) * (HEIGHT + PAD) + PAD)
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"clip-operator",
"Surface clipping with different operators",

View file

@ -28,6 +28,8 @@
#define WIDTH 64
#define HEIGHT 64
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"clip-twice",
"Verifies that the clip mask is updated correctly when it constructed by setting the clip path twice.",

View file

@ -6,6 +6,8 @@
#define SIZE2 20
#define OFFSET 10
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"composite-integer-translate-over-repeat",
"Test simple compositing: integer-translation 32->32 OVER, with repeat",

View file

@ -7,6 +7,8 @@
#define SCALE 1.5
const char png_filename[] = "romedalen.png";
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"composite-integer-translate-over",
"Test simple compositing: integer-translation 32->32 OVER",

View file

@ -7,6 +7,8 @@
const char png_filename[] = "romedalen.png";
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"composite-integer-translate-source",
"Test simple compositing: integer-translation 32->32 SOURCE",

View file

@ -31,6 +31,8 @@
#define WIDTH 2
#define HEIGHT 2
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"create-from-png-stream",
"Tests the creation of an image surface from a PNG using a FILE *",

View file

@ -30,6 +30,8 @@
#define WIDTH 2
#define HEIGHT 2
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"create-from-png",
"Tests the creation of an image surface from a PNG file",

View file

@ -35,6 +35,8 @@
#define SIZE (5 * LINE_WIDTH)
#define PAD (2 * LINE_WIDTH)
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"dash-caps-joins",
"Test caps and joins when dashing",

BIN
test/dash-no-dash-ref.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 B

95
test/dash-no-dash.c Normal file
View file

@ -0,0 +1,95 @@
/*
* Copyright © 2006 Red Hat, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software
* and its documentation for any purpose is hereby granted without
* fee, provided that the above copyright notice appear in all copies
* and that both that copyright notice and this permission notice
* appear in supporting documentation, and that the name of
* Red Hat, Inc. not be used in advertising or publicity pertaining to
* distribution of the software without specific, written prior
* permission. Red Hat, Inc. makes no representations about the
* suitability of this software for any purpose. It is provided "as
* is" without express or implied warranty.
*
* RED HAT, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL RED HAT, INC. BE LIABLE FOR ANY SPECIAL,
* INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
* RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Author: Carl D. Worth <cworth@cworth.org>
*/
#include "cairo-test.h"
#include <stdlib.h>
#define PAD 1
#define LINE_WIDTH 2
#define HEIGHT (PAD + 4 * (LINE_WIDTH + PAD))
#define WIDTH 16
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"dash-no-dash",
"Tests that we can actually turn dashing on and off again",
WIDTH, HEIGHT,
draw
};
static void
line (cairo_t *cr)
{
cairo_move_to (cr, PAD, 0.0);
cairo_line_to (cr, WIDTH - PAD, 0.0);
}
static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
{
double dash = 2.0;
/* We draw in black, so paint white first. */
cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); /* white */
cairo_paint (cr);
cairo_set_source_rgb (cr, 0, 0, 0); /* black */
cairo_translate (cr, 0.0, PAD + LINE_WIDTH / 2);
/* First draw a solid line... */
line (cr);
cairo_stroke (cr);
cairo_translate (cr, 0.0, LINE_WIDTH + PAD);
/* then a dashed line... */
cairo_set_dash (cr, &dash, 1, 0.0);
line (cr);
cairo_stroke (cr);
cairo_translate (cr, 0.0, LINE_WIDTH + PAD);
/* back to solid... */
cairo_set_dash (cr, NULL, 0, 0.0);
line (cr);
cairo_stroke (cr);
cairo_translate (cr, 0.0, LINE_WIDTH + PAD);
/* and finally, back to dashed. */
cairo_set_dash (cr, &dash, 1, 0.0);
line (cr);
cairo_stroke (cr);
return CAIRO_TEST_SUCCESS;
}
int
main (void)
{
return cairo_test (&test);
}

View file

@ -34,6 +34,8 @@
* https://bugs.freedesktop.org/show_bug.cgi?id=2729
*/
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"dash-offset-negative",
"Tests cairo_set_dash with a negative offset",

View file

@ -29,6 +29,8 @@
#define SIZE (5 * LINE_WIDTH)
#define PAD (2 * LINE_WIDTH)
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"dash-scale",
"Test interactions of cairo_set_dash and cairo_scale, (in particular with a non-uniformly scaled pen)",

View file

@ -33,6 +33,8 @@
* on invisible lines.
*/
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"dash-zero-length",
"Tests cairo_set_dash with zero length",

View file

@ -28,6 +28,8 @@
#define IMAGE_WIDTH 40
#define IMAGE_HEIGHT 22
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"degenerate-path",
"Tests the behaviour of degenerate paths with different cap types",

View file

@ -29,6 +29,8 @@
#define SIZE 10
#define PAD 2
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"device-offset-positive",
"Simple test using a surface with a positive device-offset as a source.",

View file

@ -29,6 +29,8 @@
#define SIZE 10
#define PAD 2
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"device-offset",
"Simple test using a surface with a negative device-offset as a source.",

View file

@ -6,6 +6,8 @@
#define OFFSET 50
const char png_filename[] = "romedalen.png";
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"extend-reflect",
"Test CAIRO_EXTEND_REFLECT for surface patterns"

View file

@ -29,6 +29,8 @@
#define PAD 2
#define SIZE 10
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"fill-and-stroke-alpha-add",
"Use a group to fill/stroke a path (each with different alpha) using DEST_OUT and ADD to combine",

View file

@ -29,6 +29,8 @@
#define PAD 2
#define SIZE 10
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"fill-and-stroke-alpha",
"Use a group to fill/stroke a path then blend the result with alpha onto the destination",

View file

@ -28,6 +28,8 @@
#define PAD 2
#define SIZE 10
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"fill-and-stroke",
"Tests using cairo_fill_preserve/cairo_stroke to fill/stroke the same path",

View file

@ -66,6 +66,8 @@
#define LITTLE_STAR_SIZE 20
#define BIG_STAR_SIZE 80
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"fill-rule",
"Tests cairo_set_full_rule with some star shapes",

View file

@ -34,6 +34,8 @@
#define IMAGE_WIDTH (PAD + STEPS * (STAMP_WIDTH + PAD) + PAD)
#define IMAGE_HEIGHT (PAD + STEPS * (STAMP_HEIGHT + PAD) + PAD)
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"filter-nearest-offset",
"Test sampling offset of CAIRO_FILTER_NEAREST"

View file

@ -26,6 +26,8 @@
#include "cairo-test.h"
#include <cairo-ft.h>
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"ft-font-create-for-ft-face",
"Simple test to verify that cairo_ft_font_create_for_ft_face doesn't crash.",

View file

@ -33,6 +33,8 @@
#define HEIGHT 30
#define TEXT_SIZE 12
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"ft-text-antialias-none",
"Tests text rendering with no antialiasing",

View file

@ -33,6 +33,8 @@
#define HEIGHT 30
#define TEXT_SIZE 12
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"ft-text-vertical-layout",
"Tests text rendering for vertical layout",

View file

@ -25,6 +25,8 @@
#include "cairo-test.h"
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"get-and-set",
"Tests calls to the most trivial cairo_get and cairo_set functions",

View file

@ -28,6 +28,8 @@
#define SIZE 8
#define PAD 2
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"get-group-target",
"Test of both cairo_get_group_target and cairo_surface_get_device_offset",

View file

@ -49,6 +49,8 @@
* _cairo_sacled_font_freeze/thaw_cache functions for this).
*/
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"glyph-cache-pressure",
"Ensure that all backends behave well under artificial glyph cache pressure",

View file

@ -25,6 +25,8 @@
#include "cairo-test.h"
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"gradient-alpha",
"Tests drawing of a gradient with various alpha values in the color stops",

View file

@ -34,6 +34,8 @@
#define WIDTH 71
#define HEIGHT 28
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"leaky-dash",
"Exercises bug #4863 in which a dashed stroke leaks into half the rectangle being filled"

View file

@ -56,6 +56,8 @@
#define WIDTH 21
#define HEIGHT 21
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"leaky-polygon",
"Exercises a corner case in the trapezoid rasterization in which pixels outside the trapezoids received a non-zero alpha",

View file

@ -52,6 +52,8 @@
#define WIDTH (XSCALE * SPLINE * 6.0)
#define HEIGHT (YSCALE * SPLINE * 2.0)
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"line-width-scale",
"Tests interaction of cairo_set_line_width with cairo_scale",

View file

@ -30,6 +30,8 @@
#define IMAGE_WIDTH 2 * LINE_LENGTH + 6
#define IMAGE_HEIGHT ((LINES+4)*LINES)/2 + 2
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"line-width",
"Tests cairo_set_line_width",

View file

@ -54,6 +54,8 @@ static const int n_stops[] = { 2, 3 };
#define WIDTH N_GRADIENT_ANGLES * UNIT_SIZE + (N_GRADIENT_ANGLES + 1) * PAD
#define HEIGHT N_N_STOPS * N_ROTATE_ANGLES * UNIT_SIZE + (N_N_STOPS * N_ROTATE_ANGLES + 1) * PAD
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"linear-gradient",
"Tests the drawing of linear gradients",

View file

@ -25,8 +25,9 @@
#
##
## Takes all the *.log files in the current directory and spits out
## html to stdout that can be used to view all the test results at once.
## Takes all the *.log files in the current directory (or those provided
## on the command line) and spits out html to stdout that can be used to
## view all the test results at once.
##
# show reference images
@ -53,7 +54,7 @@ foreach (<*.log>) {
$tests->{$1}->{$2}->{$3} = {} unless $tests->{$1}->{$2}->{$3};
$tests->{$1}->{$2}->{$3}->{$4} = $5;
$teststats->{$2} = {"PASS" => 0, "FAIL" => 0, "XFAIL" => 0, "UNTESTED" => 0}
$teststats->{$2} = {"PASS" => 0, "FAIL" => 0, "XFAIL" => 0, "UNTESTED" => 0, "CRASHED" =>0}
unless $teststats->{$2};
($teststats->{$2}->{$5})++;
}
@ -92,16 +93,18 @@ sub printl {
printl '<html><head>';
printl '<title>Cairo Test Results</title>';
printl '<style type="text/css">';
printl 'a img { border: none; }';
printl '.PASS { background-color: #009900; min-width: 1em; }';
printl '.FAIL { background-color: #990000; }';
printl '.XFAIL { background-color: #999900; }';
printl '.UNTESTED { background-color: #333333; }';
printl '.PASSstr { color: #009900; }';
printl '.FAILstr { color: #990000; }';
printl '.XFAILstr { color: #999900; }';
printl '.UNTESTEDstr { color: #333333; }';
printl 'img { max-width: 15em; min-width: 3em; }';
printl 'a img { border: solid 1px #FFF; }';
printl '.PASS { background-color: #0B0; min-width: 1em; }';
printl '.FAIL { background-color: #B00; }';
printl '.XFAIL { background-color: #BB0; }';
printl '.UNTESTED { background-color: #555; }';
printl '.CRASHED { background-color: #F00; color: #FF0; }';
printl '.PASSstr { color: #0B0; }';
printl '.FAILstr { color: #D00; }';
printl '.XFAILstr { color: #BB0; }';
printl '.CRASHEDstr { color: #F00; }';
printl '.UNTESTEDstr { color: #555; }';
printl 'img { max-width: 15em; min-width: 3em; margin: 3px; }';
printl 'td { vertical-align: top; }';
printl '</style>';
printl '<body>';
@ -121,7 +124,7 @@ print '<td></td>' if $config_show_ref;
foreach my $target (@targets) {
print '<td>';
print '<span class="PASSstr">', $teststats->{$target}->{"PASS"}, '</span>/';
print '<span class="FAILstr">', $teststats->{$target}->{"FAIL"}, '</span>/';
print '<span class="FAILstr">', $teststats->{$target}->{"FAIL"} + $teststats->{$target}->{"CRASHED"}, '</span>/';
print '<span class="XFAILstr">', $teststats->{$target}->{"XFAIL"}, '</span>/';
print '<span class="UNTESTEDstr">', $teststats->{$target}->{"UNTESTED"}; '</span>';
print '</td>';
@ -160,8 +163,6 @@ foreach my $test (sort(keys %$tests)) {
foreach my $format (@formats) {
my $testline = "";
my $num_failed = 0;
foreach my $target (@targets) {
my $tgtdata = $tests->{$test}->{$target};
if ($tgtdata) {
@ -175,21 +176,27 @@ foreach my $test (sort(keys %$tests)) {
$testline .= "<a href=\"" . $testfiles{"out"} . "\"><img src=\"" . $testfiles{"out"} . "\"></a>";
}
} elsif ($testres eq "FAIL") {
$num_failed++;
if ($config_show_fail || $config_show_all) {
$testline .= "<a href=\"" . $testfiles{"out"} . "\"><img src=\"" . $testfiles{"out"} . "\"></a>";
$testline .= "<hr size=\"1\">";
#$testline .= "<hr size=\"1\">";
$testline .= " ";
$testline .= "<a href=\"" . $testfiles{"diff"} . "\"><img src=\"" . $testfiles{"diff"} . "\"></a>";
}
} elsif ($testres eq "CRASHED") {
$testline .= "!!!CRASHED!!!";
} elsif ($testres eq "XFAIL") {
#nothing
if ($config_show_all) {
$testline .= "<a href=\"" . $testfiles{"out"} . "\"><img src=\"" . $testfiles{"out"} . "\"></a>";
$testline .= "<hr size=\"1\">";
#$testline .= "<hr size=\"1\">";
$testline .= " ";
$testline .= "<a href=\"" . $testfiles{"diff"} . "\"><img src=\"" . $testfiles{"diff"} . "\"></a>";
}
}
} elsif ($testres eq "UNTESTED") {
#nothing
} else {
$testline .= "UNSUPPORTED STATUS (update make-html.pl)";
}
$testline .= "</td>";
} else {

View file

@ -25,6 +25,8 @@
#include "cairo-test.h"
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"mask-ctm",
"Test that cairo_mask is affected properly by the CTM",

View file

@ -25,6 +25,8 @@
#include "cairo-test.h"
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"mask-surface-ctm",
"Test that cairo_mask_surface is affected properly by the CTM",

View file

@ -179,6 +179,8 @@ static void (*clip_funcs[])(cairo_t *cr, int x, int y) = {
#define IMAGE_WIDTH (ARRAY_SIZE (pattern_funcs) * (WIDTH + PAD) + PAD)
#define IMAGE_HEIGHT (ARRAY_SIZE (mask_funcs) * ARRAY_SIZE (clip_funcs) * (HEIGHT + PAD) + PAD)
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"mask",
"Tests of cairo_mask",

View file

@ -45,6 +45,8 @@
#include "cairo-test.h"
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"move-to-show-surface",
"Tests calls to cairo_show_surface after cairo_move_to",

View file

@ -27,6 +27,8 @@
#define SIZE 10
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"new-sub-path",
"Test the cairo_new_sub_path call",

View file

@ -32,6 +32,8 @@
* https://bugs.freedesktop.org/show_bug.cgi?id=3915
*/
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"nil-surface",
"Test that nil surfaces do not make cairo crash.",

View file

@ -146,6 +146,8 @@ static void (*draw_funcs[])(cairo_t *cr, int x, int y) = {
#define IMAGE_WIDTH (ARRAY_SIZE (pattern_funcs) * (WIDTH + PAD) + PAD)
#define IMAGE_HEIGHT (ARRAY_SIZE (draw_funcs) * (HEIGHT + PAD) + PAD)
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"operator-clear",
"Test of CAIRO_OPERATOR_CLEAR",

View file

@ -185,6 +185,8 @@ static void (*draw_funcs[])(cairo_t *cr, int x, int y) = {
#define IMAGE_WIDTH (ARRAY_SIZE (pattern_funcs) * (WIDTH + PAD) + PAD)
#define IMAGE_HEIGHT (ARRAY_SIZE (draw_funcs) * (HEIGHT + PAD) + PAD)
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"operator-source",
"Test of CAIRO_OPERATOR_SOURCE",

View file

@ -26,6 +26,8 @@
#include "cairo-test.h"
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"paint-source-alpha",
"Simple test of cairo_paint with a source surface with non-opaque alpha",

View file

@ -26,6 +26,8 @@
#include "cairo-test.h"
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"paint-with-alpha",
"Simple test of cairo_paint_with_alpha",

View file

@ -25,6 +25,8 @@
#include "cairo-test.h"
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"paint",
"Test calls to cairo_paint",

View file

@ -26,6 +26,8 @@
#include <stdlib.h>
#include "cairo-test.h"
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"path-data",
"Tests calls to path_data functions: cairo_copy_path_data, cairo_copy_path_data_flat, and cairo_append_path_data",

View file

@ -13,6 +13,8 @@
#define IMAGE_WIDTH (3 * WIDTH)
#define IMAGE_HEIGHT IMAGE_WIDTH
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"pixman-rotate",
"Exposes pixman off-by-one error when rotating",

View file

@ -32,6 +32,8 @@
#define WIDTH (UNIT_SIZE + PAD) + PAD
#define HEIGHT (UNIT_SIZE + PAD) + PAD
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"push-group",
"Verify that cairo_push_group works.",

View file

@ -30,6 +30,8 @@
* https://bugs.freedesktop.org/show_bug.cgi?id=4137
*/
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"rectangle-rounding-error",
"This demonstrates (or not) a rounding error that causes a gap between "

View file

@ -26,6 +26,8 @@
#define SIZE 10
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"rel-path",
"Tests calls to various relative path functions",

View file

@ -25,6 +25,8 @@
#include "cairo-test.h"
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"scale-source-surface-paint",
"Test call sequence: cairo_scale; cairo_set_source_surface; cairo_paint",

View file

@ -27,6 +27,8 @@
#define TEXT_SIZE 12
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"select-font-face",
"Tests using cairo_select_font_face to draw text in different faces",

View file

@ -41,6 +41,8 @@
#include <math.h>
#include "cairo-test.h"
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"select-font-no-show-text",
"Test calling cairo_select_font_face but never drawing text.",

View file

@ -29,6 +29,8 @@
#define SIZE 40
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"self-copy",
"Test copying from a surface to itself with a clip",

View file

@ -44,6 +44,8 @@
#include "cairo-test.h"
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"self-intersecting",
"Test strokes of self-intersecting paths"

View file

@ -25,6 +25,8 @@
#include "cairo-test.h"
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"set-source",
"Tests calls to various set_source functions",

View file

@ -78,6 +78,8 @@
* Sans Mono. */
#define GLYPH_INDEX 48
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"show-glyphs-many",
"Test that cairo_show_glyps works when handed 'many' glyphs",

View file

@ -27,6 +27,8 @@
#define TEXT_SIZE 12
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"show-text-current-point",
"Test that cairo_show_text adjusts the current point properly",

View file

@ -29,6 +29,8 @@
#define SIZE 50
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"source-clip",
"Test using a surface with an active clip as a source",

View file

@ -25,6 +25,8 @@
#include "cairo-test.h"
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"source-surface-scale-paint",
"Test call sequence: cairo_set_source_surface; cairo_scale; cairo_paint",

View file

@ -42,6 +42,8 @@
#include "cairo-test.h"
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"surface-finish-twice",
"Test to exercise a crash when calling cairo_surface_finish twice on the same surface.",

View file

@ -25,6 +25,8 @@
#include "cairo-test.h"
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"surface-pattern",
"Tests use of a surface pattern",

View file

@ -29,6 +29,8 @@
#define HEIGHT 22
#define TEXT_SIZE 12
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"text-antialias-gray",
"Tests text rendering with grayscale antialiasing",

View file

@ -29,6 +29,8 @@
#define HEIGHT 22
#define TEXT_SIZE 12
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"text-antialias-none",
"Tests text rendering with no antialiasing",

View file

@ -29,6 +29,8 @@
#define HEIGHT 22
#define TEXT_SIZE 12
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"text-antialias-subpixel",
"Tests text rendering with subpixel antialiasing",

View file

@ -62,6 +62,8 @@
#include "cairo-test.h"
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"text-cache-crash",
"Test case for bug causing an assertion failure in _cairo_cache_lookup",

View file

@ -28,6 +28,8 @@
#define IMAGE_WIDTH 64
#define IMAGE_HEIGHT 64
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"text-pattern",
"Patterned Text",

View file

@ -84,6 +84,8 @@
#define NUM_TEXT 20
#define TEXT_SIZE 12
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"text-rotate",
"Tests show_text under various rotations"

View file

@ -28,6 +28,8 @@
#define WIDTH 45
#define HEIGHT 30
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"transforms",
"Test various transformations.",

View file

@ -43,6 +43,8 @@
#include "cairo-test.h"
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"translate-show-surface",
"Tests calls to cairo_show_surface after cairo_translate",

View file

@ -164,6 +164,8 @@ static void (*clip_funcs[])(cairo_t *cr, int x, int y) = {
#define IMAGE_WIDTH (ARRAY_SIZE (pattern_funcs) * (WIDTH + PAD) + PAD)
#define IMAGE_HEIGHT (ARRAY_SIZE (draw_funcs) * ARRAY_SIZE (clip_funcs) * (HEIGHT + PAD) + PAD)
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"trap-clip",
"Trapezoid clipping",

View file

@ -25,6 +25,8 @@
#include "cairo-test.h"
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"unantialiased-shapes",
"Test shape drawing without antialiasing",

View file

@ -132,6 +132,8 @@ static cairo_operator_t operators[] = {
#define IMAGE_WIDTH (ARRAY_SIZE (operators) * (WIDTH + PAD) + PAD)
#define IMAGE_HEIGHT (ARRAY_SIZE (draw_funcs) * (HEIGHT + PAD) + PAD)
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"unbounded-operator",
"Operators with an effect for transparent source/mask",

View file

@ -42,6 +42,8 @@
* 2006-06-13 Paul Giblock reports that this only happens with the
* xlib backend, and then only on some systems.
*/
static cairo_test_draw_function_t draw;
cairo_test_t test = {
"zero-alpha",
"Testing that drawing with zero alpha has no effect",