1 ## Makefile for Bison testsuite.
3 # Copyright (C) 2000-2015 Free Software Foundation, Inc.
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 of the License, or
8 # (at your option) any later version.
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/>.
18 EXTRA_DIST += $(TESTSUITE_AT) tests/testsuite
20 DISTCLEANFILES += tests/atconfig $(check_SCRIPTS)
21 MAINTAINERCLEANFILES += $(TESTSUITE)
27 $(top_srcdir)/tests/package.m4: $(top_srcdir)/configure
28 $(AM_V_GEN)rm -f $@ $@.tmp
30 echo '# Signature of the current package.'; \
31 echo 'm4_define([AT_PACKAGE_NAME], [$(PACKAGE_NAME)])'; \
32 echo 'm4_define([AT_PACKAGE_TARNAME], [$(PACKAGE_TARNAME)])'; \
33 echo 'm4_define([AT_PACKAGE_VERSION], [$(PACKAGE_VERSION)])'; \
34 echo 'm4_define([AT_PACKAGE_STRING], [$(PACKAGE_STRING)])'; \
35 echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'; \
37 $(AM_V_at)mv $@.tmp $@
39 ## ------------------------- ##
40 ## Generate the test suite. ##
41 ## ------------------------- ##
52 tests/glr-regression.at \
70 TESTSUITE = $(top_srcdir)/tests/testsuite
72 AUTOTEST = $(AUTOM4TE) --language=autotest
73 AUTOTESTFLAGS = -I $(top_srcdir)/tests
74 $(TESTSUITE): $(TESTSUITE_AT)
76 $(AUTOTEST) $(AUTOTESTFLAGS) $(srcdir)/tests/testsuite.at -o $@.tmp
77 $(AM_V_at)$(PERL) -pi -e 's/\@tb\@/\t/g' $@.tmp
78 $(AM_V_at)mv $@.tmp $@
81 ## -------------------- ##
82 ## Run the test suite. ##
83 ## -------------------- ##
85 # Move into tests/ so that testsuite.dir etc. be created there.
86 RUN_TESTSUITE = $(TESTSUITE) -C tests $(TESTSUITEFLAGS)
87 check_SCRIPTS = $(BISON) tests/atconfig tests/atlocal
88 RUN_TESTSUITE_deps = all $(TESTSUITE) $(check_SCRIPTS)
90 clean-local: clean-local-tests
92 test ! -f $(TESTSUITE) || $(TESTSUITE) -C tests --clean
94 check-local: $(RUN_TESTSUITE_deps)
97 # Run the test suite on the *installed* tree.
98 installcheck-local: $(RUN_TESTSUITE_deps)
99 $(RUN_TESTSUITE) AUTOTEST_PATH='$(bindir)'
101 # Be real mean with it.
102 .PHONY: maintainer-check-g++
103 maintainer-check-g++: $(RUN_TESTSUITE_deps)
104 $(RUN_TESTSUITE) --compile-c-with-cxx
106 .PHONY: maintainer-check-posix
107 maintainer-check-posix: $(RUN_TESTSUITE_deps)
108 $(RUN_TESTSUITE) POSIXLY_CORRECT=1 _POSIX2_VERSION=200112
110 .PHONY: maintainer-check-valgrind
111 maintainer-check-valgrind: $(RUN_TESTSUITE_deps)
112 test -z '$(VALGRIND)' || \
114 PREBISON='$(VALGRIND_PREBISON)' PREPARSER='$(VALGRIND) -q' \
115 VALGRIND_OPTS='--leak-check=full --show-reachable=yes'
117 .PHONY: maintainer-check
118 maintainer-check: maintainer-check-posix maintainer-check-valgrind maintainer-check-g++
120 .PHONY: maintainer-push-check
121 maintainer-push-check:
122 $(MAKE) $(AM_MAKEFLAGS) maintainer-check \
123 TESTSUITEFLAGS='BISON_USE_PUSH_FOR_PULL=1 $(TESTSUITEFLAGS)'
125 .PHONY: maintainer-xml-check
126 maintainer-xml-check:
127 $(MAKE) $(AM_MAKEFLAGS) maintainer-check \
128 TESTSUITEFLAGS='BISON_TEST_XML=1 $(TESTSUITEFLAGS)'
130 .PHONY: maintainer-release-check
131 maintainer-release-check: maintainer-check maintainer-push-check maintainer-xml-check