From: Ralf Wildenhues Date: Mon, 21 Mar 2011 21:18:42 +0000 (+0100) Subject: Merge branch 'maint' X-Git-Tag: ng-0.5a~222 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fac422c8914f14acae106338ddd6efc0297c49e9;p=thirdparty%2Fautomake.git Merge branch 'maint' --- fac422c8914f14acae106338ddd6efc0297c49e9 diff --cc tests/Makefile.am index 121d0a6a2,4becdbb1d..05870853f --- a/tests/Makefile.am +++ b/tests/Makefile.am @@@ -600,8 -486,8 +600,9 @@@ ltinstloc.test ltlibobjs.test \ ltlibsrc.test \ ltorder.test \ +lzip.test \ lzma.test \ + m4-inclusion.test \ maintclean.test \ make.test \ makej.test \ @@@ -817,8 -663,6 +818,7 @@@ silent-lex-gcc.test silent-lex-generic.test \ silent-yacc-gcc.test \ silent-yacc-generic.test \ +silent-nowarn.test \ - sinclude.test \ srcsub.test \ srcsub2.test \ space.test \ diff --cc tests/Makefile.in index 1fe16e0ca,b9b1f6e13..61cb70592 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@@ -862,8 -756,8 +862,9 @@@ ltinstloc.test ltlibobjs.test \ ltlibsrc.test \ ltorder.test \ +lzip.test \ lzma.test \ + m4-inclusion.test \ maintclean.test \ make.test \ makej.test \ @@@ -1079,8 -933,6 +1080,7 @@@ silent-lex-gcc.test silent-lex-generic.test \ silent-yacc-gcc.test \ silent-yacc-generic.test \ +silent-nowarn.test \ - sinclude.test \ srcsub.test \ srcsub2.test \ space.test \ diff --cc tests/defs index cf0b49504,fb57dfd38..f6237d33b --- a/tests/defs +++ b/tests/defs @@@ -55,138 -46,60 +55,138 @@@ 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 +} + +# Ensure $testbuilddir is set correctly. +test -f "$testbuilddir/defs-static" || { + echo "$me: $testbuilddir/defs-static not found, check \$testbuilddir" >&2 + exit 99 +} + +# 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 +# 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 DISABLE_HARD_ERRORS +unset TESTS +unset TEST_LOG_COMPILER +unset TEST_LOGS +unset RECHECK_LOGS +unset VERBOSE + + +## ---------------------------- ## +## 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. +# So use `Exit STATUS' instead of `exit STATUS' inside of the tests. +# Turn off errexit here so that we don't trip the bug with OSF1/Tru64 +# sh inside this function. +Exit () +{ + set +e + (exit $1) + exit $1 +} + +# is_newest FILE FILES +# -------------------- +# Return false if any file in FILES is newer than FILE. +# Resolve ties in favor of FILE. +is_newest () +{ + is_newest_files=`find "$@" -newer "$1"` + test -z "$is_newest_files" +} + +# AUTOMAKE_run status [options...] +# -------------------------------- +# Run Automake with OPTIONS, and fail if automake +# does not exit with STATUS. +AUTOMAKE_run () +{ + expected_exitcode=$1 + shift + exitcode=0 + $AUTOMAKE ${1+"$@"} >stdout 2>stderr || exitcode=$? + cat stderr >&2 + cat stdout + test $exitcode = $expected_exitcode || Exit 1 } -if test -z "$srcdir"; then - # compute $srcdir. - srcdir=`echo "$0" | sed -e 's,/[^\\/]*$,,'` - test "$srcdir" = $0 && srcdir=. -else :; fi +# AUTOMAKE_fails [options...] +# --------------------------- +# Run Automake with OPTIONS, and fail if automake +# does not exit with STATUS. +AUTOMAKE_fails () +{ + AUTOMAKE_run 1 ${1+"$@"} +} -# Ensure $srcdir is set correctly. -test -f "$srcdir/defs.in" || { - echo "$srcdir/defs.in not found, check \$srcdir" 1>&2 - exit 1 +commented_sed_unindent_prog=' + /^$/b # Nothing to do for empty lines. + x # Get x into pattern space. + /^$/{ # No prior x, go prepare it. + g # Copy this 1st non-blank line into pattern space. + s/^\(['"$tab"' ]*\).*/x\1/ # Prepare x in pattern space. + } # Now: x in pattern and in hold. + G # Build x\n in pattern space, and + h # duplicate it into hold space. + s/\n.*$// # Restore x in pattern space, and + x # exchange with the above duplicate in hold space. + s/^x\(.*\)\n\1// # Remove leading from . + s/^x.*\n// # Restore when there is no leading . +' + +# unindent [input files...] +# ------------------------- +# Remove the "proper" amount of leading whitespace from the given files, +# and output the result on stdout. That amount is determined by looking +# at the leading whitespace of the first non-blank line in the input +# files. If no input file is specified, standard input is implied. +unindent () +{ + if test x"$sed_unindent_prog" = x; then - sed_unindent_prog=`echo "$commented_sed_unindent_prog" | sed -e "s/ *# .*//"` ++ sed_unindent_prog=`printf '%s\n' "$commented_sed_unindent_prog" | sed -e "s/ *# .*//"` + fi + sed "$sed_unindent_prog" ${1+"$@"} } -me=`echo "$0" | sed -e 's,.*[\\/],,;s/\.test$//'` - -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 "$AUTOHEADER" && AUTOHEADER="@am_AUTOHEADER@" -test -z "$AUTOUPDATE" && AUTOUPDATE=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" + +## ----------------------------------------------------------- ## +## Checks for required tools, and additional setups (if any) ## +## required by them. ## +## ----------------------------------------------------------- ## + +# Print it here, so that the user will see it also if the test +# will be skipped due to some tool missing in $PATH itslef. echo "$PATH" -# Some shells forget to export modified environment variables. -# (See note about `export' in the Autoconf manual.) -export PATH +# Look for (and maybe set up) required tools and/or system features; skip +# the current test if they are not found. for tool in : $required do # Check that each required tool is present.