1 ## Makefile for Bison testsuite.
3 ## Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free
4 ## Software Foundation, Inc.
6 ## This program is free software: you can redistribute it and/or modify
7 ## it under the terms of the GNU General Public License as published by
8 ## the Free Software Foundation, either version 3 of the License, or
9 ## (at your option) any later version.
11 ## This program is distributed in the hope that it will be useful,
12 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ## GNU General Public License for more details.
16 ## You should have received a copy of the GNU General Public License
17 ## along with this program. If not, see <http://www.gnu.org/licenses/>.
19 EXTRA_DIST += $(TESTSUITE_AT) tests/testsuite tests/package.m4
21 DISTCLEANFILES += tests/atconfig $(check_SCRIPTS)
22 MAINTAINERCLEANFILES += $(TESTSUITE)
28 $(top_srcdir)/tests/package.m4: $(top_srcdir)/configure
31 echo '# Signature of the current package.'; \
32 echo 'm4_define([AT_PACKAGE_NAME], [$(PACKAGE_NAME)])'; \
33 echo 'm4_define([AT_PACKAGE_TARNAME], [$(PACKAGE_TARNAME)])'; \
34 echo 'm4_define([AT_PACKAGE_VERSION], [$(PACKAGE_VERSION)])'; \
35 echo 'm4_define([AT_PACKAGE_STRING], [$(PACKAGE_STRING)])'; \
36 echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'; \
51 tests/glr-regression.at \
66 TESTSUITE = $(top_srcdir)/tests/testsuite
68 AUTOTEST = $(AUTOM4TE) --language=autotest
69 AUTOTEST_FLAGS = -I $(top_srcdir)/tests
70 $(TESTSUITE): tests/package.m4 $(TESTSUITE_AT)
71 $(AUTOTEST) $(AUTOTEST_FLAGS) $(top_srcdir)/tests/testsuite.at -o $@.tmp
74 tests/atconfig: $(top_builddir)/config.status
75 ./config.status tests/$@
77 clean-local: clean-local-tests
79 test ! -f $(TESTSUITE) || cd tests && ../$(TESTSUITE) --clean
81 check-local: tests/atconfig tests/atlocal $(TESTSUITE)
82 # Move into tests/ so that testsuite.dir etc. be created there.
83 cd tests && ../$(TESTSUITE) $(TESTSUITEFLAGS)
85 check_SCRIPTS = tests/bison
87 # Run the test suite on the *installed* tree.
89 cd tests && ../$(TESTSUITE) AUTOTEST_PATH="$(bindir)" $(TESTSUITEFLAGS)
91 # Be real mean with it.
92 .PHONY: maintainer-check-g++
93 maintainer-check-g++: $(TESTSUITE)
94 cd tests && ../$(TESTSUITE) CC='$(CXX)'
96 .PHONY: maintainer-check-posix
97 maintainer-check-posix: $(TESTSUITE)
98 cd tests && ../$(TESTSUITE) POSIXLY_CORRECT=1 _POSIX2_VERSION=200112
100 .PHONY: maintainer-check-valgrind
101 maintainer-check-valgrind: $(TESTSUITE)
102 test -z '$(VALGRIND)' || \
103 VALGRIND_OPTS='--leak-check=full --show-reachable=yes' \
105 ../$(TESTSUITE) PREBISON='$(VALGRIND) -q' PREPARSER='$(VALGRIND) -q'
107 .PHONY: maintainer-check
108 maintainer-check: maintainer-check-posix maintainer-check-valgrind maintainer-check-g++
110 .PHONY: maintainer-push-check
111 maintainer-push-check:
112 BISON_USE_PUSH_FOR_PULL=1 $(MAKE) $(AM_MAKEFLAGS) maintainer-check
114 .PHONY: maintainer-xml-check
115 maintainer-xml-check:
116 BISON_TEST_XML=1 $(MAKE) $(AM_MAKEFLAGS) maintainer-check