From 3f7593612f52f88eabb87de0c1efbf86bf31e8c2 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Thu, 13 Jul 2006 15:00:16 -0700 Subject: [PATCH 1/7] Make the various test and check targets depend on all as well. --- Makefile.am | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index 805253439..8ce2bc4c3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,11 +4,11 @@ SUBDIRS = pixman src doc .PHONY: doc test doc: -$(MAKE) -C doc doc -test: +test: all -$(MAKE) -C test test -retest: +retest: all -$(MAKE) -C test retest -recheck: +recheck: all -$(MAKE) -C test recheck # libpng is required for our test programs From ebc736730615021b07b851b41c6de79248ca00e4 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 13 Jul 2006 18:17:39 -0400 Subject: [PATCH 2/7] Fix test result formatting. --- test/cairo-test.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/cairo-test.c b/test/cairo-test.c index c33931155..96ffcba4c 100644 --- a/test/cairo-test.c +++ b/test/cairo-test.c @@ -1881,7 +1881,10 @@ cairo_test_expecting (cairo_test_t *test, cairo_test_log ("UNTESTED\n"); break; case CAIRO_TEST_CRASHED: - if (!no_fail_on_stdout) + if (no_fail_on_stdout) + /* eat the test name */ + printf ("\r"); + else printf ("CRASHED\n"); cairo_test_log ("CRASHED\n"); fprintf (stderr, "%s-%s-%s [%d]:\t%s!!!TEST-CASE CRASH!!!%s\n", @@ -1896,13 +1899,16 @@ cairo_test_expecting (cairo_test_t *test, printf ("XFAIL\n"); cairo_test_log ("XFAIL\n"); } else { - if (!no_fail_on_stdout) + if (no_fail_on_stdout) + /* eat the test name */ + printf ("\r"); + else printf ("FAIL\n"); - cairo_test_log ("FAIL\n"); fprintf (stderr, "%s-%s-%s [%d]:\t%sUNEXPECTED FAILURE%s\n", test->name, target->name, _cairo_test_content_name (target->content), dev_offset, fail_face, normal_face); + cairo_test_log ("FAIL\n"); } ret = status; break; From ff1280ce98ecc9ddee7b63e21eaec3d47ed3df8b Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Thu, 13 Jul 2006 15:08:19 -0700 Subject: [PATCH 3/7] cairo-test.c: Prefer FALSE and TRUE for cairo_bool_t values. --- 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 96ffcba4c..bcab6796d 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 cairo_bool_t limited_targets = 0, no_fail_on_stdout = 0; + volatile cairo_bool_t limited_targets = FALSE, no_fail_on_stdout = FALSE; const char *tname; void (*old_segfault_handler)(int); volatile cairo_test_status_t status, ret; @@ -1777,7 +1777,7 @@ cairo_test_expecting (cairo_test_t *test, fail_face = "\033[41m\033[37m\033[1m"; normal_face = "\033[m"; if (isatty (1)) - no_fail_on_stdout = 1; + no_fail_on_stdout = TRUE; } #endif @@ -1794,7 +1794,7 @@ cairo_test_expecting (cairo_test_t *test, if ((tname = getenv ("CAIRO_TEST_TARGET")) != NULL && *tname) { - limited_targets = 1; + limited_targets = TRUE; num_targets = 0; targets_to_test = NULL; From b2d04d7f1a14c961ea10b76581436ae07dfe6ef5 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Thu, 13 Jul 2006 15:21:02 -0700 Subject: [PATCH 4/7] Rename no_fail_on_stdout to eliminate confusing negative inside a Boolean variable name --- test/cairo-test.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/test/cairo-test.c b/test/cairo-test.c index bcab6796d..70ef85240 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 cairo_bool_t limited_targets = FALSE, no_fail_on_stdout = FALSE; + volatile cairo_bool_t limited_targets = FALSE, print_fail_on_stdout = TRUE; const char *tname; void (*old_segfault_handler)(int); volatile cairo_test_status_t status, ret; @@ -1777,7 +1777,7 @@ cairo_test_expecting (cairo_test_t *test, fail_face = "\033[41m\033[37m\033[1m"; normal_face = "\033[m"; if (isatty (1)) - no_fail_on_stdout = TRUE; + print_fail_on_stdout = FALSE; } #endif @@ -1881,11 +1881,12 @@ cairo_test_expecting (cairo_test_t *test, cairo_test_log ("UNTESTED\n"); break; case CAIRO_TEST_CRASHED: - if (no_fail_on_stdout) + if (print_fail_on_stdout) { + printf ("CRASHED\n"); + } else { /* eat the test name */ printf ("\r"); - else - 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, @@ -1899,11 +1900,12 @@ cairo_test_expecting (cairo_test_t *test, printf ("XFAIL\n"); cairo_test_log ("XFAIL\n"); } else { - if (no_fail_on_stdout) + if (print_fail_on_stdout) { + printf ("FAIL\n"); + } else { /* eat the test name */ printf ("\r"); - else - printf ("FAIL\n"); + } fprintf (stderr, "%s-%s-%s [%d]:\t%sUNEXPECTED FAILURE%s\n", test->name, target->name, _cairo_test_content_name (target->content), dev_offset, From 4b22cb41a9c1fbfc310ae7fd024ceffdb4bf3947 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Thu, 13 Jul 2006 15:23:06 -0700 Subject: [PATCH 5/7] Use 'FAIL' instead of 'UNEXPECTED FAILURE' in test output. There's no ambiguity anymore due to duplicated printing, so go back to the classic, and easier to read wording. --- 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 70ef85240..7fea53acf 100644 --- a/test/cairo-test.c +++ b/test/cairo-test.c @@ -1906,7 +1906,7 @@ cairo_test_expecting (cairo_test_t *test, /* eat the test name */ printf ("\r"); } - fprintf (stderr, "%s-%s-%s [%d]:\t%sUNEXPECTED FAILURE%s\n", + fprintf (stderr, "%s-%s-%s [%d]:\t%sFAIL%s\n", test->name, target->name, _cairo_test_content_name (target->content), dev_offset, fail_face, normal_face); From 6c7099b0ccc926b4f427c3cceb1fed5534c693ec Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 13 Jul 2006 18:49:52 -0400 Subject: [PATCH 6/7] Only generate HTML for log files passed on the command line. With the make bits already in place, this means that make retest creates HTML for only the retested tests. --- test/make-html.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/make-html.pl b/test/make-html.pl index 587ca627d..ce3db54d2 100755 --- a/test/make-html.pl +++ b/test/make-html.pl @@ -45,7 +45,9 @@ my $tests = {}; my $teststats = {}; -foreach (<*.log>) { +if ($#ARGV >= 0) { @files = @ARGV; } else { @files = <*.log>; } + +foreach (<@files>) { (open LOG, "$_") || next; while () { next unless /^TEST: (.*) TARGET: (.*) FORMAT: (.*) OFFSET: (.*) RESULT: (.*)$/; From 6a5d66f651b7fe94e74ee803a452bac5b54c95ca Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 13 Jul 2006 18:53:25 -0400 Subject: [PATCH 7/7] Go back to "!!!CRASHED!!!" message now that there's no confusion. --- test/cairo-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/cairo-test.c b/test/cairo-test.c index 7fea53acf..19adf3e63 100644 --- a/test/cairo-test.c +++ b/test/cairo-test.c @@ -1882,13 +1882,13 @@ cairo_test_expecting (cairo_test_t *test, break; case CAIRO_TEST_CRASHED: if (print_fail_on_stdout) { - printf ("CRASHED\n"); + printf ("!!!CRASHED!!!\n"); } else { /* eat the test name */ printf ("\r"); } cairo_test_log ("CRASHED\n"); - fprintf (stderr, "%s-%s-%s [%d]:\t%s!!!TEST-CASE CRASH!!!%s\n", + fprintf (stderr, "%s-%s-%s [%d]:\t%s!!!CRASHED!!!%s\n", test->name, target->name, _cairo_test_content_name (target->content), dev_offset, fail_face, normal_face);