automake-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-commit] [SCM] GNU Automake branch, testsuite-work, updated. v1


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, testsuite-work, updated. v1.11-873-g02742f0
Date: Thu, 26 May 2011 20:45:42 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=02742f0f6ee02cec94a033a446b4a36d90859aca

The branch, testsuite-work has been updated
       via  02742f0f6ee02cec94a033a446b4a36d90859aca (commit)
       via  fc5ac9a1e1573fa286da745491daaf373271578f (commit)
       via  eb147a19783b1cee960502697124e68e4c109df5 (commit)
      from  47fc204c850dd547d8d8dd28bdc07074d9179626 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 02742f0f6ee02cec94a033a446b4a36d90859aca
Author: Stefano Lattarini <address@hidden>
Date:   Thu May 26 22:28:45 2011 +0200

    tests: split 'subst2.test' to improve modularity and coverage
    
    * tests/subst2.test: Test removed, split into ...
    * tests/programs-primary-rewritten.test: ... this test ...
    * tests/subst-no-trailing-empty-line.test: ... and this one ...
    * tests/extra-programs-empty.test: ... and this one.
    * tests/Makefile.am (TESTS): Update.

commit fc5ac9a1e1573fa286da745491daaf373271578f
Author: Stefano Lattarini <address@hidden>
Date:   Thu May 26 15:42:02 2011 +0200

    tests: tweak and improve tests on Automake conditionals
    
    The "avoid the requirement of a working compiler" we refer about
    below is obtained by disabling automatic dependency tracking and
    defining `CC' (and `EXEEXT', `OBJEXT', `CXX', etc., if needed) to
    dummy values, either directly in the `Makefile.am', or by AC_SUBST
    in `configure.in'.
    
    The "cosmetic changes" we refer about below consists in, e.g.,
    adding a trailing `:' command to a script, using proper m4 quoting
    in `configure.in' files, adding commands that offer more debugging
    output, explicitly declaring phony targets as such in Makefiles,
    making use of idioms more consistent with those employed in other
    tests, following the GNU formatting standards more closely, etc.
    
    * tests/cond.test: Cosmetic changes.
    * tests/cond3.test: Likewise.
    * tests/cond10.test: Likewise.
    * tests/cond14.test: Likewise.
    * tests/cond15.test: Likewise.
    * tests/cond17.test: Likewise.
    * tests/cond40.test: Likewise.
    * tests/cond13.test: Likewise, and make grepping of the generated
    `Makefile.in' slightly stricter.
    * tests/cond6.test: Extend by also running ./configure, make and
    "make install".  Few cosmetic changes.
    * tests/cond8.test: Likewise.
    * tests/cond2.test: Do few cosmetic changes.  Make grepping of
    automake stderr stricter.
    * tests/cond20.test: Likewise.
    * tests/cond23.test: Likewise.
    * tests/cond24.test: Likewise.
    * tests/cond42.test: Likewise.
    * tests/cond46.test: Likewise.
    * tests/cond9.test: Move more checks in the `Makefile.am' instead
    of grepping make's output.
    * tests/cond38.test: Likewise.
    * tests/cond11.test: Likewise.  Avoid the requirement of a working
    C compiler.
    * tests/cond16.test: Likewise.
    * tests/cond22.test: Likewise.
    * tests/cond30.test: Likewise.
    * tests/cond31.test: Likewise.
    * tests/cond4.test: Likewise, and drop the now-useless GNU make
    requirement as well.
    * tests/cond18.test: Likewise.
    * tests/cond19.test: Likewise.
    * tests/cond22.test: Likewise.
    * tests/cond25.test: Add trailing `:' command.
    * tests/cond26.test: Likewise.
    * tests/cond27.test: Likewise.
    * tests/cond28.test: Likewise.
    * tests/cond29.test: Use `unindent' function for better formatting.
    Other minor cosmetic changes.  Use a `timeout' program (if it's
    available) to determine whether the script takes too long, instead
    of just hoping that the user will notice an abnormally long test
    execution time.
    * tests/cond33.test: Extend a bit.  Fix heading comments.  Few more
    cosmetic changes.
    * tests/cond37.test: Ensure verbose printing of captured make
    output.  Minor cosmetic changes.
    * tests/cond34.test: Likewise.  Avoid the requirement of a working
    C compiler.  Make grepping of make output slightly stricter.
    * tests/cond35.test: Quote literal dots in grep regexp.  Add extra
    debugging output.  Minor cosmetic changes.
    * tests/cond36.test: Likewise.
    * tests/cond41.test: Do not simply check that aclocal fails, but
    also grep its stderr for the expected error message.
    * tests/cond43.test: Likewise (but the program being automake).
    Few cosmetic changes.
    * tests/condd.test: Avoid the requirement of a working C compiler.
    * tests/condman3.test: Extend by using more man pages and more
    manpage sections.
    * tests/condman.test: Removed, it's completely superseded by
    `condman3.test'.
    * tests/Makefile.am (TESTS): Update.

commit eb147a19783b1cee960502697124e68e4c109df5
Author: Stefano Lattarini <address@hidden>
Date:   Wed May 25 19:05:15 2011 +0200

    lex tests: avoid spurious failures when LEXLIB isn't found
    
    The AC_PROG_LEX Autoconf macro does not diagnose a failure to find
    the "lex library" expected to provide a `yywrap' function (function
    which is required to link most lex-generated programs).  On the
    contrary, when all the link attempts (i.e., with `-ll' and `-lfl')
    fail, configure declares that no lex library is needed, and simply
    proceeds with the configuration process -- only for the build to
    possibly fail later, at make time.
    
    This behaviour might be (partly) intended; the Autoconf manual
    reads:
     ``You are encouraged to use Flex in your sources, since it is
       both more pleasant to use than plain Lex and the C source
       it produces is portable.  In order to ensure portability,
       however, you must either provide a function `yywrap' or, if
       you don't use it (e.g., your scanner has no `#include'-like
       feature), simply include a `%noyywrap' statement in the
       scanner's source.''
    
    This AC_PROG_LEX behaviour is causing some spurious failures of the
    Automake testsuite in environments which lack a proper library
    providing `yywrap' (this happens for example in     Linux->MinGW cross
    compilations).  But at this point is clear that a proper workaround
    is to simply provide a fall-back implementation of `yywrap' in our
    lexers.
    
    * tests/cond35.test: Provide a dummy `yywrap' function.
    * tests/lex3.test: Likewise.
    * tests/lexvpath.test: Likewise.
    * tests/silent-many-gcc.test: Likewise.
    * tests/silent-many-generic.test: Likewise.
    * tests/silent-lex-gcc.test: Likewise, and a dummy `main' too.
    * tests/silent-lex-generic.test: Likewise.
    * tests/lex-lib.test: New test.
    * tests/lex-libobj.test: New test.
    * tests/lex-nowrap.test: New test.
    * tests/Makefile.am (TESTS): Update.
    * THANKS: Update.
    
    Thanks to Russ Allbery for the suggestion.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                          |  124 ++++++++++++++++++++
 THANKS                                             |    1 +
 tests/Makefile.am                                  |    8 +-
 tests/Makefile.in                                  |    8 +-
 tests/cond.test                                    |    4 +-
 tests/cond10.test                                  |    6 +-
 tests/cond11.test                                  |   23 ++--
 tests/cond13.test                                  |    8 +-
 tests/cond14.test                                  |    5 +-
 tests/cond15.test                                  |    2 +-
 tests/cond16.test                                  |   16 +--
 tests/cond17.test                                  |   10 +-
 tests/cond18.test                                  |   16 ++--
 tests/cond19.test                                  |   27 ++---
 tests/cond2.test                                   |   11 +-
 tests/cond20.test                                  |   12 +-
 tests/cond22.test                                  |   23 ++--
 tests/cond23.test                                  |    4 +-
 tests/cond24.test                                  |    7 +-
 tests/cond25.test                                  |    2 +
 tests/cond26.test                                  |    2 +
 tests/cond27.test                                  |    2 +
 tests/cond28.test                                  |    2 +
 tests/cond29.test                                  |   31 +++--
 tests/cond3.test                                   |   14 +-
 tests/cond30.test                                  |   33 +++---
 tests/cond31.test                                  |   29 +++--
 tests/cond32.test                                  |   38 ++++---
 tests/cond33.test                                  |   22 +++-
 tests/cond34.test                                  |   40 ++++---
 tests/cond35.test                                  |   11 ++-
 tests/cond36.test                                  |   13 +-
 tests/cond37.test                                  |   12 +-
 tests/cond38.test                                  |   16 ++-
 tests/cond4.test                                   |   34 +++---
 tests/cond40.test                                  |    2 +
 tests/cond41.test                                  |    8 +-
 tests/cond42.test                                  |   34 +++---
 tests/cond43.test                                  |    5 +
 tests/cond46.test                                  |   36 +++---
 tests/cond6.test                                   |   33 +++++-
 tests/cond8.test                                   |   43 +++++++-
 tests/cond9.test                                   |   11 +-
 tests/condd.test                                   |    8 +-
 tests/condman.test                                 |   37 ------
 tests/condman3.test                                |   33 ++++--
 tests/{subst2.test => extra-programs-empty.test}   |   44 ++++----
 tests/{target-cflags.test => lex-lib.test}         |   54 ++++-----
 tests/{target-cflags.test => lex-libobj.test}      |   60 +++++-----
 tests/{lex3.test => lex-noyywrap.test}             |   37 ++----
 tests/lex3.test                                    |   10 ++-
 tests/lexvpath.test                                |   12 ++-
 ...subst2.test => programs-primary-rewritten.test} |   50 +++++----
 tests/silent-lex-gcc.test                          |    9 ++
 tests/silent-lex-generic.test                      |    9 ++
 tests/silent-many-gcc.test                         |    5 +
 tests/silent-many-generic.test                     |    5 +
 tests/subst-no-trailing-empty-line.test            |   89 ++++++++++++++
 58 files changed, 810 insertions(+), 440 deletions(-)
 delete mode 100755 tests/condman.test
 copy tests/{subst2.test => extra-programs-empty.test} (52%)
 copy tests/{target-cflags.test => lex-lib.test} (61%)
 copy tests/{target-cflags.test => lex-libobj.test} (56%)
 copy tests/{lex3.test => lex-noyywrap.test} (69%)
 rename tests/{subst2.test => programs-primary-rewritten.test} (55%)
 create mode 100755 tests/subst-no-trailing-empty-line.test

diff --git a/ChangeLog b/ChangeLog
index d26268d..24183b7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,127 @@
+2011-05-26  Stefano Lattarini  <address@hidden>
+
+       tests: split 'subst2.test' to improve modularity and coverage
+       * tests/subst2.test: Test removed, split into ...
+       * tests/programs-primary-rewritten.test: ... this test ...
+       * tests/subst-no-trailing-empty-line.test: ... and this one ...
+       * tests/extra-programs-empty.test: ... and this one.
+       * tests/Makefile.am (TESTS): Update.
+
+2011-05-26  Stefano Lattarini  <address@hidden>
+
+       tests: tweak and improve tests on Automake conditionals
+       The "avoid the requirement of a working compiler" we refer about
+       below is obtained by disabling automatic dependency tracking and
+       defining `CC' (and `EXEEXT', `OBJEXT', `CXX', etc., if needed) to
+       dummy values, either directly in the `Makefile.am', or by AC_SUBST
+       in `configure.in'.
+       The "cosmetic changes" we refer about below consists in, e.g.,
+       adding a trailing `:' command to a script, using proper m4 quoting
+       in `configure.in' files, adding commands that offer more debugging
+       output, explicitly declaring phony targets as such in Makefiles,
+       making use of idioms more consistent with those employed in other
+       tests, following the GNU formatting standards more closely, etc.
+       * tests/cond.test: Cosmetic changes.
+       * tests/cond3.test: Likewise.
+       * tests/cond10.test: Likewise.
+       * tests/cond14.test: Likewise.
+       * tests/cond15.test: Likewise.
+       * tests/cond17.test: Likewise.
+       * tests/cond40.test: Likewise.
+       * tests/cond13.test: Likewise, and make grepping of the generated
+       `Makefile.in' slightly stricter.
+       * tests/cond6.test: Extend by also running ./configure, make and
+       "make install".  Few cosmetic changes.
+       * tests/cond8.test: Likewise.
+       * tests/cond2.test: Do few cosmetic changes.  Make grepping of
+       automake stderr stricter.
+       * tests/cond20.test: Likewise.
+       * tests/cond23.test: Likewise.
+       * tests/cond24.test: Likewise.
+       * tests/cond42.test: Likewise.
+       * tests/cond46.test: Likewise.
+       * tests/cond9.test: Move more checks in the `Makefile.am' instead
+       of grepping make's output.
+       * tests/cond38.test: Likewise.
+       * tests/cond11.test: Likewise.  Avoid the requirement of a working
+       C compiler.
+       * tests/cond16.test: Likewise.
+       * tests/cond22.test: Likewise.
+       * tests/cond30.test: Likewise.
+       * tests/cond31.test: Likewise.
+       * tests/cond4.test: Likewise, and drop the now-useless GNU make
+       requirement as well.
+       * tests/cond18.test: Likewise.
+       * tests/cond19.test: Likewise.
+       * tests/cond22.test: Likewise.
+       * tests/cond25.test: Add trailing `:' command.
+       * tests/cond26.test: Likewise.
+       * tests/cond27.test: Likewise.
+       * tests/cond28.test: Likewise.
+       * tests/cond29.test: Use `unindent' function for better formatting.
+       Other minor cosmetic changes.  Use a `timeout' program (if it's
+       available) to determine whether the script takes too long, instead
+       of just hoping that the user will notice an abnormally long test
+       execution time.
+       * tests/cond33.test: Extend a bit.  Fix heading comments.  Few more
+       cosmetic changes.
+       * tests/cond37.test: Ensure verbose printing of captured make
+       output.  Minor cosmetic changes.
+       * tests/cond34.test: Likewise.  Avoid the requirement of a working
+       C compiler.  Make grepping of make output slightly stricter.
+       * tests/cond35.test: Quote literal dots in grep regexp.  Add extra
+       debugging output.  Minor cosmetic changes.
+       * tests/cond36.test: Likewise.
+       * tests/cond41.test: Do not simply check that aclocal fails, but
+       also grep its stderr for the expected error message.
+       * tests/cond43.test: Likewise (but the program being automake).
+       Few cosmetic changes.
+       * tests/condd.test: Avoid the requirement of a working C compiler.
+       * tests/condman3.test: Extend by using more man pages and more
+       manpage sections.
+       * tests/condman.test: Removed, it's completely superseded by
+       `condman3.test'.
+       * tests/Makefile.am (TESTS): Update.
+
+2011-05-25  Stefano Lattarini  <address@hidden>
+
+       lex tests: avoid spurious failures when LEXLIB isn't found
+       The AC_PROG_LEX Autoconf macro does not diagnose a failure to find
+       the "lex library" expected to provide a `yywrap' function (function
+       which is required to link most lex-generated programs).  On the
+       contrary, when all the link attempts (i.e., with `-ll' and `-lfl')
+       fail, configure declares that no lex library is needed, and simply
+       proceeds with the configuration process -- only for the build to
+       possibly fail later, at make time.
+       This behaviour might be (partly) intended; the Autoconf manual
+       reads:
+        ``You are encouraged to use Flex in your sources, since it is
+          both more pleasant to use than plain Lex and the C source
+          it produces is portable.  In order to ensure portability,
+          however, you must either provide a function `yywrap' or, if
+          you don't use it (e.g., your scanner has no `#include'-like
+          feature), simply include a `%noyywrap' statement in the
+          scanner's source.''
+       This AC_PROG_LEX behaviour is causing some spurious failures of the
+       Automake testsuite in environments which lack a proper library
+       providing `yywrap' (this happens for example in Linux->MinGW cross
+       compilations).  But at this point is clear that a proper workaround
+       is to simply provide a fall-back implementation of `yywrap' in our
+       lexers.
+       * tests/cond35.test: Provide a dummy `yywrap' function.
+       * tests/lex3.test: Likewise.
+       * tests/lexvpath.test: Likewise.
+       * tests/silent-many-gcc.test: Likewise.
+       * tests/silent-many-generic.test: Likewise.
+       * tests/silent-lex-gcc.test: Likewise, and a dummy `main' too.
+       * tests/silent-lex-generic.test: Likewise.
+       * tests/lex-lib.test: New test.
+       * tests/lex-libobj.test: New test.
+       * tests/lex-nowrap.test: New test.
+       * tests/Makefile.am (TESTS): Update.
+       * THANKS: Update.
+       Thanks to Russ Allbery for the suggestion.
+
 2011-05-25  Stefano Lattarini  <address@hidden>
 
        testsuite: require C++ compiler explicitly in tests needing it
diff --git a/THANKS b/THANKS
index 5ee0e4c..96d215e 100644
--- a/THANKS
+++ b/THANKS
@@ -310,6 +310,7 @@ Roberto Bagnara             address@hidden
 Roman Fietze           address@hidden
 Ronald Landheer                address@hidden
 Roumen Petrov          address@hidden
+Russ Allbery           address@hidden
 Rusty Ballinger                address@hidden
 Ryan T. Sammartino     address@hidden
 Sam Hocevar            address@hidden
diff --git a/tests/Makefile.am b/tests/Makefile.am
index ff20e25..09adc65 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -342,7 +342,6 @@ condhook2.test \
 condinc.test \
 condinc2.test \
 condlib.test \
-condman.test \
 condman2.test \
 condman3.test \
 configure.test \
@@ -462,6 +461,7 @@ extra9.test \
 extra10.test \
 extra11.test \
 extra12.test \
+extra-programs-empty.test \
 extradep.test \
 extradep2.test \
 f90only.test \
@@ -566,6 +566,9 @@ lex5.test \
 lexcpp.test \
 lexvpath.test \
 lex-subobj-nodep.test \
+lex-lib.test \
+lex-libobj.test \
+lex-noyywrap.test \
 lflags.test \
 lflags2.test \
 libexec.test \
@@ -790,6 +793,7 @@ primary.test \
 primary2.test \
 primary3.test \
 proginst.test \
+programs-primary-rewritten.test \
 python.test \
 python2.test \
 python3.test \
@@ -937,10 +941,10 @@ subpkg2.test \
 subpkg3.test \
 subpkg4.test \
 subst.test \
-subst2.test \
 subst3.test \
 subst4.test \
 subst5.test \
+subst-no-trailing-empty-line.test \
 substref.test \
 substre2.test \
 substtarg.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 55647ee..ad8b2c0 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -607,7 +607,6 @@ condhook2.test \
 condinc.test \
 condinc2.test \
 condlib.test \
-condman.test \
 condman2.test \
 condman3.test \
 configure.test \
@@ -727,6 +726,7 @@ extra9.test \
 extra10.test \
 extra11.test \
 extra12.test \
+extra-programs-empty.test \
 extradep.test \
 extradep2.test \
 f90only.test \
@@ -831,6 +831,9 @@ lex5.test \
 lexcpp.test \
 lexvpath.test \
 lex-subobj-nodep.test \
+lex-lib.test \
+lex-libobj.test \
+lex-noyywrap.test \
 lflags.test \
 lflags2.test \
 libexec.test \
@@ -1055,6 +1058,7 @@ primary.test \
 primary2.test \
 primary3.test \
 proginst.test \
+programs-primary-rewritten.test \
 python.test \
 python2.test \
 python3.test \
@@ -1202,10 +1206,10 @@ subpkg2.test \
 subpkg3.test \
 subpkg4.test \
 subst.test \
-subst2.test \
 subst3.test \
 subst4.test \
 subst5.test \
+subst-no-trailing-empty-line.test \
 substref.test \
 substre2.test \
 substtarg.test \
diff --git a/tests/cond.test b/tests/cond.test
index f4567f1..6bc1e70 100755
--- a/tests/cond.test
+++ b/tests/cond.test
@@ -20,7 +20,7 @@
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
-AM_CONDITIONAL(TEST, true)
+AM_CONDITIONAL([TEST], [true])
 AC_OUTPUT
 END
 
@@ -39,3 +39,5 @@ grep '^TEST_FALSE' Makefile.in && Exit 1
 grep '^TEST_TRUE' Makefile.in && Exit 1
 grep 'address@hidden@VAR = true$' Makefile.in
 grep 'address@hidden@VAR = false$' Makefile.in
+
+:
diff --git a/tests/cond10.test b/tests/cond10.test
index 49a3d6b..ac2ffe3 100755
--- a/tests/cond10.test
+++ b/tests/cond10.test
@@ -20,8 +20,8 @@
 
 cat >> configure.in << 'END'
 AC_PROG_CC
-AM_CONDITIONAL(USE_A,[test x = y])
-AM_CONDITIONAL(USE_B,[test x = z])
+AM_CONDITIONAL([USE_A], [test x = y])
+AM_CONDITIONAL([USE_B], [test x = z])
 AC_OUTPUT
 END
 
@@ -43,3 +43,5 @@ END
 $ACLOCAL
 $AUTOMAKE -a
 grep 'USE_A_FALSE.*USE_B_FALSE.*output_c\...OBJEXT.' Makefile.in
+
+:
diff --git a/tests/cond11.test b/tests/cond11.test
index 9e7f6da..89ab482 100755
--- a/tests/cond11.test
+++ b/tests/cond11.test
@@ -18,18 +18,16 @@
 # This checks that, if LDADD is set from a conditional variable
 # and an AC_SUBST, the _DEPENDENCIES variable is set correctly.
 
-required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
-AC_PROG_CC
+AC_SUBST([CC], [false])
 AM_CONDITIONAL([USE_A], [test -z "$two"])
 AC_SUBST([SUBSTVAR], [bar])
 AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
-
 if USE_A
 foolibs=faz.la
 else
@@ -40,8 +38,11 @@ noinst_PROGRAMS = foo
 foo_SOURCES = foo.c
 LDADD = $(SUBSTVAR) $(foolibs)
 
-print:
-       @echo BEG: $(foo_DEPENDENCIES) :END
+.PHONY: test1 test2
+test1:
+       test faz.la = $(foo_DEPENDENCIES)
+test2:
+       test -z "`echo $(foo_DEPENDENCIES)`"
 END
 
 : > config.guess
@@ -50,14 +51,12 @@ END
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE --ignore-deps
 
 ./configure
-$MAKE -e print > stdout
-cat stdout
-grep 'BEG: faz.la :END' stdout
+$MAKE test1
 
 ./configure two=yes
-$MAKE -e print > stdout
-cat stdout
-grep 'BEG: :END' stdout
+$MAKE test2
+
+:
diff --git a/tests/cond13.test b/tests/cond13.test
index 193b02d..190f1e6 100755
--- a/tests/cond13.test
+++ b/tests/cond13.test
@@ -23,8 +23,8 @@ cat >> configure.in << 'END'
 AC_PROG_CC
 AC_PROG_CXX
 AC_PROG_RANLIB
-AM_CONDITIONAL(COND1, true)
-AM_CONDITIONAL(COND2, true)
+AM_CONDITIONAL([COND1], [true])
+AM_CONDITIONAL([COND2], [true])
 END
 
 cat > Makefile.am << 'END'
@@ -50,4 +50,6 @@ END
 $ACLOCAL
 $AUTOMAKE
 
-grep 'am_libtest_a_OBJECTS = .*$' Makefile.in
+grep '^am_libtest_a_OBJECTS =' Makefile.in
+
+:
diff --git a/tests/cond14.test b/tests/cond14.test
index f5a5e24..6e552c1 100755
--- a/tests/cond14.test
+++ b/tests/cond14.test
@@ -25,7 +25,6 @@ AM_CONDITIONAL([COND1], [true])
 END
 
 cat > Makefile.am << 'END'
-
 if COND1
 BUILD_helldl = helldl
 helldl_SOURCES = dlmain.c
@@ -46,7 +45,7 @@ END
 $ACLOCAL
 $AUTOMAKE
 
-num=`grep 'helldl$(EXEEXT):' Makefile.in | wc -l`
-test $num -eq 2
+$FGREP helldl Makefile.in # For debugging.
+test `$FGREP -c 'helldl$(EXEEXT):' Makefile.in` -eq 2
 
 :
diff --git a/tests/cond15.test b/tests/cond15.test
index fbd5e04..d5fb0a0 100755
--- a/tests/cond15.test
+++ b/tests/cond15.test
@@ -25,7 +25,6 @@ AM_CONDITIONAL([COND2], [true])
 END
 
 cat > Makefile.am << 'END'
-
 if COND1
 if COND2
 bin_SCRIPTS = helldl
@@ -53,6 +52,7 @@ END
 $ACLOCAL
 $AUTOMAKE
 
+$FGREP helldl Makefile.in # For debugging.
 num1=`$FGREP 'helldl$(EXEEXT):' Makefile.in | wc -l`
 num2=`$FGREP '@COND1_FALSE@@address@hidden(EXEEXT):' Makefile.in | wc -l`
 test $num1 -eq 4
diff --git a/tests/cond16.test b/tests/cond16.test
index d27472c..89182c4 100755
--- a/tests/cond16.test
+++ b/tests/cond16.test
@@ -18,11 +18,9 @@
 # references.
 # Report from Richard Boulton
 
-required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
-AC_PROG_CC
 AM_CONDITIONAL([COND1], [true])
 AC_OUTPUT
 END
@@ -30,6 +28,9 @@ END
 : > hello.c
 
 cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = no-dependencies
+CC = false
+OBJEXT = o
 
 if COND1
 var = foo.c
@@ -40,18 +41,15 @@ endif
 bin_PROGRAMS = hell
 hell_SOURCES = $(var:=)
 
-echorule:
-       @echo $(hell_SOURCES) $(hell_OBJECTS)
-
+.PHONY: test
+test:
+       test "`echo $(hell_SOURCES) $(hell_OBJECTS)`" = "foo.c foo.o"
 END
 
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
-
 ./configure
-
-val=`$MAKE -s echorule`;
-test "x$val" = "xfoo.c foo.o"
+$MAKE test
 
 :
diff --git a/tests/cond17.test b/tests/cond17.test
index 90a38e6..c934ee8 100755
--- a/tests/cond17.test
+++ b/tests/cond17.test
@@ -20,13 +20,11 @@
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT(Makefile.am)
-AM_INIT_AUTOMAKE(hello,0.23)
+cat >> configure.in << 'END'
 AC_PROG_CC
 AC_PROG_CXX
-AM_CONDITIONAL(COND1, true)
-AC_OUTPUT(Makefile)
+AM_CONDITIONAL([COND1], [true])
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
@@ -40,3 +38,5 @@ END
 
 $ACLOCAL
 $AUTOMAKE -a
+
+:
diff --git a/tests/cond18.test b/tests/cond18.test
index 57c5516..9c404a4 100755
--- a/tests/cond18.test
+++ b/tests/cond18.test
@@ -17,17 +17,18 @@
 # Regression test for substitution references to conditional variables.
 # Report from Richard Boulton
 
-required='cc GNUmake'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
-AC_PROG_CC
 AM_CONDITIONAL([COND1], [true])
 AM_CONDITIONAL([COND2], [true])
 AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = no-dependencies
+CC = false
+OBJEXT = obj
 
 var1 = dlmain
 
@@ -45,8 +46,10 @@ endif
 
 helldl_SOURCES = $(var3)
 
-echorule:
-       @echo $(helldl_SOURCES) $(helldl_OBJECTS)
+.PHONY: test
+test:
+       test x"`echo $(helldl_SOURCES) $(helldl_OBJECTS)`" = \
+            x"dlmain.c foo.c dlmain.obj foo.obj"
 
 bin_PROGRAMS = helldl
 END
@@ -54,10 +57,7 @@ END
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
-
 ./configure
-
-val=`$MAKE --no-print-directory echorule`;
-test "x$val" = "xdlmain.c foo.c dlmain.o foo.o"
+$MAKE test
 
 :
diff --git a/tests/cond19.test b/tests/cond19.test
index c5ac15a..50ae9cb 100755
--- a/tests/cond19.test
+++ b/tests/cond19.test
@@ -17,17 +17,18 @@
 # Regression test for substitution references to conditional variables.
 # Report from Richard Boulton
 
-required='cc GNUmake'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
-AC_PROG_CC
+AC_SUBST([CC], [false])
+AC_SUBST([OBJEXT], [o])
 AM_CONDITIONAL([COND1], [test "x$CONDITION1" = "xtrue"])
 AM_CONDITIONAL([COND2], [test "x$CONDITION2" = "xtrue"])
 AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
+bin_PROGRAMS = helldl
 
 var1 = dlmain
 
@@ -47,28 +48,24 @@ endif
 
 helldl_SOURCES = $(var3:.c=1.c) $(var4:.c=2.c)
 
-echorule:
-       @echo $(helldl_SOURCES) $(helldl_OBJECTS)
+got = `echo $(helldl_SOURCES) $(helldl_OBJECTS)`
 
-bin_PROGRAMS = helldl
+.PHONY: test
+test:
+       test x"$(exp)" = x"$(got)"
 END
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE -a
+$AUTOMAKE -a -i
 
 CONDITION1=true CONDITION2=true ./configure
-vala=`$MAKE --no-print-directory echorule`;
+$MAKE test exp='dlmaina1.c dlmainb2.c dlmaina1.o dlmainb2.o'
 CONDITION1=true CONDITION2=false ./configure
-valb=`$MAKE --no-print-directory echorule`;
+$MAKE test exp='dlmainb1.c dlmaina2.c dlmainb1.o dlmaina2.o'
 CONDITION1=false CONDITION2=true ./configure
-valc=`$MAKE --no-print-directory echorule`;
+$MAKE test exp='dlmaina1.c dlmainb2.c dlmaina1.o dlmainb2.o'
 CONDITION1=false CONDITION2=false ./configure
-vald=`$MAKE --no-print-directory echorule`;
-
-test "x$vala" = "xdlmaina1.c dlmainb2.c dlmaina1.o dlmainb2.o"
-test "x$valb" = "xdlmainb1.c dlmaina2.c dlmainb1.o dlmaina2.o"
-test "x$valc" = "xdlmaina1.c dlmainb2.c dlmaina1.o dlmainb2.o"
-test "x$vald" = "xdlmainb1.c dlmaina2.c dlmainb1.o dlmaina2.o"
+$MAKE test exp='dlmainb1.c dlmaina2.c dlmainb1.o dlmaina2.o'
 
 :
diff --git a/tests/cond2.test b/tests/cond2.test
index b47e324..0f0235b 100755
--- a/tests/cond2.test
+++ b/tests/cond2.test
@@ -19,11 +19,8 @@
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
-AM_CONDITIONAL(TEST, true)
-AC_OUTPUT(Makefile)
+cat >> configure.in << 'END'
+AM_CONDITIONAL([TEST], [true])
 END
 
 cat > Makefile.am << 'END'
@@ -39,4 +36,6 @@ mkdir dir1
 
 $ACLOCAL
 AUTOMAKE_fails
-grep 'Makefile.am:4:.*dir2.*does not exist' stderr
+grep '^Makefile\.am:4:.*dir2.*does not exist' stderr
+
+:
diff --git a/tests/cond20.test b/tests/cond20.test
index f0e1dd8..cd2ec0b 100755
--- a/tests/cond20.test
+++ b/tests/cond20.test
@@ -19,16 +19,12 @@
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT(Makefile.am)
-AM_INIT_AUTOMAKE(hello,0.23)
+cat >> configure.in << 'END'
 AC_PROG_CC
-AM_CONDITIONAL(COND1, true)
-AC_OUTPUT(Makefile)
+AM_CONDITIONAL([COND1], [true])
 END
 
 cat > Makefile.am << 'END'
-
 var1 = $(var2)
 
 if COND1
@@ -45,4 +41,6 @@ END
 $ACLOCAL
 $AUTOCONF
 AUTOMAKE_fails -a
-grep "recursively defined" stderr
+grep "variable.*var2.*recursively defined" stderr
+
+:
diff --git a/tests/cond22.test b/tests/cond22.test
index 4d88f9d..72120eb 100755
--- a/tests/cond22.test
+++ b/tests/cond22.test
@@ -17,14 +17,14 @@
 # Regression test for bug when sources listed in conditional.
 # Report from Richard Boulton.  PR/326.
 
-required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
-AC_PROG_CC
-AM_CONDITIONAL(ONE, true)
-AM_CONDITIONAL(TWO, false)
-AM_CONDITIONAL(THREE, false)
+CC=false; AC_SUBST([CC])
+OBJEXT=oo; AC_SUBST([OBJEXT])
+AM_CONDITIONAL([ONE], [true])
+AM_CONDITIONAL([TWO], [false])
+AM_CONDITIONAL([THREE], [false])
 AC_OUTPUT
 END
 
@@ -55,14 +55,15 @@ endif
 
 targ_SOURCES = $(SONE) $(STWO) $(STHREE) $(STHREE2)
 
-echo:
-       echo BEG: $(targ_OBJECTS) :END;
+.PHONY: test
+test:
+       test "`echo $(targ_OBJECTS)`" = "one.oo two.oo three.oo three2.oo"
 END
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE --ignore-deps
 ./configure
-OBJEXT=oo $MAKE -e echo > output
-cat output
-$FGREP 'BEG: one.oo two.oo three.oo three2.oo :END' output
+$MAKE test
+
+:
diff --git a/tests/cond23.test b/tests/cond23.test
index 7cb8292..db209b2 100755
--- a/tests/cond23.test
+++ b/tests/cond23.test
@@ -32,4 +32,6 @@ EOF
 
 $ACLOCAL
 AUTOMAKE_fails
-grep 'libdir was already defined' stderr
+grep '^Makefile\.am:2:.* libdir was already defined' stderr
+
+:
diff --git a/tests/cond24.test b/tests/cond24.test
index 7bfa89f..11f8d87 100755
--- a/tests/cond24.test
+++ b/tests/cond24.test
@@ -22,15 +22,18 @@
 cat >>configure.in <<EOF
 AC_SUBST([foo], [bar])
 AM_CONDITIONAL([COND], [true])
-AC_OUTPUT
 EOF
 
 cat >Makefile.am <<EOF
 if COND
+## A dummy comment to change line numer.
 foo = baz
 endif
 EOF
 
 $ACLOCAL
 AUTOMAKE_fails
-grep 'foo was already defined' stderr
+grep '^Makefile\.am:3:.* foo was already defined' stderr
+grep '^configure\.in:4:.*foo.* previously defined here' stderr
+
+:
diff --git a/tests/cond25.test b/tests/cond25.test
index 9d1686d..fe03745 100755
--- a/tests/cond25.test
+++ b/tests/cond25.test
@@ -35,3 +35,5 @@ EOF
 
 $ACLOCAL
 $AUTOMAKE
+
+:
diff --git a/tests/cond26.test b/tests/cond26.test
index 7252dbd..3c29b59 100755
--- a/tests/cond26.test
+++ b/tests/cond26.test
@@ -34,3 +34,5 @@ EOF
 
 $ACLOCAL
 $AUTOMAKE
+
+:
diff --git a/tests/cond27.test b/tests/cond27.test
index 141723c..74f2e48 100755
--- a/tests/cond27.test
+++ b/tests/cond27.test
@@ -34,3 +34,5 @@ $ACLOCAL
 AUTOMAKE_fails
 grep ' USE_FOO' stderr && Exit 1
 grep '!USE_FOO' stderr
+
+:
diff --git a/tests/cond28.test b/tests/cond28.test
index e5f254e..0c6cd29 100755
--- a/tests/cond28.test
+++ b/tests/cond28.test
@@ -34,3 +34,5 @@ EOF
 
 $ACLOCAL
 $AUTOMAKE
+
+:
diff --git a/tests/cond29.test b/tests/cond29.test
index f248850..222743c 100755
--- a/tests/cond29.test
+++ b/tests/cond29.test
@@ -21,11 +21,12 @@
 # possible combinations of conditionals (it would do this five times,
 # to define a01_DEPENDENCIES, a02_DEPENDENCIES, a03_OBJECTS,
 # a04_OBJECTS, and to rewrite bin_PROGRAM), eating all memory, swap,
-# or cpu time it can found.  Although this test won't print `FAIL' if
-# it fails, it will take long enough so it can't go unnoticed.
+# or cpu time it can found.
 
 . ./defs || Exit 1
 
+timeout 10s true || skip_ "timeout command not found"
+
 echo AC_PROG_CC >>configure.in
 
 cat >Makefile.am <<EOF
@@ -35,17 +36,23 @@ a03_SOURCES =
 EOF
 
 for i in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22; do
-cat >>Makefile.am <<EOF
-if C$i
-bin_PROGRAMS += a$i
-a01_LDADD = foo${i}.o
-a02_LDADD += bar${i}.o
-a03_SOURCES += baz${i}.c
-a04_SOURCES = quux${i}.c
-endif C$i
+  unindent >>Makefile.am <<EOF
+    if C$i
+    bin_PROGRAMS += a$i
+    a01_LDADD = foo${i}.o
+    a02_LDADD += bar${i}.o
+    a03_SOURCES += baz${i}.c
+    a04_SOURCES = quux${i}.c
+    endif C$i
 EOF
-echo "AM_CONDITIONAL([C$i], [:])" >>configure.in
+  echo "AM_CONDITIONAL([C$i], [:])" >>configure.in
 done
 
 $ACLOCAL
-$AUTOMAKE
+# Be lax w.r.t. the timeout for low-priority processes on heavily
+# loaded systems.
+niceness=`nice || echo 0`
+case $niceness in [0-9]*);; *) niceness=0;; esac
+timeout `expr 60 '+' $niceness '*' 20`s $AUTOMAKE
+
+:
diff --git a/tests/cond3.test b/tests/cond3.test
index 2a75d43..7e9b3ae 100755
--- a/tests/cond3.test
+++ b/tests/cond3.test
@@ -20,14 +20,12 @@
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+cat >> configure.in << 'END'
 AC_PROG_CC
-AM_CONDITIONAL(ONE, true)
-AM_CONDITIONAL(TWO, false)
-AM_CONDITIONAL(THREE, maybe)
-AC_OUTPUT(Makefile)
+AM_CONDITIONAL([ONE], [true])
+AM_CONDITIONAL([TWO], [false])
+AM_CONDITIONAL([THREE], [maybe])
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
@@ -78,3 +76,5 @@ targ_OBJECTS = $(am_targ_OBJECTS)
 EOF
 
 diff expected produced
+
+:
diff --git a/tests/cond30.test b/tests/cond30.test
index e1c1341..fb44bf6 100755
--- a/tests/cond30.test
+++ b/tests/cond30.test
@@ -16,17 +16,19 @@
 
 # For PR/352: make sure we support bin_PROGRAMS being defined conditionally.
 
-required=cc
 . ./defs || Exit 1
 
 cat >>configure.in <<'EOF'
-AC_PROG_CC
-AM_CONDITIONAL(C1, [test -z "$two"])
-AM_CONDITIONAL(C2, [test -n "$two"])
+AM_CONDITIONAL([C1], [test -z "$two"])
+AM_CONDITIONAL([C2], [test -n "$two"])
 AC_OUTPUT
 EOF
 
-cat >>Makefile.am <<'EOF'
+cat > Makefile.am <<'EOF'
+AUTOMAKE_OPTIONS = no-dependencies
+CC = false
+EXEEXT = .foo
+
 if C1
 bin_PROGRAMS = a
 endif
@@ -34,23 +36,24 @@ if C2
 bin_PROGRAMS = b $(undefined)
 endif
 
-print:
-       @echo 'BEG: $(bin_PROGRAMS) :END'
+.PHONY: test-a test-b
+test-a:
+       test a.foo = $(bin_PROGRAMS)
+test-b:
+       test b.foo = $(bin_PROGRAMS)
 EOF
 
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
 
+$FGREP 'a_SOURCES = a.c' Makefile.in
+$FGREP 'b_SOURCES = b.c' Makefile.in
+
 ./configure
-EXEEXT=.foo $MAKE -e print > stdout
-cat stdout
-grep 'BEG: a.foo :END' stdout
+$MAKE test-a
 
 ./configure two=yes
-EXEEXT=.foo $MAKE -e print > stdout
-cat stdout
-grep 'BEG: b.foo :END' stdout
+$MAKE test-b
 
-grep 'a_SOURCES = a.c' Makefile.in
-grep 'b_SOURCES = b.c' Makefile.in
+:
diff --git a/tests/cond31.test b/tests/cond31.test
index 70feffc..5110ab1 100755
--- a/tests/cond31.test
+++ b/tests/cond31.test
@@ -20,13 +20,14 @@ required=cc
 . ./defs || Exit 1
 
 cat >>configure.in <<'EOF'
-AC_PROG_CC
-AM_CONDITIONAL(C1, [test -z "$two"])
-AM_CONDITIONAL(C2, [test -n "$two"])
+AC_SUBST([CC], [false])
+AC_SUBST([OBJEXT], [o])
+AM_CONDITIONAL([C1], [test -z "$two"])
+AM_CONDITIONAL([C2], [test -n "$two"])
 AC_OUTPUT
 EOF
 
-cat >>Makefile.am <<'EOF'
+cat > Makefile.am <<'EOF'
 bin_PROGRAMS = a
 a_LDADD = c0.o -L/some/where
 if C1
@@ -35,20 +36,22 @@ endif
 if C2
 a_LDADD += c2.o -dlopen c3.la
 endif
-print:
-       @echo BEG: $(a_DEPENDENCIES) :END
+
+.PHONY: test1 test2
+test1:
+       test "`echo $(a_DEPENDENCIES)`" = "c0.o c1.o"
+test2:
+       test "`echo $(a_DEPENDENCIES)`" = "c0.o c2.o c3.la"
 EOF
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE --ignore-deps
 
 ./configure
-$MAKE -e print > stdout
-cat stdout
-grep 'BEG: c0.o c1.o :END' stdout
+$MAKE test1
 
 ./configure two=yes
-$MAKE -e print > stdout
-cat stdout
-grep 'BEG: c0.o c2.o c3.la :END' stdout
+$MAKE test2
+
+:
diff --git a/tests/cond32.test b/tests/cond32.test
index 57113dd..30fde11 100755
--- a/tests/cond32.test
+++ b/tests/cond32.test
@@ -16,26 +16,31 @@
 
 # Make sure the user can override a conditional _DEPENDENCIES.
 
-required=cc
 . ./defs || Exit 1
 
 cat >>configure.in <<'EOF'
-AC_PROG_CC
-AM_CONDITIONAL(C1, [test -z "$two"])
-AM_CONDITIONAL(C2, [test -n "$two"])
-AM_CONDITIONAL(C3, [test -z "$three"])
-AC_SUBST([MYSUB], [foo.o])
+AM_CONDITIONAL([C1], [test -z "$two"])
+AM_CONDITIONAL([C2], [test -n "$two"])
+AM_CONDITIONAL([C3], [test -z "$three"])
+# We define CC in Makefile.am, but OBJEXT here.
+OBJEXT=o; AC_SUBST([OBJEXT])
+AC_SUBST([MYSUB], ["foo.$OBJEXT"])
 AC_OUTPUT
 EOF
 
 cat >>Makefile.am <<'EOF'
+AUTOMAKE_OPTIONS = no-dependencies
+CC = :
+
 bin_PROGRAMS = a
+
 if C1
 a_LDADD = $(MYSUB)
 a_DEPENDENCIES = $(MYSUB) nonsense.a
 # Note that `nonsense.a' is there just to make sure Automake insn't
 # using some self computed a_DEPENDENCIES variable.
 endif
+
 if C2
 if C3
 BAR = bar.o
@@ -44,8 +49,11 @@ BAR = baz.o
 endif
 a_LDADD = $(BAR)
 endif
-print:
-       @echo BEG: $(a_DEPENDENCIES) :END
+
+got = `echo $(a_DEPENDENCIES)`
+test:
+       test "$(exp)" = "$(got)"
+.PHONY: test
 EOF
 
 $ACLOCAL
@@ -53,16 +61,12 @@ $AUTOCONF
 $AUTOMAKE
 
 ./configure
-$MAKE -e print > stdout
-cat stdout
-grep 'BEG: foo.o nonsense.a :END' stdout
+$MAKE test exp='foo.o nonsense.a'
 
 ./configure two=yes three=
-$MAKE -e print > stdout
-cat stdout
-grep 'BEG: bar.o :END' stdout
+$MAKE test exp='bar.o'
 
 ./configure two=yes three=yes
-$MAKE -e print > stdout
-cat stdout
-grep 'BEG: baz.o :END' stdout
+$MAKE test exp='baz.o'
+
+:
diff --git a/tests/cond33.test b/tests/cond33.test
index 6f822aa..126a4c1 100755
--- a/tests/cond33.test
+++ b/tests/cond33.test
@@ -14,7 +14,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Check for conditional library with a conditional directory.
+# Check that $(mkdir_p) handles well conditionally-defined install
+# directories.
 # Report from Ralf Corsepius
 
 . ./defs || Exit 1
@@ -24,7 +25,7 @@ AM_CONDITIONAL([INC], [test -z "$two"])
 AC_OUTPUT
 EOF
 
-cat >>Makefile.am <<'EOF'
+cat > Makefile.am <<'EOF'
 if INC
 include_foodir = $(includedir)/foo
 include_foo_HEADERS = foo.h
@@ -35,6 +36,8 @@ endif
 
 foo.h x.sh:
        :>$@
+
+.PHONY: distdircheck
 distdircheck: distdir
        test -f $(distdir)/foo.h
        test -f $(distdir)/x.sh
@@ -44,9 +47,12 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
 
+cwd=`pwd` || Exit 99
 mkdir nowhere
 chmod a-w nowhere
-./configure "--prefix=`pwd`/nowhere" "--bindir=`pwd`/bin" 
"--includedir=`pwd`/inc"
+
+./configure --prefix="$cwd"/nowhere --bindir="$cwd"/bin \
+            --includedir="$cwd"/inc
 $MAKE installdirs
 test ! -d bin
 test -d inc/foo
@@ -55,13 +61,19 @@ rm -rf inc
 $MAKE install
 test ! -d bin
 test -f inc/foo/foo.h
+$MAKE distdircheck
+
 rm -rf inc
-./configure two=two \
-            "--prefix=`pwd`/nowhere" "--bindir=`pwd`/bin" 
"--includedir=`pwd`/inc"
+
+./configure two=two --prefix="$cwd"/nowhere --bindir="$cwd"/bin \
+                    --includedir="$cwd"/inc
 $MAKE install
 test ! -d inc
 test -f bin/x.sh
+rm -rf inc
 $MAKE installdirs
 test ! -d inc
 test -d bin
 $MAKE distdircheck
+
+:
diff --git a/tests/cond34.test b/tests/cond34.test
index 13b7a27..1e030e8 100755
--- a/tests/cond34.test
+++ b/tests/cond34.test
@@ -14,20 +14,20 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Check for _DEPDENDENCIES definition with conditional _LDADD.
+# Check for _DEPENDENCIES definition with conditional _LDADD.
 # Report from Elena A. Vengerova
 
-required=cc
 . ./defs || Exit 1
 
 cat >>configure.in <<'EOF'
-AM_CONDITIONAL([TWO], test -n "$two")
-AC_PROG_CC
+AM_CONDITIONAL([TWO], [test -n "$two"])
 AC_OUTPUT
 EOF
 
-cat >>Makefile.am <<'EOF'
+cat > Makefile.am <<'EOF'
 OBJEXT=z
+CC=false
+AUTOMAKE_OPTIONS=no-dependencies
 
 bin_PROGRAMS = test1 test2
 
@@ -42,26 +42,34 @@ endif !TWO
 
 test1_DEPENDENCIES = $(test1_LDADD) somethingelse.a
 
+.PHONY: dep-test1 dep-test2
 dep-test1:
        echo BEG: $(test1_DEPENDENCIES) :END
 dep-test2:
        echo BEG: $(test2_DEPENDENCIES) :END
-
 EOF
 
-:> test.c
-
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
 ./configure
-$MAKE dep-test1 >out
-grep 'BEG: one.z somethingelse.a :END' out
-$MAKE dep-test2 >out
-grep 'BEG: three.z :END' out
+
+$MAKE dep-test1 >stdout || { cat stdout; Exit 1; }
+cat stdout
+$FGREP 'BEG: one.z somethingelse.a :END' stdout
+
+$MAKE dep-test2 >stdout || { cat stdout; Exit 1; }
+cat stdout
+$FGREP 'BEG: three.z :END' stdout
 
 ./configure two=2
-$MAKE dep-test1 >out
-grep 'BEG: two.z somethingelse.a :END' out
-$MAKE dep-test2 >out
-grep 'BEG: two.z somethingelse.a :END' out
+
+$MAKE dep-test1 >stdout || { cat stdout; Exit 1; }
+cat stdout
+$FGREP 'BEG: two.z somethingelse.a :END' stdout
+
+$MAKE dep-test2 >stdout || { cat stdout; Exit 1; }
+cat stdout
+$FGREP 'BEG: two.z somethingelse.a :END' stdout
+
+:
diff --git a/tests/cond35.test b/tests/cond35.test
index 2fba1f1..143c082 100755
--- a/tests/cond35.test
+++ b/tests/cond35.test
@@ -28,7 +28,7 @@ AC_PROG_YACC
 AC_OUTPUT
 EOF
 
-cat >>Makefile.am <<'EOF'
+cat > Makefile.am <<'EOF'
 AM_YFLAGS               =       -d
 
 BUILT_SOURCES           =       tparse.h
@@ -54,11 +54,18 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-test `grep tparse.h: Makefile.in | wc -l` = 1
+$FGREP 'tparse.h' Makefile.in # For debugging.
+test `$FGREP -c 'tparse.h:' Makefile.in` = 1
 
 cat > tscan.l << 'END'
 %%
 "END"   return EOF;
+%%
+/* Avoid possible link errors. */
+int yywrap (void)
+{
+  return 0;
+}
 END
 
 cat > tparse.y << 'END'
diff --git a/tests/cond36.test b/tests/cond36.test
index 06d5a60..b4a9a31 100755
--- a/tests/cond36.test
+++ b/tests/cond36.test
@@ -19,14 +19,14 @@
 . ./defs || Exit 1
 
 cat >>configure.in <<'EOF'
-AM_CONDITIONAL([CASE_A], test -z "$case_B")
+AM_CONDITIONAL([CASE_A], [test -z "$case_B"])
 AC_PROG_CC
 AM_PROG_LEX
 AC_PROG_YACC
 AC_OUTPUT
 EOF
 
-cat >>Makefile.am <<'EOF'
+cat > Makefile.am <<'EOF'
 AM_YFLAGS               =       -d
 
 BUILT_SOURCES           =       tparse.h
@@ -49,12 +49,13 @@ $ACLOCAL
 # Presently Automake doesn't fully support partially overriden rules
 # and should complain.
 AUTOMAKE_fails --add-missing
-grep 'tparse.h.*already defined' stderr
+grep 'tparse\.h.*already defined' stderr
 $AUTOMAKE -Wno-error
 
 # Still and all, it should generate two rules.
-test `grep tparse.h: Makefile.in | wc -l` = 2
-grep '@address@hidden:' Makefile.in
-grep '@address@hidden:' Makefile.in
+$FGREP 'tparse.h' Makefile.in # For debugging.
+test `$FGREP -c 'tparse.h:' Makefile.in` = 2
+$FGREP '@address@hidden:' Makefile.in
+$FGREP '@address@hidden:' Makefile.in
 
 :
diff --git a/tests/cond37.test b/tests/cond37.test
index 59923e8..e639231 100755
--- a/tests/cond37.test
+++ b/tests/cond37.test
@@ -20,11 +20,11 @@
 . ./defs || Exit 1
 
 cat >>configure.in <<'EOF'
-AM_CONDITIONAL([CASE_A], test -n "$case_A")
+AM_CONDITIONAL([CASE_A], [test -n "$case_A"])
 AC_OUTPUT
 EOF
 
-cat >>Makefile.am <<'EOF'
+cat > Makefile.am <<'EOF'
 if CASE_A
 check-local:
        @echo GrepMe1
@@ -39,18 +39,18 @@ $AUTOCONF
 $AUTOMAKE
 
 ./configure
-$MAKE check >stdout
+$MAKE check >stdout || { cat stdout; Exit 1; }
 cat stdout
 grep GrepMe1 stdout && Exit 1
-$MAKE install >stdout
+$MAKE install >stdout || { cat stdout; Exit 1; }
 cat stdout
 grep GrepMe2 stdout
 
 ./configure case_A=1
-$MAKE check >stdout
+$MAKE check >stdout || { cat stdout; Exit 1; }
 cat stdout
 grep GrepMe1 stdout
-$MAKE install >stdout
+$MAKE install >stdout || { cat stdout; Exit 1; }
 cat stdout
 grep GrepMe2 stdout && Exit 1
 
diff --git a/tests/cond38.test b/tests/cond38.test
index 222007d..8638dae 100755
--- a/tests/cond38.test
+++ b/tests/cond38.test
@@ -25,7 +25,7 @@ AM_CONDITIONAL([CASE_B], :)
 AC_OUTPUT
 EOF
 
-cat >>Makefile.am <<'EOF'
+cat > Makefile.am <<'EOF'
 SUBDIRS = a
 if CASE_A
 SUBDIRS += b
@@ -46,8 +46,10 @@ if CASE_B
 SUBDIRS += iXYZ
 SUBDIRS += jZYX
 endif
-print:
-       @echo BEG: $(SUBDIRS) :END
+
+.PHONY: test
+test:
+       test "`echo $(SUBDIRS)`" = 'a b c d e f g h iXYZ jZYX'
 EOF
 
 mkdir a b c d e f g h iXYZ jZYX
@@ -57,9 +59,9 @@ $AUTOCONF
 $AUTOMAKE
 
 ./configure
-$MAKE print >stdout
-cat stdout
-# Check good ordering
-grep 'BEG: a b c d e f g h iXYZ jZYX :END' stdout
 # Make sure no extra variable was created for the last 3 items.
 grep 'append.*=.* h iXYZ jZYX' Makefile
+# Check good ordering.
+$MAKE test
+
+:
diff --git a/tests/cond4.test b/tests/cond4.test
index 8a7fcd3..7d2aaea 100755
--- a/tests/cond4.test
+++ b/tests/cond4.test
@@ -17,11 +17,11 @@
 
 # Another sources-in-conditional test.  Report from Tim Goodwin.
 
-required='cc GNUmake'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
-AC_PROG_CC
+AC_SUBST([CC], [false])
+AC_SUBST([OBJEXT], [o])
 AM_CONDITIONAL([ONE], [test "x$CONDITION1" = "xtrue"])
 AM_CONDITIONAL([TWO], [test "x$CONDITION2" = "xtrue"])
 AC_OUTPUT
@@ -40,35 +40,29 @@ endif
 
 targ_SOURCES = main.c $(OPT1) $(OPT2)
 
-echo-objects:
-       @echo $(targ_OBJECTS)
+got = `echo $(targ_OBJECTS)`
+
+.PHONY: test
+test:
+       test x"$(exp)" = x"$(got)"
 END
 
 $ACLOCAL
-$AUTOMAKE
+$AUTOMAKE -i
 
 # We should not output useless definitions.
-test "`grep 'address@hidden@' Makefile.in | wc -l`" -eq 0
+grep 'address@hidden@' Makefile.in && Exit 1
+grep 'address@hidden@' Makefile.in && Exit 1
 
 $AUTOCONF
 
 CONDITION1=true CONDITION2=true ./configure
-msgtt=`$MAKE --no-print-directory echo-objects`
+$MAKE test exp='main.o one.o two.o'
 CONDITION1=true CONDITION2=false ./configure
-msgtf=`$MAKE --no-print-directory echo-objects`
+$MAKE test exp='main.o one.o'
 CONDITION1=false CONDITION2=true ./configure
-msgft=`$MAKE --no-print-directory echo-objects`
+$MAKE test exp='main.o two.o'
 CONDITION1=false CONDITION2=false ./configure
-msgff=`$MAKE --no-print-directory echo-objects`
-
-: msgtt = $msgtt
-: msgtf = $msgtf
-: msgft = $msgft
-: msgff = $msgff
-
-test x"$msgtt" = x"main.o one.o two.o"
-test x"$msgtf" = x"main.o one.o"
-test x"$msgft" = x"main.o two.o"
-test x"$msgff" = x"main.o"
+$MAKE test exp='main.o'
 
 :
diff --git a/tests/cond40.test b/tests/cond40.test
index 267d1eb..e0ffbd2 100755
--- a/tests/cond40.test
+++ b/tests/cond40.test
@@ -21,6 +21,7 @@
 # Test AM_COND_IF.
 
 . ./defs || Exit 1
+
 cat >>configure.in <<'END'
 AC_DEFUN([FOO],
         [AC_CONFIG_FILES([$1])])
@@ -82,4 +83,5 @@ $MAKE file3 && Exit 1
 test ! -f file1
 test -f file2
 test ! -f file3
+
 :
diff --git a/tests/cond41.test b/tests/cond41.test
index b68573f..c3778c1 100755
--- a/tests/cond41.test
+++ b/tests/cond41.test
@@ -21,11 +21,15 @@
 # AM_COND_IF with an undefined condition should fail.
 
 . ./defs || Exit 1
+
 cat >>configure.in <<'END'
-AM_COND_IF([COND],
+AM_COND_IF([BAD_COND],
           [AC_CONFIG_FILES([file1])])
 AC_OUTPUT
 END
 
-$ACLOCAL && Exit 1
+$ACLOCAL 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+grep '^configure\.in:4:.*AM_COND_IF.* no such condition.*BAD_COND' stderr
+
 :
diff --git a/tests/cond42.test b/tests/cond42.test
index 265ab29..9ae88cc 100755
--- a/tests/cond42.test
+++ b/tests/cond42.test
@@ -23,35 +23,41 @@
 # but better to be safe.
 
 . ./defs || Exit 1
+
 cat >>configure.in <<'END'
 AM_CONDITIONAL([COND], [:])
-# next line needed so that cond-if.m4 is pulled in.
+# The next line is needed so that cond-if.m4 is pulled in.
 AM_COND_IF([COND])
 _AM_COND_IF([COND])
 AC_OUTPUT
 END
+
+edit_configure_in ()
+{
+  sed "$@" < configure.in >configure.int
+  mv -f configure.int configure.in
+  rm -rf autom4te*.cache
+}
+
 : >Makefile.am
 
 $ACLOCAL
 AUTOMAKE_fails
-grep 'condition stack' stderr
+grep '^configure\.in:8:.* condition stack' stderr
 
-sed 's/_AM_COND_IF/_AM_COND_ELSE/' < configure.in >configure.int
-mv -f configure.int configure.in
-rm -rf autom4te*.cache
+edit_configure_in 's/_AM_COND_IF/_AM_COND_ELSE/'
 AUTOMAKE_fails
-grep 'else without if' stderr
+grep '^configure\.in:7:.* else without if' stderr
 
-sed 's/_AM_COND_ELSE/_AM_COND_ENDIF/' < configure.in >configure.int
-mv -f configure.int configure.in
-rm -rf autom4te*.cache
+edit_configure_in 's/_AM_COND_ELSE/_AM_COND_ENDIF/'
 AUTOMAKE_fails
-grep 'endif without if' stderr
+grep '^configure\.in:7:.* endif without if' stderr
 
-sed 's/\(_AM_COND_ENDIF\).*/_AM_COND_IF\
-_AM_COND_ENDIF/' < configure.in >configure.int
-mv -f configure.int configure.in
-rm -rf autom4te*.cache
+edit_configure_in 's/\(_AM_COND_ENDIF\).*/_AM_COND_IF\
+_AM_COND_ENDIF/'
 AUTOMAKE_fails
+grep '^configure\.in:7:.* not enough arguments.* _AM_COND_IF' stderr
+grep '^configure\.in:8:.* not enough arguments.* _AM_COND_ENDIF' stderr
 test 2 = `grep -c 'not enough arguments' stderr`
+
 :
diff --git a/tests/cond43.test b/tests/cond43.test
index befa165..d112bd7 100755
--- a/tests/cond43.test
+++ b/tests/cond43.test
@@ -21,6 +21,7 @@
 # Ensure an error with underquoted usage of AM_COND_IF in configure.ac.
 
 . ./defs || Exit 1
+
 cat >>configure.in <<'END'
 AM_CONDITIONAL([COND1], [:])
 AM_CONDITIONAL([COND2], [:])
@@ -29,10 +30,12 @@ AM_COND_IF([COND1],
 )
 AC_OUTPUT
 END
+
 : >Makefile.am
 
 $ACLOCAL
 AUTOMAKE_fails
+$EGREP '^configure\.in:7:.* missing m4 quoting.*macro depth 2( |$)' stderr
 
 sed '/.AM_COND_IF/{
        s/^/[/
@@ -41,3 +44,5 @@ sed '/.AM_COND_IF/{
 mv -f configure.int configure.in
 rm -rf autom4te*.cache
 $AUTOMAKE
+
+:
diff --git a/tests/cond46.test b/tests/cond46.test
index ffeebd2..5b15979 100755
--- a/tests/cond46.test
+++ b/tests/cond46.test
@@ -19,11 +19,13 @@
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
-AM_CONDITIONAL([USE_A],[test x = y])
-AM_CONDITIONAL([USE_B],[test x = z])
+AM_CONDITIONAL([USE_A], [test x = y])
+AM_CONDITIONAL([USE_B], [test x = z])
 AC_OUTPUT
 END
 
+notcompat="incompatible with current conditional"
+
 $ACLOCAL
 
 cat > Makefile.am << 'END'
@@ -32,7 +34,7 @@ endif !USE_A
 END
 
 AUTOMAKE_fails
-grep 'endif.*incompatible with current conditional' stderr
+grep "^Makefile\\.am:2:.*endif.*!USE_A.*$notcompat.*[^!]USE_A" stderr
 
 cat > Makefile.am << 'END'
 if USE_A
@@ -40,7 +42,7 @@ endif USE_B
 END
 
 AUTOMAKE_fails
-grep 'endif.*incompatible with current conditional' stderr
+grep "^Makefile\\.am:2:.*endif.*[^!]USE_B.*$notcompat.*[^!]USE_A" stderr
 
 cat > Makefile.am << 'END'
 if USE_A
@@ -49,7 +51,7 @@ endif USE_A
 END
 
 AUTOMAKE_fails
-grep 'endif.*incompatible with current conditional' stderr
+grep "^Makefile\\.am:3:.*endif.*[^!]USE_A.*$notcompat.*USE_A" stderr
 
 cat > Makefile.am << 'END'
 if USE_A
@@ -68,7 +70,7 @@ endif
 END
 
 AUTOMAKE_fails
-grep 'endif.*incompatible with current conditional' stderr
+grep "^Makefile\\.am:4:.*endif.*!USE_A.*$notcompat.*USE_B" stderr
 
 cat > Makefile.am << 'END'
 if USE_A
@@ -77,32 +79,34 @@ endif
 END
 
 AUTOMAKE_fails
-grep 'else.*incompatible with current conditional' stderr
+grep "^Makefile\\.am:2:.*else.*[^!]USE_A.*$notcompat.*[^!]USE_A" stderr
 
 cat > Makefile.am << 'END'
 if USE_A
-else USE_B
+else !USE_A
 endif
 END
 
-AUTOMAKE_fails
-grep 'else.*incompatible with current conditional' stderr
+$AUTOMAKE
 
 cat > Makefile.am << 'END'
 if USE_A
-if USE_B
-else USE_A
-endif
+else USE_B
 endif
 END
 
 AUTOMAKE_fails
-grep 'else.*incompatible with current conditional' stderr
+grep "^Makefile\\.am:2:.*else.*[^!]USE_B.*$notcompat.*[^!]USE_A" stderr
 
 cat > Makefile.am << 'END'
 if USE_A
-else !USE_A
+if USE_B
+else USE_A
+endif
 endif
 END
 
-$AUTOMAKE
+AUTOMAKE_fails
+grep "^Makefile\\.am:3:.*else.*[^!]USE_A.*$notcompat.*[^!]USE_B" stderr
+
+:
diff --git a/tests/cond6.test b/tests/cond6.test
index 4a576b4..60436ab 100755
--- a/tests/cond6.test
+++ b/tests/cond6.test
@@ -19,10 +19,9 @@
 
 . ./defs || Exit 1
 
-echo 'AM_CONDITIONAL(FOO, true)' >> configure.in
+echo 'AM_CONDITIONAL([FOO], [true])' >> configure.in
 
 cat > Makefile.am << 'END'
-
 if FOO
 
 helpdir = $(prefix)/Help
@@ -36,7 +35,37 @@ helpdir = $(prefix)/help
 help_DATA = foo
 
 endif
+
+a b c d e f g h:
+       touch $@
+
+.PHONY: print-data
+print-data:
+       echo BEG: $(help_DATA) :END
 END
 
+
+# Older versions of this test checked that automake could process the above
+# Makefile.am even with no AC_OUTPUT in configure.  So continue to do this
+# check, for completeness.
 $ACLOCAL
 $AUTOMAKE
+
+rm -rf autom4te*.cache
+
+echo AC_OUTPUT >> configure.in
+$AUTOCONF
+$AUTOMAKE Makefile
+
+./configure --prefix="`pwd`/_inst"
+
+$MAKE print-data >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep '^BEG: a b c d e f g h :END$' stdout
+
+$MAKE install
+for x in a b c d e f g h; do 
+  test -f _inst/Help/$x
+done
+
+:
diff --git a/tests/cond8.test b/tests/cond8.test
index 3a81a28..3fe7b5c 100755
--- a/tests/cond8.test
+++ b/tests/cond8.test
@@ -22,7 +22,8 @@
 
 cat >> configure.in << 'END'
 AC_PROG_CC
-AM_CONDITIONAL(X, false)
+AM_CONDITIONAL([X], [test "$x" = yes])
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
@@ -31,7 +32,47 @@ bin_PROGRAMS = x y
 else
 noinst_PROGRAMS = x y
 endif
+
+.PHONY: get-built get-install not-install
+get-built:
+       test -f x.$(OBJEXT)
+       test -f y.$(OBJEXT)
+       test -f x$(EXEEXT)
+       test -f y$(EXEEXT)
+get-installed:
+       test -f $(bindir)/x$(EXEEXT)
+       test -f $(bindir)/y$(EXEEXT)
+not-installed:
+       if find $(prefix) -type f | grep .; then exit 1; else :; fi
 END
 
 $ACLOCAL
 $AUTOMAKE
+$AUTOCONF
+
+cat > x.c <<'END'
+int main (void)
+{
+  return 0;
+}
+END
+
+cp x.c y.c
+
+instdir=`pwd`/_inst || Exit 99
+
+# Skip the rest of the test in case of e.g. missing C compiler.
+./configure --prefix="$instdir" x=yes || Exit $?
+$MAKE install
+$MAKE get-built
+$MAKE get-installed
+
+$MAKE distclean
+rm -rf _inst
+
+./configure --prefix="$instdir" x=no
+$MAKE install
+$MAKE get-built
+$MAKE not-installed
+
+:
diff --git a/tests/cond9.test b/tests/cond9.test
index 22792ae..c039871 100755
--- a/tests/cond9.test
+++ b/tests/cond9.test
@@ -20,7 +20,7 @@
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
-AM_CONDITIONAL(WRONG, [test x = y])
+AM_CONDITIONAL([WRONG], [test x = y])
 AC_OUTPUT
 END
 
@@ -31,12 +31,15 @@ else
 this=is_something_interesting
 endif
 
-echo-something:
-       echo '$(this)'
+.PHONY: test-this
+test-this:
+       test '$(this)' = is_something_interesting
 END
 
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 ./configure
-$MAKE echo-something | grep interesting > /dev/null
+$MAKE test-this
+
+:
diff --git a/tests/condd.test b/tests/condd.test
index 71d10ea..b0cf6f0 100755
--- a/tests/condd.test
+++ b/tests/condd.test
@@ -17,21 +17,22 @@
 
 # Test for bug in conditionals.
 
-required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
-AC_PROG_CC
 dnl Define a macro with the same name as the conditional to exhibit
 dnl any underquoted bug.
 AC_DEFUN([COND1], ["some'meaningless;characters`])
-AM_CONDITIONAL([COND1], false)
+AM_CONDITIONAL([COND1], [false])
 AC_CONFIG_FILES([foo/Makefile])
 AC_CONFIG_FILES([bar/Makefile])
 AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = no-dependencies
+CC = false
+
 SUBDIRS = foo
 if COND1
 SUBDIRS += bar
@@ -46,6 +47,7 @@ else
 hello_SOURCES += hello-generic.c
 endif
 
+.PHONY: test
 test: distdir
        test -f $(distdir)/foo/Makefile.am
        test -f $(distdir)/bar/Makefile.am
diff --git a/tests/condman.test b/tests/condman.test
deleted file mode 100755
index 8584014..0000000
--- a/tests/condman.test
+++ /dev/null
@@ -1,37 +0,0 @@
-#! /bin/sh
-# Copyright (C) 1998, 2001, 2002, 2010, 2011 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Make sure conditionals work with man pages.
-
-. ./defs || Exit 1
-
-cat >> configure.in << 'END'
-AM_CONDITIONAL([FRED], [true])
-END
-
-cat > Makefile.am << 'END'
-if FRED
-man_MANS = foo.1
-else
-man_MANS = joe.1
-endif
-END
-
-$ACLOCAL
-$AUTOMAKE
-
-:
diff --git a/tests/condman3.test b/tests/condman3.test
index 2482d8d..cfba3f8 100755
--- a/tests/condman3.test
+++ b/tests/condman3.test
@@ -26,37 +26,48 @@ END
 cat > Makefile.am << 'END'
 if COND
 man_MANS = foo.1
+man4_MANS = 6.man
 else
-man_MANS = bar.2
+man_MANS = bar.2 baz.1
+man5_MANS = zap.5
 endif
 
 .PHONY: test1 test2
 test1:
+       find $(mandir) ;: For debugging.
        test -f $(mandir)/man1/foo.1
+       test -f $(mandir)/man4/6.4
        test ! -f $(mandir)/man2/bar.2
+       test ! -f $(mandir)/man1/baz.1
+       test ! -f $(mandir)/man5/zap.5
 test2:
-       test ! -f $(mandir)/man1/foo.1
+       find $(mandir) ;: For debugging.
        test -f $(mandir)/man2/bar.2
+       test -f $(mandir)/man1/baz.1
+       test -f $(mandir)/man5/zap.5
+       test ! -f $(mandir)/man1/foo.1
+       test ! -f $(mandir)/man4/6.4
+       test ! -f $(mandir)/man4/6.man
 END
 
 $ACLOCAL
 $AUTOMAKE
 $AUTOCONF
 
-mkdir dir1
-cd dir1
+$EGREP 'MANS|\.([123456789]|man)' Makefile.in # For debugging.
+
+mkdir build
+cd build
 ../configure FOO=true --prefix="`pwd`/_inst"
-sed -n '/man_MANS/p' Makefile # useful for debugging
-: > foo.1
+$EGREP 'MANS|\.([123456789]|man)' Makefile # For debugging.
+touch foo.1 6.man
 $MAKE install
 $MAKE test1
 
 cd ..
-mkdir dir2
-cd dir2
-../configure FOO=false --prefix="`pwd`/_inst"
-sed -n '/man_MANS/p' Makefile # useful for debugging
-: > bar.2
+./configure FOO=false --prefix="`pwd`/_inst"
+$EGREP 'MANS|\.([123456789]|man)' Makefile # For debugging.
+touch bar.2 baz.1 zap.5
 $MAKE install
 $MAKE test2
 
diff --git a/tests/subst2.test b/tests/extra-programs-empty.test
similarity index 52%
copy from tests/subst2.test
copy to tests/extra-programs-empty.test
index d64d8c0..992c5ee 100755
--- a/tests/subst2.test
+++ b/tests/extra-programs-empty.test
@@ -14,40 +14,40 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Make sure a multi-line definition cannot be terminated by an empty
-# line (when there are @substitutions@ inside).
+# Test that EXTRA_PROGRAMS doesn't get removed because it is empty.
+# This check hs been introduced in commit `Release-1-9-254-g9d0eaef'
+# into the former test `subst2.test'.
 
-required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
+AC_CONFIG_FILES([Makefile2 Makefile3])
+AC_SUBST([prog])
 AC_PROG_CC
-AC_SUBST([ABCDEFGHIJKLMNOPQRSTUVWX])
-AC_SUBST([ABCDEFGHIJKLMNOPQRSTUVWXY])
-AC_SUBST([ABCDEFGHIJKLMNOPQRSTUVWXYZ])
 AC_OUTPUT
 END
 
-cat >Makefile.am <<'END'
-bin_PROGRAMS = x @ABCDEFGHIJKLMNOPQRSTUVWX@ @ABCDEFGHIJKLMNOPQRSTUVWXY@ 
@ABCDEFGHIJKLMNOPQRSTUVWXYZ@
+cat > Makefile.am <<'END'
 EXTRA_PROGRAMS =
+END
 
-EXEEXT = .bin
+cat > Makefile2.am <<'END'
+bin_PROGRAMS = a @prog@ b
+EXTRA_PROGRAMS =
+END
 
-print-programs:
-       @echo BEG: $(bin_PROGRAMS) :END
+cat > Makefile3.am <<'END'
+empty =
+EXTRA_PROGRAMS = $(empty)
 END
 
 $ACLOCAL
-$AUTOCONF
 $AUTOMAKE
-./configure
-EXEEXT=.bin $MAKE print-programs >foo
-cat foo
-grep 'BEG: x.bin :END' foo
-EXEEXT=.bin am__empty=X $MAKE -e print-programs >foo
-cat foo
-grep 'BEG: x.bin X :END' foo
-
-# Test for another bug, where EXTRA_PROGRAMS was removed because it was empty.
-grep EXTRA_PROGRAMS Makefile.in
+
+grep '^EXTRA_PROGRAMS = *$' Makefile.in
+grep '^EXTRA_PROGRAMS = *$' Makefile2.in
+# Be laxer here, since EXTRA_PROGRAMS might be internally rewritten
+# by Automake when it contains references to other variables.
+grep '^EXTRA_PROGRAMS =' Makefile3.in
+
+:
diff --git a/tests/target-cflags.test b/tests/lex-lib.test
similarity index 61%
copy from tests/target-cflags.test
copy to tests/lex-lib.test
index cbb5e33..07af3ff 100755
--- a/tests/target-cflags.test
+++ b/tests/lex-lib.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2000, 2001, 2002, 2004, 2010, 2011 Free Software
+# Copyright (C) 1999, 2001, 2002, 2003, 2004, 2010, 2011 Free Software
 # Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -15,63 +15,53 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Test to make sure target specific CFLAGS work
-# Assar Westerlund <address@hidden>
+# Check that we can provide a personal `yywrap' function in a custom
+# library.
 
-required=cc
+required='cc lex'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
 AC_PROG_CC
-AM_PROG_CC_C_O
+AC_PROG_RANLIB
+LEXLIB=libmylex.a
+AC_PROG_LEX
 AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
-AUTOMAKE_OPTIONS = no-dependencies
-
-bin_PROGRAMS = foo bar
-foo_CFLAGS   = -DFOO
+bin_PROGRAMS = lexer
+lexer_SOURCES = foo.l
+lexer_LDADD = $(LEXLIB)
+EXTRA_lexer_DEPENDENCIES = $(LEXLIB)
+noinst_LIBRARIES = libmylex.a
+libmylex_a_SOURCES = mu.c
 END
 
-cat > foo.c << 'END'
-#include <stdio.h>
-#ifdef FOO
-int main(void)
+cat > mu.c << 'END'
+int yywrap (void)
 {
   return 0;
 }
-#endif
 END
 
-cat > bar.c << 'END'
-#ifndef FOO
-int main(void)
+cat > foo.l <<'END'
+%%
+.
+%%
+int main (void)
 {
   return 0;
 }
-#endif
 END
 
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
-mkdir build
-
-cd build
-../configure
-$MAKE
-if cross_compiling; then :; else
-  ./foo
-  ./bar
-fi
-cd ..
 
 ./configure
 $MAKE
-if cross_compiling; then :; else
-  ./foo
-  ./bar
-fi
+test -f foo.c
+test -f libmylex.a
 
 :
diff --git a/tests/target-cflags.test b/tests/lex-libobj.test
similarity index 56%
copy from tests/target-cflags.test
copy to tests/lex-libobj.test
index cbb5e33..1ca1d4c 100755
--- a/tests/target-cflags.test
+++ b/tests/lex-libobj.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2000, 2001, 2002, 2004, 2010, 2011 Free Software
+# Copyright (C) 1999, 2001, 2002, 2003, 2004, 2010, 2011 Free Software
 # Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -15,63 +15,61 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Test to make sure target specific CFLAGS work
-# Assar Westerlund <address@hidden>
+# Check that we can provide a personal `yywrap' function through the
+# LIBOBJ machinery.
 
-required=cc
+required='cc lex'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
 AC_PROG_CC
-AM_PROG_CC_C_O
+AC_PROG_RANLIB
+AC_PROG_LEX
+save_LIBS=$LIBS
+LIBS="$LEXLIB $LIBS"
+AC_REPLACE_FUNCS([yywrap])
+LIBS=$save_LIBS
 AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
-AUTOMAKE_OPTIONS = no-dependencies
-
-bin_PROGRAMS = foo bar
-foo_CFLAGS   = -DFOO
+noinst_PROGRAMS = foo
+foo_SOURCES = foo.l
+foo_LDADD = $(LEXLIB) $(LIBOBJS)
 END
 
-cat > foo.c << 'END'
-#include <stdio.h>
-#ifdef FOO
-int main(void)
+cat > yywrap.c << 'END'
+int yywrap (void)
 {
   return 0;
 }
-#endif
 END
 
-cat > bar.c << 'END'
-#ifndef FOO
-int main(void)
+cat > foo.l <<'END'
+%%
+.
+%%
+int main (void)
 {
   return 0;
 }
-#endif
 END
 
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
-mkdir build
 
-cd build
-../configure
+./configure
+grep LIBOBJS Makefile # For debugging.
 $MAKE
-if cross_compiling; then :; else
-  ./foo
-  ./bar
-fi
-cd ..
+$MAKE distclean
 
-./configure
+# Force no "system lex library".
+./configure LEXLIB='-L /lib'
+grep LIBOBJS Makefile # For debugging.
+grep '^LIBOBJS *=.*yywrap.*\.o' Makefile # Sanity check.
 $MAKE
-if cross_compiling; then :; else
-  ./foo
-  ./bar
-fi
+
+$MAKE distcheck
 
 :
diff --git a/tests/lex3.test b/tests/lex-noyywrap.test
similarity index 69%
copy from tests/lex3.test
copy to tests/lex-noyywrap.test
index 7def55a..9431970 100755
--- a/tests/lex3.test
+++ b/tests/lex-noyywrap.test
@@ -15,11 +15,9 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Basic semantic checks on Lex support.
-# Test associated with PR 19.
-# From Matthew D. Langston.
+# Check Lex support with flex using the `%noyywrap' option.
 
-required='cc flex GNUmake'
+required='cc flex'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
@@ -29,18 +27,22 @@ AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
-LDADD             = @LEXLIB@
-noinst_PROGRAMS   = foo
-foo_SOURCES       = foo.l
+bin_PROGRAMS = foo
+foo_SOURCES = foo.l
+
+.PHONY: test-no-lexlib
+check-local: test-no-lexlib
+test-no-lexlib:
+       test x'$(LEXLIB)' = x'none needed'
 END
 
 cat > foo.l << 'END'
+%option noyywrap
 %%
 "GOOD"   return EOF;
 .
 %%
-int
-main ()
+int main (void)
 {
   /* We don't use a 'while' loop here (like a real lexer would do)
      to avoid possible hangs. */
@@ -55,7 +57,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 
-./configure
+./configure LEXLIB="none needed"
 
 # Program should build and run.
 $MAKE
@@ -64,20 +66,7 @@ if cross_compiling; then :; else
   echo BAD | ./foo && Exit 1
 fi
 
-# The generated file `foo.c' must be shipped.
-$MAKE distdir
-test -f $distdir/foo.c
-
 # Sanity check on distribution.
-$MAKE distcheck
-
-# While we are at it, make sure that foo.c is erased by
-# maintainer-clean, and not by distclean.
-test -f foo.c
-$MAKE distclean
-test -f foo.c
-./configure # we must re-create `Makefile'
-$MAKE maintainer-clean
-test ! -f foo.c
+$MAKE distcheck DISTCHECK_CONFIGURE_FLAGS='LEXLIB="none needed"'
 
 :
diff --git a/tests/lex3.test b/tests/lex3.test
index 7def55a..9c2f5b4 100755
--- a/tests/lex3.test
+++ b/tests/lex3.test
@@ -39,8 +39,8 @@ cat > foo.l << 'END'
 "GOOD"   return EOF;
 .
 %%
-int
-main ()
+
+int main (void)
 {
   /* We don't use a 'while' loop here (like a real lexer would do)
      to avoid possible hangs. */
@@ -49,6 +49,12 @@ main ()
   else
     return 1;
 }
+
+/* Avoid possible link errors. */
+int yywrap (void)
+{
+  return 0;
+}
 END
 
 $ACLOCAL
diff --git a/tests/lexvpath.test b/tests/lexvpath.test
index 212db31..93902b3 100755
--- a/tests/lexvpath.test
+++ b/tests/lexvpath.test
@@ -52,7 +52,15 @@ cat > lexer.l << 'END'
 END
 
 cat > foo.c << 'END'
-int main () { return 0; }
+int main (void)
+{
+  return 0;
+}
+/* Avoid possible link errors. */
+int yywrap (void)
+{
+  return 0;
+}
 END
 
 $ACLOCAL
@@ -61,7 +69,7 @@ $AUTOMAKE -a
 
 mkdir sub
 
-# We must run configure early, to find out whay $LEX_OUTPUT_ROOT is.
+# We must run configure early, to find out why $LEX_OUTPUT_ROOT is.
 cd sub
 ../configure
 . ./lexoutroot
diff --git a/tests/subst2.test b/tests/programs-primary-rewritten.test
similarity index 55%
rename from tests/subst2.test
rename to tests/programs-primary-rewritten.test
index d64d8c0..e52bd56 100755
--- a/tests/subst2.test
+++ b/tests/programs-primary-rewritten.test
@@ -14,40 +14,48 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Make sure a multi-line definition cannot be terminated by an empty
-# line (when there are @substitutions@ inside).
+# Make sure xxx_PROGRAMS gets properly rewritten where needed.  These
+# checks have been introduced in commit `Release-1-9-254-g9d0eaef' into
+# the former test `subst2.test'.
 
-required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
-AC_PROG_CC
-AC_SUBST([ABCDEFGHIJKLMNOPQRSTUVWX])
-AC_SUBST([ABCDEFGHIJKLMNOPQRSTUVWXY])
-AC_SUBST([ABCDEFGHIJKLMNOPQRSTUVWXYZ])
+AC_SUBST([FOO], [c])
 AC_OUTPUT
 END
 
 cat >Makefile.am <<'END'
-bin_PROGRAMS = x @ABCDEFGHIJKLMNOPQRSTUVWX@ @ABCDEFGHIJKLMNOPQRSTUVWXY@ 
@ABCDEFGHIJKLMNOPQRSTUVWXYZ@
+AUTOMAKE_OPTIONS = no-dependencies
+CC = false
+EXEEXT = .bin
+
+check_PROGRAMS = a
+bin_PROGRAMS = b @FOO@
+noinst_PROGRAMS = $(bar) $(baz:=de)
 EXTRA_PROGRAMS =
 
-EXEEXT = .bin
+bar = zardoz
+baz = mau
 
-print-programs:
-       @echo BEG: $(bin_PROGRAMS) :END
+.PHONY: test
+test:
+       test '$(check_PROGRAMS)' = a.bin
+       test '$(bin_PROGRAMS)' = 'b.bin c'
+       test '$(noinst_PROGRAMS)' = 'zardoz.bin maude.bin'
 END
 
 $ACLOCAL
-$AUTOCONF
 $AUTOMAKE
+
+grep PROGRAMS Makefile.in # For debugging.
+
+# Check that no useless indirections are used.
+grep '^check_PROGRAMS = a$(EXEEXT)$' Makefile.in
+grep '^bin_PROGRAMS = b$(EXEEXT) @address@hidden' Makefile.in
+
+$AUTOCONF
 ./configure
-EXEEXT=.bin $MAKE print-programs >foo
-cat foo
-grep 'BEG: x.bin :END' foo
-EXEEXT=.bin am__empty=X $MAKE -e print-programs >foo
-cat foo
-grep 'BEG: x.bin X :END' foo
-
-# Test for another bug, where EXTRA_PROGRAMS was removed because it was empty.
-grep EXTRA_PROGRAMS Makefile.in
+$MAKE test
+
+:
diff --git a/tests/silent-lex-gcc.test b/tests/silent-lex-gcc.test
index a55f358..2a691c3 100755
--- a/tests/silent-lex-gcc.test
+++ b/tests/silent-lex-gcc.test
@@ -55,6 +55,15 @@ cat > foo.l <<'EOF'
 "END"   return EOF;
 .
 %%
+/* Avoid possible link errors. */
+int yywrap (void)
+{
+  return 0;
+}
+int main (void)
+{
+  return 0;
+}
 EOF
 cp foo.l sub/bar.l
 
diff --git a/tests/silent-lex-generic.test b/tests/silent-lex-generic.test
index 7e74d64..bc3ffff 100755
--- a/tests/silent-lex-generic.test
+++ b/tests/silent-lex-generic.test
@@ -55,6 +55,15 @@ cat > foo.l <<'EOF'
 "END"   return EOF;
 .
 %%
+/* Avoid possible link errors. */
+int yywrap (void)
+{
+  return 0;
+}
+int main (void)
+{
+  return 0;
+}
 EOF
 cp foo.l sub/bar.l
 
diff --git a/tests/silent-many-gcc.test b/tests/silent-many-gcc.test
index 79fa4a6..8cdb35b 100755
--- a/tests/silent-many-gcc.test
+++ b/tests/silent-many-gcc.test
@@ -158,6 +158,11 @@ cat > foo5.l <<'EOF'
 "END"   return EOF;
 .
 %%
+/* Avoid possible link errors. */
+int yywrap (void)
+{
+  return 0;
+}
 EOF
 cat > foo6.y <<'EOF'
 %{
diff --git a/tests/silent-many-generic.test b/tests/silent-many-generic.test
index 9897b0c..c81f52c 100755
--- a/tests/silent-many-generic.test
+++ b/tests/silent-many-generic.test
@@ -160,6 +160,11 @@ cat > foo5.l <<'EOF'
 "END"   return EOF;
 .
 %%
+/* Avoid possible link errors. */
+int yywrap (void)
+{
+  return 0;
+}
 EOF
 cat > foo6.y <<'EOF'
 %{
diff --git a/tests/subst-no-trailing-empty-line.test 
b/tests/subst-no-trailing-empty-line.test
new file mode 100755
index 0000000..595644e
--- /dev/null
+++ b/tests/subst-no-trailing-empty-line.test
@@ -0,0 +1,89 @@
+#! /bin/sh
+# Copyright (C) 2003, 2006, 2011 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
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# If the last line of a automake-rewritten definition is made only of
+# @substitutions@, automake should take care of appending an empty
+# variable to make sure that line cannot end up substituted as a blank
+# line (that would confuse HP-UX Make).
+# These checks have been introduced in commit `Release-1-9-254-g9d0eaef'
+# into the former test `subst2.test'.
+
+. ./defs || Exit 1
+
+v1=ABCDEFGHIJKLMNOPQRSTUVWX
+v2=ABCDEFGHIJKLMNOPQRSTUVWXY
+v3=ABCDEFGHIJKLMNOPQRSTUVWXYZ
+bs='\\' # Literal backslash for grep.
+
+cat >> configure.in <<END
+AC_SUBST([A], [''])
+# These are deliberately quite long, so that the xxx_PROGRAMS definition
+# in Makefile.am below will be split on multiple lines, with the last
+# line
+AC_SUBST([$v1], [''])
+AC_SUBST([$v2], [''])
+AC_SUBST([$v3], [''])
+AC_OUTPUT
+END
+
+cat >Makefile.am <<END
+AUTOMAKE_OPTIONS = no-dependencies
+CC = false
+EXEEXT =
+
+noinst_PROGRAMS = x @$v1@ @$v2@ @$v3@
+bin_PROGRAMS = @A@ mu @$v2@ @$v3@
+check_PROGRAMS = zardoz \$(noinst_PROGRAMS)
+
+## Required whenever there are @substituted@ values in the
+## PROGRAMS primary, otherwise automake will complain.
+EXTRA_PROGRAMS =
+
+print-programs:
+       @echo BEG1: \$(noinst_PROGRAMS) :END1
+       @echo BEG2: \$(bin_PROGRAMS) :END2
+       @echo BEG3: \$(check_PROGRAMS) :END3
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+$EGREP -n 'ABCD|am__empty' Makefile.in # For debugging,
+# Sanity check.
+test `$EGREP -c "^[ address@hidden@ @address@hidden $tab]*$bs?$" Makefile.in` 
-eq 2
+
+./configure
+{
+  sed -n '/^noinst_PROGRAMS =/,/[^\\]$/p' Makefile
+  sed -n '/^bin_PROGRAMS =/,/[^\\]$/p' Makefile
+  sed -n '/^check_PROGRAMS =/,/[^\\]$/p' Makefile
+} >t-programs
+cat t-programs
+grep '^ *$' t-programs && Exit 1
+
+$MAKE print-programs >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep '^BEG1: x :END1$' stdout
+grep '^BEG2: mu :END2$' stdout
+grep '^BEG3: zardoz x :END3$' stdout
+
+am__empty=X $MAKE -e print-programs >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep '^BEG1: x X :END1$' stdout
+grep '^BEG2: mu X :END2$' stdout
+grep '^BEG3: zardoz x X :END3$' stdout
+
+:


hooks/post-receive
-- 
GNU Automake



reply via email to

[Prev in Thread] Current Thread [Next in Thread]