From: Stefano Lattarini Date: Mon, 8 Aug 2011 12:40:59 +0000 (+0200) Subject: Merge branch 'maint' X-Git-Tag: ng-0.5a~143 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f807dd5a843bc219424b3a9f33f2498dbc1c610a;p=thirdparty%2Fautomake.git Merge branch 'maint' * maint: test defs: more environment cleanup --- f807dd5a843bc219424b3a9f33f2498dbc1c610a diff --cc ChangeLog index 81e2569f6,af2556fcc..a8a671141 --- a/ChangeLog +++ b/ChangeLog @@@ -1,3 -1,9 +1,9 @@@ + 2011-08-08 Stefano Lattarini + + test defs: more environment cleanup - * tests/defs.in: Also unset variables AM_COLOR_TESTS and ++ * tests/defs: Also unset variables AM_COLOR_TESTS and + AM_TESTS_ENVIRONMENT. + 2011-08-08 Stefano Lattarini tests: fix spurious failure with Solaris make diff --cc tests/defs index dc7add076,775945546..701668deb --- a/tests/defs +++ b/tests/defs @@@ -58,52 -46,83 +58,53 @@@ nl= # is defined initially, so that saving and restoring $IFS works. IFS=$sp$tab$nl -# Ensure we are running from the right directory. -test -f ./defs || { - echo "defs: not found in current directory" 1>&2 - exit 1 +# Ensure $testsrcdir is set correctly. +test -f "$testsrcdir/defs-static.in" || { + echo "$me: $testsrcdir/defs-static.in not found, check \$testsrcdir" >&2 + exit 99 } -if test -z "$srcdir"; then - # compute $srcdir. - srcdir=`echo "$0" | sed -e 's,/[^\\/]*$,,'` - test "$srcdir" = $0 && srcdir=. -else :; fi - -# Ensure $srcdir is set correctly. -test -f "$srcdir/defs.in" || { - echo "$srcdir/defs.in not found, check \$srcdir" 1>&2 - exit 1 +# Ensure $testbuilddir is set correctly. +test -f "$testbuilddir/defs-static" || { + echo "$me: $testbuilddir/defs-static not found, check \$testbuilddir" >&2 + exit 99 } -# The name of the current test (without the `.test' suffix). -# Test scripts can override it if they need to (but this should -# be done carefully, and *before* including ./defs). -if test -z "$me"; then - me=`echo "$0" | sed -e 's,.*[\\/],,;s/\.test$//'` -elif env | grep '^me=' >/dev/null; then - echo "$0: variable \`me' is set in the environment: this is unsafe" >&2 - exit 99 -fi - -# Check that the environment is properly sanitized. -for var in required parallel_tests; do - if env | grep "^$var=" >/dev/null; then - echo "$me: variable \`$var' is set in the environment:" \ - "this is unsafe" >&2 - exit 99 - fi -done -unset var +# Unset some MAKE... variables that may cause $MAKE to act like a +# recursively invoked sub-make. Any $MAKE invocation in a test is +# conceptually an independent invocation, not part of the main +# 'automake' build. +unset MFLAGS MAKEFLAGS AM_MAKEFLAGS MAKELEVEL __MKLVL__ MAKE_JOBS_FIFO +# Unset verbosity flag. +unset V +# Also unset variables that will let `make -e install' divert +# files into unwanted directories. +unset DESTDIR +unset prefix exec_prefix bindir datarootdir datadir docdir dvidir +unset htmldir includedir infodir libdir libexecdir localedir mandir +unset oldincludedir pdfdir psdir sbindir sharedstatedir sysconfdir +# Unset variables that might change the "make distcheck" behaviour. +unset DISTCHECK_CONFIGURE_FLAGS AM_DISTCHECK_CONFIGURE_FLAGS +# The tests call `make -e' but we do not want $srcdir from the environment +# to override the definition from the Makefile. +unset srcdir +# Also unset variables that control our test driver. While not +# conceptually independent, they cause some changed semantics we +# need to control (and test for) in some of the tests to ensure +# backward-compatible behavior. - unset TESTS_ENVIRONMENT ++unset TESTS_ENVIRONMENT AM_TESTS_ENVIRONMENT +unset DISABLE_HARD_ERRORS ++unset AM_COLOR_TESTS +unset TESTS +unset TEST_LOG_COMPILER +unset TEST_LOGS +unset RECHECK_LOGS +unset VERBOSE -# This might be used in testcases checking distribution-related features. -# Test scripts are free to override this if they need to. -distdir=$me-1.0 -APIVERSION='@APIVERSION@' -PATH_SEPARATOR='@PATH_SEPARATOR@' - -# Make sure we override the user shell. -SHELL='@SHELL@' -export SHELL -# User can override various tools used. -test -z "$PERL" && PERL='@PERL@' -test -z "$MAKE" && MAKE=make -test -z "$AUTOCONF" && AUTOCONF="@am_AUTOCONF@" -test -z "$AUTOM4TE" && AUTOM4TE="@am_AUTOM4TE@" -test -z "$AUTORECONF" && AUTORECONF="@am_AUTORECONF@" -test -z "$AUTOHEADER" && AUTOHEADER="@am_AUTOHEADER@" -test -z "$AUTOUPDATE" && AUTOUPDATE="@am_AUTOUPDATE@" -test -z "$MISSING" && MISSING=`pwd`/../lib/missing -# Use -Werror because this also turns some Perl warnings into error. -# (Tests for which this is inappropriate should use -Wno-error.) -test -z "$ACLOCAL" && ACLOCAL="aclocal-$APIVERSION -Werror" -# Extra flags to pass to aclocal before all other flags added by this script. -ACLOCAL_TESTSUITE_FLAGS= -export ACLOCAL_TESTSUITE_FLAGS - -# See how Automake should be run. We put --foreign as the default -# strictness to avoid having to create lots and lots of files. A test -# can override this by specifying a different strictness. Use -Wall -# -Werror by default. Tests for which this is inappropriate -# (e.g. when testing that a warning is enabled by a specific switch) -# should use -Wnone or/and -Wno-error -test -z "$AUTOMAKE" && AUTOMAKE="automake-$APIVERSION --foreign -Werror -Wall" - -PATH="`pwd`$PATH_SEPARATOR$PATH" -echo "$PATH" -# Some shells forget to export modified environment variables. -# (See note about `export' in the Autoconf manual.) -export PATH +## ---------------------------- ## +## Auxiliary shell functions. ## +## ---------------------------- ## # We use a trap below for cleanup. This requires us to go through # hoops to get the right exit status transported through the signal.