]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Tests defs: keep track of original $AUTOMAKE and $ACLOCAL values.
authorStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 22 Dec 2010 09:36:18 +0000 (10:36 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 22 Dec 2010 09:36:18 +0000 (10:36 +0100)
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.

ChangeLog
tests/defs-static.in
tests/help.test
tests/help2.test
tests/help3.test
tests/help4.test

index ad68203f27800a5b0f2a49ad5ccb7701cd6addca..378742e7fc050babad431270c35cc09b59abc757 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+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>
 
index 2ca4b57b958056831bdc7b6b68ed0213098e3680..c4ae75818233af48de8271478a632b9a7c2b8e27 100644 (file)
@@ -51,8 +51,16 @@ test -z "$AUTOCONF" && AUTOCONF="@am_AUTOCONF@"
 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
@@ -60,9 +68,15 @@ 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',
index dd8b3b45f804527666d67d85a058f0a31f0129e2..d8aa96f42bd68e08eba980841e432bce63a80e0b 100755 (executable)
@@ -25,9 +25,10 @@ set -e
 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
index 5212092a5554bd34ebc8e1a78c74f8068cf82bdc..384507f557bcf5fe3d4cd7dbd3a220243a0a8c33 100755 (executable)
@@ -24,9 +24,10 @@ set -e
 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
 
index 72399e3dc11072bafc7c21a159c91c29fdd2dd37..d3652ea2074bb89b70c3d295d38fcae852dbba4b 100755 (executable)
@@ -24,9 +24,10 @@ set -e
 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])
index c5eb31e62c3d6af2f98de452d42722f87430c7f3..ab377e6a8d8c4d8fbc0de290ecbdb8b011ba43b6 100755 (executable)
@@ -25,9 +25,10 @@ set -e
 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`