1 ## Makefile for Bison testsuite.
3 ## Copyright (C) 2000-2015, 2018-2021 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 <https://www.gnu.org/licenses/>.
19 %D
%/README.md
%D
%/linear \
20 $(TESTSUITE_AT
) %D
%/testsuite
%D
%/testsuite.h
22 DISTCLEANFILES
+= %D
%/atconfig
$(check_SCRIPTS
)
23 MAINTAINERCLEANFILES
+= $(TESTSUITE
)
29 $(top_srcdir
)/%D
%/package.m4
: $(top_srcdir
)/configure
30 $(AM_V_GEN
)rm -f
$@
$@.tmp
32 echo
'# Signature of the current package.'; \
33 echo
'm4_define([AT_PACKAGE_NAME], [$(PACKAGE_NAME)])'; \
34 echo
'm4_define([AT_PACKAGE_TARNAME], [$(PACKAGE_TARNAME)])'; \
35 echo
'm4_define([AT_PACKAGE_VERSION], [$(PACKAGE_VERSION)])'; \
36 echo
'm4_define([AT_PACKAGE_STRING], [$(PACKAGE_STRING)])'; \
37 echo
'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'; \
39 $(AM_V_at
)mv
$@.tmp
$@
42 # Update the test cases. Consider the latest test results to be the
43 # correct expectations, and change the test cases to match them.
46 $(AM_V_GEN
)cd
$(top_srcdir
) \
47 && build-aux
/update-test
$(abs_builddir
)/%D
%/testsuite.
dir/*/testsuite.log
49 ## ------------------------- ##
50 ## Generate the test suite. ##
51 ## ------------------------- ##
60 %D
%/counterexample.at \
65 %D
%/glr-regression.at \
86 TESTSUITE
= $(top_srcdir
)/%D
%/testsuite
88 AUTOTEST
= $(AUTOM4TE
) --language
=autotest
89 AUTOTESTFLAGS
= -I
$(top_srcdir
)/%D
%
90 $(TESTSUITE
): $(TESTSUITE_AT
)
92 $(AUTOTEST
) $(AUTOTESTFLAGS
) $(srcdir)/%D
%/testsuite.at
-o
$@.tmp
93 $(AM_V_at
)"$(PERL)" -pi
-e
's/\@tb\@/\t/g' $@.tmp
94 $(AM_V_at
)mv
$@.tmp
$@
97 ## -------------------- ##
98 ## Run the test suite. ##
99 ## -------------------- ##
101 # Move into %D%/ so that testsuite.dir etc. be created there.
102 RUN_TESTSUITE
= $(SHELL
) $(TESTSUITE
) -C
%D
% $(TESTSUITEFLAGS
)
103 check_SCRIPTS
+= $(BISON
) %D
%/atconfig
%D
%/atlocal
104 RUN_TESTSUITE_deps
= all $(TESTSUITE
) $(check_SCRIPTS
)
106 clean-local
: clean-local-tests
108 test ! -f
$(TESTSUITE
) ||
$(TESTSUITE
) -C
%D
% --clean
111 recheck
: $(RUN_TESTSUITE_deps
)
114 -e
'eof && /^(\d+).*: FAILED/ && print "$$1 "' \
115 %D
%/testsuite.
dir/*/testsuite.log
)
117 check-local
: check-tests
120 check-tests
: $(RUN_TESTSUITE_deps
)
123 # Run the test suite on the *installed* tree.
124 installcheck-local
: $(RUN_TESTSUITE_deps
)
125 $(RUN_TESTSUITE
) AUTOTEST_PATH
='$(bindir)'
127 # Be real mean with it.
128 .PHONY
: maintainer-check-g
++
129 maintainer-check-g
++: $(RUN_TESTSUITE_deps
)
130 $(RUN_TESTSUITE
) --compile-c-with-cxx
132 .PHONY
: maintainer-check-posix
133 maintainer-check-posix
: $(RUN_TESTSUITE_deps
)
134 $(RUN_TESTSUITE
) POSIXLY_CORRECT
=1 _POSIX2_VERSION
=200112
136 .PHONY
: maintainer-check-valgrind
137 VALGRIND_OPTS
= --leak-check
=full
--show-reachable
=yes
--gen-suppressions
=all \
138 $(VALGRIND_OPTS_SUPPRESSION
)
139 maintainer-check-valgrind
: $(RUN_TESTSUITE_deps
)
140 test 'x$(VALGRIND)' = x || \
142 PREBISON
='$(VALGRIND) -q' PREPARSER
='$(VALGRIND) -q' \
143 VALGRIND_OPTS
="$(VALGRIND_OPTS)"
145 .PHONY
: maintainer-check
146 maintainer-check
: maintainer-check-posix maintainer-check-valgrind maintainer-check-g
++
148 .PHONY
: maintainer-check-push
149 maintainer-check-push
:
150 $(MAKE
) $(AM_MAKEFLAGS
) maintainer-check \
151 TESTSUITEFLAGS
='BISON_USE_PUSH_FOR_PULL=1 $(TESTSUITEFLAGS)'
153 .PHONY
: maintainer-check-xml
154 maintainer-check-xml
:
155 $(MAKE
) $(AM_MAKEFLAGS
) maintainer-check \
156 TESTSUITEFLAGS
='BISON_TEST_XML=1 $(TESTSUITEFLAGS)'
158 .PHONY
: maintainer-check-release
159 maintainer-check-release
: maintainer-check maintainer-check-push maintainer-check-xml