2011-02-15 Stefano Lattarini <stefano.lattarini@gmail.com>
+ python: report the 'PYTHON' influential environment variable
+ * m4/python.m4 (AM_PATH_PYTHON): Call AC_ARG_VAR on PYTHON.
+ * doc/automake.texi (Python): Update and extend.
+ * tests/help-python.test: New test.
+ * tests/Makefile.am (TESTS): Update.
+ * THANKS (Jack Kelly): Update e-mail address.
+ Suggestion by Jack Kelly.
+
+ 2011-02-10 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests defs: clear TESTS_ENVIRONMENT variable
+ * tests/defs.in (TESTS_ENVIRONMENT): Unset it, so that values
+ from environment won't interfere with the testcases.
+ Suggestion by Ralf Wildenhues.
+
++2011-02-15 Stefano Lattarini <stefano.lattarini@gmail.com>
++
+ tests: `instspc-*.test': do not create useless source file
+ * tests/instspc-tests.sh (create_input_data): Do not create
+ unused source file `source2.c'.
+
+2011-02-15 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests: optimize `instspc-*.test' for speed
+ After the split of `instspc.test' into various generated tests,
+ the running time of the testsuite has noticeably increased, since
+ all these new generated tests must run aclocal, autoconf and
+ automake, whereas previously they were run only once (at the
+ beginning of `instspc.test'). But luckily, since the new tests
+ share the same input files for the autotools, this situation can
+ be easily worked around (at the expenses of a slight increase of
+ complexity for the testsuite scaffolding).
+ * tests/instspc-data.test: New helper test, properly calling
+ the `instspc-tests.sh' script to generate input data for the
+ others `instspc-*.test' tests.
+ * tests/Makefile.am (TESTS): Add `instspc-data.test'.
+ ($(instspc_tests:.test=.log)): Depend on its log file.
+ (instspc-data.log): Depend on `instspc-tests.sh'.
+ * tests/instspc-tests.sh: Recognize new action `generate-data',
+ and use it to create hand-written and autotools-generated static
+ files shared by all the `instspc-*.test' tests.
+ When sourced by the `instspc-*.test' tests, use those previously
+ created files instead of recreating them from scratch.
+ (unindent, create_input_data): New subroutines.
+ Some other related changes and refactorings.
+ From a suggestion by Ralf Wildenhues.
+
+2011-02-14 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ python: fix spurious failure in tests
+ * tests/python-vars.test: Ignore cached values from config.site
+ by exporting CONFIG_SITE=/dev/null. Be laxer in matching the
+ expected values of output variables `pythondir' and `pyexecdir',
+ since they can change quite unpredictably among different python
+ installations. Also, avoid "hyping" debugging output, thus
+ offering smaller trace output and more informative diff.
+ Report and suggestions by Ralf Wildenhues.
+ * tests/python-virtualenv.test: Require python, since we call it
+ even after the virtualenv has been deactivated. Ignore cached
+ values from config.site by exporting CONFIG_SITE=/dev/null.
+
2011-02-06 Stefano Lattarini <stefano.lattarini@gmail.com>
tests: tweak few tests on simple and parallel test drivers
# 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 $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. ##
+## ---------------------------- ##
-# Ensure $srcdir is set correctly.
-test -f "$srcdir/defs.in" || {
- echo "$srcdir/defs.in not found, check \$srcdir" 1>&2
- exit 1
+# 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
}
-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"
+# 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+"$@"}
+}
+
+
+## ----------------------------------------------------------- ##
+## 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.
echo "AC_CONFIG_FILES([Makefile])"
} >configure.in
-# 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
-# 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
-
-echo "=== Running test $0"
-
-# We might need extra macros, e.g., from Libtool or Gettext.
-# Find them on the system.
-# Use `-I $srcdir/../m4' in addition to `--acdir=$srcdir/../m4', because the
-# other `-I' directories added for libtool and gettext might contain
-# files from an old version of Automake that we don't want to use.
-# Use `-Wno-syntax' because we do not want our test suite to fail because
-# some third-party .m4 file is underquoted.
-case $required in
- *libtool* | *gettext* )
- aclocaldir='@prefix@/share/aclocal'
- extra_includes=""
- if test -f $aclocaldir/dirlist; then
- extra_includes=`
- <$aclocaldir/dirlist \
- sed 's/#.*//;s/[ ][ ]*$//g' \
- | while read dir; do test ! -d "$dir" || echo "-I $dir"; done`
- else :; fi
-
- libtool_found=no
- gettext_found=no
- for d in $extra_includes $aclocaldir ; do
- test "x$d" != x-I || continue
- if test -f "$d/libtool.m4"; then
- libtool_found=yes
- fi
- if test -f "$d/gettext.m4"; then
- gettext_found=yes
- fi
- done
- case $required in
- *libtool* ) test $libtool_found = yes || Exit 77 ;;
- *gettext* ) test $gettext_found = yes || Exit 77 ;;
- esac
- # Libtool cannot cope with spaces in the build tree. Our testsuite setup
- # cannot cope with spaces in the source tree name for Libtool and gettext
- # tests.
- case $srcdir,`pwd` in
- *\ * | *\ *) Exit 77 ;;
- esac
- ACLOCAL="$ACLOCAL -Wno-syntax -I $srcdir/../m4 $extra_includes -I $aclocaldir"
- ;;
-esac
-
-testaclocaldir='@abs_top_srcdir@/m4'
-
-# POSIX no longer requires 'egrep' and 'fgrep',
-# but some hosts lack 'grep -E' and 'grep -F'.
-EGREP='@EGREP@'
-FGREP='@FGREP@'
-
-# The amount we should wait after modifying files depends on the platform.
-# For instance, Windows '95, '98 and ME have 2-second granularity
-# and can be up to 3 seconds in the future w.r.t. the system clock.
-sleep='sleep @MODIFICATION_DELAY@'
-
-# The tests call `make -e' but we do not want $srcdir from the environment
-# to override the definition from the Makefile.
-testsrcdir=$srcdir
-unset srcdir
-
-# An old timestamp that can be given to a file, in "touch -t" format.
-# The time stamp should be portable to all file systems of interest.
-# Just for fun, choose the exact time of the announcement of the GNU project
-# in UTC; see <http://www.gnu.org/gnu/initial-announcement.html>.
-old_timestamp=198309271735.59
-
-# 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+"$@"}
-}
+## ---------------- ##
+## Ready to go... ##
+## ---------------- ##
-# Turn on shell traces.
set -x
+set -e
pwd