test summaries for automake 1.12 test harness
authorMorgan Deters <mdeters@gmail.com>
Tue, 28 Aug 2012 18:38:19 +0000 (18:38 +0000)
committerMorgan Deters <mdeters@gmail.com>
Tue, 28 Aug 2012 18:38:19 +0000 (18:38 +0000)
test/Makefile.am

index 932c79c02a93fdaaef53e93d5196e20a83c7ccba..de8220064bacdf22a6a0767a9c07449a3d8b0415 100644 (file)
@@ -57,15 +57,18 @@ check-recursive: check-pre
 .PHONY: check-pre
 check-pre:
        @rm -f $(subdirs_to_check:=/test-suite.log)
+
+if AUTOMAKE_1_11
+# automake 1.11 version
 check-local:
        @$(am__tty_colors); \
        echo $${blu}===============================  TESTING SUMMARY  =============================$$std; \
        if test -s "unit/test-suite.log"; then :; else \
                echo "$${red}Unit tests did not run; maybe there were compilation problems ?$$std"; \
-        fi; \
+       fi; \
        if test -s "system/test-suite.log"; then :; else \
                echo "$${red}System tests did not run; maybe there were compilation problems ?$$std"; \
-        fi; \
+       fi; \
        for dir in $(subdirs_to_check); do \
                log=$$dir/test-suite.log; \
                if test -s "$$log"; then \
@@ -79,3 +82,32 @@ check-local:
                fi; \
        done; \
        echo $${blu}===============================  TESTING SUMMARY  =============================$$std
+else
+# automake 1.12 version
+check-local:
+       @$(am__tty_colors); \
+       echo $${blu}===============================  TESTING SUMMARY  =============================$$std; \
+       if test -s "unit/test-suite.log"; then :; else \
+               echo "$${red}Unit tests did not run; maybe there were compilation problems ?$$std"; \
+       fi; \
+       if test -s "system/test-suite.log"; then :; else \
+               echo "$${red}System tests did not run; maybe there were compilation problems ?$$std"; \
+       fi; \
+       for dir in $(subdirs_to_check); do \
+               log=$$dir/test-suite.log; \
+               if test -s "$$log"; then \
+                       status="`head -n 11 $$log | tail -7`"; \
+                       nicestatus="`echo $$status | sed 's/# [A-Z]*: 0 *//g;s/# \([A-Z]*\): \([0-9]*\)/\2 \1,/g;s/, *$$//;'`"; \
+                       if      echo "$$status" | grep -q '# FAIL:  0' && \
+                               echo "$$status" | grep -q '# XPASS: 0' && \
+                               echo "$$status" | grep -q '# ERROR: 0' && \
+                               echo "$$status" | grep -q '# SKIP:  0'; then \
+                               printf "$$grn%-30s in $$dir$$std\\n" "$$nicestatus"; \
+                       else \
+                               echo "$$red$$nicestatus"; \
+                               echo "    @abs_builddir@/$$log$$std"; \
+                       fi; \
+               fi; \
+       done; \
+       echo $${blu}===============================  TESTING SUMMARY  =============================$$std
+endif