From aed7c58fca872426d39a0cb2239548043b681d0f Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Thu, 25 Apr 2002 07:48:34 +0000 Subject: [PATCH] * lib/am/check.am: Show skipped tests. Display the $(PACKAGE_BUGREPORT) address on failure. --- ChangeLog | 5 +++++ TODO | 2 -- lib/am/check.am | 27 +++++++++++++++++++++++++-- tests/Makefile.in | 22 ++++++++++++++++++++-- 4 files changed, 50 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index a82fe45..13fe959 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-04-25 Alexandre Duret-Lutz + + * lib/am/check.am: Show skipped tests. Display the + $(PACKAGE_BUGREPORT) address on failure. + 2002-04-24 Alexandre Duret-Lutz Fix PR automake/315: diff --git a/TODO b/TODO index d974073..fc96666 100644 --- a/TODO +++ b/TODO @@ -26,8 +26,6 @@ investigate problems with conditionally defined libraries add an error if the user makefile.am violates our namespace rules -have 'make check' print tests which are skipped - we need a document describing automake from the end user's point of view eg describe INSTALL_HEADER there, among other things diff --git a/lib/am/check.am b/lib/am/check.am index ea308e0..bdeaded 100644 --- a/lib/am/check.am +++ b/lib/am/check.am @@ -19,7 +19,7 @@ .PHONY: check-TESTS check-TESTS: $(TESTS) - @failed=0; all=0; xfail=0; xpass=0; \ + @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list='$(TESTS)'; \ if test -n "$$list"; then \ @@ -30,6 +30,7 @@ check-TESTS: $(TESTS) elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ +## Success all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *" $$tst "*) \ @@ -42,6 +43,7 @@ check-TESTS: $(TESTS) ;; \ esac; \ elif test $$? -ne 77; then \ +## Failure all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *" $$tst "*) \ @@ -53,8 +55,13 @@ check-TESTS: $(TESTS) echo "FAIL: $$tst"; \ ;; \ esac; \ + else \ +## Skipped + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ fi; \ done; \ +## Prepare the banner if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="All $$all tests passed"; \ @@ -68,9 +75,25 @@ check-TESTS: $(TESTS) banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ fi; \ fi; \ - dashes=`echo "$$banner" | sed s/./=/g`; \ +## DASHES should contain the largest line of the banner. + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + skipped="($$skip tests were not run)"; \ + test `echo "$$skipped" | wc -c` -gt `echo "$$banner" | wc -c` && \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -gt `echo "$$banner" | wc -c` && \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ + test -n "$$skipped" && echo "$$skipped"; \ + test -n "$$report" && echo "$$report"; \ echo "$$dashes"; \ test "$$failed" -eq 0; \ else :; fi diff --git a/tests/Makefile.in b/tests/Makefile.in index 51062fd..e6b58bb 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -480,7 +480,7 @@ TAGS: check-TESTS: $(TESTS) - @failed=0; all=0; xfail=0; xpass=0; \ + @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list='$(TESTS)'; \ if test -n "$$list"; then \ @@ -512,6 +512,9 @@ check-TESTS: $(TESTS) echo "FAIL: $$tst"; \ ;; \ esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ fi; \ done; \ if test "$$failed" -eq 0; then \ @@ -527,9 +530,24 @@ check-TESTS: $(TESTS) banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ fi; \ fi; \ - dashes=`echo "$$banner" | sed s/./=/g`; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + skipped="($$skip tests were not run)"; \ + test `echo "$$skipped" | wc -c` -gt `echo "$$banner" | wc -c` && \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -gt `echo "$$banner" | wc -c` && \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ + test -n "$$skipped" && echo "$$skipped"; \ + test -n "$$report" && echo "$$report"; \ echo "$$dashes"; \ test "$$failed" -eq 0; \ else :; fi -- 2.7.4