+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.
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
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
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 '..'
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
:
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