[cairo-commit] 4 commits - src/cairo.h test/cairo-test.c test/Makefile.am

Behdad Esfahbod behdad at kemper.freedesktop.org
Thu Jul 13 11:25:21 PDT 2006


 src/cairo.h       |    4 ++--
 test/Makefile.am  |    4 ++--
 test/cairo-test.c |   16 ++++++++++------
 3 files changed, 14 insertions(+), 10 deletions(-)

New commits:
diff-tree b2668e944d1819f2b8f9973f1f42b1ca36bb193d (from 510d23acef9fc75eb968795191091cbc1d33bc09)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Thu Jul 13 14:02:58 2006 -0400

    Use cairo_bool_t.

diff --git a/test/cairo-test.c b/test/cairo-test.c
index c6bf79b..c339311 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;
diff-tree 510d23acef9fc75eb968795191091cbc1d33bc09 (from 601c0503f7906151698929051852d13c377cfef1)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Thu Jul 13 13:39:04 2006 -0400

    Fix doc typo.

diff --git a/src/cairo.h b/src/cairo.h
index 2003093..e5349c9 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
diff-tree 601c0503f7906151698929051852d13c377cfef1 (from 09dfae5fbf34fb19b283973df7112b14638d6466)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Thu Jul 13 13:30:52 2006 -0400

    Send grep errors to hell^Wnull.

diff --git a/test/Makefile.am b/test/Makefile.am
index d4a76fa..97ac10d 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 '\<FAIL\>' $(TESTS:=.log) | sed -e 's/[.]log$$//' | xargs echo`
-FAILED_TESTS = `grep -l '\<FAIL\>' $(TESTS:=.log) | tr '\n' ' ' | sed -e 's/[.]log  */ /g; s/^ //; s/ $$//'`
+#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)"
 
diff-tree 09dfae5fbf34fb19b283973df7112b14638d6466 (from 778c4730a86296bf0a71080cf7008d7291792256)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Thu Jul 13 13:22:49 2006 -0400

    Don't write FAIL messages on stdout if both stdout/err are going to screen.

diff --git a/test/cairo-test.c b/test/cairo-test.c
index 3945182..c6bf79b 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,


More information about the cairo-commit mailing list