+2010-12-22 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ Tests defs: keep track of original $AUTOMAKE and $ACLOCAL values.
+ This is especially useful for tests which might want to run
+ automake and aclocal without additional flags and warnings.
+ * tests/defs-static.in ($original_ACLOCAL): New variable.
+ ($original_AUTOMAKE): Likewise.
+ * tests/help.test: Use them.
+ * tests/help2.test: Likewise.
+ * tests/help3.test: Likewise.
+ * tests/help4.test: Likewise.
+ From a suggestion by Ralf Wildenhues.
+
2010-12-13 Stefano Lattarini <stefano.lattarini@gmail.com>
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
test -z "$AUTOHEADER" && AUTOHEADER="@am_AUTOHEADER@"
test -z "$AUTOUPDATE" && AUTOUPDATE=autoupdate
test -z "$MISSING" && MISSING=$top_testsrcdir/lib/missing
+
# Use -Werror because this also turns some Perl warnings into error.
-# (Tests for which this is inappropriate should use -Wno-error.)
+# Tests for which this is inappropriate should use -Wno-error.
+# Tests who want complete control over aclocal command-line options
+# should use $original_ACLOCAL.
+# Note: the first `test -z' conditional below is to ensure defs-static
+# really remains idempotent.
+if test -z "$original_ACLOCAL"; then
+ original_ACLOCAL=${ACLOCAL-"aclocal-$APIVERSION"}
+fi
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
+# -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. Tests who want complete control over
+# automake command-line options should use $original_AUTOMAKE.
+# Note: the first `test -z' conditional below is to ensure defs-static
+# really remains idempotent.
+if test -z "$original_AUTOMAKE"; then
+ original_AUTOMAKE=${AUTOMAKE-"automake-$APIVERSION"}
+fi
test -z "$AUTOMAKE" && AUTOMAKE="automake-$APIVERSION --foreign -Werror -Wall"
# POSIX no longer requires 'egrep' and 'fgrep',
mkdir emptydir
cd emptydir
-# Honour user overrides for $ACLOCAL and $AUTOMAKE.
-ACLOCAL=`echo " $ACLOCAL " | sed 's/ -W[^ ]*/ /g'`
-AUTOMAKE=`echo " $AUTOMAKE " | sed 's/ -W[^ ]*/ /g'`
+# Honour user overrides for $ACLOCAL and $AUTOMAKE, but without
+# adding extra options.
+ACLOCAL=$original_ACLOCAL
+AUTOMAKE=$original_AUTOMAKE
$ACLOCAL --version
$ACLOCAL --help
mkdir cleandir
cd cleandir
-# Honour user overrides for $ACLOCAL and $AUTOMAKE.
-ACLOCAL=`echo " $ACLOCAL " | sed 's/ -W[^ ]*/ /g'`
-AUTOMAKE=`echo " $AUTOMAKE " | sed 's/ -W[^ ]*/ /g'`
+# Honour user overrides for $ACLOCAL and $AUTOMAKE, but without
+# adding extra options.
+ACLOCAL=$original_ACLOCAL
+AUTOMAKE=$original_AUTOMAKE
echo '[' > configure.in
mkdir cleandir
cd cleandir
-# Honour user overrides for $ACLOCAL and $AUTOMAKE.
-ACLOCAL=`echo " $ACLOCAL " | sed 's/ -W[^ ]*/ /g'`
-AUTOMAKE=`echo " $AUTOMAKE " | sed 's/ -W[^ ]*/ /g'`
+# Honour user overrides for $ACLOCAL and $AUTOMAKE, but without
+# adding extra options.
+ACLOCAL=$original_ACLOCAL
+AUTOMAKE=$original_AUTOMAKE
cat > configure.in <<END
AC_INIT([$me], [1.0])
mkdir emptydir
cd emptydir
-# Honour user overrides for $ACLOCAL and $AUTOMAKE.
-ACLOCAL=`echo " $ACLOCAL " | sed 's/ -W[^ ]*/ /g'`
-AUTOMAKE=`echo " $AUTOMAKE " | sed 's/ -W[^ ]*/ /g'`
+# Honour user overrides for $ACLOCAL and $AUTOMAKE, but without
+# adding extra options.
+ACLOCAL=$original_ACLOCAL
+AUTOMAKE=$original_AUTOMAKE
escape_dots () { sed 's/\./\\./g'; } # avoid issues with `\' in backquotes
apiversion_rx=`echo "$APIVERSION" | escape_dots`