From: Stefano Lattarini Date: Sat, 23 Apr 2011 21:51:17 +0000 (+0200) Subject: Merge branch 'maint' X-Git-Tag: ng-0.5a~193 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=13b8cba6f99cb3cf9c93065832760389a7962963;p=thirdparty%2Fautomake.git Merge branch 'maint' --- 13b8cba6f99cb3cf9c93065832760389a7962963 diff --cc tests/Makefile.am index 28058d9a0,49d894281..9b91fb1ac --- a/tests/Makefile.am +++ b/tests/Makefile.am @@@ -816,16 -659,7 +816,17 @@@ regex-obsolete.test req.test \ reqd.test \ reqd2.test \ +repeated-options.test \ rulepat.test \ +self-check-cleanup.test \ +self-check-dir.test \ +self-check-env-sanitize.test \ +self-check-exit.test \ +self-check-is_newest.test \ +self-check-me.test \ ++self-check-report.test \ +self-check-sanity.test \ +self-check-unindent.test \ sanity.test \ scripts.test \ seenc.test \ diff --cc tests/Makefile.in index 5342b96cd,78d723c86..0fd70b57e --- a/tests/Makefile.in +++ b/tests/Makefile.in @@@ -1081,16 -930,7 +1081,17 @@@ regex-obsolete.test req.test \ reqd.test \ reqd2.test \ +repeated-options.test \ rulepat.test \ +self-check-cleanup.test \ +self-check-dir.test \ +self-check-env-sanitize.test \ +self-check-exit.test \ +self-check-is_newest.test \ +self-check-me.test \ ++self-check-report.test \ +self-check-sanity.test \ +self-check-unindent.test \ sanity.test \ scripts.test \ seenc.test \ diff --cc tests/defs index 797e54271,4e0db165f..4f035f73e --- a/tests/defs +++ b/tests/defs @@@ -128,110 -134,20 +128,124 @@@ Exit ( exit $1 } + # Print warnings (e.g., about skipped and failed tests) to this file + # number. Override by putting, say: + # stderr_fileno_=9; export stderr_fileno_; exec 9>&2; + # in the definition of AM_TESTS_ENVIRONMENT. + # This is useful when using automake's parallel tests mode, to print the + # reason for skip/failure to console, rather than to the *.log files. + : ${stderr_fileno_=2} + + # Copied from Gnulib's `tests/init.sh'. + warn_ () { echo "$@" 1>&$stderr_fileno_; } + fail_ () { warn_ "$me: failed test: $@"; Exit 1; } + skip_ () { warn_ "$me: skipped test: $@"; Exit 77; } + framework_failure_ () { warn_ "$me: set-up failure: $@"; Exit 99; } + +# 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 +} + +# AUTOMAKE_fails [options...] +# --------------------------- +# Run Automake with OPTIONS, and fail if automake +# does not exit with STATUS. +AUTOMAKE_fails () +{ + AUTOMAKE_run 1 ${1+"$@"} +} + +# using_gmake +# ----------- +# Return success if $MAKE is GNU make, return failure otherwise. +# Caches the result for speed reasons. +using_gmake () +{ + case $am__using_gmake in + yes) + return 0;; + no) + return 1;; + '') + # Use --version AND -v, because SGI Make doesn't fail on --version. + # Also grep for GNU because newer versions of FreeBSD make do + # not complain about `--version' (they seem to silently ignore it). + if $MAKE --version -v | grep GNU; then + am__using_gmake=yes + return 0 + else + am__using_gmake=no + return 1 + fi;; + *) + echo "invalid value for \$am__using_gmake: '$am__using_gmake'" >&2 + Exit 99;; + esac +} + +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=`printf '%s\n' "$commented_sed_unindent_prog" | sed -e "s/ *# .*//"` + fi + sed "$sed_unindent_prog" ${1+"$@"} +} +sed_unindent_prog="" # Avoid interferences from the environment. + + +## ----------------------------------------------------------- ## +## 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 itself. +echo "$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.