automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

print skipped tests and bug report address


From: Alexandre Duret-Lutz
Subject: print skipped tests and bug report address
Date: 17 Apr 2002 21:23:23 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

This conditionally adds two lines to the summary banner
displayed at the end of `make check'; one is for the count of
skipped tests, and the other is for the bug-report address
(printed on failure).  That's a simple feature I have been
longing for.

Here is a sample output, on three tests (faked to FAIL or SKIP):

PASS: aclocal.test
SKIP: req.test
FAIL: suffix.test
=====================================
1 of 2 tests failed
(1 tests were not run)
Please report to address@hidden
=====================================

There is probably room for improvement in both the wording and
the layout; please comment.

Index: ChangeLog
--- ChangeLog
+++ ChangeLog
@@ -1,1 +1,6 @@
+2002-04-17  Alexandre Duret-Lutz  <address@hidden>
+
+       * lib/am/check.am: Show skipped tests.  Display the
+       $(PACKAGE_BUGREPORT) address on failure.
+

Index: TODO
===================================================================
RCS file: /home/adl/CVSROOT/HEAD-20020417-2028/TODO,v
retrieving revision 1.1
diff -u -r1.1 TODO
--- TODO 17 Apr 2002 18:28:47 -0000 1.1
+++ TODO 17 Apr 2002 19:11:31 -0000
@@ -26,8 +26,6 @@
 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: lib/am/check.am
===================================================================
RCS file: /home/adl/CVSROOT/HEAD-20020417-2028/lib/am/check.am,v
retrieving revision 1.1
diff -u -r1.1 check.am
--- lib/am/check.am 17 Apr 2002 18:28:48 -0000 1.1
+++ lib/am/check.am 17 Apr 2002 19:08:19 -0000
@@ -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 @@
            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 @@
              ;; \
              esac; \
            elif test $$? -ne 77; then \
+## Failure
              all=`expr $$all + 1`; \
              case " $(XFAIL_TESTS) " in \
              *" $$tst "*) \
@@ -53,8 +55,13 @@
                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 @@
              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: tests/Makefile.in
===================================================================
RCS file: /home/adl/CVSROOT/HEAD-20020417-2028/tests/Makefile.in,v
retrieving revision 1.1
diff -u -r1.1 Makefile.in
--- tests/Makefile.in 17 Apr 2002 18:28:48 -0000 1.1
+++ tests/Makefile.in 17 Apr 2002 19:12:15 -0000
@@ -477,7 +477,7 @@
 
 
 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 \
@@ -509,6 +509,9 @@
                echo "FAIL: $$tst"; \
              ;; \
              esac; \
+           else \
+             skip=`expr $$skip + 1`; \
+             echo "SKIP: $$tst"; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
@@ -524,9 +527,24 @@
              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

-- 
Alexandre Duret-Lutz




reply via email to

[Prev in Thread] Current Thread [Next in Thread]