2007-09-13 12:13:35 +02:00
|
|
|
# Include this file at the end of each tests/*/Makefile.am.
|
2010-01-01 10:56:28 +01:00
|
|
|
# Copyright (C) 2007-2010 Free Software Foundation, Inc.
|
2007-09-13 12:13:35 +02: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 16:28:11 +02:00
|
|
|
|
|
|
|
|
# Ensure that all version-controlled executable files are listed in TESTS.
|
2007-10-20 10:07:12 +02:00
|
|
|
# Collect test names from the line matching /^TESTS = \\$$/ to the following
|
|
|
|
|
# one that does not end in '\'.
|
2007-09-16 11:20:55 +02:00
|
|
|
_v = TESTS
|
2008-04-24 12:58:24 +02:00
|
|
|
_w = root_tests
|
2007-09-13 12:13:35 +02:00
|
|
|
vc_exe_in_TESTS: Makefile
|
2008-01-13 12:44:53 +01:00
|
|
|
@rm -f t1 t2
|
2007-10-29 07:47:21 +01:00
|
|
|
@if test -d $(top_srcdir)/.git && test $(srcdir) = .; then \
|
2008-04-24 12:58:24 +02:00
|
|
|
{ sed -n '/^$(_v) =[ ]*\\$$/,/[^\]$$/p' \
|
2008-04-17 23:34:45 +02:00
|
|
|
$(srcdir)/Makefile.am \
|
2008-04-24 12:58:24 +02:00
|
|
|
| sed 's/^ *//;/^\$$.*/d;/^$(_v) =/d'; \
|
|
|
|
|
sed -n '/^$(_w) =[ ]*\\$$/,/[^\]$$/p' \
|
|
|
|
|
$(srcdir)/Makefile.am \
|
|
|
|
|
| sed 's/^ *//;/^\$$.*/d;/^$(_w) =/d'; } \
|
2007-10-20 10:07:12 +02:00
|
|
|
| tr -s '\012\\' ' ' | fmt -1 | sort -u > t1 && \
|
2008-01-31 13:25:13 +01:00
|
|
|
for f in `cd $(top_srcdir) && build-aux/vc-list-files $(subdir)`; do \
|
|
|
|
|
f=`echo $$f|sed 's!^$(subdir)/!!'`; \
|
2007-10-20 10:07:12 +02: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 12:13:35 +02:00
|
|
|
else :; fi
|
|
|
|
|
|
|
|
|
|
check: vc_exe_in_TESTS
|
|
|
|
|
.PHONY: vc_exe_in_TESTS
|
2007-08-16 16:28:11 +02:00
|
|
|
|
2008-04-24 12:31:13 +02:00
|
|
|
built_programs = \
|
|
|
|
|
(cd $(top_builddir)/src && MAKEFLAGS= $(MAKE) -s built_programs.list)
|
|
|
|
|
|
2008-06-18 10:01:54 +02:00
|
|
|
# Note that the first lines are statements. They ensure that environment
|
2008-05-02 23:44:59 +02: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-14 21:47:08 +02:00
|
|
|
TESTS_ENVIRONMENT = \
|
2008-05-27 13:45:44 +02:00
|
|
|
. $(srcdir)/lang-default; \
|
2008-09-29 22:30:11 +02:00
|
|
|
tmp__=$$TMPDIR; test -d "$$tmp__" || tmp__=.; \
|
2008-05-27 13:45:44 +02:00
|
|
|
. $(srcdir)/envvar-check; \
|
2008-05-14 09:37:02 +02:00
|
|
|
TMPDIR=$$tmp__; export TMPDIR; \
|
2009-02-27 09:12:14 +01:00
|
|
|
exec 9>&2; \
|
2008-05-12 14:39:55 +02:00
|
|
|
shell_or_perl_() { \
|
2008-05-14 09:37:02 +02: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_=; \
|
2008-05-27 13:45:44 +02:00
|
|
|
$(PERL) -w$$T_ -I$(srcdir) -MCoreutils \
|
2009-03-14 12:15:40 +01:00
|
|
|
-M"CuTmpdir qw($$f)" -- "$$1"; \
|
2008-05-12 14:39:55 +02: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 08:41:28 +02:00
|
|
|
export \
|
2010-04-07 11:47:28 +02:00
|
|
|
VERSION='$(VERSION)' \
|
2008-04-26 09:28:48 +02:00
|
|
|
LOCALE_FR='$(LOCALE_FR)' \
|
2008-09-25 20:01:24 +02:00
|
|
|
LOCALE_FR_UTF8='$(LOCALE_FR_UTF8)' \
|
2007-10-14 21:47:08 +02:00
|
|
|
abs_top_builddir='$(abs_top_builddir)' \
|
|
|
|
|
abs_top_srcdir='$(abs_top_srcdir)' \
|
2008-05-27 13:24:20 +02:00
|
|
|
abs_srcdir='$(abs_srcdir)' \
|
2007-10-14 21:47:08 +02:00
|
|
|
built_programs="`$(built_programs)`" \
|
|
|
|
|
host_os=$(host_os) \
|
|
|
|
|
host_triplet='$(host_triplet)' \
|
|
|
|
|
srcdir='$(srcdir)' \
|
|
|
|
|
top_srcdir='$(top_srcdir)' \
|
2010-01-28 18:12:20 +00:00
|
|
|
CONFIG_HEADER='$(abs_top_builddir)/$(CONFIG_INCLUDE)' \
|
2009-12-11 13:59:57 +01:00
|
|
|
CU_TEST_NAME=`basename '$(abs_srcdir)'`,`echo $$tst|sed 's,^\./,,;s,/,-,g'` \
|
2008-10-25 11:34:14 +02:00
|
|
|
CC='$(CC)' \
|
2008-09-03 10:33:06 +02:00
|
|
|
AWK='$(AWK)' \
|
2007-10-14 21:47:08 +02: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 11:03:03 +01:00
|
|
|
PACKAGE_BUGREPORT='$(PACKAGE_BUGREPORT)' \
|
2007-10-14 21:47:08 +02:00
|
|
|
PACKAGE_VERSION=$(PACKAGE_VERSION) \
|
|
|
|
|
PERL='$(PERL)' \
|
2008-10-04 17:12:08 +02:00
|
|
|
PREFERABLY_POSIX_SHELL='$(PREFERABLY_POSIX_SHELL)' \
|
2007-10-14 21:47:08 +02:00
|
|
|
REPLACE_GETCWD=$(REPLACE_GETCWD) \
|
2010-01-12 10:18:21 +00:00
|
|
|
; test -d /usr/xpg4/bin && PATH='/usr/xpg4/bin$(PATH_SEPARATOR)'"$$PATH"; \
|
2008-05-12 14:39:55 +02:00
|
|
|
PATH='$(abs_top_builddir)/src$(PATH_SEPARATOR)'"$$PATH" \
|
2008-07-10 08:41:28 +02:00
|
|
|
; shell_or_perl_
|
2007-08-16 16:28:11 +02:00
|
|
|
|
2008-04-12 09:52:42 +02:00
|
|
|
VERBOSE = yes
|