1 ## Process this file with automake to create Makefile.in
3 # Copyright (C) 1996-2012 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 2, or (at your option)
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 # Run the tests with the shell detected at configure time.
19 LOG_COMPILER = $(SHELL)
21 TEST_EXTENSIONS = .pl .test .tap
22 TEST_LOG_COMPILER = $(LOG_COMPILER)
23 TAP_LOG_COMPILER = $(LOG_COMPILER)
24 PL_LOG_COMPILER = $(PERL)
25 AM_PL_LOG_FLAGS = -Mstrict -I $(top_builddir)/lib -I $(top_srcdir)/lib -w
27 TAP_LOG_DRIVER = AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/lib/tap-driver.sh
29 AM_TAP_LOG_DRIVER_FLAGS = --merge
31 EXTRA_DIST = ax/is ChangeLog-old
33 TESTS = ## Will be updated later.
37 yacc-bison-skeleton-cxx.test \
38 yacc-bison-skeleton.test \
41 override-conditional-2.test \
46 parallel-tests-many.test \
47 pr8365-remake-timing.test \
48 lex-subobj-nodep.test \
49 remake-am-pr10111.test \
50 remake-m4-pr10111.test \
52 ## FIXME: this "expected failures" are in truth an hack used to
53 ## FIXME: to verify that some incorrect usages of our perl: libraries
54 ## FIXME: raise an error. We should find a cleaner way to check that.
62 # Some testsuite-influential variables should be overridable from the
63 # test scripts, but not from the environment.
64 AM_TESTS_ENVIRONMENT = \
70 am_test_prefer_config_shell \
71 am_original_AUTOMAKE \
74 eval test x"\$${$$v}" = x || unset $$v; \
76 # The 'AM_TESTS_REEXEC=no' setting tells the tests not to needlessly
77 # re-execute themselves with the shell detected at configure time, since
78 # we are already running them under it explicitly in our setup (see e.g.
79 # the definition of TEST_LOG_COMPILER above).
80 AM_TESTS_ENVIRONMENT += AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC;
81 # We want warning messages and explanations for skipped tests to go to
82 # the console if possible, so set up 'stderr_fileno_' properly.
83 AM_TESTS_FD_REDIRECT = 9>&2
84 AM_TESTS_ENVIRONMENT += stderr_fileno_=9; export stderr_fileno_;
88 include $(srcdir)/list-of-tests.mk
90 TESTS += $(handwritten_TESTS)
91 EXTRA_DIST += $(handwritten_TESTS)
93 # Automatically-generated tests wrapping hand-written ones.
94 # Also, automatically-computed dependencies for tests.
96 include $(srcdir)/testsuite-part.am
98 TESTS += $(generated_TESTS)
99 EXTRA_DIST += $(generated_TESTS)
101 $(srcdir)/testsuite-part.am:
102 $(AM_V_at)rm -f testsuite-part.tmp $@
103 $(AM_V_GEN)$(PERL) $(srcdir)/gen-testsuite-part \
104 --srcdir $(srcdir) > testsuite-part.tmp
105 $(AM_V_at)chmod a-w testsuite-part.tmp
106 $(AM_V_at)mv -f testsuite-part.tmp $@
107 EXTRA_DIST += gen-testsuite-part
109 $(generated_TESTS) $(srcdir)/testsuite-part.am: \
110 gen-testsuite-part list-of-tests.mk Makefile.am $(handwritten_TESTS)
112 # Static dependencies valid for each test case.
113 check_SCRIPTS = wrap/aclocal-$(APIVERSION) wrap/automake-$(APIVERSION)
114 check_DATA = defs defs-static plain-functions.sh tap-functions.sh
115 EXTRA_DIST += tap-functions.sh plain-functions.sh
117 # Few more static dependencies.
118 distcheck-missing-m4.log distcheck-outdated-m4.log: distcheck-hook-m4.am
119 EXTRA_DIST += distcheck-hook-m4.am
121 # Keep in sync with AC_SUBST'd stuff in defs-static.in.
123 -e 's|@abs_srcdir[@]|$(abs_srcdir)|g' \
124 -e 's|@abs_top_srcdir[@]|$(abs_top_srcdir)|g' \
125 -e 's|@abs_builddir[@]|$(abs_builddir)|g' \
126 -e 's|@abs_top_builddir[@]|$(abs_top_builddir)|g' \
127 -e 's|@prefix[@]|$(prefix)|g' \
128 -e 's|@amdir[@]|$(amdir)|g' \
129 -e 's|@bindir[@]|$(bindir)|g' \
130 -e 's|@datadir[@]|$(datadir)|g' \
131 -e 's|@docdir[@]|$(docdir)|g' \
132 -e 's|@automake_acdir[@]|$(automake_acdir)|g' \
133 -e 's|@system_acdir[@]|$(system_acdir)|g' \
134 -e 's|@scriptdir[@]|$(scriptdir)|g' \
135 -e 's|@pkgvdatadir[@]|$(pkgvdatadir)|g' \
136 -e 's|@host_alias[@]|$(host_alias)|g' \
137 -e 's|@build_alias[@]|$(build_alias)|g' \
138 -e 's|@APIVERSION[@]|$(APIVERSION)|g' \
139 -e 's|@PATH_SEPARATOR[@]|$(PATH_SEPARATOR)|g' \
140 -e 's|@SHELL[@]|$(SHELL)|g' \
141 -e 's|@AWK[@]|$(AWK)|g' \
142 -e 's|@PERL[@]|$(PERL)|g' \
143 -e 's|@EGREP[@]|$(EGREP)|g' \
144 -e 's|@FGREP[@]|$(FGREP)|g' \
145 -e 's|@CPPFLAGS[@]|$(CPPFLAGS)|g' \
146 -e 's|@CC[@]|$(CC)|g' \
147 -e 's|@CFLAGS[@]|$(CFLAGS)|g' \
148 -e 's|@CXX[@]|$(CXX)|g' \
149 -e 's|@CXXFLAGS[@]|$(CXXFLAGS)|g' \
150 -e 's|@F77[@]|$(F77)|g' \
151 -e 's|@FFLAGS[@]|$(FFLAGS)|g' \
152 -e 's|@FC[@]|$(FC)|g' \
153 -e 's|@FCFLAGS[@]|$(FCFLAGS)|g' \
154 -e 's|@GNU_CC[@]|$(GNU_CC)|g' \
155 -e 's|@GNU_CFLAGS[@]|$(GNU_CFLAGS)|g' \
156 -e 's|@GNU_CXX[@]|$(GNU_CXX)|g' \
157 -e 's|@GNU_CXXFLAGS[@]|$(GNU_CXXFLAGS)|g' \
158 -e 's|@GNU_F77[@]|$(GNU_F77)|g' \
159 -e 's|@GNU_FFLAGS[@]|$(GNU_FFLAGS)|g' \
160 -e 's|@GNU_FC[@]|$(GNU_FC)|g' \
161 -e 's|@GNU_FCFLAGS[@]|$(GNU_FCFLAGS)|g' \
162 -e 's|@GNU_GCJ[@]|$(GNU_GCJ)|g' \
163 -e 's|@GNU_GCJFLAGS[@]|$(GNU_GCJFLAGS)|g' \
164 -e 's|@YACC[@]|$(YACC)|g' \
165 -e 's|@LEX[@]|$(LEX)|g' \
166 -e 's|@TEX[@]|$(TEX)|g' \
167 -e 's|@MODIFICATION_DELAY[@]|$(MODIFICATION_DELAY)|g' \
168 -e 's|@am_AUTOCONF[@]|$(am_AUTOCONF)|g' \
169 -e 's|@am_AUTOM4TE[@]|$(am_AUTOM4TE)|g' \
170 -e 's|@am_AUTORECONF[@]|$(am_AUTORECONF)|g' \
171 -e 's|@am_AUTOHEADER[@]|$(am_AUTOHEADER)|g' \
172 -e 's|@am_AUTOUPDATE[@]|$(am_AUTOUPDATE)|g' \
173 -e 's|@sh_errexit_works[@]|$(sh_errexit_works)|g' \
174 -e 's|@configure_input[@]|Generated from $@.in. DO NOT EDIT BY HAND!|'
176 defs-static: defs-static.in
177 $(AM_V_at)rm -f $@ $@-t
178 $(AM_V_GEN)$(do_subst) $(srcdir)/defs-static.in >$@-t
179 $(AM_V_at) : Sanity check on the substitutions; \
180 if LC_ALL=C grep '@[a-zA-Z0-9_][a-zA-Z0-9_]*@' $@-t; then \
181 echo "$@ contains unexpanded substitution (see lines above)"; \
184 $(AM_V_at)chmod a-w $@-t && mv -f $@-t $@
185 EXTRA_DIST += defs-static.in
186 CLEANFILES = defs-static
188 # If two test scripts have the same basename, they will end up sharing
189 # the same log file, leading to all sort of undefined and undesired
191 check-no-repeated-test-name:
192 @LC_ALL=C; export LC_ALL; \
193 lst='$(TEST_LOGS)'; for log in $$lst; do echo $$log; done \
194 | sort | uniq -c | awk '($$1 > 1) { print }' \
195 | sed 's/\.log$$//' | grep . >&2 \
197 echo $@: test names listed above are duplicated >&2; \
200 check-local: check-no-repeated-test-name
201 .PHONY: check-no-repeated-test-name
203 ## Checking the list of tests.
205 include $(srcdir)/CheckListOfTests.am
207 # Run the testsuite with the installed aclocal and automake.
209 am_running_installcheck=yes $(MAKE) $(AM_MAKEFLAGS) check
211 clean-local: clean-local-check
212 .PHONY: clean-local-check
214 -set x *.dir; shift; \
215 if test "$$#,$$1" = "1,*.dir"; then \
216 : there is no test directory to clean; \
218 find "$$@" -type d ! -perm -700 -exec chmod u+rwx {} ';'; \
222 ## Run the testsuite through the 'prove' utility. Mostly for maintainers,
223 ## and to find out possible incompatibilities between 'prove' and the
224 ## Automake own TAP driver.
227 AM_PROVEFLAGS = --timer
229 test -z "$$tests" || \
231 $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) \
232 $(PROVE) $(AM_PROVEFLAGS) -e $(srcdir)/prove-runner $(PROVEFLAGS) \
233 $$tests $(AM_TESTS_FD_REDIRECT); \
236 EXTRA_DIST += prove-runner
238 .PHONY: prove installprove
239 prove installprove: $(TESTS) prove-runner defs-static
241 ## The testsuite can be run either using the automake build tree or
242 ## the already-installed automake package.
244 install*) am_running_installcheck=yes;; \
245 *) am_running_installcheck=no;; \
247 export am_running_installcheck; \
248 ## XXX Our poor-man way to handle inter-tests dependencies without the
249 ## XXX help of make. This is obviously fragile and doesn't scale,
250 ## XXX but for now it's good enough since we have only one possible
251 ## XXX inter-tests dependency at the moment.
252 need_tap_common_setup=no; \
253 lst=' $(TESTS) '; for t in $$lst; do \
254 case ' $(on_tap_with_common_setup_TESTS) ' in \
255 *" $$t "*) need_tap_common_setup=yes; break;; \
259 if test $$need_tap_common_setup = yes; then \
260 t=tap-common-setup.test; \
261 if test -f ./$$t; then \
264 tests=$(srcdir)/$$t; \
266 ## Do not stop if there's a failure here, we want to run the following
268 echo "$@: running pre-requisite tests ..."; \
269 $(AM_PROVECMD) || exits_status=$$?; \
270 echo "$@: done. We'll shortly run the main testsuite."; \
272 ## Handle VPATH builds, and ensure that the tests have a properly
275 for t in $(TESTS); do \
276 ## XXX In next line, another hack for inter-tests dependencies: this
277 ## XXX can't run concurrently to the tests that use the data files it
279 case "$$need_tap_common_setup,/$$t" in \
280 yes,*/tap-common-setup.test) continue;; \
282 if test -f ./$$t; then \
285 echo $(srcdir)/$$t; \
288 ## Extra environment, mostly for use by 'prove-runner'.
289 ## XFAIL_TESTS gets normalized to play nicer with VPATH builds.
291 for t in $(XFAIL_TESTS); do \
292 echo $$t; echo ./$$t; echo $(srcdir)/$$t; \
293 done | LC_ALL=C sort | uniq`; \
294 XFAIL_TESTS=`echo $$XFAIL_TESTS`; \
295 TAP_RUNNER='$(TAP_LOG_COMPILE)' \
296 TEST_RUNER='$(TEST_LOG_COMPILE)' \
297 export XFAIL_TESTS TAP_RUNNER TEST_RUNNER; \
298 ## For consistency with the Automake testsuite harness, that exports
299 ## this unconditionally in the test scripts' environment.
300 srcdir='$(srcdir)'; export srcdir; \
302 $(AM_PROVECMD) || exit_status=$$?; \