[cairo-commit] 3 commits - src/cairo-glitz-surface.c test/cairo-test.c test/README

Behdad Esfahbod behdad at kemper.freedesktop.org
Thu Jul 6 10:51:38 PDT 2006


 src/cairo-glitz-surface.c |   17 ++++++++++-----
 test/README               |   50 ++++++++++++++++++++++++++++++++++------------
 test/cairo-test.c         |    9 +++++---
 3 files changed, 54 insertions(+), 22 deletions(-)

New commits:
diff-tree 807cb2fd8e4867d5aab7bd2c887e17160cf9a22f (from 95016b3274f4eedf6bd917a5b8bf8f6745c54581)
Author: David Reveman <davidr at novell.com>
Date:   Thu Jul 6 13:50:41 2006 -0400

    Ignore color for CAIRO_OPERATOR_CLEAR in glitz backend.

diff --git a/src/cairo-glitz-surface.c b/src/cairo-glitz-surface.c
index f25a220..c7d6aa3 100644
--- a/src/cairo-glitz-surface.c
+++ b/src/cairo-glitz-surface.c
@@ -924,9 +924,10 @@ _cairo_glitz_surface_fill_rectangles (vo
 				      int		       n_rects)
 {
     cairo_glitz_surface_t *dst = abstract_dst;
+    cairo_glitz_surface_t *src;
 
-    if (op == CAIRO_OPERATOR_SOURCE)
-    {
+    switch (op) {
+    case CAIRO_OPERATOR_SOURCE: {
 	glitz_color_t glitz_color;
 
 	glitz_color.red = color->red_short;
@@ -936,11 +937,14 @@ _cairo_glitz_surface_fill_rectangles (vo
 
 	glitz_set_rectangles (dst->surface, &glitz_color,
 			      (glitz_rectangle_t *) rects, n_rects);
-    }
-    else
-    {
-	cairo_glitz_surface_t *src;
+    } break;
+    case CAIRO_OPERATOR_CLEAR: {
+	static glitz_color_t glitz_color = { 0, 0, 0, 0 };
 
+	glitz_set_rectangles (dst->surface, &glitz_color,
+			      (glitz_rectangle_t *) rects, n_rects);
+    } break;
+    default:
 	if (op == CAIRO_OPERATOR_SATURATE)
 	    return CAIRO_INT_STATUS_UNSUPPORTED;
 
@@ -971,6 +975,7 @@ _cairo_glitz_surface_fill_rectangles (vo
 	}
 
 	cairo_surface_destroy (&src->base);
+	break;
     }
 
     if (glitz_surface_get_status (dst->surface) == GLITZ_STATUS_NOT_SUPPORTED)
diff-tree 95016b3274f4eedf6bd917a5b8bf8f6745c54581 (from f90182fe2ad383bf240e2b02003fd7cd0a7e90ff)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Thu Jul 6 13:48:18 2006 -0400

    Make CAIRO_TEST_TARGET="" make check pass tests.

diff --git a/test/cairo-test.c b/test/cairo-test.c
index 158c14e..d750e95 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -1820,9 +1820,12 @@ cairo_test_expecting (cairo_test_t *test
 
     /* The intended logic here is that we return overall SUCCESS
      * iff. there is at least one tested backend and that all tested
-     * backends return SUCCESS. In other words:
+     * backends return SUCCESS, OR, there's no backend to test at all.
+     * In other words:
      *
-     *	if      any backend not SUCCESS
+     *  if      no backend to test
+     *          -> SUCCESS
+     *	else if any backend not SUCCESS
      *		-> FAILURE
      *	else if all backends UNTESTED
      *		-> FAILURE
@@ -1884,7 +1887,7 @@ cairo_test_expecting (cairo_test_t *test
 	}
     }
     if (ret == CAIRO_TEST_UNTESTED)
-	ret = CAIRO_TEST_FAILURE;
+	ret = num_targets ? CAIRO_TEST_FAILURE : CAIRO_TEST_SUCCESS;
 
     fclose (cairo_test_log_file);
 
diff-tree f90182fe2ad383bf240e2b02003fd7cd0a7e90ff (from 83dcbe05b5bce6619e650d63be58a35fcb1609c1)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Thu Jul 6 13:42:25 2006 -0400

    Update test/README

diff --git a/test/README b/test/README
index edff360..0fb7f72 100644
--- a/test/README
+++ b/test/README
@@ -7,11 +7,29 @@ Using this test should be as simple as r
 assuming that the cairo distribution in the directory above has been
 configured and built. The test suite here goes through some effort to
 run against the locally compiled library rather than any installed
-version.
+version, but those efforts may fall short depending the level of your
+libtool madness.
 
 The test suite needs to be run before any code is committed and before
 any release. Here are the rules governing the use of the suite:
 
+
+Tailoring tests running
+-----------------------
+
+There are some mechanisms to limit the tests run during "make check".
+These come very handy when doing development, but should not be used
+to circumvent the "pass" requirements listed below.
+
+To limit the backends that the tests are run against, use the
+CAIRO_TEST_TARGET environment variable, that can also be passed to make.
+It should contain a (space-, comma-, etc-separate) list of backends to test.
+To limit the tests run, use the make TESTS variable, which should be a
+space-separated list of tests to run.  For example:
+
+  make check CAIRO_TEST_TARGET=image,ps TESTS="zero-alpha"
+
+
 Before committing
 -----------------
 
@@ -24,27 +42,31 @@ indicate known bugs. The final message s
 If any tests have a status of FAIL, then the new code has caused a
 regression error which should be fixed before the code is committed.
 
+
 When a new bug is found
 -----------------------
 A new test case should be added by imitating the style of an existing
 test. This means adding the following files:
 
-	new_bug.c
-	new_bug-ref.png
+	new-bug.c
+	new-bug-ref.png
 
-Where new_bug.c is a minimal program to demonstrate the bug, following
-the style of existing tests. The new_bug-ref.png image should contain
-the desired result of new_bug.c if the bug were fixed.
+Where new-bug.c is a minimal program to demonstrate the bug, following
+the style of existing tests. The new-bug-ref.png image should contain
+the desired result of new-bug.c if the bug were fixed.
+
+Makefile.am should be edited, adding new-bug.c to both the TESTS and
+XFAIL_TESTS lists and new-bug-ref.png to EXTRA_DIST, add new-bug to
+.gitignore, and last but not least, don't forget to "git add" the new
+files.
 
-Makefile.am should be edited, adding new_bug.c to both the TESTS and
-XFAIL_TESTS lists.
 
 When a new feature is added
 ---------------------------
 It's important for the regression suite to keep pace with development
-of the library. So a new test should be added for each new
-feature. The work involved is similar the work described above for new
-bugs. The only distinction is that the test is expected to pass so it
+of the library. So a new test should be added for each new feature.
+The work involved is similar the work described above for new bugs.
+The only distinction is that the test is expected to pass so it
 should not be added to the XFAIL_TESTS list.
 
 
@@ -55,10 +77,12 @@ result in an "unexpected pass" for the t
 appropriate, then remove the relevant file name from the XFAIL_TESTS
 variable in Makefile.am.
 
+
 Before releasing
 ----------------
-All tests should return a result of PASS meaning all known bugs are
-fixed, resulting in the happy message:
+All tests should return a result of PASS for all supported (those enabled by
+default) backends,  meaning all known bugs are fixed, resulting in the happy
+message:
 
 	All XX tests passed
 


More information about the cairo-commit mailing list