From 0ac2bbbf52737b2e368de269651c56dab90c928a Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 13 Jul 2006 11:27:05 -0400 Subject: [PATCH 01/13] Improve test HTML generation: - Make "make retest" not generate all .log files. - Format improvements in the generated HTML file. --- test/Makefile.am | 27 ++++++++++++++++++-------- test/cairo-test.c | 16 ++++++++-------- test/make-html.pl | 49 +++++++++++++++++++++++++++-------------------- 3 files changed, 55 insertions(+), 37 deletions(-) diff --git a/test/Makefile.am b/test/Makefile.am index c96f7a70e..f5d4f44e7 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -481,26 +481,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 '\' $(TESTS:=.log) | sed -e 's/[.]log$$//' | xargs echo` +FAILED_TESTS = `grep -l '\' $(TESTS:=.log) | 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 '\' *.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 +523,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 diff --git a/test/cairo-test.c b/test/cairo-test.c index 8b4ae1172..94d3b1e48 100644 --- a/test/cairo-test.c +++ b/test/cairo-test.c @@ -1799,7 +1799,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 +1814,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); } @@ -1935,21 +1934,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; } } diff --git a/test/make-html.pl b/test/make-html.pl index 8b34e1254..7af9dcdeb 100755 --- a/test/make-html.pl +++ b/test/make-html.pl @@ -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 ''; printl 'Cairo Test Results'; printl ''; printl ''; @@ -121,7 +124,7 @@ print '' if $config_show_ref; foreach my $target (@targets) { print ''; print '', $teststats->{$target}->{"PASS"}, '/'; - print '', $teststats->{$target}->{"FAIL"}, '/'; + print '', $teststats->{$target}->{"FAIL"} + $teststats->{$target}->{"CRASHED"}, '/'; print '', $teststats->{$target}->{"XFAIL"}, '/'; print '', $teststats->{$target}->{"UNTESTED"}; ''; print ''; @@ -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 .= ""; } } elsif ($testres eq "FAIL") { - $num_failed++; - if ($config_show_fail || $config_show_all) { $testline .= ""; - $testline .= "
"; + #$testline .= "
"; + $testline .= " "; $testline .= ""; } + } elsif ($testres eq "CRASHED") { + $testline .= "!!!CRASHED!!!"; } elsif ($testres eq "XFAIL") { #nothing if ($config_show_all) { $testline .= ""; - $testline .= "
"; + #$testline .= "
"; + $testline .= " "; $testline .= ""; } - } + } elsif ($testres eq "UNTESTED") { + #nothing + } else { + $testline .= "UNSUPPORTED STATUS (update make-html.pl)"; + } $testline .= ""; } else { From f8eeca97684f7c8eba7b918c34fe5ccbf32e2f5f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 13 Jul 2006 11:48:42 -0400 Subject: [PATCH 02/13] Tiny doc typo fix. --- src/cairo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cairo.c b/src/cairo.c index d2793a071..551de6f82 100644 --- a/src/cairo.c +++ b/src/cairo.c @@ -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 From cf1b23a4c57d436098619443068611a48b88187e Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 13 Jul 2006 12:58:24 -0400 Subject: [PATCH 03/13] Add prototype for draw in each test file and remove it from the header. --- test/a8-mask.c | 2 ++ test/bitmap-font.c | 2 ++ test/cairo-test.h | 1 - test/caps-joins-alpha.c | 2 ++ test/caps-joins.c | 2 ++ test/caps-sub-paths.c | 2 ++ test/clip-all.c | 2 ++ test/clip-fill-rule-pixel-aligned.c | 2 ++ test/clip-fill-rule.c | 2 ++ test/clip-nesting.c | 2 ++ test/clip-operator.c | 2 ++ test/clip-twice.c | 2 ++ test/composite-integer-translate-over-repeat.c | 2 ++ test/composite-integer-translate-over.c | 2 ++ test/composite-integer-translate-source.c | 2 ++ test/create-from-png-stream.c | 2 ++ test/create-from-png.c | 2 ++ test/dash-caps-joins.c | 2 ++ test/dash-offset-negative.c | 2 ++ test/dash-scale.c | 2 ++ test/dash-zero-length.c | 2 ++ test/degenerate-path.c | 2 ++ test/device-offset-positive.c | 2 ++ test/device-offset.c | 2 ++ test/extend-reflect.c | 2 ++ test/fill-and-stroke-alpha-add.c | 2 ++ test/fill-and-stroke-alpha.c | 2 ++ test/fill-and-stroke.c | 2 ++ test/fill-rule.c | 2 ++ test/filter-nearest-offset.c | 2 ++ test/ft-font-create-for-ft-face.c | 2 ++ test/ft-text-antialias-none.c | 2 ++ test/ft-text-vertical-layout.c | 2 ++ test/get-and-set.c | 2 ++ test/get-group-target.c | 2 ++ test/glyph-cache-pressure.c | 2 ++ test/gradient-alpha.c | 2 ++ test/leaky-dash.c | 2 ++ test/leaky-polygon.c | 2 ++ test/line-width-scale.c | 2 ++ test/line-width.c | 2 ++ test/linear-gradient.c | 2 ++ test/mask-ctm.c | 2 ++ test/mask-surface-ctm.c | 2 ++ test/mask.c | 2 ++ test/move-to-show-surface.c | 2 ++ test/new-sub-path.c | 2 ++ test/nil-surface.c | 2 ++ test/operator-clear.c | 2 ++ test/operator-source.c | 2 ++ test/paint-source-alpha.c | 2 ++ test/paint-with-alpha.c | 2 ++ test/paint.c | 2 ++ test/path-data.c | 2 ++ test/pixman-rotate.c | 2 ++ test/push-group.c | 2 ++ test/rectangle-rounding-error.c | 2 ++ test/rel-path.c | 2 ++ test/scale-source-surface-paint.c | 2 ++ test/select-font-face.c | 2 ++ test/select-font-no-show-text.c | 2 ++ test/self-copy.c | 2 ++ test/self-intersecting.c | 2 ++ test/set-source.c | 2 ++ test/show-glyphs-many.c | 2 ++ test/show-text-current-point.c | 2 ++ test/source-clip.c | 2 ++ test/source-surface-scale-paint.c | 2 ++ test/surface-finish-twice.c | 2 ++ test/surface-pattern.c | 2 ++ test/text-antialias-gray.c | 2 ++ test/text-antialias-none.c | 2 ++ test/text-antialias-subpixel.c | 2 ++ test/text-cache-crash.c | 2 ++ test/text-pattern.c | 2 ++ test/text-rotate.c | 2 ++ test/transforms.c | 2 ++ test/translate-show-surface.c | 2 ++ test/trap-clip.c | 2 ++ test/unantialiased-shapes.c | 2 ++ test/unbounded-operator.c | 2 ++ test/zero-alpha.c | 2 ++ 82 files changed, 162 insertions(+), 1 deletion(-) diff --git a/test/a8-mask.c b/test/a8-mask.c index b619025bb..e21b9df6b 100644 --- a/test/a8-mask.c +++ b/test/a8-mask.c @@ -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" diff --git a/test/bitmap-font.c b/test/bitmap-font.c index 3707a35aa..bf8f109e1 100644 --- a/test/bitmap-font.c +++ b/test/bitmap-font.c @@ -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", diff --git a/test/cairo-test.h b/test/cairo-test.h index fbcbf29ef..3694f35d8 100644 --- a/test/cairo-test.h +++ b/test/cairo-test.h @@ -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; diff --git a/test/caps-joins-alpha.c b/test/caps-joins-alpha.c index 969a9a536..cdf608613 100644 --- a/test/caps-joins-alpha.c +++ b/test/caps-joins-alpha.c @@ -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", diff --git a/test/caps-joins.c b/test/caps-joins.c index 9b2055a94..c7306a01b 100644 --- a/test/caps-joins.c +++ b/test/caps-joins.c @@ -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", diff --git a/test/caps-sub-paths.c b/test/caps-sub-paths.c index c42c7cd04..73af8aa7e 100644 --- a/test/caps-sub-paths.c +++ b/test/caps-sub-paths.c @@ -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.", diff --git a/test/clip-all.c b/test/clip-all.c index 404607374..2ff883d55 100644 --- a/test/clip-all.c +++ b/test/clip-all.c @@ -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", diff --git a/test/clip-fill-rule-pixel-aligned.c b/test/clip-fill-rule-pixel-aligned.c index 07b9efed9..c2bb08b3b 100644 --- a/test/clip-fill-rule-pixel-aligned.c +++ b/test/clip-fill-rule-pixel-aligned.c @@ -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", diff --git a/test/clip-fill-rule.c b/test/clip-fill-rule.c index 84619d741..5012b3b1f 100644 --- a/test/clip-fill-rule.c +++ b/test/clip-fill-rule.c @@ -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", diff --git a/test/clip-nesting.c b/test/clip-nesting.c index 66c277b87..2d53782ae 100644 --- a/test/clip-nesting.c +++ b/test/clip-nesting.c @@ -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", diff --git a/test/clip-operator.c b/test/clip-operator.c index 44ea6f46f..52cbba61d 100644 --- a/test/clip-operator.c +++ b/test/clip-operator.c @@ -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", diff --git a/test/clip-twice.c b/test/clip-twice.c index d63458125..71a3c148b 100644 --- a/test/clip-twice.c +++ b/test/clip-twice.c @@ -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.", diff --git a/test/composite-integer-translate-over-repeat.c b/test/composite-integer-translate-over-repeat.c index 17eafa138..e0978ff23 100644 --- a/test/composite-integer-translate-over-repeat.c +++ b/test/composite-integer-translate-over-repeat.c @@ -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", diff --git a/test/composite-integer-translate-over.c b/test/composite-integer-translate-over.c index 84c7a04b2..9c4562100 100644 --- a/test/composite-integer-translate-over.c +++ b/test/composite-integer-translate-over.c @@ -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", diff --git a/test/composite-integer-translate-source.c b/test/composite-integer-translate-source.c index f2b808694..af0f58781 100644 --- a/test/composite-integer-translate-source.c +++ b/test/composite-integer-translate-source.c @@ -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", diff --git a/test/create-from-png-stream.c b/test/create-from-png-stream.c index 2eaeb9f4f..4e8a29d8a 100644 --- a/test/create-from-png-stream.c +++ b/test/create-from-png-stream.c @@ -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 *", diff --git a/test/create-from-png.c b/test/create-from-png.c index da03a1199..4aefc34ca 100644 --- a/test/create-from-png.c +++ b/test/create-from-png.c @@ -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", diff --git a/test/dash-caps-joins.c b/test/dash-caps-joins.c index 4dd9868ec..722a59d2e 100644 --- a/test/dash-caps-joins.c +++ b/test/dash-caps-joins.c @@ -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", diff --git a/test/dash-offset-negative.c b/test/dash-offset-negative.c index a2d0269bb..539e3cde5 100644 --- a/test/dash-offset-negative.c +++ b/test/dash-offset-negative.c @@ -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", diff --git a/test/dash-scale.c b/test/dash-scale.c index 36ac818b4..b845dcf8c 100644 --- a/test/dash-scale.c +++ b/test/dash-scale.c @@ -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)", diff --git a/test/dash-zero-length.c b/test/dash-zero-length.c index 1c9361e2b..6e9854adc 100644 --- a/test/dash-zero-length.c +++ b/test/dash-zero-length.c @@ -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", diff --git a/test/degenerate-path.c b/test/degenerate-path.c index c4272cc52..ab6a34d75 100644 --- a/test/degenerate-path.c +++ b/test/degenerate-path.c @@ -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", diff --git a/test/device-offset-positive.c b/test/device-offset-positive.c index 3d4773d84..908061282 100644 --- a/test/device-offset-positive.c +++ b/test/device-offset-positive.c @@ -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.", diff --git a/test/device-offset.c b/test/device-offset.c index 1b92c8a23..5f0eb80f0 100644 --- a/test/device-offset.c +++ b/test/device-offset.c @@ -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.", diff --git a/test/extend-reflect.c b/test/extend-reflect.c index 1d53af9bb..297c475f6 100644 --- a/test/extend-reflect.c +++ b/test/extend-reflect.c @@ -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" diff --git a/test/fill-and-stroke-alpha-add.c b/test/fill-and-stroke-alpha-add.c index 9b672d7cf..0a3ebbc7b 100644 --- a/test/fill-and-stroke-alpha-add.c +++ b/test/fill-and-stroke-alpha-add.c @@ -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", diff --git a/test/fill-and-stroke-alpha.c b/test/fill-and-stroke-alpha.c index 170fafea9..1d01151e3 100644 --- a/test/fill-and-stroke-alpha.c +++ b/test/fill-and-stroke-alpha.c @@ -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", diff --git a/test/fill-and-stroke.c b/test/fill-and-stroke.c index 382e9f741..345b51d00 100644 --- a/test/fill-and-stroke.c +++ b/test/fill-and-stroke.c @@ -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", diff --git a/test/fill-rule.c b/test/fill-rule.c index f31c70dcd..6b186eff3 100644 --- a/test/fill-rule.c +++ b/test/fill-rule.c @@ -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", diff --git a/test/filter-nearest-offset.c b/test/filter-nearest-offset.c index 01db5e8b7..2727f56ea 100644 --- a/test/filter-nearest-offset.c +++ b/test/filter-nearest-offset.c @@ -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" diff --git a/test/ft-font-create-for-ft-face.c b/test/ft-font-create-for-ft-face.c index 196bacc53..64a32241c 100644 --- a/test/ft-font-create-for-ft-face.c +++ b/test/ft-font-create-for-ft-face.c @@ -26,6 +26,8 @@ #include "cairo-test.h" #include +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.", diff --git a/test/ft-text-antialias-none.c b/test/ft-text-antialias-none.c index 4294f28eb..55a6fa3c8 100644 --- a/test/ft-text-antialias-none.c +++ b/test/ft-text-antialias-none.c @@ -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", diff --git a/test/ft-text-vertical-layout.c b/test/ft-text-vertical-layout.c index 3502b6c13..d7638eeec 100644 --- a/test/ft-text-vertical-layout.c +++ b/test/ft-text-vertical-layout.c @@ -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", diff --git a/test/get-and-set.c b/test/get-and-set.c index 5589b304d..ae17cc894 100644 --- a/test/get-and-set.c +++ b/test/get-and-set.c @@ -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", diff --git a/test/get-group-target.c b/test/get-group-target.c index 009087bd7..73a2d951d 100644 --- a/test/get-group-target.c +++ b/test/get-group-target.c @@ -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", diff --git a/test/glyph-cache-pressure.c b/test/glyph-cache-pressure.c index 3661fa310..5b5e6c45d 100644 --- a/test/glyph-cache-pressure.c +++ b/test/glyph-cache-pressure.c @@ -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", diff --git a/test/gradient-alpha.c b/test/gradient-alpha.c index 1ec155990..a56b50791 100644 --- a/test/gradient-alpha.c +++ b/test/gradient-alpha.c @@ -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", diff --git a/test/leaky-dash.c b/test/leaky-dash.c index 961c62086..d78fac56c 100644 --- a/test/leaky-dash.c +++ b/test/leaky-dash.c @@ -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" diff --git a/test/leaky-polygon.c b/test/leaky-polygon.c index 69884e65b..252686095 100644 --- a/test/leaky-polygon.c +++ b/test/leaky-polygon.c @@ -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", diff --git a/test/line-width-scale.c b/test/line-width-scale.c index b06e982b9..eada6c6b0 100644 --- a/test/line-width-scale.c +++ b/test/line-width-scale.c @@ -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", diff --git a/test/line-width.c b/test/line-width.c index 6d112c99b..ad51c74d8 100644 --- a/test/line-width.c +++ b/test/line-width.c @@ -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", diff --git a/test/linear-gradient.c b/test/linear-gradient.c index fd8da6801..7681cbf0f 100644 --- a/test/linear-gradient.c +++ b/test/linear-gradient.c @@ -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", diff --git a/test/mask-ctm.c b/test/mask-ctm.c index 8c5d4bd68..d6939902a 100644 --- a/test/mask-ctm.c +++ b/test/mask-ctm.c @@ -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", diff --git a/test/mask-surface-ctm.c b/test/mask-surface-ctm.c index ea807f95a..02384c6c5 100644 --- a/test/mask-surface-ctm.c +++ b/test/mask-surface-ctm.c @@ -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", diff --git a/test/mask.c b/test/mask.c index faaecd629..ed328199e 100644 --- a/test/mask.c +++ b/test/mask.c @@ -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", diff --git a/test/move-to-show-surface.c b/test/move-to-show-surface.c index 2b5cc401f..869320786 100644 --- a/test/move-to-show-surface.c +++ b/test/move-to-show-surface.c @@ -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", diff --git a/test/new-sub-path.c b/test/new-sub-path.c index bff3a7634..93580cebd 100644 --- a/test/new-sub-path.c +++ b/test/new-sub-path.c @@ -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", diff --git a/test/nil-surface.c b/test/nil-surface.c index 5819cb0b5..80cb290cd 100644 --- a/test/nil-surface.c +++ b/test/nil-surface.c @@ -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.", diff --git a/test/operator-clear.c b/test/operator-clear.c index 89fdd3e96..575ce1d0a 100644 --- a/test/operator-clear.c +++ b/test/operator-clear.c @@ -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", diff --git a/test/operator-source.c b/test/operator-source.c index 17c045729..6784622e5 100644 --- a/test/operator-source.c +++ b/test/operator-source.c @@ -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", diff --git a/test/paint-source-alpha.c b/test/paint-source-alpha.c index afef33314..36a158b86 100644 --- a/test/paint-source-alpha.c +++ b/test/paint-source-alpha.c @@ -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", diff --git a/test/paint-with-alpha.c b/test/paint-with-alpha.c index 81e2138af..864b95673 100644 --- a/test/paint-with-alpha.c +++ b/test/paint-with-alpha.c @@ -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", diff --git a/test/paint.c b/test/paint.c index e76a5451c..0149db684 100644 --- a/test/paint.c +++ b/test/paint.c @@ -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", diff --git a/test/path-data.c b/test/path-data.c index 9868205d7..903e92c6f 100644 --- a/test/path-data.c +++ b/test/path-data.c @@ -26,6 +26,8 @@ #include #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", diff --git a/test/pixman-rotate.c b/test/pixman-rotate.c index e02d91824..425f883ac 100644 --- a/test/pixman-rotate.c +++ b/test/pixman-rotate.c @@ -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", diff --git a/test/push-group.c b/test/push-group.c index f77778661..738df6f18 100644 --- a/test/push-group.c +++ b/test/push-group.c @@ -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.", diff --git a/test/rectangle-rounding-error.c b/test/rectangle-rounding-error.c index 4d0d35ebf..2cfbe9c9d 100644 --- a/test/rectangle-rounding-error.c +++ b/test/rectangle-rounding-error.c @@ -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 " diff --git a/test/rel-path.c b/test/rel-path.c index d82e62a63..165c10e85 100644 --- a/test/rel-path.c +++ b/test/rel-path.c @@ -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", diff --git a/test/scale-source-surface-paint.c b/test/scale-source-surface-paint.c index d98b260a3..1fbe0c428 100644 --- a/test/scale-source-surface-paint.c +++ b/test/scale-source-surface-paint.c @@ -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", diff --git a/test/select-font-face.c b/test/select-font-face.c index 20ade007d..30daf25dd 100644 --- a/test/select-font-face.c +++ b/test/select-font-face.c @@ -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", diff --git a/test/select-font-no-show-text.c b/test/select-font-no-show-text.c index 74bc1e9ea..c0e4f46ad 100644 --- a/test/select-font-no-show-text.c +++ b/test/select-font-no-show-text.c @@ -41,6 +41,8 @@ #include #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.", diff --git a/test/self-copy.c b/test/self-copy.c index c872f7f86..0c238555f 100644 --- a/test/self-copy.c +++ b/test/self-copy.c @@ -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", diff --git a/test/self-intersecting.c b/test/self-intersecting.c index 77547cb41..870783e65 100644 --- a/test/self-intersecting.c +++ b/test/self-intersecting.c @@ -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" diff --git a/test/set-source.c b/test/set-source.c index 87953b6ac..773789731 100644 --- a/test/set-source.c +++ b/test/set-source.c @@ -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", diff --git a/test/show-glyphs-many.c b/test/show-glyphs-many.c index 95cca92fe..f9137e6c9 100644 --- a/test/show-glyphs-many.c +++ b/test/show-glyphs-many.c @@ -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", diff --git a/test/show-text-current-point.c b/test/show-text-current-point.c index d551ea42c..ebd364452 100644 --- a/test/show-text-current-point.c +++ b/test/show-text-current-point.c @@ -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", diff --git a/test/source-clip.c b/test/source-clip.c index e8f6dea90..4243bf0cd 100644 --- a/test/source-clip.c +++ b/test/source-clip.c @@ -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", diff --git a/test/source-surface-scale-paint.c b/test/source-surface-scale-paint.c index f1da8c533..8c3096a80 100644 --- a/test/source-surface-scale-paint.c +++ b/test/source-surface-scale-paint.c @@ -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", diff --git a/test/surface-finish-twice.c b/test/surface-finish-twice.c index 9a6a02857..62acf7141 100644 --- a/test/surface-finish-twice.c +++ b/test/surface-finish-twice.c @@ -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.", diff --git a/test/surface-pattern.c b/test/surface-pattern.c index 3124d76ec..8fe40e668 100644 --- a/test/surface-pattern.c +++ b/test/surface-pattern.c @@ -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", diff --git a/test/text-antialias-gray.c b/test/text-antialias-gray.c index 1a044ebc8..0c9f30dd7 100644 --- a/test/text-antialias-gray.c +++ b/test/text-antialias-gray.c @@ -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", diff --git a/test/text-antialias-none.c b/test/text-antialias-none.c index 4d9d6560f..32f7a0ed4 100644 --- a/test/text-antialias-none.c +++ b/test/text-antialias-none.c @@ -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", diff --git a/test/text-antialias-subpixel.c b/test/text-antialias-subpixel.c index b78007c2b..aba989087 100644 --- a/test/text-antialias-subpixel.c +++ b/test/text-antialias-subpixel.c @@ -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", diff --git a/test/text-cache-crash.c b/test/text-cache-crash.c index 2b78813f2..00b3b2931 100644 --- a/test/text-cache-crash.c +++ b/test/text-cache-crash.c @@ -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", diff --git a/test/text-pattern.c b/test/text-pattern.c index 7c6c7e724..40a2a4545 100644 --- a/test/text-pattern.c +++ b/test/text-pattern.c @@ -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", diff --git a/test/text-rotate.c b/test/text-rotate.c index 39e868a6c..abc6baa5b 100644 --- a/test/text-rotate.c +++ b/test/text-rotate.c @@ -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" diff --git a/test/transforms.c b/test/transforms.c index c0d0c3460..97b8fe853 100644 --- a/test/transforms.c +++ b/test/transforms.c @@ -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.", diff --git a/test/translate-show-surface.c b/test/translate-show-surface.c index 574a419f6..a505f369a 100644 --- a/test/translate-show-surface.c +++ b/test/translate-show-surface.c @@ -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", diff --git a/test/trap-clip.c b/test/trap-clip.c index 3adeb344e..a1483de09 100644 --- a/test/trap-clip.c +++ b/test/trap-clip.c @@ -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", diff --git a/test/unantialiased-shapes.c b/test/unantialiased-shapes.c index b6799970f..2ca4ee829 100644 --- a/test/unantialiased-shapes.c +++ b/test/unantialiased-shapes.c @@ -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", diff --git a/test/unbounded-operator.c b/test/unbounded-operator.c index 1b14268e4..70dab83fe 100644 --- a/test/unbounded-operator.c +++ b/test/unbounded-operator.c @@ -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", diff --git a/test/zero-alpha.c b/test/zero-alpha.c index c67c382d8..833e24c9b 100644 --- a/test/zero-alpha.c +++ b/test/zero-alpha.c @@ -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", From da0f348350c3ca28d40601aefbca12903632cc18 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 13 Jul 2006 13:16:10 -0400 Subject: [PATCH 04/13] ***cworth finds them [the background colors] a bit too bright --- test/make-html.pl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/make-html.pl b/test/make-html.pl index 7af9dcdeb..587ca627d 100755 --- a/test/make-html.pl +++ b/test/make-html.pl @@ -94,16 +94,16 @@ printl ''; printl 'Cairo Test Results'; printl ''; From 65d0431b98e7e8d966bbcb43a542a86a9c95e0dc Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Thu, 13 Jul 2006 10:04:19 -0700 Subject: [PATCH 05/13] Add retest and recheck targets to the top-level Makefile --- Makefile.am | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 7855fd6f4..805253439 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 From f3d45d17902cb109dacf30d826ea8f93408473ba Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Thu, 13 Jul 2006 10:04:55 -0700 Subject: [PATCH 06/13] Eliminate a few simple compiler warnings --- test/cairo-test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/cairo-test.c b/test/cairo-test.c index 94d3b1e48..3945182d8 100644 --- a/test/cairo-test.c +++ b/test/cairo-test.c @@ -1637,8 +1637,8 @@ 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; - const char *tname; + volatile int limited_targets = 0; + char *tname; void (*old_segfault_handler)(int); volatile cairo_test_status_t status, ret; volatile cairo_test_target_t **targets_to_test; @@ -1799,7 +1799,7 @@ cairo_test_expecting (cairo_test_t *test, while (*tname) { int found = 0; - const char *end = strpbrk (tname, " \t\r\n;:,"); + char *end = strpbrk (tname, " \t\r\n;:,"); if (!end) end = tname + strlen (tname); From d2d9a74c77d6bbc51502cee2288fd7d76c30f926 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Wed, 12 Jul 2006 14:49:14 -0700 Subject: [PATCH 07/13] Add dash-no-dash test case to demonstrate PDF failure to turn off dashing. --- test/.gitignore | 3 +- test/Makefile.am | 8 ++-- test/dash-no-dash-ref.png | Bin 0 -> 152 bytes test/dash-no-dash.c | 95 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 102 insertions(+), 4 deletions(-) create mode 100644 test/dash-no-dash-ref.png create mode 100644 test/dash-no-dash.c diff --git a/test/.gitignore b/test/.gitignore index a0255e7c9..1b6b64e17 100644 --- a/test/.gitignore +++ b/test/.gitignore @@ -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 diff --git a/test/Makefile.am b/test/Makefile.am index f5d4f44e7..d4a76fa98 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -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 \ diff --git a/test/dash-no-dash-ref.png b/test/dash-no-dash-ref.png new file mode 100644 index 0000000000000000000000000000000000000000..9afd045db0bbaf087e718088b385f8bc5048feee GIT binary patch literal 152 zcmeAS@N?(olHy`uVBq!ia0vp^0w6XA8<1SE`<)7qVoUONcVYMsf(!O8p9~aXFY)ws zWxvMGC8D5^@H$NaC}id7;uxYaG5OE`|NraRxEQ#Zfk0VVIdT?I;QRrX&bI~P0gt%V s*w{M6C+v0PnxCX^(0A-mK?f^C;x-Ap`_6M808L@=boFyt=akR{04I1a2mk;8 literal 0 HcmV?d00001 diff --git a/test/dash-no-dash.c b/test/dash-no-dash.c new file mode 100644 index 000000000..21235b964 --- /dev/null +++ b/test/dash-no-dash.c @@ -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 + */ + +#include "cairo-test.h" +#include + +#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); +} From 778c4730a86296bf0a71080cf7008d7291792256 Mon Sep 17 00:00:00 2001 From: Kent Worsnop Date: Thu, 13 Jul 2006 10:20:12 -0700 Subject: [PATCH 08/13] PDF: Fix for dash-no-dash test case, (so that dashing can be turned off) --- src/cairo-pdf-surface.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c index 663097f21..aaf71c7ec 100644 --- a/src/cairo-pdf-surface.c +++ b/src/cairo-pdf-surface.c @@ -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, From 09dfae5fbf34fb19b283973df7112b14638d6466 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 13 Jul 2006 13:22:49 -0400 Subject: [PATCH 09/13] Don't write FAIL messages on stdout if both stdout/err are going to screen. --- test/cairo-test.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/test/cairo-test.c b/test/cairo-test.c index 3945182d8..c6bf79bcf 100644 --- a/test/cairo-test.c +++ b/test/cairo-test.c @@ -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,8 +1637,8 @@ 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 int limited_targets = 0; - char *tname; + volatile int limited_targets = 0, no_fail_on_stdout = 0; + const char *tname; void (*old_segfault_handler)(int); volatile cairo_test_status_t status, ret; volatile cairo_test_target_t **targets_to_test; @@ -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); @@ -1879,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, @@ -1893,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, From 601c0503f7906151698929051852d13c377cfef1 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 13 Jul 2006 13:30:52 -0400 Subject: [PATCH 10/13] Send grep errors to hell^Wnull. --- test/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Makefile.am b/test/Makefile.am index d4a76fa98..97ac10d16 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -484,8 +484,8 @@ 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 '\' $(TESTS:=.log) | sed -e 's/[.]log$$//' | xargs echo` -FAILED_TESTS = `grep -l '\' $(TESTS:=.log) | tr '\n' ' ' | sed -e 's/[.]log */ /g; s/^ //; s/ $$//'` +#FAILED_TESTS = `grep -l '\' $(TESTS:=.log) 2>/dev/null | sed -e 's/[.]log$$//' | xargs echo` +FAILED_TESTS = `grep -l '\' $(TESTS:=.log) 2>/dev/null | tr '\n' ' ' | sed -e 's/[.]log */ /g; s/^ //; s/ $$//'` recheck = check TESTS="$(FAILED_TESTS)" From 510d23acef9fc75eb968795191091cbc1d33bc09 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 13 Jul 2006 13:39:04 -0400 Subject: [PATCH 11/13] Fix doc typo. --- src/cairo.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cairo.h b/src/cairo.h index 2003093e0..e5349c9f7 100644 --- a/src/cairo.h +++ b/src/cairo.h @@ -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 From b2668e944d1819f2b8f9973f1f42b1ca36bb193d Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 13 Jul 2006 14:02:58 -0400 Subject: [PATCH 12/13] Use cairo_bool_t. --- test/cairo-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cairo-test.c b/test/cairo-test.c index c6bf79bcf..c33931155 100644 --- a/test/cairo-test.c +++ b/test/cairo-test.c @@ -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 int limited_targets = 0, no_fail_on_stdout = 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; From 1409b8be0ca00a0904b1732661915d3eba753a51 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 13 Jul 2006 14:33:41 -0400 Subject: [PATCH 13/13] Fix Name tag in backend .pc files to include "cairo-". --- src/cairo-backend.pc.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cairo-backend.pc.in b/src/cairo-backend.pc.in index 8fc51579d..862063ca4 100644 --- a/src/cairo-backend.pc.in +++ b/src/cairo-backend.pc.in @@ -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@