1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright (C) 2001, 2003, 2006, 2007, 2008 Free Software Foundation,
5 ## This program is free software; you can redistribute it and/or modify
6 ## it under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation; either version 3, or (at your option)
10 ## This program is distributed in the hope that it will be useful,
11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ## GNU General Public License for more details.
15 ## You should have received a copy of the GNU General Public License
16 ## along with this program. If not, see <http://www.gnu.org/licenses/>.
19 # If stdout is a non-dumb tty, use colors. If test -t is not supported,
20 # then this fails; a conservative approach. Of course do not redirect
21 # stdout here, just stderr.
23 red=; grn=; lgn=; blu=; std=; \
24 test "X$(AM_COLOR_TESTS)" != Xno \
25 && test "X$$TERM" != Xdumb \
26 && { test "X$(AM_COLOR_TESTS)" = Xalways || test -t 1 2>/dev/null; } \
36 red=; grn=; lgn=; blu=; std=
42 @failed=0; all=0; xfail=0; xpass=0; skip=0; \
43 srcdir=$(srcdir); export srcdir; \
44 ## Make sure Solaris VPATH-expands all members of this list, even
45 ## the first and the last one; thus the spaces around $(TESTS)
48 if test -n "$$list"; then \
49 for tst in $$list; do \
50 if test -f ./$$tst; then dir=./; \
51 ## Note: Solaris 2.7 seems to expand TESTS using VPATH. That's
52 ## why we also try `dir='
53 elif test -f $$tst; then dir=; \
54 else dir="$(srcdir)/"; fi; \
55 if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
57 all=`expr $$all + 1`; \
58 case " $(XFAIL_TESTS) " in \
59 *[\ \ ]$$tst[\ \ ]*) \
60 xpass=`expr $$xpass + 1`; \
61 failed=`expr $$failed + 1`; \
62 col=$$red; res=XPASS; \
65 col=$$grn; res=PASS; \
68 elif test $$? -ne 77; then \
70 all=`expr $$all + 1`; \
71 case " $(XFAIL_TESTS) " in \
72 *[\ \ ]$$tst[\ \ ]*) \
73 xfail=`expr $$xfail + 1`; \
74 col=$$lgn; res=XFAIL; \
77 failed=`expr $$failed + 1`; \
78 col=$$red; res=FAIL; \
83 skip=`expr $$skip + 1`; \
84 col=$$blu; res=SKIP; \
86 echo "$${col}$$res$${std}: $$tst"; \
89 if test "$$failed" -eq 0; then \
90 if test "$$xfail" -eq 0; then \
91 banner="All $$all tests passed"; \
93 banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
96 if test "$$xpass" -eq 0; then \
97 banner="$$failed of $$all tests failed"; \
99 banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
102 ## DASHES should contain the largest line of the banner.
105 if test "$$skip" -ne 0; then \
106 skipped="($$skip tests were not run)"; \
107 test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
108 dashes="$$skipped"; \
111 if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
112 report="Please report to $(PACKAGE_BUGREPORT)"; \
113 test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
116 dashes=`echo "$$dashes" | sed s/./=/g`; \
117 if test "$$failed" -eq 0; then \
118 echo "$$grn$$dashes"; \
120 echo "$$red$$dashes"; \
123 test -z "$$skipped" || echo "$$skipped"; \
124 test -z "$$report" || echo "$$report"; \
125 echo "$$dashes$$std"; \
126 test "$$failed" -eq 0; \