Improve tests `help*.test' (also fixes maintcheck failures).
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 2 Oct 2010 17:33:44 +0000 (19:33 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 3 Oct 2010 21:11:29 +0000 (23:11 +0200)
* tests/help.test: To run automake, use `$AUTOMAKE' with all `-W'
flags stripped away rather than hard-coded `automake-$APIVERSION',
to better honour user-overrides.  Similarly for aclocal.
* tests/help2.test: Likewise.
* tests/help3.test: Likewise.
* tests/help4.test: Likewise.

From a suggestion by Ralf Wildenhues.

ChangeLog
tests/help.test
tests/help2.test
tests/help3.test
tests/help4.test

index 2090381..06a6e47 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2010-10-03  Stefano Lattarini  <stefano.lattarini@gmail.com>
+           Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Improve tests `help*.test' (also fixes maintcheck failures).
+       * tests/help.test: To run automake, use `$AUTOMAKE' with all `-W'
+       flags stripped away rather than hard-coded `automake-$APIVERSION',
+       to better honour user-overrides.  Similarly for aclocal.
+       * tests/help2.test: Likewise.
+       * tests/help3.test: Likewise.
+       * tests/help4.test: Likewise.
+
 2010-10-03  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        Document and fix expansion of variables before rules.
index ddeb92f..012e1d7 100755 (executable)
@@ -25,18 +25,22 @@ set -e
 mkdir emptydir
 cd emptydir
 
-aclocal-$APIVERSION --version
-aclocal-$APIVERSION --help
-automake-$APIVERSION --version
-automake-$APIVERSION --help
+# Honour user overrides for $ACLOCAL and $AUTOMAKE.
+ACLOCAL=`echo " $ACLOCAL " | sed 's/ -W[^ ]* / /g'`
+AUTOMAKE=`echo " $AUTOMAKE " | sed 's/ -W[^ ]* / /g'`
+
+$ACLOCAL --version
+$ACLOCAL --help
+$AUTOMAKE --version
+$AUTOMAKE --help
 
 # Sanity checks: aclocal and automake cannot work without configure.ac
 # or configure.in.
-aclocal-$APIVERSION 2>stderr && { cat stderr >&2; Exit 1; }
+$ACLOCAL 2>stderr && { cat stderr >&2; Exit 1; }
 cat stderr >&2
 $FGREP configure.ac stderr
 $FGREP configure.in stderr
-automake-$APIVERSION 2>stderr && { cat stderr >&2; Exit 1; }
+$AUTOMAKE 2>stderr && { cat stderr >&2; Exit 1; }
 cat stderr >&2
 $FGREP configure.ac stderr
 $FGREP configure.in stderr
index 014f187..7a05aca 100755 (executable)
@@ -24,16 +24,20 @@ 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'`
+
 echo '[' > configure.in
 
-automake-$APIVERSION --version
-automake-$APIVERSION --help
+$AUTOMAKE --version
+$AUTOMAKE --help
 
 # aclocal and automake cannot work without configure.ac or configure.in
-aclocal-$APIVERSION 2>stderr && { cat stderr >&2; Exit 1; }
+$ACLOCAL 2>stderr && { cat stderr >&2; Exit 1; }
 cat stderr >&2
 $FGREP configure.in stderr
-automake-$APIVERSION 2>stderr && { cat stderr >&2; Exit 1; }
+$AUTOMAKE 2>stderr && { cat stderr >&2; Exit 1; }
 cat stderr >&2
 $FGREP configure.in stderr
 
index 8e9e76f..04a07d6 100755 (executable)
@@ -24,6 +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'`
+
 cat > configure.in <<END
 AC_INIT([$me], [1.0])
 AC_CONFIG_AUX_DIR([.]) dnl prevent automake from looking into '..'
@@ -36,22 +40,22 @@ cat > Makefile.am <<END
 pkgdata_DATA =
 END
 
-aclocal-$APIVERSION --force --help --output=foo.m4
+$ACLOCAL --force --help --output=foo.m4
 test ! -r foo.m4
-aclocal-$APIVERSION --output=foo.m4 --version --force
+$ACLOCAL --output=foo.m4 --version --force
 test ! -r foo.m4
 # Sanity check.
-aclocal-$APIVERSION --output=foo.m4 --force
+$ACLOCAL --output=foo.m4 --force
 test -f foo.m4
 
 mv -f foo.m4 aclocal.m4 # automake will need aclocal.m4
 
-automake-$APIVERSION --add-missing --help --copy
+$AUTOMAKE --add-missing --help --copy
 test ! -r install-sh
-automake-$APIVERSION --copy --version --add-mising
+$AUTOMAKE --copy --version --add-mising
 test ! -r install-sh
 # Sanity check.
-automake-$APIVERSION --add-missing --copy
+$AUTOMAKE --add-missing --copy
 test -f install-sh
 
 :
index 906e508..117a073 100755 (executable)
@@ -25,25 +25,29 @@ 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'`
+
 escape_dots () { sed 's/\./\\./g'; } # avoid issues with `\' in backquotes
 apiversion_rx=`echo "$APIVERSION" | escape_dots`
 
-aclocal-$APIVERSION --version --help >stdout || { cat stdout; Exit 1; }
+$ACLOCAL --version --help >stdout || { cat stdout; Exit 1; }
 cat stdout
 grep "^aclocal.*$apiversion_rx" stdout
 grep "^Usage" stdout && Exit 1
 
-aclocal-$APIVERSION --help --version >stdout || { cat stdout; Exit 1; }
+$ACLOCAL --help --version >stdout || { cat stdout; Exit 1; }
 cat stdout
 grep "^Usage" stdout
 grep "^aclocal.*$apiversion_rx" stdout && Exit 1
 
-automake-$APIVERSION --version --help >stdout || { cat stdout; Exit 1; }
+$AUTOMAKE --version --help >stdout || { cat stdout; Exit 1; }
 cat stdout
 grep "^automake.*$apiversion_rx" stdout
 grep "^Usage" stdout && Exit 1
 
-automake-$APIVERSION --help --version >stdout || { cat stdout; Exit 1; }
+$AUTOMAKE --help --version >stdout || { cat stdout; Exit 1; }
 cat stdout
 grep "^Usage" stdout
 grep "^automake.*$apiversion_rx" stdout && Exit 1