Another testsuite-tweaking patch. This time, the changes should be small and simple.
Regards, Stefano -*-*-*- Minor improvements for tests `acloca*.test'. * tests/acloca15.test: Add trailing `:' command. * tests/acloca21.test: Likewise. * tests/aclocal3.test: Likewise. * tests/aclocal.test: Likewise. Also, make grepping of aclocal's stderr stricter. * tests/acloca20.test: Add trailing `:' command. Prefer fgrep over grep where possible. * tests/acloca22.test: Likewise. * tests/aclocal7.test: Likewise. * tests/aclocal5.test: Likewise, and prefer $me over hard-coded test name. * tests/aclocal6.test: Likewise. * tests/acloca19.test: Add trailing `:' command. Prefer fgrep over grep where possible. Ensure verbose printing of make's captured stdout. * tests/aclocal8.test: Ensure verbose printing of make's captured stdout/stderr. Prefer fgrep over grep where possible. Normalize delimiters of here-documents. * tests/aclocal4.test: Add trailing `:' command. Normalize delimiters of here-documents. * tests/acloca17.test: Likewise. * tests/aclocal9.test: Likewise. Also, prefer fgrep over grep where possible. * tests/acloca10.test: Likewise. * tests/acloca11.test: Likewise. * tests/acloca12.test: Likewise. * tests/acloca13.test: Likewise. * tests/acloca23.test: Likewise. * tests/acloca18.test: Likewise. Also, make some grep regexps slighty stricter. * tests/acloca14.test: Likewise. Also, prefer `diff' over `cmp' and provide some cosmetic fixes in whitespaces. * tests/acloca16.test: Minor cosmetic fix in whitespaces. --- ChangeLog | 37 +++++++++++++++++++++++++++++++++++++ tests/acloca10.test | 42 ++++++++++++++++++++++-------------------- tests/acloca11.test | 12 +++++++----- tests/acloca12.test | 14 ++++++++------ tests/acloca13.test | 20 +++++++++++--------- tests/acloca14.test | 26 +++++++++++++++++--------- tests/acloca15.test | 4 +++- tests/acloca16.test | 3 ++- tests/acloca17.test | 12 +++++++----- tests/acloca18.test | 32 +++++++++++++++++--------------- tests/acloca19.test | 14 ++++++++------ tests/acloca20.test | 10 ++++++---- tests/acloca21.test | 4 +++- tests/acloca22.test | 18 +++++++++++++----- tests/acloca23.test | 4 ++-- tests/aclocal.test | 8 +++++--- tests/aclocal3.test | 2 ++ tests/aclocal4.test | 8 +++++--- tests/aclocal5.test | 14 ++++++++------ tests/aclocal6.test | 22 ++++++++++++---------- tests/aclocal7.test | 14 +++++++++----- tests/aclocal8.test | 13 +++++++------ tests/aclocal9.test | 16 +++++++++------- 23 files changed, 220 insertions(+), 129 deletions(-)
From a159e5b3ae8b6d94cf16c6e25563d28fec474b1e Mon Sep 17 00:00:00 2001 From: Stefano Lattarini <stefano.lattar...@gmail.com> Date: Mon, 21 Jun 2010 22:03:16 +0200 Subject: [PATCH] Minor improvements for tests `acloca*.test'. * tests/acloca15.test: Add trailing `:' command. * tests/acloca21.test: Likewise. * tests/aclocal3.test: Likewise. * tests/aclocal.test: Likewise. Also, make grepping of aclocal's stderr stricter. * tests/acloca20.test: Add trailing `:' command. Prefer fgrep over grep where possible. * tests/acloca22.test: Likewise. * tests/aclocal7.test: Likewise. * tests/aclocal5.test: Likewise, and prefer $me over hard-coded test name. * tests/aclocal6.test: Likewise. * tests/acloca19.test: Add trailing `:' command. Prefer fgrep over grep where possible. Ensure verbose printing of make's captured stdout. * tests/aclocal8.test: Ensure verbose printing of make's captured stdout/stderr. Prefer fgrep over grep where possible. Normalize delimiters of here-documents. * tests/aclocal4.test: Add trailing `:' command. Normalize delimiters of here-documents. * tests/acloca17.test: Likewise. * tests/aclocal9.test: Likewise. Also, prefer fgrep over grep where possible. * tests/acloca10.test: Likewise. * tests/acloca11.test: Likewise. * tests/acloca12.test: Likewise. * tests/acloca13.test: Likewise. * tests/acloca23.test: Likewise. * tests/acloca18.test: Likewise. Also, make some grep regexps slighty stricter. * tests/acloca14.test: Likewise. Also, prefer `diff' over `cmp' and provide some cosmetic fixes in whitespaces. * tests/acloca16.test: Minor cosmetic fix in whitespaces. --- ChangeLog | 37 +++++++++++++++++++++++++++++++++++++ tests/acloca10.test | 42 ++++++++++++++++++++++-------------------- tests/acloca11.test | 12 +++++++----- tests/acloca12.test | 14 ++++++++------ tests/acloca13.test | 20 +++++++++++--------- tests/acloca14.test | 26 +++++++++++++++++--------- tests/acloca15.test | 4 +++- tests/acloca16.test | 3 ++- tests/acloca17.test | 12 +++++++----- tests/acloca18.test | 32 +++++++++++++++++--------------- tests/acloca19.test | 14 ++++++++------ tests/acloca20.test | 10 ++++++---- tests/acloca21.test | 4 +++- tests/acloca22.test | 18 +++++++++++++----- tests/acloca23.test | 4 ++-- tests/aclocal.test | 8 +++++--- tests/aclocal3.test | 2 ++ tests/aclocal4.test | 8 +++++--- tests/aclocal5.test | 14 ++++++++------ tests/aclocal6.test | 22 ++++++++++++---------- tests/aclocal7.test | 14 +++++++++----- tests/aclocal8.test | 13 +++++++------ tests/aclocal9.test | 16 +++++++++------- 23 files changed, 220 insertions(+), 129 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4366381..25ad852 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,40 @@ +2010-06-27 Stefano Lattarini <stefano.lattar...@gmail.com> + + Minor improvements for tests `acloca*.test'. + * tests/acloca15.test: Add trailing `:' command. + * tests/acloca21.test: Likewise. + * tests/aclocal3.test: Likewise. + * tests/aclocal.test: Likewise. Also, make grepping of aclocal's + stderr stricter. + * tests/acloca20.test: Add trailing `:' command. Prefer fgrep + over grep where possible. + * tests/acloca22.test: Likewise. + * tests/aclocal7.test: Likewise. + * tests/aclocal5.test: Likewise, and prefer $me over hard-coded + test name. + * tests/aclocal6.test: Likewise. + * tests/acloca19.test: Add trailing `:' command. Prefer fgrep + over grep where possible. Ensure verbose printing of make's + captured stdout. + * tests/aclocal8.test: Ensure verbose printing of make's captured + stdout/stderr. Prefer fgrep over grep where possible. Normalize + delimiters of here-documents. + * tests/aclocal4.test: Add trailing `:' command. Normalize + delimiters of here-documents. + * tests/acloca17.test: Likewise. + * tests/aclocal9.test: Likewise. Also, prefer fgrep over grep + where possible. + * tests/acloca10.test: Likewise. + * tests/acloca11.test: Likewise. + * tests/acloca12.test: Likewise. + * tests/acloca13.test: Likewise. + * tests/acloca23.test: Likewise. + * tests/acloca18.test: Likewise. Also, make some grep regexps + slighty stricter. + * tests/acloca14.test: Likewise. Also, prefer `diff' over `cmp' + and provide some cosmetic fixes in whitespaces. + * tests/acloca16.test: Minor cosmetic fix in whitespaces. + 2010-06-26 Ralf Wildenhues <ralf.wildenh...@gmx.de> Update program --help output to match current GCS. diff --git a/tests/acloca10.test b/tests/acloca10.test index 7716f2a..9ad46a2 100755 --- a/tests/acloca10.test +++ b/tests/acloca10.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2003, 2005, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -24,11 +24,11 @@ set -e -cat >> configure.in << 'END' +cat >> configure.in <<EOF MACRO2 MACRO1 MACRO3 -END +EOF mkdir m4_1 m4_2 dirlist-test @@ -48,20 +48,20 @@ EOF $ACLOCAL -I m4_1 -I m4_2 $AUTOCONF ./configure -grep macro11 foo -grep macro21 foo -grep macro3 foo -grep MACRO3 aclocal.m4 +$FGREP macro11 foo +$FGREP macro21 foo +$FGREP macro3 foo +$FGREP MACRO3 aclocal.m4 test ! -f m4_1/macro.m4 test ! -f m4_2/macro.m4 $ACLOCAL -I m4_2 -I m4_1 $AUTOCONF ./configure -grep macro12 foo -grep macro21 foo -grep macro3 foo -grep MACRO3 aclocal.m4 +$FGREP macro12 foo +$FGREP macro21 foo +$FGREP macro3 foo +$FGREP MACRO3 aclocal.m4 test ! -f m4_1/macro.m4 test ! -f m4_2/macro.m4 @@ -69,10 +69,10 @@ ACLOCAL_TESTSUITE_FLAGS='-I m4_1 -I m4_2' $ACLOCAL --install $AUTOCONF ./configure -grep macro11 foo -grep macro21 foo -grep macro3 foo -grep MACRO3 aclocal.m4 && Exit 1 +$FGREP macro11 foo +$FGREP macro21 foo +$FGREP macro3 foo +$FGREP MACRO3 aclocal.m4 && Exit 1 test -f m4_1/macro.m4 test ! -f m4_2/macro.m4 cp aclocal.m4 copy.m4 @@ -81,11 +81,13 @@ echo '#GREPME' >>dirlist-test/macro.m4 $ACLOCAL --install $AUTOCONF ./configure -grep macro11 foo -grep macro21 foo -grep macro3 foo -grep MACRO3 aclocal.m4 && Exit 1 -grep GREPME m4_1/macro.m4 && Exit 1 +$FGREP macro11 foo +$FGREP macro21 foo +$FGREP macro3 foo +$FGREP MACRO3 aclocal.m4 && Exit 1 +$FGREP GREPME m4_1/macro.m4 && Exit 1 test -f m4_1/macro.m4 test ! -f m4_2/macro.m4 diff aclocal.m4 copy.m4 + +: diff --git a/tests/acloca11.test b/tests/acloca11.test index 61e9e8a..cb16132 100755 --- a/tests/acloca11.test +++ b/tests/acloca11.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2003 Free Software Foundation, Inc. +# Copyright (C) 2003, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,10 +21,10 @@ set -e -cat >> configure.in << 'END' +cat >> configure.in <<EOF MACRO2 MACRO1 -END +EOF mkdir m4 @@ -40,5 +40,7 @@ EOF $ACLOCAL -I m4 $AUTOCONF ./configure -grep macro12 foo -grep macro21 foo +$FGREP macro12 foo +$FGREP macro21 foo + +: diff --git a/tests/acloca12.test b/tests/acloca12.test index 14d699a..9fedfba 100755 --- a/tests/acloca12.test +++ b/tests/acloca12.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2003 Free Software Foundation, Inc. +# Copyright (C) 2003, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -22,9 +22,9 @@ set -e -cat >> configure.in << 'END' +cat >> configure.in <<EOF MACRO1 -END +EOF mkdir m4 @@ -40,6 +40,8 @@ EOF $ACLOCAL --verbose -I m4 $AUTOCONF ./configure -grep macro11 foo && Exit 1 -grep macro21 foo && Exit 1 -grep macro12 foo +$FGREP macro11 foo && Exit 1 +$FGREP macro21 foo && Exit 1 +$FGREP macro12 foo + +: diff --git a/tests/acloca13.test b/tests/acloca13.test index 56a54eb..23fbb2e 100755 --- a/tests/acloca13.test +++ b/tests/acloca13.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2003, 2005, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,10 +20,10 @@ set -e -cat >> configure.in << 'END' +cat >> configure.in <<'EOF' m4_include([somefile.m4]) AC_OUTPUT -END +EOF cat >Makefile.am <<'EOF' check-local: @@ -37,26 +37,26 @@ mkdir m4 echo MACRO1 >somefile.m4 echo 'AC_PREREQ([2.58])' >m4/otherfile.m4 -cat >m4/version1.m4 <<EOF +cat >m4/version1.m4 <<'EOF' AC_DEFUN([MACRO1]) AC_DEFUN([MACRO2]) m4_sinclude(m4/otherfile.m4) EOF -cat >m4/version2.m4 <<EOF +cat >m4/version2.m4 <<'EOF' AC_DEFUN([MACRO1]) EOF $ACLOCAL -I m4 -grep version2 aclocal.m4 -grep version1 aclocal.m4 && Exit 1 +$FGREP version2 aclocal.m4 +$FGREP version1 aclocal.m4 && Exit 1 $sleep echo MACRO2 >somefile.m4 $ACLOCAL -I m4 -grep version2 aclocal.m4 && Exit 1 -grep version1 aclocal.m4 +$FGREP version2 aclocal.m4 && Exit 1 +$FGREP version1 aclocal.m4 $sleep # aclocal.m4 should change if we touch otherfile.m4 @@ -69,3 +69,5 @@ $AUTOCONF $AUTOMAKE ./configure $MAKE distcheck + +: diff --git a/tests/acloca14.test b/tests/acloca14.test index a4e86d7..1018089 100755 --- a/tests/acloca14.test +++ b/tests/acloca14.test @@ -22,13 +22,14 @@ required=GNUmake set -e -cat >> configure.in << 'END' +cat >> configure.in <<'EOF' AM_PROG_LIBTOOL AC_OUTPUT -END +EOF 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], @@ -38,6 +39,7 @@ AC_REQUIRE([SOMETHING_ELSE])dnl AC_DEFUN([SOMETHING]) EOF + echo 'm4_include([d.m4])' > c.m4 echo 'AC_DEFUN([SOMETHING_ELSE])' >d.m4 @@ -45,7 +47,7 @@ mkdir defs echo 'AC_DEFUN([SOMETHING_ELSE])' >defs/e.m4 echo 'AC_DEFUN([ANOTHER_MACRO])' >defs/f.m4 -cat >>Makefile.am<<\EOF +cat >>Makefile.am<<'EOF' ACLOCAL_AMFLAGS = -I defs testdist1: distdir test -f $(distdir)/acinclude.m4 @@ -85,29 +87,35 @@ $MAKE testdist1 cp aclocal.m4 stamp $sleep -cat >>c.m4 <<\EOF +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 +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 + +: diff --git a/tests/acloca15.test b/tests/acloca15.test index dd612ec..dc0420c 100755 --- a/tests/acloca15.test +++ b/tests/acloca15.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2004 Free Software Foundation, Inc. +# Copyright (C) 2004, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -43,3 +43,5 @@ $FGREP AM_SOME_MACRO aclocal.m4 && Exit 1 $FGREP AM_MORE_MACRO aclocal.m4 && Exit 1 $FGREP 'm4_include([m4/more.m4])' aclocal.m4 test 1 = `grep m4_include aclocal.m4 | wc -l` + +: diff --git a/tests/acloca16.test b/tests/acloca16.test index 93bde8b..334f463 100755 --- a/tests/acloca16.test +++ b/tests/acloca16.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2004 Free Software Foundation, Inc. +# Copyright (C) 2004, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -33,4 +33,5 @@ EOF $ACLOCAL -I m4 grep m4/some.m4 aclocal.m4 && Exit 1 + : diff --git a/tests/acloca17.test b/tests/acloca17.test index 884f24b..69e602a 100755 --- a/tests/acloca17.test +++ b/tests/acloca17.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2004, 2008 Free Software Foundation, Inc. +# Copyright (C) 2004, 2008, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,12 +20,12 @@ set -e -cat >> configure.in << 'END' +cat >> configure.in <<'EOF' SOME_DEFS -END +EOF mkdir m4 -cat >m4/somedefs.m4 <<EOF +cat >m4/somedefs.m4 <<'EOF' AC_DEFUN([SOME_DEFS], [ AC_REQUIRE([UNDEFINED_MACRO]) ]) @@ -36,4 +36,6 @@ EOF WARNINGS=error $ACLOCAL -I m4 2>stderr && { cat stderr >&2; Exit 1; } cat stderr >&2 -grep 'configure.in:4:.*UNDEFINED_MACRO' stderr +grep 'configure\.in:4:.*UNDEFINED_MACRO' stderr + +: diff --git a/tests/acloca18.test b/tests/acloca18.test index dbd0bfb..faa686d 100755 --- a/tests/acloca18.test +++ b/tests/acloca18.test @@ -20,10 +20,10 @@ set -e -cat >> configure.in << 'END' +cat >> configure.in <<EOF AM_MACRO1 AM_MACRO2 -END +EOF mkdir 1 2 3 4 5 6 @@ -70,44 +70,44 @@ ACLOCAL_TESTSUITE_FLAGS='-I 1 -I 2 -I 3 -I 4' $ACLOCAL $AUTOCONF ./configure -grep macro11 foo -grep macro21 foo +$FGREP macro11 foo +$FGREP macro21 foo rm -f foo $ACLOCAL --install $AUTOCONF ./configure -grep macro12 foo -grep macro23 foo +$FGREP macro12 foo +$FGREP macro23 foo ACLOCAL_TESTSUITE_FLAGS='-I 4 -I 1 -I 2 -I 3' rm -f foo $ACLOCAL --install --dry-run $AUTOCONF ./configure -grep macro12 foo -grep macro23 foo +$FGREP macro12 foo +$FGREP macro23 foo rm -f foo $ACLOCAL --install $AUTOCONF ./configure -grep macro14 foo -grep macro23 foo +$FGREP macro14 foo +$FGREP macro23 foo ACLOCAL_TESTSUITE_FLAGS='-I 4 -I 1 -I 2' 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 $ACLOCAL --install $AUTOCONF ./configure -grep macro14 foo -grep macro21 foo +$FGREP macro14 foo +$FGREP macro21 foo mkdir dirlist-test @@ -126,10 +126,12 @@ cat stderr >&2 cat stdout grep '#serial 456' stdout test ! -f 4/m1.m4 -grep 'installing.*4/m1.m4' stderr +grep 'installing.*4/m1\.m4' stderr $ACLOCAL -I 5 2>stderr && { cat stderr >&2; Exit 1; } -test `grep -c 'ill-formed serial' stderr` -eq 3 +test `$FGREP -c 'ill-formed serial' stderr` -eq 3 $ACLOCAL -I 6 2>stderr && { cat stderr >&2; Exit 1; } grep 'serial.*before any macro definition' stderr + +: diff --git a/tests/acloca19.test b/tests/acloca19.test index accad81..8b4e263 100755 --- a/tests/acloca19.test +++ b/tests/acloca19.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2005 Free Software Foundation, Inc. +# Copyright (C) 2005, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -41,9 +41,11 @@ END $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 +$FGREP GREPME stdout +$FGREP aconfig.ac aclocal.m4 && Exit 1 +$FGREP bconfig.ac aclocal.m4 && Exit 1 +$FGREP with-grepme configure + +: diff --git a/tests/acloca20.test b/tests/acloca20.test index 6408bef..661ecde 100755 --- a/tests/acloca20.test +++ b/tests/acloca20.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -39,7 +39,7 @@ END $AUTOCONF ./configure ./doit -grep 'wrong foo' aclocal.m4 +$FGREP 'wrong foo' aclocal.m4 cat >acinclude.m4 <<'END' m4_define([FOO], [echo right foo]) @@ -49,5 +49,7 @@ mv -f configure.int configure.in $ACLOCAL $AUTOCONF --force -./configure | grep 'right foo' -grep 'wrong foo' foo.m4 +./configure | $FGREP 'right foo' +$FGREP 'wrong foo' foo.m4 + +: diff --git a/tests/acloca21.test b/tests/acloca21.test index 7b66279..4da39ca 100755 --- a/tests/acloca21.test +++ b/tests/acloca21.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2006 Free Software Foundation, Inc. +# Copyright (C) 2006, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -30,3 +30,5 @@ dnl m4_include(__some_really_bogus_nonexistent_file__.m4) echo 'include(foobar)' is OK EOF $ACLOCAL + +: diff --git a/tests/acloca22.test b/tests/acloca22.test index 913e4d9..07690c0 100755 --- a/tests/acloca22.test +++ b/tests/acloca22.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2007 Free Software Foundation, Inc. +# Copyright (C) 2007, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -25,25 +25,33 @@ cat >>configure.in <<EOF FOO AC_OUTPUT EOF + cat >foo.m4 <<EOF AC_DEFUN([FOO], [AC_SUBST([GREPFOO])]) EOF + cat >bar.m4 <<EOF AC_DEFUN([BAR], [AC_SUBST([GREPBAR])]) EOF + cat >Makefile.am <<EOF ACLOCAL_AMFLAGS = -I . EOF + $ACLOCAL -I . $AUTOMAKE $AUTOCONF + ./configure $MAKE -grep GREPFOO Makefile -grep GREPBAR Makefile && Exit 1 +$FGREP GREPFOO Makefile +$FGREP GREPBAR Makefile && Exit 1 + sed 's/FOO/BAR/' < configure.in > t mv -f t configure.in rm -f foo.m4 $MAKE -grep GREPFOO Makefile && Exit 1 -grep GREPBAR Makefile +$FGREP GREPFOO Makefile && Exit 1 +$FGREP GREPBAR Makefile + +: diff --git a/tests/acloca23.test b/tests/acloca23.test index 1741e70..186fce7 100755 --- a/tests/acloca23.test +++ b/tests/acloca23.test @@ -25,9 +25,9 @@ FOO END mkdir m4 -cat >m4/foo.m4 <<EOF +cat >m4/foo.m4 << 'END' AC_DEFUN(FOO, [echo foo]) -EOF +END $ACLOCAL -I m4 2>stderr && { cat stderr >&2; Exit 1; } cat stderr >&2 diff --git a/tests/aclocal.test b/tests/aclocal.test index d3437d2..fda0810 100755 --- a/tests/aclocal.test +++ b/tests/aclocal.test @@ -27,18 +27,20 @@ test -f fred $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" + +: diff --git a/tests/aclocal3.test b/tests/aclocal3.test index a6aee0f..9c8b38d 100755 --- a/tests/aclocal3.test +++ b/tests/aclocal3.test @@ -32,3 +32,5 @@ END $ACLOCAL -I macros 2>stderr && { cat stderr >&2; Exit 1; } cat stderr grep 'macros/gnome.m4:2:.*AM_PATH_GTK.*not found' stderr + +: diff --git a/tests/aclocal4.test b/tests/aclocal4.test index 9fa96ec..8fb69a6 100755 --- a/tests/aclocal4.test +++ b/tests/aclocal4.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2003 Free Software Foundation, Inc. +# Copyright (C) 2003, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -23,7 +23,7 @@ required=GNUmake set -e -cat >>configure.in <<EOF +cat >>configure.in <<'EOF' AC_PROG_RANLIB AC_PROG_CC MY_MACRO @@ -32,7 +32,7 @@ AC_OUTPUT EOF mkdir m4 -cat >m4/mymacro.m4 <<EOF +cat >m4/mymacro.m4 <<'EOF' AC_DEFUN([MY_MACRO], []) EOF @@ -73,3 +73,5 @@ AC_DEFUN([MY_MACRO], [AC_LIBOBJ([foo])]) EOF $MAKE check-foo + +: diff --git a/tests/aclocal5.test b/tests/aclocal5.test index 5cd8231..bbb1759 100755 --- a/tests/aclocal5.test +++ b/tests/aclocal5.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2005, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -55,16 +55,18 @@ echo 'AU_ALIAS([AM_TEST], [AC_SUBST])' > m4/moredefs.m4 cd sub $MAKE cd .. -grep GREPME Makefile -grep GREPME sub/Makefile +$FGREP GREPME Makefile +$FGREP GREPME sub/Makefile # 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. echo 'AC_DEFUN_ONCE([AM_TEST], [AC_SUBST(__$1__)])' > m4/moredefs.m4 $MAKE -grep 'm4/moredefs\.m4' aclocal.m4 -grep '__GREPME__' configure +$FGREP 'm4/moredefs.m4' aclocal.m4 +$FGREP '__GREPME__' configure + +: diff --git a/tests/aclocal6.test b/tests/aclocal6.test index 266d64b..9be2cc9 100755 --- a/tests/aclocal6.test +++ b/tests/aclocal6.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2003 Free Software Foundation, Inc. +# Copyright (C) 2003, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -66,18 +66,18 @@ echo 'AC_SUBST([METOO])' > ../acinclude.m4 cd sub $MAKE cd .. -grep GREPME Makefile -grep GREPME sub/Makefile -grep GREPME sub/Makefile -grep METOO Makefile -grep METOO sub/Makefile -grep METOO sub/Makefile +$FGREP GREPME Makefile +$FGREP GREPME sub/Makefile +$FGREP GREPME sub/Makefile +$FGREP METOO Makefile +$FGREP METOO sub/Makefile +$FGREP METOO sub/Makefile # 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.) @@ -89,3 +89,5 @@ $MAKE maintainer-clean test ! -d ../autom4te.cache test ! -f Makefile test ! -f sub/Makefile + +: diff --git a/tests/aclocal7.test b/tests/aclocal7.test index e123a3f..baf9795 100755 --- a/tests/aclocal7.test +++ b/tests/aclocal7.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2003, 2006 Free Software Foundation, Inc. +# Copyright (C) 2003, 2006, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,7 +15,8 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # Make sure aclocal does not overwrite aclocal.m4 needlessly. -# Also make sure automake --no-force does not overwrite Makefile.in needlessly. +# Also make sure automake --no-force does not overwrite Makefile.in +# needlessly. . ./defs || Exit 1 @@ -77,7 +78,8 @@ $ACLOCAL -I m4 $sleep $AUTOMAKE --no-force -# aclocal.m4 should have been updated, although its contents haven't changed. +# aclocal.m4 should have been updated, although its contents haven't +# changed. test `ls -1t aclocal.m4 foo | sed 1q` = aclocal.m4 test `ls -1t Makefile.in foo | sed 1q` = Makefile.in test `ls -1t sub/Makefile.in foo | sed 1q` = sub/Makefile.in @@ -93,7 +95,7 @@ test `ls -1t aclocal.m4 foo | sed 1q` = foo test `ls -1t Makefile.in foo | sed 1q` = Makefile.in test `ls -1t sub/Makefile.in foo | sed 1q` = foo -grep README Makefile.in && Exit 1 +$FGREP README Makefile.in && Exit 1 : > README $sleep @@ -104,7 +106,7 @@ $AUTOMAKE --no-force test `ls -1t Makefile.in foo | sed 1q` = Makefile.in test `ls -1t sub/Makefile.in foo | sed 1q` = foo -grep README Makefile.in +$FGREP README Makefile.in : > sub/Makefile.in $sleep @@ -116,3 +118,5 @@ $AUTOMAKE --no-force test `ls -1t aclocal.m4 foo | sed 1q` = foo test `ls -1t Makefile.in foo | sed 1q` = foo test `ls -1t sub/Makefile.in foo | sed 1q` = sub/Makefile.in + +: diff --git a/tests/aclocal8.test b/tests/aclocal8.test index ac10aff..acc694e 100755 --- a/tests/aclocal8.test +++ b/tests/aclocal8.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2003, 2004 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -25,18 +25,19 @@ SOME_DEFS END mkdir m4 -cat >m4/somedefs.m4 <<EOF +cat >m4/somedefs.m4 << 'END' AC_DEFUN([SOME_DEFS], [ m4_if([a], [a], [MACRO1], [MACRO2]) ]) -EOF +END 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 +$ACLOCAL -I m4 >output 2>&1 || { cat output; Exit 1; } cat output test 0 = `wc -l <output` -grep macro1.m4 aclocal.m4 -grep macro2.m4 aclocal.m4 && Exit 1 +$FGREP macro1.m4 aclocal.m4 +$FGREP macro2.m4 aclocal.m4 && Exit 1 + : diff --git a/tests/aclocal9.test b/tests/aclocal9.test index 325f6ae..fcc1572 100755 --- a/tests/aclocal9.test +++ b/tests/aclocal9.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2003 Free Software Foundation, Inc. +# Copyright (C) 2003, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,10 +20,10 @@ set -e -cat >> configure.in << 'END' +cat >> configure.in <<EOF MACRO1 MACRO2 -END +EOF mkdir m4_1 m4_2 @@ -39,11 +39,13 @@ EOF $ACLOCAL -I m4_1 -I m4_2 $AUTOCONF ./configure -grep macro11 foo -grep macro21 foo +$FGREP macro11 foo +$FGREP macro21 foo $ACLOCAL -I m4_2 -I m4_1 $AUTOCONF ./configure -grep macro12 foo -grep macro21 foo +$FGREP macro12 foo +$FGREP macro21 foo + +: -- 1.6.5