1 ## Process this file with automake to create Makefile.in
3 # Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005,
4 # 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation,
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 # Run the tests with the shell detected at configure time.
21 LOG_COMPILER = $(SHELL)
23 TEST_EXTENSIONS = .pl .test .tap
24 TEST_LOG_COMPILER = $(LOG_COMPILER)
25 TAP_LOG_COMPILER = $(LOG_COMPILER)
26 PL_LOG_COMPILER = $(PERL)
27 AM_PL_LOG_FLAGS = -Mstrict -I $(top_builddir)/lib -I $(top_srcdir)/lib -w
29 TAP_LOG_DRIVER = AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/lib/tap-driver.sh
31 AM_TAP_LOG_DRIVER_FLAGS = --merge --comments
32 ## Avoid spurious TAP diagnostic. We use an awful indirection with a
33 ## shell command substitution here, since the string needs to contain
34 ## `#' characters, and these can't be escaped portably in a make macro
36 ## FIXME: this is quite inefficient though, as it adds one extra fork
37 ## FIXME: per TAP test script; this is OK for the moment, since we have
38 ## FIXME: few such scripts, but might become an issue in the future.
39 ## Keep this in sync with the definition of $diag_string_ in tests/defs.
40 AM_TAP_LOG_DRIVER_FLAGS += --diagnostic-string `printf '\043%%\043\n'`
42 EXTRA_DIST = ChangeLog-old
44 TESTS = ## Will be updated later.
50 override-conditional-2.test \
53 pr8365-remake-timing.test \
54 lex-subobj-nodep.test \
55 remake-am-pr10111.test \
56 remake-m4-pr10111.test \
58 ## FIXME: this "expected failures" are in truth an hack used to
59 ## FIXME: to verify that some incorrect usages of our perl: libraries
60 ## FIXME: raise an error. We should find a cleaner way to check that.
68 # Some testsuite-influential variables should be overridable from the
69 # test scripts, but not from the environment.
70 AM_TESTS_ENVIRONMENT = \
76 am_test_prefer_config_shell \
77 am_original_AUTOMAKE \
80 eval test x"\$${$$v}" = x || unset $$v; \
82 # The `AM_TESTS_REEXEC=no' setting tells the tests not to needlessly
83 # re-execute themselves with the shell detected at configure time, since
84 # we are already running them under it explicitly in our setup (see e.g.
85 # the definition of TEST_LOG_COMPILER above).
86 AM_TESTS_ENVIRONMENT += AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC;
87 # We want warning messages and explanations for skipped tests to go to
88 # the console if possible, so set up `stderr_fileno_' properly.
89 AM_TESTS_FD_REDIRECT = 9>&2
90 AM_TESTS_ENVIRONMENT += stderr_fileno_=9; export stderr_fileno_;
94 include $(srcdir)/list-of-tests.mk
96 TESTS += $(handwritten_TESTS)
97 EXTRA_DIST += $(handwritten_TESTS)
99 # Automatically-generated tests wrapping hand-written ones.
100 # Also, automatically-computed dependencies for tests.
102 include $(srcdir)/testsuite-part.am
104 TESTS += $(generated_TESTS)
105 EXTRA_DIST += $(generated_TESTS)
107 $(srcdir)/testsuite-part.am:
108 $(AM_V_at)rm -f testsuite-part.tmp $@
109 $(AM_V_GEN)$(PERL) $(srcdir)/gen-testsuite-part \
110 --srcdir $(srcdir) > testsuite-part.tmp
111 $(AM_V_at)chmod a-w testsuite-part.tmp
112 $(AM_V_at)mv -f testsuite-part.tmp $@
113 EXTRA_DIST += gen-testsuite-part
115 $(generated_TESTS) $(srcdir)/testsuite-part.am: \
116 gen-testsuite-part list-of-tests.mk Makefile.am $(handwritten_TESTS)
118 # Static dependencies valid for each test case.
119 check_SCRIPTS = aclocal-$(APIVERSION) automake-$(APIVERSION)
120 check_DATA = defs defs-static plain-functions.sh tap-functions.sh
121 EXTRA_DIST += tap-functions.sh plain-functions.sh
123 # Few more static dependencies.
124 distcheck-missing-m4.log distcheck-outdated-m4.log: distcheck-hook-m4.am
125 EXTRA_DIST += distcheck-hook-m4.am
127 # Keep in sync with AC_SUBST'd stuff in defs-static.in.
129 -e 's|@abs_srcdir[@]|$(abs_srcdir)|g' \
130 -e 's|@abs_top_srcdir[@]|$(abs_top_srcdir)|g' \
131 -e 's|@abs_builddir[@]|$(abs_builddir)|g' \
132 -e 's|@abs_top_builddir[@]|$(abs_top_builddir)|g' \
133 -e 's|@prefix[@]|$(prefix)|g' \
134 -e 's|@amdir[@]|$(amdir)|g' \
135 -e 's|@bindir[@]|$(bindir)|g' \
136 -e 's|@datadir[@]|$(datadir)|g' \
137 -e 's|@docdir[@]|$(docdir)|g' \
138 -e 's|@automake_acdir[@]|$(automake_acdir)|g' \
139 -e 's|@system_acdir[@]|$(system_acdir)|g' \
140 -e 's|@scriptdir[@]|$(scriptdir)|g' \
141 -e 's|@pkgvdatadir[@]|$(pkgvdatadir)|g' \
142 -e 's|@host_alias[@]|$(host_alias)|g' \
143 -e 's|@build_alias[@]|$(build_alias)|g' \
144 -e 's|@APIVERSION[@]|$(APIVERSION)|g' \
145 -e 's|@PATH_SEPARATOR[@]|$(PATH_SEPARATOR)|g' \
146 -e 's|@SHELL[@]|$(SHELL)|g' \
147 -e 's|@PERL[@]|$(PERL)|g' \
148 -e 's|@EGREP[@]|$(EGREP)|g' \
149 -e 's|@FGREP[@]|$(FGREP)|g' \
150 -e 's|@TEX[@]|$(TEX)|g' \
151 -e 's|@MODIFICATION_DELAY[@]|$(MODIFICATION_DELAY)|g' \
152 -e 's|@am_AUTOCONF[@]|$(am_AUTOCONF)|g' \
153 -e 's|@am_AUTOM4TE[@]|$(am_AUTOM4TE)|g' \
154 -e 's|@am_AUTORECONF[@]|$(am_AUTORECONF)|g' \
155 -e 's|@am_AUTOHEADER[@]|$(am_AUTOHEADER)|g' \
156 -e 's|@am_AUTOUPDATE[@]|$(am_AUTOUPDATE)|g' \
157 -e 's|@sh_errexit_works[@]|$(sh_errexit_works)|g' \
158 -e 's|@configure_input[@]|Generated from $@.in. DO NOT EDIT BY HAND!|'
160 defs-static: defs-static.in
161 $(AM_V_at)rm -f $@ $@-t
162 $(AM_V_GEN)$(do_subst) $(srcdir)/defs-static.in >$@-t
163 $(AM_V_at) : Sanity check on the substitutions; \
164 if LC_ALL=C grep '@[a-zA-Z0-9_][a-zA-Z0-9_]*@' $@-t; then \
165 echo "$@ contains unexpanded substitution (see lines above)"; \
168 $(AM_V_at)chmod a-w $@-t && mv -f $@-t $@
169 EXTRA_DIST += defs-static.in
170 CLEANFILES = defs-static
172 # If two test scripts have the same basename, they will end up sharing
173 # the same log file, leading to all sort of undefined and undesired
175 check-no-repeated-test-name:
176 @LC_ALL=C; export LC_ALL; \
177 lst='$(TEST_LOGS)'; for log in $$lst; do echo $$log; done \
178 | sort | uniq -c | awk '($$1 > 1) { print }' \
179 | sed 's/\.log$$//' | grep . >&2 \
181 echo $@: test names listed above are duplicated >&2; \
184 check-local: check-no-repeated-test-name
185 .PHONY: check-no-repeated-test-name
187 ## Checking the list of tests.
189 include $(srcdir)/CheckListOfTests.am
191 # Run the testsuite with the installed aclocal and automake.
193 am_running_installcheck=yes $(MAKE) $(AM_MAKEFLAGS) check
195 clean-local: clean-local-check
196 .PHONY: clean-local-check
198 -set x *.dir; shift; \
199 if test "$$#,$$1" = "1,*.dir"; then \
200 : there is no test directory to clean; \
202 find "$$@" -type d ! -perm -700 -exec chmod u+rwx {} ';'; \
206 ## Run the testsuite through the `prove' utility. Mostly for maintainers,
207 ## and to find out possible incompatibilities between `prove' and the
208 ## Automake own TAP driver.
211 AM_PROVEFLAGS = --timer
213 test -z "$$tests" || \
215 $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) \
216 $(PROVE) $(AM_PROVEFLAGS) -e $(srcdir)/prove-runner $(PROVEFLAGS) \
217 $$tests $(AM_TESTS_FD_REDIRECT); \
220 EXTRA_DIST += prove-runner
222 .PHONY: prove installprove
223 prove installprove: $(TESTS) prove-runner defs-static
225 ## The testsuite can be run either using the automake build tree or
226 ## the already-installed automake package.
228 install*) am_running_installcheck=yes;; \
229 *) am_running_installcheck=no;; \
231 export am_running_installcheck; \
232 ## XXX Our poor-man way to handle inter-tests dependencies without the
233 ## XXX help of make. This is obviously fragile and doesn't scale,
234 ## XXX but for now it's good enough since we have only one possible
235 ## XXX inter-tests dependency at the moment.
236 need_tap_common_setup=no; \
237 lst=' $(TESTS) '; for t in $$lst; do \
238 case ' $(on_tap_with_common_setup_TESTS) ' in \
239 *" $$t "*) need_tap_common_setup=yes; break;; \
243 if test $$need_tap_common_setup = yes; then \
244 t=tap-common-setup.test; \
245 if test -f ./$$t; then \
248 tests=$(srcdir)/$$t; \
250 ## Do not stop if there's a failure here, we want to run the following
252 echo "$@: running pre-requisite tests ..."; \
253 $(AM_PROVECMD) || exits_status=$$?; \
254 echo "$@: done. We'll shortly run the main testsuite."; \
256 ## Handle VPATH builds, and ensure that the tests have a properly
259 for t in $(TESTS); do \
260 ## XXX In next line, another hack for inter-tests dependencies: this
261 ## XXX can't run concurrently to the tests that use the data files it
263 case "$$need_tap_common_setup,/$$t" in \
264 yes,*/tap-common-setup.test) continue;; \
266 if test -f ./$$t; then \
269 echo $(srcdir)/$$t; \
272 ## Extra environment, mostly for use by `prove-runner'.
273 ## XFAIL_TESTS gets normalized to play nicer with VPATH builds.
275 for t in $(XFAIL_TESTS); do \
276 echo $$t; echo ./$$t; echo $(srcdir)/$$t; \
277 done | LC_ALL=C sort | uniq`; \
278 XFAIL_TESTS=`echo $$XFAIL_TESTS`; \
279 TAP_RUNNER='$(TAP_LOG_COMPILE)' \
280 TEST_RUNER='$(TEST_LOG_COMPILE)' \
281 export XFAIL_TESTS TAP_RUNNER TEST_RUNNER; \
282 ## For consistency with the Automake testsuite harness, that exports
283 ## this unconditionally in the test scripts' environment.
284 srcdir='$(srcdir)'; export srcdir; \
286 $(AM_PROVECMD) || exit_status=$$?; \