* tests/missing.test: Build and use our own `autoconf' script, to avoid spurious failures due to configure-time value of $AUTOCONF being an absolute path. Prefer passing overrides to ./configure on the command line rather than in the environment. Some other related and unrelated improvements. * tests/missing2.test: Likewise, and keep more in sync with `missing.test' by adding checks with version number suffixes. --- ChangeLog | 9 +++++++++ tests/missing.test | 45 +++++++++++++++++++++++++++++---------------- tests/missing2.test | 41 ++++++++++++++++++++++++++++++++--------- 3 files changed, 70 insertions(+), 25 deletions(-)
From 663b6c360b229685b6c6aa7135adc38da63b9585 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini <stefano.lattar...@gmail.com> Date: Wed, 18 Aug 2010 19:38:53 +0200 Subject: [PATCH 2/6] Testsuite: fix missing*.test for non-default autotools.
* tests/missing.test: Build and use our own `autoconf' script, to avoid spurious failures due to configure-time value of $AUTOCONF being an absolute path. Prefer passing overrides to ./configure on the command line rather than in the environment. Some other related and unrelated improvements. * tests/missing2.test: Likewise, and keep more in sync with `missing.test' by adding checks with version number suffixes. --- ChangeLog | 9 +++++++++ tests/missing.test | 45 +++++++++++++++++++++++++++++---------------- tests/missing2.test | 41 ++++++++++++++++++++++++++++++++--------- 3 files changed, 70 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index 92f2063..7f817e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2010-08-19 Stefano Lattarini <stefano.lattar...@gmail.com> + Testsuite: fix missing*.test for non-default autotools. + * tests/missing.test: Build and use our own `autoconf' script, to + avoid spurious failures due to configure-time value of $AUTOCONF + being an absolute path. Prefer passing overrides to ./configure + on the command line rather than in the environment. Some other + related and unrelated improvements. + * tests/missing2.test: Likewise, and keep more in sync with + `missing.test' by adding checks with version number suffixes. + Test that autoconf(s) used by the testsuite and by aclocal match. * tests/remake0.test: New test. * tests/Makefile.am (TESTS): Updated. diff --git a/tests/missing.test b/tests/missing.test index eaf6f54..01d741a 100755 --- a/tests/missing.test +++ b/tests/missing.test @@ -1,6 +1,6 @@ #! /bin/sh -# Copyright (C) 2003, 2004, 2006, 2007, 2008 Free Software Foundation, -# Inc. +# Copyright (C) 2003, 2004, 2006, 2007, 2008, 2010 Free Software +# Foundation, Inc. # # 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 @@ -16,6 +16,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # Test missing with version mismatches. +# Keep this in sync with sister test `missing.test'. . ./defs || Exit 1 @@ -31,36 +32,48 @@ $ACLOCAL $AUTOCONF $AUTOMAKE --add-missing +# Avoid problems with configure-time $AUTOCONF that is absolute values. +# Such problems already occurred in practice. +mkdir xbin +cat > xbin/autoconf <<END +#!/bin/sh +exec $AUTOCONF \${1+"\$@"} +END +chmod a+x xbin/autoconf +cat xbin/autoconf # for debugging +cp xbin/autoconf xbin/autoconf6789 + +PATH=`pwd`/xbin:$PATH; export PATH + # Make sure we do use missing, even if the user exported AUTOCONF. # (We cannot export this new value, because it would be used by Automake # when tracing, and missing is no good for this.) -MYAUTOCONF="./missing --run $AUTOCONF" unset AUTOCONF +MYAUTOCONF="./missing --run autoconf" ./configure AUTOCONF="$MYAUTOCONF" + $MAKE $sleep # Hopefully the install version of Autoconf cannot compete with this one... -echo 'AC_PREREQ(9999)' >> aclocal.m4 +echo 'AC_PREREQ([9999])' >> aclocal.m4 $MAKE distdir -# Try version number suffixes if we can add them safely. -case $MYAUTOCONF in *autoconf) - ./configure AUTOCONF="${MYAUTOCONF}6789" - $MAKE - $sleep - # Hopefully the install version of Autoconf cannot compete with this one... - echo 'AC_PREREQ(9999)' >> aclocal.m4 - $MAKE distdir -esac +# Try version number suffixes. +./configure AUTOCONF="${MYAUTOCONF}6789" +$MAKE +$sleep +touch aclocal.m4 +$MAKE distdir -# Run again, but without missing, to ensure that timestamps were updated. -export AUTOMAKE ACLOCAL -./configure AUTOCONF="$MYAUTOCONF" +# Run again, but without missing to wrap aclocal/automake, to ensure that +# timestamps were updated. +./configure AUTOCONF="$MYAUTOCONF" AUTOMAKE="$AUTOMAKE" ACLOCAL="$ACLOCAL" $MAKE # Make sure $MAKE fails when timestamps aren't updated and missing is not used. $sleep touch aclocal.m4 $MAKE && Exit 1 + : diff --git a/tests/missing2.test b/tests/missing2.test index 2629198..41a793e 100755 --- a/tests/missing2.test +++ b/tests/missing2.test @@ -1,5 +1,6 @@ #! /bin/sh -# Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2006, 2007, 2010 Free Software Foundation, +# Inc. # # 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 @@ -15,6 +16,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # Test missing with version mismatches. +# Keep this in sync with sister test `missing.test'. . ./defs || Exit 1 @@ -26,32 +28,53 @@ AC_OUTPUT EOF : > v.m4 - : > Makefile.am $ACLOCAL $AUTOCONF $AUTOMAKE --add-missing -# See missing.test for explanations about this. -MYAUTOCONF="./missing --run $AUTOCONF" +# Avoid problems with configure-time $AUTOCONF that is absolute values. +# Such problems already occurred in practice. +mkdir xbin +cat > xbin/autoconf <<END +#!/bin/sh +exec $AUTOCONF \${1+"\$@"} +END +chmod a+x xbin/autoconf +cat xbin/autoconf # for debugging + +PATH=`pwd`/xbin:$PATH; export PATH + +# Make sure we do use missing, even if the user exported AUTOCONF. +# (We cannot export this new value, because it would be used by Automake +# when tracing, and missing is no good for this.) unset AUTOCONF +MYAUTOCONF="./missing --run autoconf" ./configure AUTOCONF="$MYAUTOCONF" $MAKE $sleep # Hopefully the install version of Autoconf cannot compete with this one... -echo 'AC_PREREQ(9999)' > v.m4 +echo 'AC_PREREQ([9999])' > v.m4 $MAKE distdir -# Run again, but without missing, to ensure that timestamps were updated. -export AUTOMAKE ACLOCAL -./configure AUTOCONF="$MYAUTOCONF" +# Try version number suffixes. +./configure AUTOCONF="${MYAUTOCONF}6789" +$MAKE +$sleep +touch v.m4 +$MAKE distdir + +# Run again, but without missing to wrap aclocal/automake, to ensure that +# timestamps were updated. +./configure AUTOCONF="$MYAUTOCONF" AUTOMAKE="$AUTOMAKE" ACLOCAL="$ACLOCAL" $MAKE -# Make sure $MAKE fail when timestamps aren't updated and missing is not used. +# Make sure $MAKE fails when timestamps aren't updated and missing is not used. $sleep touch v.m4 $MAKE && Exit 1 + : -- 1.7.1