]> git.saurik.com Git - bison.git/blame_incremental - tests/local.mk
gnulib: update
[bison.git] / tests / local.mk
... / ...
CommitLineData
1## Makefile for Bison testsuite.
2
3# Copyright (C) 2000-2015 Free Software Foundation, Inc.
4#
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.
9#
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.
14#
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/>.
17
18EXTRA_DIST += $(TESTSUITE_AT) tests/testsuite
19
20DISTCLEANFILES += tests/atconfig $(check_SCRIPTS)
21MAINTAINERCLEANFILES += $(TESTSUITE)
22
23## ------------ ##
24## package.m4. ##
25## ------------ ##
26
27$(top_srcdir)/tests/package.m4: $(top_srcdir)/configure
28 $(AM_V_GEN)rm -f $@ $@.tmp
29 $(AM_V_at){ \
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)])'; \
36 } >$@.tmp
37 $(AM_V_at)mv $@.tmp $@
38
39## ------------------------- ##
40## Generate the test suite. ##
41## ------------------------- ##
42
43TESTSUITE_AT = \
44 tests/testsuite.at \
45 \
46 tests/actions.at \
47 tests/c++.at \
48 tests/calc.at \
49 tests/conflicts.at \
50 tests/cxx-type.at \
51 tests/existing.at \
52 tests/glr-regression.at \
53 tests/headers.at \
54 tests/input.at \
55 tests/java.at \
56 tests/javapush.at \
57 tests/local.at \
58 tests/named-refs.at \
59 tests/output.at \
60 tests/package.m4 \
61 tests/push.at \
62 tests/reduce.at \
63 tests/regression.at \
64 tests/sets.at \
65 tests/skeletons.at \
66 tests/synclines.at \
67 tests/torture.at \
68 tests/types.at
69
70TESTSUITE = $(top_srcdir)/tests/testsuite
71
72AUTOTEST = $(AUTOM4TE) --language=autotest
73AUTOTESTFLAGS = -I $(top_srcdir)/tests
74$(TESTSUITE): $(TESTSUITE_AT)
75 $(AM_V_GEN) \
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 $@
79
80
81## -------------------- ##
82## Run the test suite. ##
83## -------------------- ##
84
85# Move into tests/ so that testsuite.dir etc. be created there.
86RUN_TESTSUITE = $(TESTSUITE) -C tests $(TESTSUITEFLAGS)
87check_SCRIPTS = $(BISON) tests/atconfig tests/atlocal
88RUN_TESTSUITE_deps = all $(TESTSUITE) $(check_SCRIPTS)
89
90clean-local: clean-local-tests
91clean-local-tests:
92 test ! -f $(TESTSUITE) || $(TESTSUITE) -C tests --clean
93
94check-local: $(RUN_TESTSUITE_deps)
95 $(RUN_TESTSUITE)
96
97# Run the test suite on the *installed* tree.
98installcheck-local: $(RUN_TESTSUITE_deps)
99 $(RUN_TESTSUITE) AUTOTEST_PATH='$(bindir)'
100
101# Be real mean with it.
102.PHONY: maintainer-check-g++
103maintainer-check-g++: $(RUN_TESTSUITE_deps)
104 $(RUN_TESTSUITE) --compile-c-with-cxx
105
106.PHONY: maintainer-check-posix
107maintainer-check-posix: $(RUN_TESTSUITE_deps)
108 $(RUN_TESTSUITE) POSIXLY_CORRECT=1 _POSIX2_VERSION=200112
109
110.PHONY: maintainer-check-valgrind
111VALGRIND_OPTS = --leak-check=full --show-reachable=yes --gen-suppressions=all \
112 $(VALGRIND_OPTS_SUPPRESSION)
113maintainer-check-valgrind: $(RUN_TESTSUITE_deps)
114 test 'x$(VALGRIND)' != x || \
115 $(RUN_TESTSUITE) \
116 PREBISON='$(VALGRIND) -q' PREPARSER='$(VALGRIND) -q' \
117 VALGRIND_OPTS="$(VALGRIND_OPTS)"
118
119.PHONY: maintainer-check
120maintainer-check: maintainer-check-posix maintainer-check-valgrind maintainer-check-g++
121
122.PHONY: maintainer-push-check
123maintainer-push-check:
124 $(MAKE) $(AM_MAKEFLAGS) maintainer-check \
125 TESTSUITEFLAGS='BISON_USE_PUSH_FOR_PULL=1 $(TESTSUITEFLAGS)'
126
127.PHONY: maintainer-xml-check
128maintainer-xml-check:
129 $(MAKE) $(AM_MAKEFLAGS) maintainer-check \
130 TESTSUITEFLAGS='BISON_TEST_XML=1 $(TESTSUITEFLAGS)'
131
132.PHONY: maintainer-release-check
133maintainer-release-check: maintainer-check maintainer-push-check maintainer-xml-check