[cairo-commit] cairo/test Makefile.am, 1.33, 1.34 cairo-test.c, 1.17, 1.18 cairo-test.h, 1.5, 1.6 pixman-rotate.c, 1.4, 1.5 text-rotate.c, 1.6, 1.7

Carl Worth commit at pdx.freedesktop.org
Thu Apr 14 10:03:00 PDT 2005


Committed by: cworth

Update of /cvs/cairo/cairo/test
In directory gabe:/tmp/cvs-serv14396/test

Modified Files:
	Makefile.am cairo-test.c cairo-test.h pixman-rotate.c 
	text-rotate.c 
Log Message:

        * test/Makefile.am: Improve instructions for when to add a test to
        the XFAIL list.

        * test/cairo-test.c: (cairo_test_expect_failure):
        * test/cairo-test.h:
        * test/pixman-rotate.c: (main):
        * test/text-rotate.c: (main): Print explanations for expected
        failures.


Index: Makefile.am
===================================================================
RCS file: /cvs/cairo/cairo/test/Makefile.am,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- Makefile.am	14 Apr 2005 16:31:21 -0000	1.33
+++ Makefile.am	14 Apr 2005 17:02:58 -0000	1.34
@@ -1,4 +1,4 @@
-# All new test cases go here
+# All test cases go here
 TESTS = 		\
 clip-twice		\
 coverage		\
@@ -22,9 +22,9 @@
 trap-clip		\
 user-data
 
-# And all new tests go here too. I really don't like having to repeat
-# this list. Anyone know a good way to avoid it? Can I use a wildcard
-# here?
+# All tests which have a reference image go here.
+# I really don't like having to repeat this list. Anyone know a good
+# way to avoid it? Can I use a wildcard here?
 EXTRA_DIST =			\
 create-for-png-ref.png		\
 fill-rule-ref.png		\
@@ -43,17 +43,19 @@
 translate-show-surface-ref.png	\
 trap-clip-ref.png
 
-# Once we can draw the text-rotate.c test case correctly, we should
-# create and add text-rotate-ref.png to the list of reference PNGs.
-
-# This list is only for known bugs (not regressions). We do need to
-# fix these before the next release, but they are expected to fail for
-# now, so they don't need to hold up any new code commit.
+# Any test for which the code committed to CVS is expected to fail
+# should be listed here.
 #
-# When new bugs are found in committed code they can be listed
-# here. New failures due to local, uncommitted code changes are
-# regression bugs that should not be listed here. Instead they should
-# be fixed before the code is committed.
+# This way, we can avoid being bothered by reports of bugs we are
+# aware of, but users can still report when tests start behaving in
+# unexpected ways on their system.
+#
+# Of course, before any "release" of cairo we should eliminate
+# everything from this list by fixing the bugs. (We don't necessarily
+# have to be that strict for "snapshots" though.)
+#
+# Also, any test listed here should call cairo_test_expect_failure and
+# provide an explanation for the expected failure.
 XFAIL_TESTS =		\
 pixman-rotate		\
 text-rotate

Index: cairo-test.c
===================================================================
RCS file: /cvs/cairo/cairo/test/cairo-test.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- cairo-test.c	13 Apr 2005 21:45:05 -0000	1.17
+++ cairo-test.c	14 Apr 2005 17:02:58 -0000	1.18
@@ -98,6 +98,15 @@
 }
 
 cairo_test_status_t
+cairo_test_expect_failure (cairo_test_t		      *test, 
+			   cairo_test_draw_function_t  draw,
+			   const char		      *because)
+{
+    printf ("%s is expected to fail %s\n", test->name, because);
+    return cairo_test (test, draw);
+}
+
+cairo_test_status_t
 cairo_test (cairo_test_t *test, cairo_test_draw_function_t draw)
 {
     cairo_test_status_t status;

Index: cairo-test.h
===================================================================
RCS file: /cvs/cairo/cairo/test/cairo-test.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- cairo-test.h	4 Apr 2005 16:47:12 -0000	1.5
+++ cairo-test.h	14 Apr 2005 17:02:58 -0000	1.6
@@ -47,6 +47,11 @@
 cairo_test_status_t
 cairo_test (cairo_test_t *test, cairo_test_draw_function_t draw);
 
+cairo_test_status_t
+cairo_test_expect_failure (cairo_test_t		      *test, 
+			   cairo_test_draw_function_t  draw,
+			   const char		      *reason);
+
 cairo_pattern_t *
 cairo_test_create_png_pattern (cairo_t *cr, const char *filename);
 

Index: pixman-rotate.c
===================================================================
RCS file: /cvs/cairo/cairo/test/pixman-rotate.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- pixman-rotate.c	29 Mar 2005 08:02:19 -0000	1.4
+++ pixman-rotate.c	14 Apr 2005 17:02:58 -0000	1.5
@@ -76,5 +76,7 @@
 int
 main (void)
 {
-    return cairo_test (&test, draw);
+    return cairo_test_expect_failure (&test, draw,
+				      "because of a known off-by-one bug "
+				      "when rotating a pixman image");
 }

Index: text-rotate.c
===================================================================
RCS file: /cvs/cairo/cairo/test/text-rotate.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- text-rotate.c	7 Apr 2005 20:29:32 -0000	1.6
+++ text-rotate.c	14 Apr 2005 17:02:58 -0000	1.7
@@ -115,5 +115,7 @@
 int
 main (void)
 {
-    return cairo_test (&test, draw);
+    return cairo_test_expect_failure (&test, draw,
+				      "because of known glyph positioning bugs "
+				      "with rotated text");
 }




More information about the cairo-commit mailing list