2007-09-13 18:13:35 +08:00
|
|
|
# Include this file at the end of each tests/*/Makefile.am.
|
2011-01-01 18:37:32 +08:00
|
|
|
# Copyright (C) 2007-2011 Free Software Foundation, Inc.
|
2007-09-13 18:13:35 +08:00
|
|
|
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2007-08-16 22:28:11 +08:00
|
|
|
|
|
|
|
# Ensure that all version-controlled executable files are listed in TESTS.
|
2007-10-20 16:07:12 +08:00
|
|
|
# Collect test names from the line matching /^TESTS = \\$$/ to the following
|
|
|
|
# one that does not end in '\'.
|
2007-09-16 17:20:55 +08:00
|
|
|
_v = TESTS
|
2008-04-24 18:58:24 +08:00
|
|
|
_w = root_tests
|
2007-09-13 18:13:35 +08:00
|
|
|
vc_exe_in_TESTS: Makefile
|
2011-01-25 21:29:07 +08:00
|
|
|
$(AM_V_GEN)rm -f t1 t2; \
|
|
|
|
if test -d $(top_srcdir)/.git && test $(srcdir) = .; then \
|
2008-04-24 18:58:24 +08:00
|
|
|
{ sed -n '/^$(_v) =[ ]*\\$$/,/[^\]$$/p' \
|
2008-04-18 05:34:45 +08:00
|
|
|
$(srcdir)/Makefile.am \
|
2008-04-24 18:58:24 +08:00
|
|
|
| sed 's/^ *//;/^\$$.*/d;/^$(_v) =/d'; \
|
|
|
|
sed -n '/^$(_w) =[ ]*\\$$/,/[^\]$$/p' \
|
|
|
|
$(srcdir)/Makefile.am \
|
|
|
|
| sed 's/^ *//;/^\$$.*/d;/^$(_w) =/d'; } \
|
2007-10-20 16:07:12 +08:00
|
|
|
| tr -s '\012\\' ' ' | fmt -1 | sort -u > t1 && \
|
2008-01-31 20:25:13 +08:00
|
|
|
for f in `cd $(top_srcdir) && build-aux/vc-list-files $(subdir)`; do \
|
|
|
|
f=`echo $$f|sed 's!^$(subdir)/!!'`; \
|
2007-10-20 16:07:12 +08:00
|
|
|
test -f "$$f" && test -x "$$f" && echo "$$f"; \
|
|
|
|
done | sort -u > t2 && \
|
|
|
|
diff -u t1 t2 || exit 1; \
|
|
|
|
rm -f t1 t2; \
|
2007-09-13 18:13:35 +08:00
|
|
|
else :; fi
|
|
|
|
|
|
|
|
check: vc_exe_in_TESTS
|
|
|
|
.PHONY: vc_exe_in_TESTS
|
2007-08-16 22:28:11 +08:00
|
|
|
|
2011-02-10 00:08:58 +08:00
|
|
|
CLEANFILES =
|
|
|
|
CLEANFILES += .built-programs
|
|
|
|
check-am: .built-programs
|
|
|
|
.built-programs:
|
2011-02-10 17:01:23 +08:00
|
|
|
$(AM_V_GEN)(cd $(top_builddir)/src \
|
|
|
|
&& MAKEFLAGS= $(MAKE) -s built_programs.list) \
|
2011-02-10 00:08:58 +08:00
|
|
|
> $@-t && mv $@-t $@
|
2008-04-24 18:31:13 +08:00
|
|
|
|
2008-06-18 16:01:54 +08:00
|
|
|
# Note that the first lines are statements. They ensure that environment
|
2008-05-03 05:44:59 +08:00
|
|
|
# variables that can perturb tests are unset or set to expected values.
|
|
|
|
# The rest are envvar settings that propagate build-related Makefile
|
|
|
|
# variables to test scripts.
|
2007-10-15 03:47:08 +08:00
|
|
|
TESTS_ENVIRONMENT = \
|
2008-05-27 19:45:44 +08:00
|
|
|
. $(srcdir)/lang-default; \
|
2010-12-15 02:07:36 +08:00
|
|
|
tmp__=$${TMPDIR-/tmp}; \
|
|
|
|
test -d "$$tmp__" && test -w "$$tmp__" || tmp__=.; \
|
2008-05-27 19:45:44 +08:00
|
|
|
. $(srcdir)/envvar-check; \
|
2008-05-14 15:37:02 +08:00
|
|
|
TMPDIR=$$tmp__; export TMPDIR; \
|
2008-05-12 20:39:55 +08:00
|
|
|
shell_or_perl_() { \
|
2008-05-14 15:37:02 +08:00
|
|
|
if grep '^\#!/usr/bin/perl' "$$1" > /dev/null; then \
|
|
|
|
if $(PERL) -e 'use warnings' > /dev/null 2>&1; then \
|
|
|
|
grep '^\#!/usr/bin/perl -T' "$$1" > /dev/null && T_=T || T_=; \
|
2011-04-28 17:12:01 +08:00
|
|
|
$(PERL) -w$$T_ -I$(srcdir) -MCoreutils -MCuSkip \
|
2009-03-14 19:15:40 +08:00
|
|
|
-M"CuTmpdir qw($$f)" -- "$$1"; \
|
2008-05-12 20:39:55 +08:00
|
|
|
else \
|
|
|
|
echo 1>&2 "$$tst: configure did not find a usable version of Perl," \
|
|
|
|
"so skipping this test"; \
|
|
|
|
(exit 77); \
|
|
|
|
fi; \
|
|
|
|
else \
|
|
|
|
$(SHELL) "$$1"; \
|
|
|
|
fi; \
|
|
|
|
}; \
|
2008-07-10 14:41:28 +08:00
|
|
|
export \
|
2010-04-07 17:47:28 +08:00
|
|
|
VERSION='$(VERSION)' \
|
2008-04-26 15:28:48 +08:00
|
|
|
LOCALE_FR='$(LOCALE_FR)' \
|
2008-09-26 02:01:24 +08:00
|
|
|
LOCALE_FR_UTF8='$(LOCALE_FR_UTF8)' \
|
2007-10-15 03:47:08 +08:00
|
|
|
abs_top_builddir='$(abs_top_builddir)' \
|
|
|
|
abs_top_srcdir='$(abs_top_srcdir)' \
|
2008-05-27 19:24:20 +08:00
|
|
|
abs_srcdir='$(abs_srcdir)' \
|
2011-02-10 00:08:58 +08:00
|
|
|
built_programs="`cat .built-programs`" \
|
2007-10-15 03:47:08 +08:00
|
|
|
host_os=$(host_os) \
|
|
|
|
host_triplet='$(host_triplet)' \
|
|
|
|
srcdir='$(srcdir)' \
|
|
|
|
top_srcdir='$(top_srcdir)' \
|
2010-01-29 02:12:20 +08:00
|
|
|
CONFIG_HEADER='$(abs_top_builddir)/$(CONFIG_INCLUDE)' \
|
2009-12-11 20:59:57 +08:00
|
|
|
CU_TEST_NAME=`basename '$(abs_srcdir)'`,`echo $$tst|sed 's,^\./,,;s,/,-,g'` \
|
2008-10-25 17:34:14 +08:00
|
|
|
CC='$(CC)' \
|
2008-09-03 16:33:06 +08:00
|
|
|
AWK='$(AWK)' \
|
2007-10-15 03:47:08 +08:00
|
|
|
EGREP='$(EGREP)' \
|
|
|
|
EXEEXT='$(EXEEXT)' \
|
|
|
|
MAKE=$(MAKE) \
|
Port to Solaris 'make' and use a Posixish shell on Solaris.
* bootstrap.conf (gnulib_modules): Add gnu-make, posix-shell.
* build-aux/check.mk (SHELL): Set to $(PREFERABLY_POSIX_SHELL),
so that commands can assume Posix syntax.
(ENABLE_HARD_ERRORS, TEST_LOGS): Don't use GNU Make's "?=" syntax.
(SH_E_WORKAROUND): New macro.
(am__check_pre, $(TEST_SUITE_LOG)): Use it.
(am__check_pre): Fail if "mkdir" fails. Use $(SHELL)
rather than relying on the "#!/bin/sh" in the file, so that tests
can use Posix syntax.
(am__check_pre, am__tty_colors): Use $$src rather than $$<, to
support the Posix-make $(TEST_LOGS) rule.
(%.log: %.test, %.log: %$(EXEEXT)): Remove unused inference rules
that rely on a GNU Make extension and cause Solaris 'make' to fail.
(SUFFIXES): New macro, so that we can use Posix style inference rules.
(%.log: %): Use this rule only if GNU_MAKE.
Set $$src so that macros can use $$src rather than $$<.
(CHECK-FORCE, DEPENDENCY, $(TEST_LOGS)): New macros and rules,
which rely only on Posix 'make' semantics, and are used only with
non-GNU 'make' implementations. $(TEST_LOGS) invokes 'make'
recursively (and a bit inefficiently) to simulate the GNU 'make'
rules.
(.log.html): Renamed from "%.html: %.log", so that it relies only
on Posix 'make' semantics.
(check-clean, .PHONY): Do not depend on check-clean-local, since
Solaris 'make' complains about nonexistent rules like that.
* src/Makefile.am (SUFFIXES): Remove; no longer needed.
(groups): Use a specific rule rather than an inference rule that
is only instantiated once. The inference-rule approach does not
work with Solaris 'make', which gets confused by the "groups:
Makefile" line. It's not clear from the Posix spec that Solaris
'make' is buggy here, so instead of worrying about it, rewrite
the makefile so that it clearly conforms to Posix.
* tests/check.mk (TESTS_ENVIRONMENT): Export PACKAGE_BUGREPORT.
GNU 'make' does this automatically for us, but Solaris 'make'
doesn't.
2007-11-15 Paul Eggert <eggert@cs.ucla.edu>
2007-11-16 18:03:03 +08:00
|
|
|
PACKAGE_BUGREPORT='$(PACKAGE_BUGREPORT)' \
|
2007-10-15 03:47:08 +08:00
|
|
|
PACKAGE_VERSION=$(PACKAGE_VERSION) \
|
|
|
|
PERL='$(PERL)' \
|
2008-10-04 23:12:08 +08:00
|
|
|
PREFERABLY_POSIX_SHELL='$(PREFERABLY_POSIX_SHELL)' \
|
2007-10-15 03:47:08 +08:00
|
|
|
REPLACE_GETCWD=$(REPLACE_GETCWD) \
|
2010-01-12 18:18:21 +08:00
|
|
|
; test -d /usr/xpg4/bin && PATH='/usr/xpg4/bin$(PATH_SEPARATOR)'"$$PATH"; \
|
2008-05-12 20:39:55 +08:00
|
|
|
PATH='$(abs_top_builddir)/src$(PATH_SEPARATOR)'"$$PATH" \
|
2011-06-14 15:59:14 +08:00
|
|
|
; shell_or_perl_ 9>&2
|
2007-08-16 22:28:11 +08:00
|
|
|
|
2008-04-12 15:52:42 +08:00
|
|
|
VERBOSE = yes
|