* lib/am/check.am: Show skipped tests. Display the
authorAlexandre Duret-Lutz <adl@gnu.org>
Thu, 25 Apr 2002 07:48:34 +0000 (07:48 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Thu, 25 Apr 2002 07:48:34 +0000 (07:48 +0000)
$(PACKAGE_BUGREPORT) address on failure.

ChangeLog
TODO
lib/am/check.am
tests/Makefile.in

index a82fe45..13fe959 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-04-25  Alexandre Duret-Lutz  <duret_g@epita.fr>
+
+       * lib/am/check.am: Show skipped tests.  Display the
+       $(PACKAGE_BUGREPORT) address on failure.
+
 2002-04-24  Alexandre Duret-Lutz  <duret_g@epita.fr>
 
        Fix PR automake/315:
diff --git a/TODO b/TODO
index d974073..fc96666 100644 (file)
--- 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
 
index ea308e0..bdeaded 100644 (file)
@@ -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
index 51062fd..e6b58bb 100644 (file)
@@ -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