1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright (C) 2001, 2003, 2006 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 2, 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
22 @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \
23 srcdir=$(srcdir); export srcdir; \
24 ## Make sure Solaris VPATH-expands all members of this list, even
25 ## the first and the last one; thus the spaces around $(TESTS)
27 if test -n "$$list"; then \
28 for tst in $$list; do \
29 if test -f ./$$tst; then dir=./; \
30 ## Note: Solaris 2.7 seems to expand TESTS using VPATH. That's
31 ## why we also try `dir='
32 elif test -f $$tst; then dir=; \
33 else dir="$(srcdir)/"; fi; \
34 if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
36 all=`expr $$all + 1`; \
37 case " $(XFAIL_TESTS) " in \
39 xpass=`expr $$xpass + 1`; \
40 failed=`expr $$failed + 1`; \
41 echo "XPASS: $$tst"; \
47 elif test $$? -ne 77; then \
49 all=`expr $$all + 1`; \
50 case " $(XFAIL_TESTS) " in \
52 xfail=`expr $$xfail + 1`; \
53 echo "XFAIL: $$tst"; \
56 failed=`expr $$failed + 1`; \
62 skip=`expr $$skip + 1`; \
67 if test "$$failed" -eq 0; then \
68 if test "$$xfail" -eq 0; then \
69 banner="All $$all tests passed"; \
71 banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
74 if test "$$xpass" -eq 0; then \
75 banner="$$failed of $$all tests failed"; \
77 banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
80 ## DASHES should contain the largest line of the banner.
83 if test "$$skip" -ne 0; then \
84 skipped="($$skip tests were not run)"; \
85 test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
89 if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
90 report="Please report to $(PACKAGE_BUGREPORT)"; \
91 test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
94 dashes=`echo "$$dashes" | sed s/./=/g`; \
97 test -z "$$skipped" || echo "$$skipped"; \
98 test -z "$$report" || echo "$$report"; \
100 test "$$failed" -eq 0; \