1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright (C) 2001, 2003, 2006, 2007 Free Software Foundation, Inc.
4 ## This program is free software; you can redistribute it and/or modify
5 ## it under the terms of the GNU General Public License as published by
6 ## the Free Software Foundation; either version 3, or (at your option)
9 ## This program is distributed in the hope that it will be useful,
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ## GNU General Public License for more details.
14 ## You should have received a copy of the GNU General Public License
15 ## along with this program; if not, write to the Free Software
16 ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 # If stdout is a non-dumb tty, use colors. If test -t is not supported,
21 # then this fails; a conservative approach. Of course do not redirect
22 # stdout here, just stderr.
24 red=; grn=; lgn=; blu=; std=; \
25 test "X$(AM_COLOR_TESTS)" != Xno \
26 && test "X$$TERM" != Xdumb \
27 && { test "X$(AM_COLOR_TESTS)" = Xalways || test -t 1 2>/dev/null; } \
37 red=; grn=; lgn=; blu=; std=
43 @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \
44 srcdir=$(srcdir); export srcdir; \
45 ## Make sure Solaris VPATH-expands all members of this list, even
46 ## the first and the last one; thus the spaces around $(TESTS)
49 if test -n "$$list"; then \
50 for tst in $$list; do \
51 if test -f ./$$tst; then dir=./; \
52 ## Note: Solaris 2.7 seems to expand TESTS using VPATH. That's
53 ## why we also try `dir='
54 elif test -f $$tst; then dir=; \
55 else dir="$(srcdir)/"; fi; \
56 if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
58 all=`expr $$all + 1`; \
59 case " $(XFAIL_TESTS) " in \
61 xpass=`expr $$xpass + 1`; \
62 failed=`expr $$failed + 1`; \
63 col=$$red; res=XPASS; \
66 col=$$grn; res=PASS; \
69 elif test $$? -ne 77; then \
71 all=`expr $$all + 1`; \
72 case " $(XFAIL_TESTS) " in \
74 xfail=`expr $$xfail + 1`; \
75 col=$$lgn; res=XFAIL; \
78 failed=`expr $$failed + 1`; \
79 col=$$red; res=FAIL; \
84 skip=`expr $$skip + 1`; \
85 col=$$blu; res=SKIP; \
87 echo "$${col}$$res$${std}: $$tst"; \
90 if test "$$failed" -eq 0; then \
91 if test "$$xfail" -eq 0; then \
92 banner="All $$all tests passed"; \
94 banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
97 if test "$$xpass" -eq 0; then \
98 banner="$$failed of $$all tests failed"; \
100 banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
103 ## DASHES should contain the largest line of the banner.
106 if test "$$skip" -ne 0; then \
107 skipped="($$skip tests were not run)"; \
108 test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
109 dashes="$$skipped"; \
112 if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
113 report="Please report to $(PACKAGE_BUGREPORT)"; \
114 test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
117 dashes=`echo "$$dashes" | sed s/./=/g`; \
118 if test "$$failed" -eq 0; then \
119 echo "$$grn$$dashes"; \
121 echo "$$red$$dashes"; \
124 test -z "$$skipped" || echo "$$skipped"; \
125 test -z "$$report" || echo "$$report"; \
126 echo "$$dashes$$std"; \
127 test "$$failed" -eq 0; \