+2010-08-10 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ Tweak and/or extend some `acloca*.test' tests.
+ * tests/aclocal8.test: Ensure verbose printing of captured
+ output.
+ * tests/aclocal.test: Likewise. Also, add trailing `:'
+ command.
+ * tests/acloca19.test: Likewise.
+ * tests/aclocal5.test: Add trailing `:' command, and prefer
+ `$me' over hard-coded test name.
+ * tests/aclocal6.test: Likewise.
+ * tests/aclocal18.test: Add trailing `:' command, and make
+ some grepping slighty stricter.
+ * tests/acloca14.test: Likewise. Also, prefer `diff' over
+ `cmp', and add some "cosmetic" blank lines.
+
2010-08-09 Stefano Lattarini <stefano.lattarini@gmail.com>
Tweak and extend tests `pr[!0-9]*.test'.
echo 'm4_include([a.m4])' > acinclude.m4
echo 'm4_include([b.m4])' > a.m4
+
cat >b.m4 <<EOF
m4_include([c.m4])
AC_DEFUN([AM_PROG_LIBTOOL],
AC_DEFUN([SOMETHING])
EOF
+
echo 'm4_include([d.m4])' > c.m4
echo 'AC_DEFUN([SOMETHING_ELSE])' >d.m4
cat >>c.m4 <<\EOF
AC_DEFUN([FOO], [ANOTHER_MACRO])
EOF
+
$MAKE
+
# Because c.m4 has changed, aclocal.m4 must have been rebuilt.
test `ls -1t aclocal.m4 stamp | sed 1q` = aclocal.m4
# However, since FOO is not used, f.m4 should not be included
# and the contents of aclocal.m4 should remain the same
-cmp aclocal.m4 stamp
-
+diff aclocal.m4 stamp
# If FOO where to be used, that would be another story, of course.
cat >>configure.in <<EOF
FOO
EOF
+
cp aclocal.m4 stamp
$sleep
+
$MAKE
-grep 'defs/f.m4' aclocal.m4
+
+$FGREP defs/f.m4 aclocal.m4
$MAKE testdist2
# Make sure aclocal diagnose missing included files with correct `file:line:'.
rm -f b.m4
$ACLOCAL 2>stderr && { cat stderr >&2; Exit 1; }
cat stderr >&2
-grep 'a.m4:1:.*b.m4.*does not exist' stderr
+grep 'a\.m4:1: .*b\.m4.*does not exist' stderr
+
+:
rm -f foo
$ACLOCAL --install 2>stderr && { cat stderr >&2; Exit 1; }
cat stderr >&2
-grep AM_MACRO2 stderr
+grep 'macro.*AM_MACRO2.*not found' stderr
ACLOCAL_TESTSUITE_FLAGS='-I 4 -I 1'
rm -f foo
cat stdout
grep '#serial 456' stdout
test ! -f 4/m1.m4
-grep 'installing.*4/m1.m4' stderr
+grep 'installing.*4/m1\.m4' stderr
+
+:
$ACLOCAL
$AUTOCONF
-./configure >stdout
+./configure >stdout || { cat stdout; Exit 1; }
cat stdout
grep GREPME stdout
grep 'aconfig\.ac' aclocal.m4 && Exit 1
grep 'bconfig\.ac' aclocal.m4 && Exit 1
grep with-grepme configure
+
+:
$ACLOCAL --output 2>stderr && { cat stderr >&2; Exit 1; }
cat stderr >&2
grep 'option.*--output.*an argument' stderr
-grep help stderr
+grep '[Tt]ry.*--help.*for more information' stderr
$ACLOCAL --unknown-option 2>stderr && { cat stderr >&2; Exit 1; }
cat stderr >&2
grep 'unrecognized.*--unknown-option' stderr
-grep help stderr
+grep '[Tt]ry.*--help.*for more information' stderr
$ACLOCAL --ver 2>stderr && { cat stderr >&2; Exit 1; }
cat stderr >&2
grep 'unrecognized.*--ver' stderr
-grep help stderr
+grep '[Tt]ry.*--help.*for more information' stderr
$ACLOCAL --versi
test "`$ACLOCAL --print-ac-dir`" = "$testaclocaldir"
+
+:
# Make sure configure dependencies are distributed.
$MAKE distdir
-test -f aclocal5-1.0/m4/moredefs.m4
+test -f $me-1.0/m4/moredefs.m4
# Change the definition of AM_TEST to check that its new definition is
# used. Check that AC_DEFUN_ONCE is caught.
$MAKE
grep 'm4/moredefs\.m4' aclocal.m4
grep '__GREPME__' configure
+
+:
# Make sure configure dependencies are distributed.
$MAKE distdir
-test -f aclocal6-1.0/m4/moredefs.m4
-test -f aclocal6-1.0/m4/somedefs.m4
-test -f aclocal6-1.0/acinclude.m4
+test -f $me-1.0/m4/moredefs.m4
+test -f $me-1.0/m4/somedefs.m4
+test -f $me-1.0/acinclude.m4
# Make sure maintainer-clean works in VPATH builds.
# (This is unrelated to the rest of this test.)
test ! -d ../autom4te.cache
test ! -f Makefile
test ! -f sub/Makefile
+
+:
echo 'AC_DEFUN([MACRO1],)' >m4/macro1.m4
echo 'AC_DEFUN([MACRO2], [AC_REQUIRE([AM_UNUSED_MACRO])])' >m4/macro2.m4
-$ACLOCAL -I m4 >output 2>&1
-cat output
+$ACLOCAL -I m4 >output 2>&1 || { cat output; Exit 1; }
test 0 = `wc -l <output`
grep macro1.m4 aclocal.m4
grep macro2.m4 aclocal.m4 && Exit 1
+
: