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-870-g47fc204
Date: Wed, 25 May 2011 16:04:47 +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=47fc204c850dd547d8d8dd28bdc07074d9179626

The branch, testsuite-work has been updated
       via  47fc204c850dd547d8d8dd28bdc07074d9179626 (commit)
       via  a4c93e4ec667745b5e6277c3ae95d5e5b38e52b1 (commit)
       via  7a7fc5659e0be4bbfc4dfb7b3fc9a45e5fb8ef0e (commit)
       via  a2674559c6840338c9591ee26884aac0aad167bb (commit)
       via  680b8fb775c3d68058b58eb5501e232159e92bbc (commit)
       via  ae610ad30c7ae239b046c2ca023c74db5b4dc6c7 (commit)
      from  deb4f3b66a082684da7cca051ce32b80abced2ec (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 47fc204c850dd547d8d8dd28bdc07074d9179626
Author: Stefano Lattarini <address@hidden>
Date:   Wed May 25 16:45:30 2011 +0200

    testsuite: require C++ compiler explicitly in tests needing it
    
    The list of the test scripts which needed a C++ compiler but
    failed to require it explicitly has been found by running:
      $ tests=`grep -lE 'CXX|\.c(c|\+\+|xx|pp)' *.test | tr '\n' ' '`
      $ am_explicit_skips=yes CXX=false make check TESTS="$tests"
    and looking for tests that reported FAIL instead of SKIP.
    After the present change, all those previously failing tests
    either pass or get correctly skipped.
    
    * tests/subobj9.test: Require `c++', instead of explicitly
    skipping on configure failure.  Add excerpts and/or details from
    the original bug report that prompted this tests to be written.
    * tests/silentcxx-gcc.test: Require g++.
    * tests/silentcxx.test: Require c++.
    * tests/suffix3.test: Likewise.

commit a4c93e4ec667745b5e6277c3ae95d5e5b38e52b1
Author: Stefano Lattarini <address@hidden>
Date:   Wed May 25 16:15:27 2011 +0200

    testsuite: don't require g++ where any C++ compiler is enough
    
    * tests/specflg10.test ($required): Use `c++', not g++.
    * tests/silent-many-generic.test: Likewise.

commit 7a7fc5659e0be4bbfc4dfb7b3fc9a45e5fb8ef0e
Author: Stefano Lattarini <address@hidden>
Date:   Mon May 23 21:53:44 2011 +0200

    testsuite: require C compiler explicitly in tests needing it
    
    The list of the test scripts which needed a C compiler but
    failed to require it explicitly has been found by running:
      $ am_explicit_skips=yes CC=false make check
    and looking for tests that reported FAIL instead of SKIP.
    After the present change, all those previously failing tests
    either pass or get correctly skipped.
    
    * tests/aclocal4.test ($required): Add `cc'.
    * tests/ansi.test: Likewise.
    * tests/ansi10.test: Likewise.
    * tests/ansi3.test: Likewise.
    * tests/ansi3b.test: Likewise.
    * tests/ansi5.test: Likewise.
    * tests/ansi6.test: Likewise.
    * tests/ansi7.test: Likewise.
    * tests/ansi9.test: Likewise.
    * tests/backcompat6.test: Likewise.
    * tests/canon7.test: Likewise.
    * tests/check5.test: Likewise.
    * tests/check7.test: Likewise.
    * tests/check8.test: Likewise.
    * tests/cond4.test: Likewise.
    * tests/cond11.test: Likewise.
    * tests/cond16.test: Likewise.
    * tests/cond18.test: Likewise.
    * tests/cond19.test: Likewise.
    * tests/cond22.test: Likewise.
    * tests/cond30.test: Likewise.
    * tests/cond31.test: Likewise.
    * tests/cond32.test: Likewise.
    * tests/cond34.test: Likewise.
    * tests/cond35.test: Likewise.
    * tests/cond39.test: Likewise.
    * tests/condd.test: Likewise.
    * tests/cygnus-dependency-tracking.test: Likewise.
    * tests/depcomp2.test: Likewise.
    * tests/depcomp6.test: Likewise.
    * tests/depcomp7.test: Likewise.
    * tests/depcomp8a.test: Likewise.
    * tests/depcomp8b.test: Likewise.
    * tests/depdist.test: Likewise.
    * tests/depend2.test: Likewise.
    * tests/depend5.test: Likewise.
    * tests/distcleancheck.test: Likewise.
    * tests/distname.test: Likewise.
    * tests/exeext.test: Likewise.
    * tests/exeext4.test: Likewise.
    * tests/extradep.test: Likewise.
    * tests/extradep2.test: Likewise.
    * tests/gnits2.test: Likewise.
    * tests/gnits3.test: Likewise.
    * tests/instdir-ltlib.test: Likewise.
    * tests/instdir-prog.test: Likewise.
    * tests/instfail.test: Likewise.
    * tests/instfail-libtool.test: Likewise.
    * tests/lex3.test: Likewise.
    * tests/lex5.test: Likewise.
    * tests/lexvpath.test: Likewise.
    * tests/lex-subobj-nodep.test: Likewise.
    * tests/lflags.test: Likewise.
    * tests/libobj-basic.test: Likewise.
    * tests/libobj2.test: Likewise.
    * tests/libobj7.test: Likewise.
    * tests/libobj10.test: Likewise.
    * tests/libobj16a.test: Likewise.
    * tests/libobj16b.test: Likewise.
    * tests/libobj17.test: Likewise.
    * tests/libobj19.test: Likewise.
    * tests/libtool2.test: Likewise.
    * tests/libtool3.test: Likewise.
    * tests/libtool7.test: Likewise.
    * tests/libtool9.test: Likewise.
    * tests/libtoo10.test: Likewise.
    * tests/libtoo11.test: Likewise.
    * tests/ltcond.test: Likewise.
    * tests/ltcond2.test: Likewise.
    * tests/ltconv.test: Likewise.
    * tests/ltinit.test: Likewise.
    * tests/ltlibsrc.test: Likewise.
    * tests/ltorder.test: Likewise.
    * tests/nobase.test: Likewise.
    * tests/nobase-libtool.test: Likewise.
    * tests/mmodely.test: Likewise.
    * tests/parallel-tests5.test: Likewise.
    * tests/parallel-tests-suffix-prog.test: Likewise.
    * tests/parallel-tests-ext-driver-prog.test: Likewise.
    * tests/posixsubst-ldadd.test: Likewise.
    * tests/posixsubst-libraries.test: Likewise.
    * tests/posixsubst-ltlibraries.test: Likewise.
    * tests/posixsubst-programs.test: Likewise.
    * tests/posixsubst-sources.test: Likewise.
    * tests/pr87.test: Likewise.
    * tests/pr204.test: Likewise.
    * tests/pr224.test: Likewise.
    * tests/pr300-lib.test: Likewise.
    * tests/pr300-ltlib.test: Likewise.
    * tests/pr300-prog.test: Likewise.
    * tests/pr401.test: Likewise.
    * tests/pr401b.test: Likewise.
    * tests/pr401c.test: Likewise.
    * tests/remake-gnulib-add-acsubst.test: Likewise.
    * tests/remake-gnulib-add-header.test: Likewise.
    * tests/regex.test: Likewise.
    * tests/repeated-options.test: Likewise.
    * tests/silent.test: Likewise.
    * tests/silent3.test: Likewise.
    * tests/silent9.test: Likewise.
    * tests/silent-lex-generic.test: Likewise.
    * tests/silent-many-generic.test: Likewise.
    * tests/silent-yacc-generic.test: Likewise.
    * tests/specflg7.test: Likewise.
    * tests/specflg9.test: Likewise.
    * tests/specflg10.test: Likewise.
    * tests/stdinc.test: Likewise.
    * tests/strip.test: Likewise.
    * tests/strip2.test: Likewise.
    * tests/strip3.test: Likewise.
    * tests/subdirbuiltsources.test: Likewise.
    * tests/subobj3.test: Likewise.
    * tests/subobj6.test: Likewise.
    * tests/subobj11a.test: Likewise.
    * tests/subpkg.test: Likewise.
    * tests/subst2.test: Likewise.
    * tests/subst3.test: Likewise.
    * tests/substref.test: Likewise.
    * tests/substre2.test: Likewise.
    * tests/suffix5.test: Likewise.
    * tests/suffix8.test: Likewise.
    * tests/suffix10.test: Likewise.
    * tests/suffix11.test: Likewise.
    * tests/suffix12.test: Likewise.
    * tests/suffix13.test: Likewise.
    * tests/target-cflags.test: Likewise.
    * tests/transform.test: Likewise.
    * tests/transform2.test: Likewise.
    * tests/yacc-basic.test: Likewise.
    * tests/yacc-d-basic.test: Likewise.
    * tests/yacc-clean.test: Likewise.
    * tests/yacc-dist-nobuild.test: Likewise.
    * tests/yacc-nodist.test: Likewise.
    * tests/yaccvpath.test: Likewise.
    * tests/yacc-d-vpath.test: Likewise.
    * tests/yacc4.test: Likewise.
    * tests/yacc7.test: Likewise.
    * tests/yacc8.test: Likewise.
    * tests/yaccdry.test: Likewise.
    * tests/yflags-cmdline-override.test: Likewise.
    * tests/yflags-force-override.test: Likewise.
    * tests/python-virtualenv.test: Likewise.  Also, improve skip
    messages.
    * tests/subobj5.test ($required): Add `cc'.
    (Makefile.am): Set `AUTOMAKE_OPTIONS' to `subdir-objects', and
    add new checking rules `test-build' and `test-distdir'.
    Extend the test by building and examining the distdir, the
    program, and the object files.
    * tests/postproc.test ($required): Add `cc'.
    Avoid the explicit `|| Exit $?' after call to configure, which
    is now either redundant (e.g., when `am_explicit_skips' is
    unset), or counter-productive (e.g., when `am_explicit_skips'
    is set to "yes").
    * tests/pr243.test: Likewise.
    * tests/pr266.test: Likewise.
    * tests/pr220.test: Simplify so that it doesn't require a
    C compiler anymore.
    * tests/subdir5.test: Likewise.
    * tests/subdir8.test: Likewise.
    * tests/lflags.test: Likewise.
    * tests/yflags.test: Likewise.
    * tests/yflags-force-conditional.test: Likewise.
    * tests/lflags2.test: Simplify so that it doesn't require a
    C++ compiler anymore.
    * tests/yflags2.test: Likewise.
    * tests/autohdrdry.test (configure.in): Remove unneeded call
    to `AC_PROG_CC'.
    * tests/pr287.test: Likewise.
    * tests/check6.test: Likewise.
    * tests/cond21.test: Likewise, plus some cosmetic adjustments.
    * tests/upc.test: Skip if configure fails with status `77'.
    * tests/upc3.test: Likewise.
    * tests/vala4.test: Likewise.
    * tests/nostdinc.test: Likewise.  Also, make grepping checks
    on `Makefile.in'.  Update heading comments.
    * tests/compile5.test: When we must skip, skip explicitly,
    and with a meaningful message.
    * tests/instspc-tests.sh: When running in "test-build" or
    "test-install" mode (as determined by the value of variable
    `$instspc_action'), require `cc'.  Adjust comments.
    * tests/depmod-tests.sh: Likewise.

commit a2674559c6840338c9591ee26884aac0aad167bb
Author: Stefano Lattarini <address@hidden>
Date:   Mon May 23 15:51:31 2011 +0200

    testsuite: allow user to ask for stricter skip semantics
    
    Given how the Automake testsuite is currently structured, if a
    command in a test script fails with status `77', the global test
    outcome is considered a SKIP, because the value of `77' for `$?'
    is passed to the exit trap.  Indeed, this happens in practice, as
    an autoconf-generated configure script can exit with status `77'
    if it fails to find, e.g., a required compiler.
    
    While this behaviour is quite useful for avoiding spurious test
    failures in the wild, it can also sometimes prevent the Automake
    developers to easily see and declare the requirements of their
    tests.
    
    This change introduces a new variable `am_explicit_skips', meant to
    be user-overridable, and which, when set to a "true" value (i.e.,
    `yes' or `1'), require a direct call to `Exit 77' in order to make
    the test outcome be considered a SKIP.
    
    * tests/defs.in ($am__test_skipped): New variable, initialized
    to `no'.
    (Exit): Set `$am__test_skipped' to `yes' if passed an exit status
    of 77.
    (trap '...' 0): When `$am_explicit_skips' is set to a "true" value,
    reset an exit status of `77' to `78' if $am__test_skipped is not
    set to `yes'.
    * tests/self-check-exit.test: Adjust: unset `am_explicit_skips'.
    * tests/self-check-explicit-skips.test: New test.
    * tests/Makefile.am (TESTS): Update.

commit 680b8fb775c3d68058b58eb5501e232159e92bbc
Author: Stefano Lattarini <address@hidden>
Date:   Tue May 24 10:42:27 2011 +0200

    testsuite: user can force skipping of compiler-requiring tests
    
    * tests/defs (cc, c++, fortran, fortran77): Skip the test if
    the relevant compiler is disabled by having the corresponding
    variable (CC, CXX, FC and F77, respectively) set to "false".
    (yacc): For consistency, skip the test when the YACC variable
    is set to "false", not when it's set to "no".  Since we are at
    it, fix the skip message to be shorter and more consistent.

commit ae610ad30c7ae239b046c2ca023c74db5b4dc6c7
Author: Stefano Lattarini <address@hidden>
Date:   Mon May 23 14:26:58 2011 +0200

    tests: tweak and improve tests on "Simple Tests" driver
    
    * tests/check.test: Make grepping of generated Makefile.in
    slightly stricter.  Add trailing `:' command.
    * tests/check2.test: Ensure verbose printing of captured make
    output.  Make grepping of generated Makefile.in and of make
    output stricter.  Add trailing `:' command.
    * tests/check3.test: Likewise.  Also, fix minor error in a
    comment.
    * tests/check4.test: Stricter grepping of make output.  Use
    `using_gmake' subroutine instead of copy&paste from defs.in
    to determine whether $MAKE is GNU make.  Add a trailing `:'
    command.
    * tests/check6.test: Add trailing `:' command.
    * tests/check10.test: Prefer redirection `>' over `>>' when
    creating new files.  Ensure verbose printing of captured make
    output.
    * tests/check11.test: Likewise.
    * tests/check7.test: Likewise.  Make grepping of make output
    stricter.  Prefer "make distcheck" over a simple "make check"
    in a VPATH build. Add trailing `:' command.
    (a.c): Format following GNU coding standards.
    (Makefile.am): Explicitly declare target `print-xfail-tests'
    as PHONY.  Distribute $(check_SCRIPTS), for distcheck.
    * tests/parallel-tests.test: Prefer redirection `>' over `>>'
    when creating new files.
    * tests/parallel-tests2.test: Likewise.
    * tests/parallel-tests9.test: Likewise.
    * tests/parallel-tests8.test: Likewise.  Make grepping of
    automake stderr stricter.
    * tests/check8.test: Likewise.  Make formatting of created
    *.c files more consistent with GNU Coding Standards.
    * tests/check-subst-prog.test (configure.in): Break overly
    long lines.
    (pass-prog.c, xfail-prog.c): Format them more consistently
    with GNU Coding Standards.
    * tests/parallel-tests3.test: Use a shorter and clearer skip
    message.  Use the `unindent' subroutine to improve readability
    of indented loop bodies.  Simplify the hack used to please
    maintainer-check.
    * tests/parallel-tests5.test: Make formatting of created *.c
    files more consistent with GNU Coding Standards.  Use the
    `unindent' subroutine to improve readability of indented loop
    bodies.
    * tests/parallel-tests10.test: Add blank line, for clarity.
    Prefer trailing `:' over trailing `Exit 0', for consistency
    with other tests.

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

Summary of changes:
 ChangeLog                                 |  301 +++++++++++++++++++++++++++++
 tests/Makefile.am                         |    1 +
 tests/Makefile.in                         |    1 +
 tests/aclocal4.test                       |    1 +
 tests/ansi.test                           |    1 +
 tests/ansi10.test                         |    2 +-
 tests/ansi3.test                          |    2 +-
 tests/ansi3b.test                         |    2 +-
 tests/ansi5.test                          |    2 +-
 tests/ansi6.test                          |    2 +-
 tests/ansi7.test                          |    2 +-
 tests/ansi9.test                          |    1 +
 tests/autohdr4.test                       |    1 +
 tests/autohdrdry.test                     |    1 -
 tests/backcompat6.test                    |    1 +
 tests/canon7.test                         |    2 +-
 tests/check-subst-prog.test               |   16 +-
 tests/check.test                          |    8 +-
 tests/check10.test                        |    8 +-
 tests/check11.test                        |    6 +-
 tests/check2.test                         |   14 +-
 tests/check3.test                         |   16 +-
 tests/check4.test                         |   34 ++--
 tests/check5.test                         |    2 +-
 tests/check6.test                         |    3 +-
 tests/check7.test                         |   26 ++-
 tests/check8.test                         |   22 +-
 tests/compile5.test                       |   11 +-
 tests/cond11.test                         |    1 +
 tests/cond16.test                         |    1 +
 tests/cond18.test                         |    2 +-
 tests/cond19.test                         |    2 +-
 tests/cond21.test                         |   10 +-
 tests/cond22.test                         |    1 +
 tests/cond30.test                         |    1 +
 tests/cond31.test                         |    1 +
 tests/cond32.test                         |    1 +
 tests/cond34.test                         |    1 +
 tests/cond35.test                         |    2 +-
 tests/cond39.test                         |    2 +
 tests/cond4.test                          |    2 +-
 tests/condd.test                          |    1 +
 tests/cygnus-dependency-tracking.test     |    1 +
 tests/defs                                |   40 +++-
 tests/depcomp2.test                       |    1 +
 tests/depcomp6.test                       |    1 +
 tests/depcomp7.test                       |    2 +-
 tests/depcomp8a.test                      |    1 +
 tests/depcomp8b.test                      |    2 +-
 tests/depdist.test                        |    1 +
 tests/depend2.test                        |    1 +
 tests/depend5.test                        |    1 +
 tests/depmod-tests.sh                     |    3 +
 tests/distcleancheck.test                 |    1 +
 tests/distname.test                       |    1 +
 tests/exeext.test                         |    1 +
 tests/exeext4.test                        |    1 +
 tests/extradep.test                       |    1 +
 tests/extradep2.test                      |    2 +-
 tests/gnits2.test                         |    2 +-
 tests/gnits3.test                         |    1 +
 tests/instdir-ltlib.test                  |    2 +-
 tests/instdir-prog.test                   |    1 +
 tests/instfail-libtool.test               |    2 +-
 tests/instfail.test                       |    1 +
 tests/instspc-tests.sh                    |    3 +
 tests/lex-subobj-nodep.test               |    2 +-
 tests/lex3.test                           |    2 +-
 tests/lex5.test                           |    2 +-
 tests/lexvpath.test                       |    2 +-
 tests/lflags.test                         |   12 +-
 tests/lflags2.test                        |   11 +-
 tests/libobj-basic.test                   |    1 +
 tests/libobj10.test                       |    1 +
 tests/libobj16a.test                      |    1 +
 tests/libobj16b.test                      |    3 +-
 tests/libobj17.test                       |    1 +
 tests/libobj19.test                       |    1 +
 tests/libobj2.test                        |    1 +
 tests/libobj7.test                        |    1 +
 tests/libtoo10.test                       |    3 +-
 tests/libtoo11.test                       |    4 +-
 tests/libtool3.test                       |    2 +-
 tests/libtool7.test                       |    2 +-
 tests/libtool9.test                       |    2 +-
 tests/ltcond.test                         |    2 +-
 tests/ltcond2.test                        |    2 +-
 tests/ltconv.test                         |    2 +-
 tests/ltinit.test                         |    2 +-
 tests/ltlibsrc.test                       |    2 +-
 tests/ltorder.test                        |    3 +-
 tests/mmodely.test                        |    1 +
 tests/nobase-libtool.test                 |    2 +-
 tests/nobase.test                         |    1 +
 tests/nostdinc.test                       |   11 +-
 tests/parallel-tests-ext-driver-prog.test |    2 +-
 tests/parallel-tests-suffix-prog.test     |    2 +-
 tests/parallel-tests.test                 |    6 +-
 tests/parallel-tests10.test               |    3 +-
 tests/parallel-tests2.test                |    7 +-
 tests/parallel-tests3.test                |   16 +-
 tests/parallel-tests5.test                |   18 +-
 tests/parallel-tests8.test                |    6 +-
 tests/parallel-tests9.test                |    7 +-
 tests/posixsubst-ldadd.test               |    3 +-
 tests/posixsubst-libraries.test           |    1 +
 tests/posixsubst-ltlibraries.test         |    2 +-
 tests/posixsubst-programs.test            |    1 +
 tests/posixsubst-sources.test             |    1 +
 tests/postproc.test                       |    3 +-
 tests/pr204.test                          |    2 +-
 tests/pr220.test                          |   14 +--
 tests/pr224.test                          |    1 +
 tests/pr243.test                          |    4 +-
 tests/pr266.test                          |    4 +-
 tests/pr287.test                          |    1 -
 tests/pr300-lib.test                      |    1 +
 tests/pr300-ltlib.test                    |    2 +-
 tests/pr300-prog.test                     |    1 +
 tests/pr401.test                          |    1 +
 tests/pr401b.test                         |    2 +-
 tests/pr401c.test                         |    1 +
 tests/pr87.test                           |    1 +
 tests/primary3.test                       |    1 +
 tests/python-virtualenv.test              |    8 +-
 tests/regex.test                          |    1 +
 tests/remake-gnulib-add-acsubst.test      |    1 +
 tests/remake-gnulib-add-header.test       |    1 +
 tests/remake-gnulib-remove-header.test    |    1 +
 tests/repeated-options.test               |    2 +-
 tests/self-check-exit.test                |    2 +
 tests/self-check-explicit-skips.test      |   52 +++++
 tests/silent-lex-generic.test             |    2 +-
 tests/silent-many-generic.test            |    4 +-
 tests/silent-yacc-generic.test            |    2 +-
 tests/silent.test                         |    1 +
 tests/silent3.test                        |    2 +-
 tests/silent9.test                        |    2 +-
 tests/silentcxx-gcc.test                  |    1 +
 tests/silentcxx.test                      |    1 +
 tests/specflg10.test                      |    2 +-
 tests/specflg7.test                       |    2 +-
 tests/specflg8.test                       |    2 +-
 tests/stdinc.test                         |    1 +
 tests/strip.test                          |    1 +
 tests/strip2.test                         |    2 +-
 tests/strip3.test                         |    2 +-
 tests/subdir5.test                        |   18 +--
 tests/subdir8.test                        |   18 +--
 tests/subdirbuiltsources.test             |    1 +
 tests/subobj11a.test                      |    1 +
 tests/subobj3.test                        |    2 +-
 tests/subobj5.test                        |   26 +++-
 tests/subobj6.test                        |    1 +
 tests/subobj9.test                        |   11 +-
 tests/subpkg.test                         |    2 +-
 tests/subst2.test                         |    2 +
 tests/subst3.test                         |    1 +
 tests/substre2.test                       |    1 +
 tests/substref.test                       |    1 +
 tests/suffix10.test                       |    2 +-
 tests/suffix11.test                       |    1 +
 tests/suffix12.test                       |    1 +
 tests/suffix13.test                       |    1 +
 tests/suffix3.test                        |    1 +
 tests/suffix5.test                        |    2 +-
 tests/suffix8.test                        |    2 +-
 tests/target-cflags.test                  |    1 +
 tests/transform.test                      |    1 +
 tests/transform2.test                     |    1 +
 tests/upc.test                            |    5 +-
 tests/upc3.test                           |    5 +-
 tests/vala4.test                          |    5 +-
 tests/yacc-basic.test                     |    2 +-
 tests/yacc-clean.test                     |    2 +-
 tests/yacc-d-basic.test                   |    2 +-
 tests/yacc-d-vpath.test                   |    2 +-
 tests/yacc-dist-nobuild.test              |    2 +-
 tests/yacc-nodist.test                    |    2 +-
 tests/yacc4.test                          |    2 +-
 tests/yacc7.test                          |    2 +-
 tests/yacc8.test                          |    2 +-
 tests/yaccdry.test                        |    2 +-
 tests/yaccvpath.test                      |    2 +-
 tests/yflags-cmdline-override.test        |    2 +-
 tests/yflags-force-conditional.test       |   16 +--
 tests/yflags-force-override.test          |    2 +-
 tests/yflags.test                         |   11 +-
 tests/yflags2.test                        |   11 +-
 189 files changed, 767 insertions(+), 291 deletions(-)
 create mode 100755 tests/self-check-explicit-skips.test

diff --git a/ChangeLog b/ChangeLog
index 39a2066..d26268d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,304 @@
+2011-05-25  Stefano Lattarini  <address@hidden>
+
+       testsuite: require C++ compiler explicitly in tests needing it
+       The list of the test scripts which needed a C++ compiler but
+       failed to require it explicitly has been found by running:
+         $ tests=`grep -lE 'CXX|\.c(c|\+\+|xx|pp)' *.test | tr '\n' ' '`
+         $ am_explicit_skips=yes CXX=false make check TESTS="$tests"
+       and looking for tests that reported FAIL instead of SKIP.
+       After the present change, all those previously failing tests
+       either pass or get correctly skipped.
+       * tests/subobj9.test: Require `c++', instead of explicitly
+       skipping on configure failure.  Add excerpts and/or details from
+       the original bug report that prompted this tests to be written.
+       * tests/silentcxx-gcc.test: Require g++.
+       * tests/silentcxx.test: Require c++.
+       * tests/suffix3.test: Likewise.
+
+2011-05-25  Stefano Lattarini  <address@hidden>
+
+       testsuite: don't require g++ where any C++ compiler is enough
+       * tests/specflg10.test ($required): Use `c++', not g++.
+       * tests/silent-many-generic.test: Likewise.
+
+2011-05-25  Stefano Lattarini  <address@hidden>
+
+       testsuite: require C compiler explicitly in tests needing it
+       The list of the test scripts which needed a C compiler but
+       failed to require it explicitly has been found by running:
+         $ am_explicit_skips=yes CC=false make check
+       and looking for tests that reported FAIL instead of SKIP.
+       After the present change, all those previously failing tests
+       either pass or get correctly skipped.
+       * tests/aclocal4.test ($required): Add `cc'.
+       * tests/ansi.test: Likewise.
+       * tests/ansi10.test: Likewise.
+       * tests/ansi3.test: Likewise.
+       * tests/ansi3b.test: Likewise.
+       * tests/ansi5.test: Likewise.
+       * tests/ansi6.test: Likewise.
+       * tests/ansi7.test: Likewise.
+       * tests/ansi9.test: Likewise.
+       * tests/backcompat6.test: Likewise.
+       * tests/canon7.test: Likewise.
+       * tests/check5.test: Likewise.
+       * tests/check7.test: Likewise.
+       * tests/check8.test: Likewise.
+       * tests/cond4.test: Likewise.
+       * tests/cond11.test: Likewise.
+       * tests/cond16.test: Likewise.
+       * tests/cond18.test: Likewise.
+       * tests/cond19.test: Likewise.
+       * tests/cond22.test: Likewise.
+       * tests/cond30.test: Likewise.
+       * tests/cond31.test: Likewise.
+       * tests/cond32.test: Likewise.
+       * tests/cond34.test: Likewise.
+       * tests/cond35.test: Likewise.
+       * tests/cond39.test: Likewise.
+       * tests/condd.test: Likewise.
+       * tests/cygnus-dependency-tracking.test: Likewise.
+       * tests/depcomp2.test: Likewise.
+       * tests/depcomp6.test: Likewise.
+       * tests/depcomp7.test: Likewise.
+       * tests/depcomp8a.test: Likewise.
+       * tests/depcomp8b.test: Likewise.
+       * tests/depdist.test: Likewise.
+       * tests/depend2.test: Likewise.
+       * tests/depend5.test: Likewise.
+       * tests/distcleancheck.test: Likewise.
+       * tests/distname.test: Likewise.
+       * tests/exeext.test: Likewise.
+       * tests/exeext4.test: Likewise.
+       * tests/extradep.test: Likewise.
+       * tests/extradep2.test: Likewise.
+       * tests/gnits2.test: Likewise.
+       * tests/gnits3.test: Likewise.
+       * tests/instdir-ltlib.test: Likewise.
+       * tests/instdir-prog.test: Likewise.
+       * tests/instfail.test: Likewise.
+       * tests/instfail-libtool.test: Likewise.
+       * tests/lex3.test: Likewise.
+       * tests/lex5.test: Likewise.
+       * tests/lexvpath.test: Likewise.
+       * tests/lex-subobj-nodep.test: Likewise.
+       * tests/lflags.test: Likewise.
+       * tests/libobj-basic.test: Likewise.
+       * tests/libobj2.test: Likewise.
+       * tests/libobj7.test: Likewise.
+       * tests/libobj10.test: Likewise.
+       * tests/libobj16a.test: Likewise.
+       * tests/libobj16b.test: Likewise.
+       * tests/libobj17.test: Likewise.
+       * tests/libobj19.test: Likewise.
+       * tests/libtool2.test: Likewise.
+       * tests/libtool3.test: Likewise.
+       * tests/libtool7.test: Likewise.
+       * tests/libtool9.test: Likewise.
+       * tests/libtoo10.test: Likewise.
+       * tests/libtoo11.test: Likewise.
+       * tests/ltcond.test: Likewise.
+       * tests/ltcond2.test: Likewise.
+       * tests/ltconv.test: Likewise.
+       * tests/ltinit.test: Likewise.
+       * tests/ltlibsrc.test: Likewise.
+       * tests/ltorder.test: Likewise.
+       * tests/nobase.test: Likewise.
+       * tests/nobase-libtool.test: Likewise.
+       * tests/mmodely.test: Likewise.
+       * tests/parallel-tests5.test: Likewise.
+       * tests/parallel-tests-suffix-prog.test: Likewise.
+       * tests/parallel-tests-ext-driver-prog.test: Likewise.
+       * tests/posixsubst-ldadd.test: Likewise.
+       * tests/posixsubst-libraries.test: Likewise.
+       * tests/posixsubst-ltlibraries.test: Likewise.
+       * tests/posixsubst-programs.test: Likewise.
+       * tests/posixsubst-sources.test: Likewise.
+       * tests/pr87.test: Likewise.
+       * tests/pr204.test: Likewise.
+       * tests/pr224.test: Likewise.
+       * tests/pr300-lib.test: Likewise.
+       * tests/pr300-ltlib.test: Likewise.
+       * tests/pr300-prog.test: Likewise.
+       * tests/pr401.test: Likewise.
+       * tests/pr401b.test: Likewise.
+       * tests/pr401c.test: Likewise.
+       * tests/remake-gnulib-add-acsubst.test: Likewise.
+       * tests/remake-gnulib-add-header.test: Likewise.
+       * tests/regex.test: Likewise.
+       * tests/repeated-options.test: Likewise.
+       * tests/silent.test: Likewise.
+       * tests/silent3.test: Likewise.
+       * tests/silent9.test: Likewise.
+       * tests/silent-lex-generic.test: Likewise.
+       * tests/silent-many-generic.test: Likewise.
+       * tests/silent-yacc-generic.test: Likewise.
+       * tests/specflg7.test: Likewise.
+       * tests/specflg9.test: Likewise.
+       * tests/specflg10.test: Likewise.
+       * tests/stdinc.test: Likewise.
+       * tests/strip.test: Likewise.
+       * tests/strip2.test: Likewise.
+       * tests/strip3.test: Likewise.
+       * tests/subdirbuiltsources.test: Likewise.
+       * tests/subobj3.test: Likewise.
+       * tests/subobj6.test: Likewise.
+       * tests/subobj11a.test: Likewise.
+       * tests/subpkg.test: Likewise.
+       * tests/subst2.test: Likewise.
+       * tests/subst3.test: Likewise.
+       * tests/substref.test: Likewise.
+       * tests/substre2.test: Likewise.
+       * tests/suffix5.test: Likewise.
+       * tests/suffix8.test: Likewise.
+       * tests/suffix10.test: Likewise.
+       * tests/suffix11.test: Likewise.
+       * tests/suffix12.test: Likewise.
+       * tests/suffix13.test: Likewise.
+       * tests/target-cflags.test: Likewise.
+       * tests/transform.test: Likewise.
+       * tests/transform2.test: Likewise.
+       * tests/yacc-basic.test: Likewise.
+       * tests/yacc-d-basic.test: Likewise.
+       * tests/yacc-clean.test: Likewise.
+       * tests/yacc-dist-nobuild.test: Likewise.
+       * tests/yacc-nodist.test: Likewise.
+       * tests/yaccvpath.test: Likewise.
+       * tests/yacc-d-vpath.test: Likewise.
+       * tests/yacc4.test: Likewise.
+       * tests/yacc7.test: Likewise.
+       * tests/yacc8.test: Likewise.
+       * tests/yaccdry.test: Likewise.
+       * tests/yflags-cmdline-override.test: Likewise.
+       * tests/yflags-force-override.test: Likewise.
+       * tests/python-virtualenv.test: Likewise.  Also, improve skip
+       messages.
+       * tests/subobj5.test ($required): Add `cc'.
+       (Makefile.am): Set `AUTOMAKE_OPTIONS' to `subdir-objects', and
+       add new checking rules `test-build' and `test-distdir'.
+       Extend the test by building and examining the distdir, the
+       program, and the object files.
+       * tests/postproc.test ($required): Add `cc'.
+       Avoid the explicit `|| Exit $?' after call to configure, which
+       is now either redundant (e.g., when `am_explicit_skips' is
+       unset), or counter-productive (e.g., when `am_explicit_skips'
+       is set to "yes").
+       * tests/pr243.test: Likewise.
+       * tests/pr266.test: Likewise.
+       * tests/pr220.test: Simplify so that it doesn't require a
+       C compiler anymore.
+       * tests/subdir5.test: Likewise.
+       * tests/subdir8.test: Likewise.
+       * tests/lflags.test: Likewise.
+       * tests/yflags.test: Likewise.
+       * tests/yflags-force-conditional.test: Likewise.
+       * tests/lflags2.test: Simplify so that it doesn't require a
+       C++ compiler anymore.   
+       * tests/yflags2.test: Likewise.
+       * tests/autohdrdry.test (configure.in): Remove unneeded call
+       to `AC_PROG_CC'.
+       * tests/pr287.test: Likewise.
+       * tests/check6.test: Likewise.
+       * tests/cond21.test: Likewise, plus some cosmetic adjustments.
+       * tests/upc.test: Skip if configure fails with status `77'.
+       * tests/upc3.test: Likewise.
+       * tests/vala4.test: Likewise.
+       * tests/nostdinc.test: Likewise.  Also, make grepping checks
+       on `Makefile.in'.  Update heading comments.
+       * tests/compile5.test: When we must skip, skip explicitly,
+       and with a meaningful message.
+       * tests/instspc-tests.sh: When running in "test-build" or
+       "test-install" mode (as determined by the value of variable
+       `$instspc_action'), require `cc'.  Adjust comments.
+       * tests/depmod-tests.sh: Likewise.
+
+2011-05-24  Stefano Lattarini  <address@hidden>
+
+       testsuite: allow user to ask for stricter skip semantics
+       Given how the Automake testsuite is currently structured, if a
+       command in a test script fails with status `77', the global test
+       outcome is considered a SKIP, because the value of `77' for `$?'
+       is passed to the exit trap.  Indeed, this happens in practice, as
+       an autoconf-generated configure script can exit with status `77'
+       if it fails to find, e.g., a required compiler.
+       While this behaviour is quite useful for avoiding spurious test
+       failures in the wild, it can also sometimes prevent the Automake
+       developers to easily see and declare the requirements of their
+       tests.
+       This change introduces a new variable `am_explicit_skips', meant to
+       be user-overridable, and which, when set to a "true" value (i.e.,
+       `yes' or `1'), require a direct call to `Exit 77' in order to make
+       the test outcome be considered a SKIP.
+       * tests/defs.in ($am__test_skipped): New variable, initialized
+       to `no'.
+       (Exit): Set `$am__test_skipped' to `yes' if passed an exit status
+       of 77.
+       (trap '...' 0): When `$am_explicit_skips' is set to a "true" value,
+       reset an exit status of `77' to `78' if $am__test_skipped is not
+       set to `yes'.
+       * tests/self-check-exit.test: Adjust: unset `am_explicit_skips'.
+       * tests/self-check-explicit-skips.test: New test.
+       * tests/Makefile.am (TESTS): Update.
+
+2011-05-24  Stefano Lattarini  <address@hidden>
+
+       testsuite: user can force skipping of compiler-requiring tests
+       * tests/defs (cc, c++, fortran, fortran77): Skip the test if
+       the relevant compiler is disabled by having the corresponding
+       variable (CC, CXX, FC and F77, respectively) set to "false".
+       (yacc): For consistency, skip the test when the YACC variable
+       is set to "false", not when it's set to "no".  Since we are at
+       it, fix the skip message to be shorter and more consistent.
+
+2011-05-23  Stefano Lattarini  <address@hidden>
+
+       tests: tweak and improve tests on "Simple Tests" driver
+       * tests/check.test: Make grepping of generated Makefile.in
+       slightly stricter.  Add trailing `:' command.
+       * tests/check2.test: Ensure verbose printing of captured make
+       output.  Make grepping of generated Makefile.in and of make
+       output stricter.  Add trailing `:' command.
+       * tests/check3.test: Likewise.  Also, fix minor error in a
+       comment.
+       * tests/check4.test: Stricter grepping of make output.  Use
+       `using_gmake' subroutine instead of copy&paste from defs.in
+       to determine whether $MAKE is GNU make.  Add a trailing `:'
+       command.
+       * tests/check6.test: Add trailing `:' command.
+       * tests/check10.test: Prefer redirection `>' over `>>' when
+       creating new files.  Ensure verbose printing of captured make
+       output.
+       * tests/check11.test: Likewise.
+       * tests/check7.test: Likewise.  Make grepping of make output
+       stricter.  Prefer "make distcheck" over a simple "make check"
+       in a VPATH build. Add trailing `:' command.
+       (a.c): Format following GNU coding standards.
+       (Makefile.am): Explicitly declare target `print-xfail-tests'
+       as PHONY.  Distribute $(check_SCRIPTS), for distcheck.
+       * tests/parallel-tests.test: Prefer redirection `>' over `>>'
+       when creating new files.
+       * tests/parallel-tests2.test: Likewise.
+       * tests/parallel-tests9.test: Likewise.
+       * tests/parallel-tests8.test: Likewise.  Make grepping of
+       automake stderr stricter.
+       * tests/check8.test: Likewise.  Make formatting of created
+       *.c files more consistent with GNU Coding Standards.
+       * tests/check-subst-prog.test (configure.in): Break overly
+       long lines.
+       (pass-prog.c, xfail-prog.c): Format them more consistently
+       with GNU Coding Standards.
+       * tests/parallel-tests3.test: Use a shorter and clearer skip
+       message.  Use the `unindent' subroutine to improve readability
+       of indented loop bodies.  Simplify the hack used to please
+       maintainer-check.
+       * tests/parallel-tests5.test: Make formatting of created *.c
+       files more consistent with GNU Coding Standards.  Use the
+       `unindent' subroutine to improve readability of indented loop
+       bodies.
+       * tests/parallel-tests10.test: Add blank line, for clarity.
+       Prefer trailing `:' over trailing `Exit 0', for consistency
+       with other tests.
+
 2011-05-21  Stefano Lattarini  <address@hidden>
 
        tests/README: small consistency improvement
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 954141b..ff20e25 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -850,6 +850,7 @@ self-check-cleanup.test \
 self-check-dir.test \
 self-check-env-sanitize.test \
 self-check-exit.test \
+self-check-explicit-skips.test \
 self-check-is_newest.test \
 self-check-me.test \
 self-check-report.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 711f4ca..55647ee 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -1115,6 +1115,7 @@ self-check-cleanup.test \
 self-check-dir.test \
 self-check-env-sanitize.test \
 self-check-exit.test \
+self-check-explicit-skips.test \
 self-check-is_newest.test \
 self-check-me.test \
 self-check-report.test \
diff --git a/tests/aclocal4.test b/tests/aclocal4.test
index 7b637bd..aa16aba 100755
--- a/tests/aclocal4.test
+++ b/tests/aclocal4.test
@@ -17,6 +17,7 @@
 # Make sure dependencies on aclocal.m4 are set correctly.
 # Report from Jim Meyering.
 
+required=cc
 . ./defs || Exit 1
 
 cat >>configure.in <<EOF
diff --git a/tests/ansi.test b/tests/ansi.test
index 066337a..aa2eb7f 100755
--- a/tests/ansi.test
+++ b/tests/ansi.test
@@ -18,6 +18,7 @@
 # Test for bug where ansi2knr.c is not included in distribution.
 # From François Pinard.
 
+required=cc
 . ./defs || Exit 1
 
 cat > Makefile.am << 'END'
diff --git a/tests/ansi10.test b/tests/ansi10.test
index 5cba1ce..208bbc5 100755
--- a/tests/ansi10.test
+++ b/tests/ansi10.test
@@ -16,7 +16,7 @@
 
 # Make sure ansi2knr works with $(LIBOBJS).
 
-required=native
+required='cc native'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/ansi3.test b/tests/ansi3.test
index f41035c..4aca8a2 100755
--- a/tests/ansi3.test
+++ b/tests/ansi3.test
@@ -17,7 +17,7 @@
 
 # Actual test of ansi2knr functionality.
 
-required=native
+required='cc native'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/ansi3b.test b/tests/ansi3b.test
index 59eef08..48ca7cb 100755
--- a/tests/ansi3b.test
+++ b/tests/ansi3b.test
@@ -19,7 +19,7 @@
 # of working gcc.  Same as ansi3.test, but with AUTOMAKE_OPTIONS
 # defined in configure.in.
 
-required=native
+required='cc native'
 . ./defs || Exit 1
 
 cat > configure.in << 'END'
diff --git a/tests/ansi5.test b/tests/ansi5.test
index b29183c..4490d8b 100755
--- a/tests/ansi5.test
+++ b/tests/ansi5.test
@@ -16,7 +16,7 @@
 
 # Test for ansi2knr in another directory.
 
-required=native
+required='cc native'
 . ./defs || Exit 1
 
 cat > configure.in << 'END'
diff --git a/tests/ansi6.test b/tests/ansi6.test
index 2a25ee1..7892d2b 100755
--- a/tests/ansi6.test
+++ b/tests/ansi6.test
@@ -17,7 +17,7 @@
 # Check ansi2knr on a source file in subdirectory.
 # From Kevin Ryde.
 
-required=native
+required='cc native'
 . ./defs || Exit 1
 
 cat > configure.in << 'END'
diff --git a/tests/ansi7.test b/tests/ansi7.test
index 3b0a37f..231d8c8 100755
--- a/tests/ansi7.test
+++ b/tests/ansi7.test
@@ -18,7 +18,7 @@
 # ansi6.test is the same test without subdir-objects.
 # From Kevin Ryde.
 
-required=native
+required='cc native'
 . ./defs || Exit 1
 
 cat > configure.in << 'END'
diff --git a/tests/ansi9.test b/tests/ansi9.test
index aba430d..52a68e8 100755
--- a/tests/ansi9.test
+++ b/tests/ansi9.test
@@ -18,6 +18,7 @@
 # can still be deansified.
 # Report from Paul D. Smith.
 
+required=cc
 . ./defs || Exit 1
 
 cat >>configure.in <<EOF
diff --git a/tests/autohdr4.test b/tests/autohdr4.test
index d9bacd3..430d75c 100755
--- a/tests/autohdr4.test
+++ b/tests/autohdr4.test
@@ -17,6 +17,7 @@
 # Check rebuild rules for AC_CONFIG_HEADERS.
 # (This should also work without GNU Make.)
 
+required=cc
 . ./defs || Exit 1
 
 cat >>configure.in <<'EOF'
diff --git a/tests/autohdrdry.test b/tests/autohdrdry.test
index c773154..b6208ff 100755
--- a/tests/autohdrdry.test
+++ b/tests/autohdrdry.test
@@ -20,7 +20,6 @@
 . ./defs || Exit 1
 
 cat >>configure.in <<'EOF'
-AC_PROG_CC
 AC_CONFIG_HEADERS([config.h])
 AC_OUTPUT
 EOF
diff --git a/tests/backcompat6.test b/tests/backcompat6.test
index 8db4630..343fd4e 100755
--- a/tests/backcompat6.test
+++ b/tests/backcompat6.test
@@ -19,6 +19,7 @@
 # This script can also serve as mild stress-testing for Automake.
 # See also the similar test `backcompat5.test'.
 
+required=cc
 . ./defs || Exit 1
 
 # Anyone doing something like this in a real-life package probably
diff --git a/tests/canon7.test b/tests/canon7.test
index 8df283c..4a4d66f 100755
--- a/tests/canon7.test
+++ b/tests/canon7.test
@@ -16,7 +16,7 @@
 
 # Stress test on canonicalization.
 
-required='libtool libtoolize'
+required='cc libtool libtoolize'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/check-subst-prog.test b/tests/check-subst-prog.test
index bda0629..245a251 100755
--- a/tests/check-subst-prog.test
+++ b/tests/check-subst-prog.test
@@ -17,14 +17,18 @@
 # Check @substituted@ TESTS, some of which are also PROGRAMS.
 # See also sister test `check-subst.test'.
 
-required=native
+required='cc native'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
 AC_PROG_CC
-AC_SUBST([script_tests], ['subst-pass-script.test subst-xfail-script.test'])
-AC_SUBST([prog_tests], ['subst-pass-prog.test$(EXEEXT) 
subst-xfail-prog.test$(EXEEXT)'])
-AC_SUBST([xfail_tests], ['xfail-script.test subst-xfail-script.test 
xfail-prog$(EXEEXT) subst-xfail-prog.test$(EXEEXT)'])
+AC_SUBST([script_tests],
+         ['subst-pass-script.test subst-xfail-script.test'])
+AC_SUBST([prog_tests],
+         ['subst-pass-prog.test$(EXEEXT) subst-xfail-prog.test$(EXEEXT)'])
+AC_SUBST([xfail_tests],
+         ['xfail-script.test subst-xfail-script.test]dnl
+         [ xfail-prog$(EXEEXT) subst-xfail-prog.test$(EXEEXT)'])
 AC_OUTPUT
 END
 
@@ -48,11 +52,11 @@ cp pass-script.test subst-pass-script.test
 cp xfail-script.test subst-xfail-script.test
 
 cat > pass-prog.c <<'END'
-int main() { return 0; }
+int main (void) { return 0; }
 END
 cat > xfail-prog.c <<'END'
 #include <stdlib.h>
-int main() { return EXIT_FAILURE; }
+int main (void) { return EXIT_FAILURE; }
 END
 # The .test extension is removed for the default source file name:
 cp pass-prog.c subst-pass-prog.c
diff --git a/tests/check.test b/tests/check.test
index 54432ec..2f9f8b1 100755
--- a/tests/check.test
+++ b/tests/check.test
@@ -28,11 +28,13 @@ $ACLOCAL
 $AUTOMAKE
 
 grep '^check-TESTS:' Makefile.in
-grep '^check-DEJAGNU' Makefile.in && Exit 1
+grep 'check-DEJAGNU' Makefile.in && Exit 1
 
 # check-TESTS is phony.
-sed -n '/^\.PHONY:/,/^$/p' Makefile.in | grep check-TESTS
+sed -n '/^\.PHONY:/,/^$/p' Makefile.in | $EGREP '(^| )check-TESTS($| )'
 
 # check should depend directly on check-am (similar tests are
 # in check2.test and check3.test).
-grep '^check: check-am' Makefile.in
+$EGREP '^check:.* check-am( |$)' Makefile.in
+
+:
diff --git a/tests/check10.test b/tests/check10.test
index 7025b98..0705188 100755
--- a/tests/check10.test
+++ b/tests/check10.test
@@ -27,15 +27,15 @@ TESTS = fail pass skip xfail xpass fail2 pass2 skip2 xfail2 
xpass2
 XFAIL_TESTS = xfail xpass xfail2 xpass2
 END
 
-cat >>pass <<'END'
+cat > pass <<'END'
 #! /bin/sh
 exit 0
 END
-cat >>fail <<'END'
+cat > fail <<'END'
 #! /bin/sh
 exit 1
 END
-cat >>skip <<'END'
+cat > skip <<'END'
 #! /bin/sh
 exit 77
 END
@@ -69,7 +69,7 @@ $AUTOMAKE
   env TESTS='pass skip xfail' $MAKE -e check
   $MAKE check
   :
-) >stdout
+) >stdout || { cat stdout; Exit 1; }
 cat stdout
 
 grep '1 [tT]ests' stdout && Exit 1
diff --git a/tests/check11.test b/tests/check11.test
index 912b619..5305c96 100755
--- a/tests/check11.test
+++ b/tests/check11.test
@@ -26,7 +26,7 @@ cat > Makefile.am << 'END'
 TESTS = skip skip2
 END
 
-cat >>skip <<'END'
+cat > skip <<'END'
 #! /bin/sh
 exit 77
 END
@@ -38,11 +38,11 @@ $AUTOCONF
 $AUTOMAKE -a
 
 ./configure
-env TESTS=skip $MAKE -e check >stdout
+env TESTS=skip $MAKE -e check >stdout || { cat stdout; Exit 1; }
 cat stdout
 grep '1.*passed' stdout && Exit 1
 
-env TESTS="skip skip2" $MAKE -e check >stdout
+env TESTS="skip skip2" $MAKE -e check >stdout || { cat stdout; Exit 1; }
 cat stdout
 grep '2.*passed' stdout && Exit 1
 
diff --git a/tests/check2.test b/tests/check2.test
index 9b8bfb1..d215518 100755
--- a/tests/check2.test
+++ b/tests/check2.test
@@ -47,16 +47,20 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
 ./configure
-$MAKE check >stdout
+
+$MAKE check >stdout || { cat stdout; Exit 1; }
 cat stdout
-grep 'PASS: subrun.sh' stdout
+grep '^PASS: subrun\.sh *$' stdout
+grep 'PASS.*echo\.sh' stdout && Exit 1
 
 # check should depend directly on check-am (similar tests are
 # in check.test and check3.test).
-grep 'check: check-recursive' Makefile.in
-grep 'check: check-am' dir/Makefile.in
+$EGREP '^check:.* check-recursive( |$)' Makefile.in
+$EGREP '^check:.* check-am( |$)' dir/Makefile.in
 
 # Make sure subrun.sh is still on its line as above.  This means Automake
 # hasn't rewritten the TESTS line unnecessarily (we can tell, because all
 # Automake variables are reformatted by VAR_PRETTY).
-grep '  subrun.sh' Makefile.in
+grep '^  subrun\.sh$' Makefile.in
+
+:
diff --git a/tests/check3.test b/tests/check3.test
index be40e3f..b4f4f9d 100755
--- a/tests/check3.test
+++ b/tests/check3.test
@@ -56,14 +56,16 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
 ./configure --prefix "`pwd`/inst"
-$MAKE check >stdout
+
+$MAKE check >stdout || { cat stdout; Exit 1; }
 cat stdout
-grep 'PASS: subrun.sh' stdout
+grep '^PASS: subrun\.sh *$' stdout
+grep 'PASS.*echo\.sh' stdout && Exit 1
 
-# check should depend directly on check-am (similar tests are
-# in check.test and check2.test).
-$FGREP 'check: $(BUILT_SOURCES)' Makefile.in
-$FGREP 'check: $(BUILT_SOURCES)' dir/Makefile.in
+# check should depend directly on $(BUILT_SOURCES) (similar tests
+# are in check.test and check2.test).
+$EGREP '^check:.* \$\(BUILT_SOURCES\)( |$)' Makefile.in
+$EGREP '^check:.* \$\(BUILT_SOURCES\)( |$)' dir/Makefile.in
 
 $MAKE clean
 # Sanity checks
@@ -73,3 +75,5 @@ test ! -f dir/command2.inc
 $MAKE install
 test -f command1.inc
 test -f dir/command2.inc
+
+:
diff --git a/tests/check4.test b/tests/check4.test
index 99adb23..417b2e4 100755
--- a/tests/check4.test
+++ b/tests/check4.test
@@ -48,35 +48,35 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
 ./configure --prefix "`pwd`/inst"
+
 $MAKE check >stdout && { cat stdout; Exit 1; }
 cat stdout
-grep 'FAIL: fail.sh' stdout
-grep 'PASS: ok.sh' stdout && Exit 1
+grep '^FAIL: fail\.sh *$' stdout
+grep '^PASS: ok\.sh *$' stdout && Exit 1
 
 # The exit status of `make -k' can be anything
 # (depending on the Make implementation)
 $MAKE -k check >stdout || :
 cat stdout
-grep 'FAIL: fail.sh' stdout
-grep 'PASS: ok.sh' stdout
+grep '^FAIL: fail\.sh *$' stdout
+grep '^PASS: ok\.sh *$' stdout
 
 # should also works when -k is not in first position
 $MAKE -s -k check >stdout || :
 cat stdout
-grep 'FAIL: fail.sh' stdout
-grep 'PASS: ok.sh' stdout
+grep '^FAIL: fail\.sh *' stdout
+grep '^PASS: ok\.sh *' stdout
 
 # The rest of the test is for GNU Make.
 
-# Use --version AND -v, because SGI Make doesn't fail on --version.
-# Also grep for GNU because newer versions of FreeBSD make do
-# not complain about `--version' (they seem to silently ignore it).
-($MAKE --version -v | grep GNU) || Exit 0
+if using_gmake; then
+  # Try with a long-option that do not have a short option equivalent
+  # (here, --no-print-directory).  That should cause all options to
+  # appear verbatim in MAKEFLAGS.
+  $MAKE --no-print-directory -k check >stdout || :
+  cat stdout
+  grep '^FAIL: fail\.sh *$' stdout
+  grep '^PASS: ok\.sh *$' stdout
+fi
 
-# Try with a long-option that do not have a short option equivalent
-# (here, --no-print-directory).  That should cause all options to
-# appear verbatim in MAKEFLAGS.
-$MAKE --no-print-directory -k check >stdout || :
-cat stdout
-grep 'FAIL: fail.sh' stdout
-grep 'PASS: ok.sh' stdout
+:
diff --git a/tests/check5.test b/tests/check5.test
index 639f343..a10989c 100755
--- a/tests/check5.test
+++ b/tests/check5.test
@@ -17,7 +17,7 @@
 
 # Test TESTS = $(check_PROGRAMS)
 
-required=native
+required='cc native'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/check6.test b/tests/check6.test
index b3ba9d8..9687008 100755
--- a/tests/check6.test
+++ b/tests/check6.test
@@ -20,7 +20,6 @@
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
-AC_PROG_CC
 AC_OUTPUT
 END
 
@@ -50,3 +49,5 @@ mkdir build
 cd build
 ../configure
 $MAKE check
+
+:
diff --git a/tests/check7.test b/tests/check7.test
index 5c5f4f3..e0b37c9 100755
--- a/tests/check7.test
+++ b/tests/check7.test
@@ -16,6 +16,7 @@
 
 # Check EXEEXT extension for XFAIL_TESTS.
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
@@ -28,20 +29,25 @@ TESTS = $(XFAIL_TESTS)
 XFAIL_TESTS = a b c d
 check_PROGRAMS = a c d
 check_SCRIPTS = b
+EXTRA_DIST = $(check_SCRIPTS)
 
+.PHONY: print-xfail-tests
 print-xfail-tests:
        @echo BEG: $(XFAIL_TESTS) :END
 END
 
-cat >>b <<'END'
+cat > b <<'END'
 #! /bin/sh
 exit 1
 END
 chmod a+x b
 
-cat >>a.c <<'END'
+cat > a.c <<'END'
 #include <stdlib.h>
-int main() { return EXIT_FAILURE; }
+int main (void)
+{
+  return EXIT_FAILURE;
+}
 END
 
 cp a.c c.c
@@ -53,12 +59,10 @@ $AUTOMAKE -a
 
 ./configure
 $MAKE check
-EXEEXT=.bin $MAKE -e print-xfail-tests >foo
-cat foo
-grep 'BEG: a.bin b c.bin d.bin :END' foo
+EXEEXT=.bin $MAKE -e print-xfail-tests >stdout || {  cat stdout; Exit 1; }
+cat stdout
+$FGREP 'BEG: a.bin b c.bin d.bin :END' stdout
 
-$MAKE distclean
-mkdir build
-cd build
-../configure
-$MAKE check
+$MAKE distcheck
+
+:
diff --git a/tests/check8.test b/tests/check8.test
index c8711e8..2258161 100755
--- a/tests/check8.test
+++ b/tests/check8.test
@@ -16,7 +16,7 @@
 
 # Check subdir TESTS.
 
-required=native
+required='cc native'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
@@ -34,29 +34,29 @@ END
 
 mkdir sub
 
-cat >>foo <<'END'
+cat > foo <<'END'
 #! /bin/sh
 test -f "$srcdir/Makefile.am"
 END
-cat >>sub/foo <<'END'
+cat > sub/foo <<'END'
 #! /bin/sh
 test -f "$srcdir/Makefile.am"
 END
 chmod a+x foo sub/foo
 
-cat >>bar.c <<'END'
-int main() { return 0; }
+cat > bar.c <<'END'
+int main (void) { return 0; }
 END
-cat >>sub/bar.c <<'END'
-int main() { return 0; }
+cat > sub/bar.c <<'END'
+int main (void) { return 0; }
 END
-cat >>baz.c <<'END'
+cat > baz.c <<'END'
 #include <stdlib.h>
-int main() { return EXIT_FAILURE; }
+int main (void) { return EXIT_FAILURE; }
 END
-cat >>sub/baz.c <<'END'
+cat > sub/baz.c <<'END'
 #include <stdlib.h>
-int main() { return EXIT_FAILURE; }
+int main (void) { return EXIT_FAILURE; }
 END
 
 $ACLOCAL
diff --git a/tests/compile5.test b/tests/compile5.test
index 6f4f4bd..cd8baee 100755
--- a/tests/compile5.test
+++ b/tests/compile5.test
@@ -37,20 +37,21 @@ END
 
 : >Makefile.am
 
+# This will be sourced, nor executed.
 cat >check_host.in << 'END'
-#! /bin/sh
-case @host_os@ in
+case '@host_os@' in
   mingw*)
     ;;
   *)
-    exit 77
+    skip_ "target OS is not MinGW"
     ;;
 esac
 case @build_os@ in
   mingw* | cygwin*)
     ;;
   *)
-    winepath -w / || exit 77
+    winepath -w / \
+      || skip_ "not on MinGW or Cygwin, and winepath not available"
     ;;
 esac
 END
@@ -59,7 +60,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 ./configure
-./check_host
+. ./check_host
 
 pwd=`pwd`
 
diff --git a/tests/cond11.test b/tests/cond11.test
index 1df840a..9e7f6da 100755
--- a/tests/cond11.test
+++ b/tests/cond11.test
@@ -18,6 +18,7 @@
 # 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'
diff --git a/tests/cond16.test b/tests/cond16.test
index 483fa64..d27472c 100755
--- a/tests/cond16.test
+++ b/tests/cond16.test
@@ -18,6 +18,7 @@
 # references.
 # Report from Richard Boulton
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/cond18.test b/tests/cond18.test
index 577c31a..57c5516 100755
--- a/tests/cond18.test
+++ b/tests/cond18.test
@@ -17,7 +17,7 @@
 # Regression test for substitution references to conditional variables.
 # Report from Richard Boulton
 
-required=GNUmake
+required='cc GNUmake'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/cond19.test b/tests/cond19.test
index a913575..c5ac15a 100755
--- a/tests/cond19.test
+++ b/tests/cond19.test
@@ -17,7 +17,7 @@
 # Regression test for substitution references to conditional variables.
 # Report from Richard Boulton
 
-required=GNUmake
+required='cc GNUmake'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/cond21.test b/tests/cond21.test
index 5d1db76..cf20452 100755
--- a/tests/cond21.test
+++ b/tests/cond21.test
@@ -19,10 +19,9 @@
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
-AC_PROG_CC
-AM_CONDITIONAL(COND1, true)
-AM_CONDITIONAL(COND2, true)
-AM_CONDITIONAL(COND3, true)
+AM_CONDITIONAL([COND1], [true])
+AM_CONDITIONAL([COND2], [true])
+AM_CONDITIONAL([COND3], [true])
 AC_OUTPUT
 END
 
@@ -61,6 +60,7 @@ if COND3
   BAR += bar3
 endif
 
+.PHONY: test
 test:
        @echo BAR: $(BAR) :BAR
        @echo FOO: $(FOO) :FOO
@@ -72,3 +72,5 @@ $AUTOMAKE -a
 ./configure
 $MAKE test | $FGREP 'BAR: bar12 bar bar3 :BAR'
 $MAKE test | $FGREP 'FOO: foo foo1 foo2 foo1b :FOO'
+
+:
diff --git a/tests/cond22.test b/tests/cond22.test
index 3354077..4d88f9d 100755
--- a/tests/cond22.test
+++ b/tests/cond22.test
@@ -17,6 +17,7 @@
 # Regression test for bug when sources listed in conditional.
 # Report from Richard Boulton.  PR/326.
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/cond30.test b/tests/cond30.test
index d156297..e1c1341 100755
--- a/tests/cond30.test
+++ b/tests/cond30.test
@@ -16,6 +16,7 @@
 
 # For PR/352: make sure we support bin_PROGRAMS being defined conditionally.
 
+required=cc
 . ./defs || Exit 1
 
 cat >>configure.in <<'EOF'
diff --git a/tests/cond31.test b/tests/cond31.test
index 7deb999..70feffc 100755
--- a/tests/cond31.test
+++ b/tests/cond31.test
@@ -16,6 +16,7 @@
 
 # Make sure we define conditional _DEPENDENCIES correctly.
 
+required=cc
 . ./defs || Exit 1
 
 cat >>configure.in <<'EOF'
diff --git a/tests/cond32.test b/tests/cond32.test
index 0e5e5d2..57113dd 100755
--- a/tests/cond32.test
+++ b/tests/cond32.test
@@ -16,6 +16,7 @@
 
 # Make sure the user can override a conditional _DEPENDENCIES.
 
+required=cc
 . ./defs || Exit 1
 
 cat >>configure.in <<'EOF'
diff --git a/tests/cond34.test b/tests/cond34.test
index 9b951f5..13b7a27 100755
--- a/tests/cond34.test
+++ b/tests/cond34.test
@@ -17,6 +17,7 @@
 # Check for _DEPDENDENCIES definition with conditional _LDADD.
 # Report from Elena A. Vengerova
 
+required=cc
 . ./defs || Exit 1
 
 cat >>configure.in <<'EOF'
diff --git a/tests/cond35.test b/tests/cond35.test
index 8aa1333..2fba1f1 100755
--- a/tests/cond35.test
+++ b/tests/cond35.test
@@ -17,7 +17,7 @@
 # Check rules output for parser defined conditionally.
 # Report from Roman Fietze.
 
-required='flex yacc'
+required='cc flex yacc'
 . ./defs || Exit 1
 
 cat >>configure.in <<'EOF'
diff --git a/tests/cond39.test b/tests/cond39.test
index 3deb1cf..f6a916e 100755
--- a/tests/cond39.test
+++ b/tests/cond39.test
@@ -20,7 +20,9 @@
 
 # Build either as CONFIG_FILE or as PROGRAM.
 
+required=cc
 . ./defs || Exit 1
+
 mkdir sub
 
 cat >>configure.in <<'END'
diff --git a/tests/cond4.test b/tests/cond4.test
index 7c56103..8a7fcd3 100755
--- a/tests/cond4.test
+++ b/tests/cond4.test
@@ -17,7 +17,7 @@
 
 # Another sources-in-conditional test.  Report from Tim Goodwin.
 
-required=GNUmake
+required='cc GNUmake'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/condd.test b/tests/condd.test
index ef5f7c7..71d10ea 100755
--- a/tests/condd.test
+++ b/tests/condd.test
@@ -17,6 +17,7 @@
 
 # Test for bug in conditionals.
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/cygnus-dependency-tracking.test 
b/tests/cygnus-dependency-tracking.test
index 1bfec25..e5df33c 100755
--- a/tests/cygnus-dependency-tracking.test
+++ b/tests/cygnus-dependency-tracking.test
@@ -17,6 +17,7 @@
 # Check that cygnus mode disables automatic dependency tracking.
 # And check that this *cannot* be overridden.
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in <<'END'
diff --git a/tests/defs b/tests/defs
index b254ef4..e3c922c 100644
--- a/tests/defs
+++ b/tests/defs
@@ -103,6 +103,10 @@ unset VERBOSE
 ##  Auxiliary shell functions.  ##
 ## ---------------------------- ##
 
+# This is used in `Exit' and in the exit trap.  See comments in the latter
+# for more information,
+am__test_skipped=no
+
 # We use a trap below for cleanup.  This requires us to go through
 # hoops to get the right exit status transported through the signal.
 # So use `Exit STATUS' instead of `exit STATUS' inside of the tests.
@@ -111,8 +115,9 @@ unset VERBOSE
 Exit ()
 {
   set +e
-  (exit $1)
-  exit $1
+  # See comments in the exit trap for the reason we do this.
+  test 77 = $1 && am__test_skipped=yes
+  (exit $1); exit $1
 }
 
 # Print warnings (e.g., about skipped and failed tests) to this file
@@ -256,9 +261,14 @@ do
   # Check that each required tool is present.
   case $tool in
     :) ;;
-    cc|c++|fortran|fortran77)
-      echo "$me: dummy requirement '$tool', no check done"
-      ;;
+    cc)
+      test "$CC"  = false && skip_ "no C compiler available";;
+    c++)
+      test "$CXX" = false && skip_ "no C++ compiler available";;
+    fortran)
+      test "$FC"  = false && skip_ "no Fortran compiler available";;
+    fortran77)
+      test "$F77" = false && skip_ "no Fortran 77 compiler available";;
     bzip2)
       # Do not use --version, bzip2 still tries to compress stdin.
       echo "$me: running bzip2 --help"
@@ -471,11 +481,8 @@ do
       flex --version || exit 77
       ;;
     yacc)
-      if test x"$YACC" = x"no"; then
-        # The user has explicitly told he doesn't want a yacc program
-        # to be used.
-        skip_ "$me: \$YACC is \"no\", skipping test"
-      elif test -z "$YACC"; then
+      test "$YACC" = false && skip_ "no Yacc program available"
+      if test -z "$YACC"; then
         # The user hasn't explicitly specified any yacc program in the
         # environment, so we try to use bison, skipping the test if it's
         # not found.
@@ -602,6 +609,19 @@ if test "$sh_errexit_works" = yes; then
   trap 'exit_status=$?
     set +e
     cd "$testbuilddir"
+    # This is to ensure that a test script does give a SKIP outcome just
+    # because a command in it happens to exit with status 77.  This
+    # behaviour, while from time to time useful to developers, is not
+    # meant to be enabled by default, as it could cause spurious failures
+    # in the wild.  Thus it will be enabled only when the variable
+    # "am_explicit_skips" is set to a "true" value.
+    case $am_explicit_skips in
+      [yY]|[yY]es|1)
+        if test $exit_status -eq 77 && test $am__test_skipped != yes; then
+          exit_status=78
+        fi
+        ;;
+    esac
     case $exit_status,$keep_testdirs in
     0,)
       find $testSubDir -type d ! -perm -700 -exec chmod u+rwx {} ";"
diff --git a/tests/depcomp2.test b/tests/depcomp2.test
index 63398db..2bceaaf 100755
--- a/tests/depcomp2.test
+++ b/tests/depcomp2.test
@@ -17,6 +17,7 @@
 # Test to make sure that depcomp is not used when it's not installed
 # From Pavel Roskin.
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/depcomp6.test b/tests/depcomp6.test
index baf9fd5..13e8c83 100755
--- a/tests/depcomp6.test
+++ b/tests/depcomp6.test
@@ -16,6 +16,7 @@
 
 # Check dependency generation (non libtool case).
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/depcomp7.test b/tests/depcomp7.test
index f404039..87f86b9 100755
--- a/tests/depcomp7.test
+++ b/tests/depcomp7.test
@@ -16,7 +16,7 @@
 
 # Check dependency generation (libtool case).
 
-required='libtoolize'
+required='cc libtoolize'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/depcomp8a.test b/tests/depcomp8a.test
index 06544d8..9866cfd 100755
--- a/tests/depcomp8a.test
+++ b/tests/depcomp8a.test
@@ -19,6 +19,7 @@
 # Keep this in sync with sister test `depcomp8b.test', which checks the
 # same thing for libtool objects.
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/depcomp8b.test b/tests/depcomp8b.test
index e4cd632..15dd109 100755
--- a/tests/depcomp8b.test
+++ b/tests/depcomp8b.test
@@ -19,7 +19,7 @@
 # Keep this in sync with sister test `depcomp8a.test', which checks the
 # same thing for non-libtool objects.
 
-required=libtoolize
+required='cc libtoolize'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/depdist.test b/tests/depdist.test
index 338763a..d5644de 100755
--- a/tests/depdist.test
+++ b/tests/depdist.test
@@ -17,6 +17,7 @@
 # Make sure depcomp is found for the distribution.
 # From Eric Magnien.
 
+required=cc
 . ./defs || Exit 1
 
 rm -f configure.in
diff --git a/tests/depend2.test b/tests/depend2.test
index a5ca0c0..9956804 100755
--- a/tests/depend2.test
+++ b/tests/depend2.test
@@ -19,6 +19,7 @@
 # --disable-dependency-tracking.
 # Report from Robert Boehne
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/depend5.test b/tests/depend5.test
index bd14c72..9d1bb41 100755
--- a/tests/depend5.test
+++ b/tests/depend5.test
@@ -17,6 +17,7 @@
 # Check that _AM_OUTPUT_DEPENDENCY_COMMANDS works with eval-style
 # quoting in $CONFIG_FILES, done by newer Autoconf.
 
+required=cc
 . ./defs || Exit 1
 
 cat >>configure.in << END
diff --git a/tests/depmod-tests.sh b/tests/depmod-tests.sh
index 2be8af0..36b5719 100755
--- a/tests/depmod-tests.sh
+++ b/tests/depmod-tests.sh
@@ -166,9 +166,12 @@ fi
 # the errexit flag, since the setup code might not be prepared to deal
 # with it.  Also pre-set `$me' for `tests/defs', so that different calls
 # to `depmod-tests.sh' won't try to use the same temporary directory.
+# The actual tests require a C compiler, so require it for them; but do
+# not require it when generating data, as it's not needed then.
 if test x"$action" = x"generate-data"; then
   me=depmod-data
 else
+  required=cc
   me=depcomp-$depmode
 fi
 set +e
diff --git a/tests/distcleancheck.test b/tests/distcleancheck.test
index b27ab07..cf2b0fe 100755
--- a/tests/distcleancheck.test
+++ b/tests/distcleancheck.test
@@ -17,6 +17,7 @@
 # Make sure the suggested `distcleancheck_listfiles' in the manual works.
 # The example Makefile.am we use is from the FAQ entry `distcleancheck'.
 
+required=cc
 . ./defs || Exit 1
 
 cat >>configure.in << 'END'
diff --git a/tests/distname.test b/tests/distname.test
index f940045..d090fe9 100755
--- a/tests/distname.test
+++ b/tests/distname.test
@@ -18,6 +18,7 @@
 # Test of names in tar file.
 # From Rainer Orth
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/exeext.test b/tests/exeext.test
index 70d7efa..08cc034 100755
--- a/tests/exeext.test
+++ b/tests/exeext.test
@@ -22,6 +22,7 @@
 # Also make sure the old definitions of bin_PROGRAMS and friend
 # aren't left around.  Report from Jim Meyering.
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/exeext4.test b/tests/exeext4.test
index c3f968c..e78a508 100755
--- a/tests/exeext4.test
+++ b/tests/exeext4.test
@@ -17,6 +17,7 @@
 # Make sure $(EXEEXT) is appended to programs and to tests that are
 # programs, but not to @address@hidden
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/extradep.test b/tests/extradep.test
index 623d73a..7f3478e 100755
--- a/tests/extradep.test
+++ b/tests/extradep.test
@@ -16,6 +16,7 @@
 
 # Test EXTRA_*_DEPENDENCIES.  See extradep2 for libtool variant.
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/extradep2.test b/tests/extradep2.test
index 9a97de4..86caa5d 100755
--- a/tests/extradep2.test
+++ b/tests/extradep2.test
@@ -16,7 +16,7 @@
 
 # Test EXTRA_*_DEPENDENCIES, libtool version; see extradep.test.
 
-required=libtoolize
+required='cc libtoolize'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/gnits2.test b/tests/gnits2.test
index 1b60387..255ba7b 100755
--- a/tests/gnits2.test
+++ b/tests/gnits2.test
@@ -17,7 +17,7 @@
 
 # Test to ensure std-options checking is correct.
 
-required=native
+required='cc native'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/gnits3.test b/tests/gnits3.test
index 0c86835..5813527 100755
--- a/tests/gnits3.test
+++ b/tests/gnits3.test
@@ -16,6 +16,7 @@
 
 # Check that AM_INSTALLCHECK_STD_OPTIONS_EXEMPT works.
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/instdir-ltlib.test b/tests/instdir-ltlib.test
index a90536d..0d9afd6 100755
--- a/tests/instdir-ltlib.test
+++ b/tests/instdir-ltlib.test
@@ -18,7 +18,7 @@
 # be installed there.
 # This test exercises the libtool code paths.
 
-required=libtoolize
+required='cc libtoolize'
 . ./defs || Exit 1
 
 cat >>configure.in <<'END'
diff --git a/tests/instdir-prog.test b/tests/instdir-prog.test
index eb52933..9ca67ad 100755
--- a/tests/instdir-prog.test
+++ b/tests/instdir-prog.test
@@ -18,6 +18,7 @@
 # nothing should be installed there.
 # This test exercises the prog and libs code paths.
 
+required=cc
 . ./defs || Exit 1
 
 cat >>configure.in <<'END'
diff --git a/tests/instfail-libtool.test b/tests/instfail-libtool.test
index 114f290..3d520f1 100755
--- a/tests/instfail-libtool.test
+++ b/tests/instfail-libtool.test
@@ -19,7 +19,7 @@
 
 # This is the libtool sister test of instfail.test
 
-required='libtool libtoolize'
+required='cc libtool libtoolize'
 . ./defs || Exit 1
 
 cat >>configure.in <<END
diff --git a/tests/instfail.test b/tests/instfail.test
index 4404387..7631243 100755
--- a/tests/instfail.test
+++ b/tests/instfail.test
@@ -19,6 +19,7 @@
 
 # This test has a few sister tests, for java, info, libtool.
 
+required=cc
 . ./defs || Exit 1
 
 cat >>configure.in <<END
diff --git a/tests/instspc-tests.sh b/tests/instspc-tests.sh
index 70c1a65..c57efb7 100755
--- a/tests/instspc-tests.sh
+++ b/tests/instspc-tests.sh
@@ -268,9 +268,12 @@ fi
 # the errexit flag, since the setup code might not be prepared to deal
 # with it.  Also pre-set `$me' for `tests/defs', so that different calls
 # to `instspc-tests.sh' won't try to use the same temporary directory.
+# The actual tests require a C compiler, so require it for them; but do
+# not require it when generating data, as it's not needed then.
 if test x"$instspc_action" = x"generate-data"; then
   me=instspc-data
 else
+  required=cc
   me=$instspc_action-$instspc_test_name
 fi
 set +e
diff --git a/tests/lex-subobj-nodep.test b/tests/lex-subobj-nodep.test
index 5f201cb..322ae96 100755
--- a/tests/lex-subobj-nodep.test
+++ b/tests/lex-subobj-nodep.test
@@ -17,7 +17,7 @@
 # Ensure subdirs for subdir scanners are generated when subdir-objects
 # are used, even when dependency tracking is disabled.
 
-required=flex
+required='cc flex'
 . ./defs || Exit 1
 
 cat >>configure.in <<\END
diff --git a/tests/lex3.test b/tests/lex3.test
index 2b7f3d1..7def55a 100755
--- a/tests/lex3.test
+++ b/tests/lex3.test
@@ -19,7 +19,7 @@
 # Test associated with PR 19.
 # From Matthew D. Langston.
 
-required='flex GNUmake'
+required='cc flex GNUmake'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/lex5.test b/tests/lex5.test
index d57a619..ee4306f 100755
--- a/tests/lex5.test
+++ b/tests/lex5.test
@@ -17,7 +17,7 @@
 
 # Test for subdir lexers.
 
-required='GNUmake flex'
+required='cc GNUmake flex'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/lexvpath.test b/tests/lexvpath.test
index 4b75950..212db31 100755
--- a/tests/lexvpath.test
+++ b/tests/lexvpath.test
@@ -22,7 +22,7 @@
 
 # Please keep this in sync with sister test `yaccvapth.test'.
 
-required=flex
+required='cc flex'
 . ./defs || Exit 1
 
 cat > lexoutroot.in << 'END'
diff --git a/tests/lflags.test b/tests/lflags.test
index da207fb..42e6da0 100755
--- a/tests/lflags.test
+++ b/tests/lflags.test
@@ -19,6 +19,7 @@
 # Please keep this in sync with the sister tests lflags2.test, yflags.test
 # and yflags2.test
 
+required=cc
 . ./defs || Exit 1
 
 cat >fake-lex <<'END'
@@ -33,7 +34,7 @@ chmod a+x fake-lex
 unset LEX || :
 
 cat >> configure.in <<'END'
-AC_PROG_CC
+AC_SUBST([CC], [false])
 # Simulate presence of Lex using our fake-lex script.
 AC_SUBST([LEX], ['$(abs_top_srcdir)'/fake-lex])
 AC_SUBST([LEX_OUTPUT_ROOT], [lex.yy])
@@ -42,6 +43,7 @@ AC_OUTPUT
 END
 
 cat > Makefile.am <<'END'
+AUTOMAKE_OPTIONS = no-dependencies
 bin_PROGRAMS = foo bar
 foo_SOURCES = main.c foo.l
 bar_SOURCES = main.c bar.l
@@ -55,19 +57,17 @@ $AUTOMAKE -a
 grep '\$(LFLAGS).*\$(bar_LFLAGS)' Makefile.in && Exit 1
 grep '\$(LFLAGS).*\$(AM_LFLAGS)' Makefile.in && Exit 1
 
-echo 'int main(void){ return 0; }' > main.c
 : > foo.l
 : > bar.l
 
 $AUTOCONF
 ./configure
-env LFLAGS=__user_flags__ $MAKE -e
-
-ls -l
+env LFLAGS=__user_flags__ $MAKE -e foo.c bar-bar.c
 
 cat foo.c
-grep '__am_flags__.*__user_flags__' foo.c
 cat bar-bar.c
+
+grep '__am_flags__.*__user_flags__' foo.c
 grep '__bar_flags__.*__user_flags__' bar-bar.c
 
 :
diff --git a/tests/lflags2.test b/tests/lflags2.test
index 6c73121..f78de85 100755
--- a/tests/lflags2.test
+++ b/tests/lflags2.test
@@ -33,7 +33,7 @@ chmod a+x fake-lex
 unset LEX || :
 
 cat >> configure.in <<'END'
-AC_PROG_CXX
+AC_SUBST([CXX], [false])
 # Simulate presence of Lex using our fake-lex script.
 AC_SUBST([LEX], ['$(abs_top_srcdir)'/fake-lex])
 AC_SUBST([LEX_OUTPUT_ROOT], [lex.yy])
@@ -42,6 +42,7 @@ AC_OUTPUT
 END
 
 cat > Makefile.am <<'END'
+AUTOMAKE_OPTIONS = no-dependencies
 bin_PROGRAMS = foo bar
 foo_SOURCES = main.cc foo.ll
 bar_SOURCES = main.cc bar.l++
@@ -55,19 +56,17 @@ $AUTOMAKE -a
 grep '\$(LFLAGS).*\$(bar_LFLAGS)' Makefile.in && Exit 1
 grep '\$(LFLAGS).*\$(AM_LFLAGS)' Makefile.in && Exit 1
 
-echo 'int main(void) { return 0; }' > main.cc
 : > foo.ll
 : > bar.l++
 
 $AUTOCONF
 ./configure
-env LFLAGS=__user_flags__ $MAKE -e
-
-ls -l
+env LFLAGS=__user_flags__ $MAKE -e foo.cc bar-bar.c++
 
 cat foo.cc
-grep '__am_flags__.*__user_flags__' foo.cc
 cat bar-bar.c++
+
+grep '__am_flags__.*__user_flags__' foo.cc
 grep '__bar_flags__.*__user_flags__' bar-bar.c++
 
 :
diff --git a/tests/libobj-basic.test b/tests/libobj-basic.test
index 0fe0278..157dd01 100755
--- a/tests/libobj-basic.test
+++ b/tests/libobj-basic.test
@@ -16,6 +16,7 @@
 
 # Make sure AC_LIBSOURCE and AC_LIBSOURCES work.
 
+required=cc
 . ./defs || Exit 1
 
 mv configure.in configure.proto
diff --git a/tests/libobj10.test b/tests/libobj10.test
index f891e85..85b3d8a 100755
--- a/tests/libobj10.test
+++ b/tests/libobj10.test
@@ -18,6 +18,7 @@
 # Do not complain about the nonexistence of a source for LIBOBJS if
 # it's in BUILT_SOURCES.  Reported by Erez Zadok.
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/libobj16a.test b/tests/libobj16a.test
index 9946bc5..9b7c6fb 100755
--- a/tests/libobj16a.test
+++ b/tests/libobj16a.test
@@ -17,6 +17,7 @@
 # Make sure AC_LIBOBJ and friends work.
 # Please keep this in sync with sister test `libobj16b.test'.
 
+required=cc
 . ./defs || Exit 1
 
 mv configure.in configure.proto
diff --git a/tests/libobj16b.test b/tests/libobj16b.test
index 1039558..9f60883 100755
--- a/tests/libobj16b.test
+++ b/tests/libobj16b.test
@@ -15,8 +15,9 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Make sure AC_LIBOBJ and friends work.
-# Please keep this in sync with sister test `libobj16b.test'.
+# Please keep this in sync with sister test `libobj16a.test'.
 
+required=cc
 . ./defs || Exit 1
 
 mv configure.in configure.proto
diff --git a/tests/libobj17.test b/tests/libobj17.test
index 4f9db57..c753f7d 100755
--- a/tests/libobj17.test
+++ b/tests/libobj17.test
@@ -16,6 +16,7 @@
 
 # Make sure AC_LIBOBJ accept non-literal arguments.
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/libobj19.test b/tests/libobj19.test
index bc495b5..8e595c2 100755
--- a/tests/libobj19.test
+++ b/tests/libobj19.test
@@ -16,6 +16,7 @@
 
 # Test support for AC_CONFIG_LIBOBJ_DIR.
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/libobj2.test b/tests/libobj2.test
index 66ca0d0..350f605 100755
--- a/tests/libobj2.test
+++ b/tests/libobj2.test
@@ -18,6 +18,7 @@
 # Test to make sure LIBOBJS works in subdirs.
 # Bug from Josh MacDonald.
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/libobj7.test b/tests/libobj7.test
index b7556b7..22207d7 100755
--- a/tests/libobj7.test
+++ b/tests/libobj7.test
@@ -17,6 +17,7 @@
 
 # Test for multiple replacement functions.
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/libtoo10.test b/tests/libtoo10.test
index 72310bb..0d999dc 100755
--- a/tests/libtoo10.test
+++ b/tests/libtoo10.test
@@ -17,8 +17,9 @@
 # Make sure .libs directories are removed for _PROGRAMS.
 # Report from Guillermo Ontañón.
 
-required=libtoolize
+required='cc libtoolize'
 . ./defs || Exit 1
+
 cat >> configure.in << 'END'
 AC_PROG_LIBTOOL
 AC_OUTPUT
diff --git a/tests/libtoo11.test b/tests/libtoo11.test
index 4cfcda5..e7b7354 100755
--- a/tests/libtoo11.test
+++ b/tests/libtoo11.test
@@ -17,8 +17,9 @@
 # Make sure config.lt is removed with Libtool 2.2.x's LT_OUTPUT.
 # Report by Charles Wilson.
 
-required=libtoolize
+required='cc libtoolize'
 . ./defs || Exit 1
+
 cat >> configure.in << 'END'
 AC_PROG_LIBTOOL
 m4_ifdef([LT_OUTPUT], [LT_OUTPUT])
@@ -33,4 +34,5 @@ $AUTOMAKE --add-missing
 $AUTOCONF
 ./configure
 $MAKE distcheck
+
 :
diff --git a/tests/libtool3.test b/tests/libtool3.test
index b50cde2..86a04b4 100755
--- a/tests/libtool3.test
+++ b/tests/libtool3.test
@@ -17,7 +17,7 @@
 # Try to build and package a program linked to a Libtool library.
 # Also make sure we do not bloat the Makefile with unneeded rules.
 
-required=libtoolize
+required='cc libtoolize'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/libtool7.test b/tests/libtool7.test
index ad8e2ec..90ae862 100755
--- a/tests/libtool7.test
+++ b/tests/libtool7.test
@@ -17,7 +17,7 @@
 # Make sure we allow Libtool's -dlopen/-dlpreopen
 # Also check basic support for AM_LIBTOOLFLAGS/LIBTOOLFLAGS
 
-required=libtoolize
+required='cc libtoolize'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/libtool9.test b/tests/libtool9.test
index b025719..ab6266e 100755
--- a/tests/libtool9.test
+++ b/tests/libtool9.test
@@ -19,7 +19,7 @@
 # Quite similar to libtool7.test, using AM_LDFLAGS in addition to
 # xxx_LDFLAGS.
 
-required=libtoolize
+required='cc libtoolize'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/ltcond.test b/tests/ltcond.test
index 1c4069d..2dc64e0 100755
--- a/tests/ltcond.test
+++ b/tests/ltcond.test
@@ -17,7 +17,7 @@
 # Test for conditional libtool libraries.
 # This combines two examples from the manual.
 
-required=libtoolize
+required='cc libtoolize'
 . ./defs || Exit 1
 
 cat >>configure.in <<'END'
diff --git a/tests/ltcond2.test b/tests/ltcond2.test
index b917eb4..42da11b 100755
--- a/tests/ltcond2.test
+++ b/tests/ltcond2.test
@@ -16,7 +16,7 @@
 
 # Test for bug in conditionals.
 
-required='native libtoolize'
+required='cc native libtoolize'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/ltconv.test b/tests/ltconv.test
index 65ee86d..c0a1099 100755
--- a/tests/ltconv.test
+++ b/tests/ltconv.test
@@ -17,7 +17,7 @@
 # Test for libtool convenience libraries.
 # This example is taken from the manual.
 
-required='native libtoolize'
+required='cc native libtoolize'
 . ./defs || Exit 1
 
 cat >>configure.in <<'END'
diff --git a/tests/ltinit.test b/tests/ltinit.test
index 189e5c2..a6131f9 100755
--- a/tests/ltinit.test
+++ b/tests/ltinit.test
@@ -18,7 +18,7 @@
 # interface (with LT_INIT etc.) is used (this interface has been
 # present since libtool 1.9b, circa 2004).
 
-required='libtoolize'
+required='cc libtoolize'
 . ./defs || Exit 1
 
 cat >>configure.in <<'END'
diff --git a/tests/ltlibsrc.test b/tests/ltlibsrc.test
index 404d274..f150626 100755
--- a/tests/ltlibsrc.test
+++ b/tests/ltlibsrc.test
@@ -16,7 +16,7 @@
 
 # Test to make sure a sensible default source for libraries is used.
 
-required=libtool
+required='cc libtool'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/ltorder.test b/tests/ltorder.test
index c411341..7c4b78c 100755
--- a/tests/ltorder.test
+++ b/tests/ltorder.test
@@ -16,7 +16,7 @@
 
 # Test for correct installation order of nobase libtool libraries.
 
-required='libtoolize'
+required='cc libtoolize'
 . ./defs || Exit 1
 
 cat >>configure.in <<'END'
@@ -57,4 +57,5 @@ grep 'has not been installed' stderr && Exit 1
 
 $MAKE uninstall
 test `find inst -type f -print | wc -l` -eq 0
+
 :
diff --git a/tests/mmodely.test b/tests/mmodely.test
index f2ad334..f232058 100755
--- a/tests/mmodely.test
+++ b/tests/mmodely.test
@@ -19,6 +19,7 @@
 # sources in maintainer mode.
 # From Derek R. Price.
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/nobase-libtool.test b/tests/nobase-libtool.test
index e2d2847..c9e057a 100755
--- a/tests/nobase-libtool.test
+++ b/tests/nobase-libtool.test
@@ -19,7 +19,7 @@
 # This is just the libtool equivalent of nobase.test, split
 # up for greater exposure of nobase.test.
 
-required=libtoolize
+required='cc libtoolize'
 . ./defs || Exit 1
 
 cat >> configure.in <<'EOF'
diff --git a/tests/nobase.test b/tests/nobase.test
index 52335d4..aca646a 100755
--- a/tests/nobase.test
+++ b/tests/nobase.test
@@ -17,6 +17,7 @@
 
 # Make sure nobase_* works.
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in <<'EOF'
diff --git a/tests/nostdinc.test b/tests/nostdinc.test
index a693003..07f91f1 100755
--- a/tests/nostdinc.test
+++ b/tests/nostdinc.test
@@ -17,6 +17,11 @@
 
 # Test to make sure nostdinc option works correctly.
 
+# We don't require a C compiler explicitly, because the first part of the
+# test (where `Makefile.in' is grepped) does not require one.  Insted, we
+# just skip the rest of the test if configure fails to find a working C
+# compiler.
+
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
@@ -33,7 +38,7 @@ END
 $ACLOCAL
 $AUTOMAKE
 
-grep '.*-I *\.' Makefile.in && Exit 1
+$EGREP '(-I *\.|-I.*srcdir|am__isrc)' Makefile.in && Exit 1
 
 # We'll test the fully-processed Makefile too.
 $AUTOCONF
@@ -41,12 +46,12 @@ $AUTOCONF
 # Test with $builddir != $srcdir
 mkdir build
 cd build
-../configure
+../configure || Exit $?
 $EGREP '.*-I *(\.|\$.srcdir.)' Makefile && Exit 1
 
 # Test with $builddir = $srcdir
 cd ..
-./configure
+./configure || Exit $?
 $EGREP '.*-I *(\.|\$.srcdir.)' Makefile && Exit 1
 
 Exit 0
diff --git a/tests/parallel-tests-ext-driver-prog.test 
b/tests/parallel-tests-ext-driver-prog.test
index fca4746..e92d262 100755
--- a/tests/parallel-tests-ext-driver-prog.test
+++ b/tests/parallel-tests-ext-driver-prog.test
@@ -20,7 +20,7 @@
 # See also related test 'parallel-tests-ext-driver.test'.
 
 parallel_tests=yes
-required=native
+required='cc native'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/parallel-tests-suffix-prog.test 
b/tests/parallel-tests-suffix-prog.test
index 5e7c2ab..1ea730a 100755
--- a/tests/parallel-tests-suffix-prog.test
+++ b/tests/parallel-tests-suffix-prog.test
@@ -19,7 +19,7 @@
 # See also sister test 'parallel-tests-suffix.test'.
 
 parallel_tests=yes
-required=native
+required='cc native'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/parallel-tests.test b/tests/parallel-tests.test
index da961e1..ea92ae7 100755
--- a/tests/parallel-tests.test
+++ b/tests/parallel-tests.test
@@ -42,19 +42,19 @@ END
 # foo.test and bar.test sleep to ensure their logs are always strictly newer
 # than the logs of their prerequisites, for HP-UX make.  The quoting pleases
 # maintainer-check.
-cat >>foo.test <<'END'
+cat > foo.test <<'END'
 #! /bin/sh
 echo "this is $0"
 sleep '1'
 exit 0
 END
-cat >>bar.test <<'END'
+cat > bar.test <<'END'
 #! /bin/sh
 echo "this is $0"
 sleep '1'
 exit 99
 END
-cat >>baz.test <<'END'
+cat > baz.test <<'END'
 #! /bin/sh
 echo "this is $0"
 exit 1
diff --git a/tests/parallel-tests10.test b/tests/parallel-tests10.test
index cdf148d..5718611 100755
--- a/tests/parallel-tests10.test
+++ b/tests/parallel-tests10.test
@@ -20,6 +20,7 @@
 
 parallel_tests=yes
 . ./defs || Exit 1
+
 cat >> configure.in << 'END'
 AC_OUTPUT
 END
@@ -43,4 +44,4 @@ $AUTOMAKE -a
 ./configure
 $MAKE check
 
-Exit 0
+:
diff --git a/tests/parallel-tests2.test b/tests/parallel-tests2.test
index 8fe5d30..85256c8 100755
--- a/tests/parallel-tests2.test
+++ b/tests/parallel-tests2.test
@@ -35,18 +35,18 @@ bla:
 CLEANFILES = bla
 END
 
-cat >>foo.test <<'END'
+cat > foo.test <<'END'
 #! /bin/sh
 echo "this is $0"
 test -f bla || exit 1
 exit 0
 END
-cat >>bar.test <<'END'
+cat > bar.test <<'END'
 #! /bin/sh
 echo "this is $0"
 exit 99
 END
-cat >>baz.test <<'END'
+cat > baz.test <<'END'
 #! /bin/sh
 echo "this is $0"
 exit 1
@@ -84,4 +84,5 @@ env TESTS=foo.test $MAKE -e recheck-html
 test -f bla
 test ! -f foo.log
 test -f mylog.html
+
 :
diff --git a/tests/parallel-tests3.test b/tests/parallel-tests3.test
index 1d621eb..a8004e7 100755
--- a/tests/parallel-tests3.test
+++ b/tests/parallel-tests3.test
@@ -22,7 +22,7 @@ required=GNUmake
 . ./defs || Exit 1
 
 case $MAKE in
-  *\ -j*) skip_ "this test does not work well if \$MAKE contains \`-j'";;
+  *\ -j*) skip_ "\$MAKE contains \`-j'";;
 esac
 
 cat >> configure.in << 'END'
@@ -35,13 +35,12 @@ END
 
 for i in 1 2 3 4 5 6 7 8; do
   echo "TESTS += foo$i.test" >> Makefile.am
-  cat >foo$i.test <<'END'
-#! /bin/sh
-echo "this is $0"
-# hack around maintainer-check check:
-sleep='sleep '1
-$sleep
-exit 0
+  unindent >foo$i.test <<'END'
+    #! /bin/sh
+    echo "this is $0"
+    # FIXME: spurious quote to please maintainer-check
+    sleep '1'
+    exit 0
 END
   chmod a+x foo$i.test
 done
@@ -78,4 +77,5 @@ do
   $sleep
 done
 $sleep
+
 :
diff --git a/tests/parallel-tests5.test b/tests/parallel-tests5.test
index 4d981c3..6b3e70b 100755
--- a/tests/parallel-tests5.test
+++ b/tests/parallel-tests5.test
@@ -21,7 +21,7 @@
 # It merely serves as demonstration.  :-)
 
 parallel_tests=yes
-required='native GNUmake'
+required='cc native GNUmake'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
@@ -41,16 +41,16 @@ END
 for i in 1 2 3 4 5 6 7 8; do
   echo "scripts += foo$i.test" >> Makefile.am
   echo "programs += foo$i.prog" >> Makefile.am
-  cat >foo$i.test <<'END'
-#! /bin/sh
-echo "this is $0"
-exit 0
+  unindent >foo$i.test <<'END'
+    #! /bin/sh
+    echo "this is $0"
+    exit 0
 END
   cat >foo$i.c <<'END'
-int main()
-{
-  return 0;
-}
+    int main (void)
+    {
+      return 0;
+    }
 END
   chmod a+x foo$i.test
 done
diff --git a/tests/parallel-tests8.test b/tests/parallel-tests8.test
index d1d5b74..84ac460 100755
--- a/tests/parallel-tests8.test
+++ b/tests/parallel-tests8.test
@@ -44,7 +44,7 @@ EXTRA_DIST = foo.in foo.test
 DISTCLEANFILES = foo.test
 END
 
-cat >>foo.in <<'END'
+cat > foo.in <<'END'
 #! /bin/sh
 echo "this is $0"
 exit 0
@@ -53,8 +53,8 @@ END
 $ACLOCAL
 $AUTOCONF
 AUTOMAKE_fails -a
-grep '(srcdir.*bar' stderr
-grep 'top_srcdir.*baz' stderr
+grep '$(srcdir).*TESTS.*bar\.test' stderr
+grep '$(top_srcdir).*TESTS.*baz\.test' stderr
 
 sed '/^TESTS +=.*srcdir/d' < Makefile.am > t
 mv -f t Makefile.am
diff --git a/tests/parallel-tests9.test b/tests/parallel-tests9.test
index e6191d9..b06d364 100755
--- a/tests/parallel-tests9.test
+++ b/tests/parallel-tests9.test
@@ -33,18 +33,18 @@ bla:
        echo bla > $@
 END
 
-cat >>foo.test <<'END'
+cat > foo.test <<'END'
 #! /bin/sh
 echo "this is $0"
 test -f bla || exit 1
 exit 0
 END
-cat >>bar.test <<'END'
+cat > bar.test <<'END'
 #! /bin/sh
 echo "this is $0"
 exit 99
 END
-cat >>baz.test <<'END'
+cat > baz.test <<'END'
 #! /bin/sh
 echo "this is $0"
 exit 1
@@ -83,4 +83,5 @@ test ! -f foo.log
 test ! -f bar.log
 test ! -f baz.log
 test -f mylog.log
+
 :
diff --git a/tests/posixsubst-ldadd.test b/tests/posixsubst-ldadd.test
index a418fc2..9d6cc2d 100755
--- a/tests/posixsubst-ldadd.test
+++ b/tests/posixsubst-ldadd.test
@@ -15,8 +15,9 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Test that POSIX variable expansion `$(var:str=rpl)' works
-# in when used in LDADD.
+# when used in LDADD.
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/posixsubst-libraries.test b/tests/posixsubst-libraries.test
index 418d241..0028309 100755
--- a/tests/posixsubst-libraries.test
+++ b/tests/posixsubst-libraries.test
@@ -18,6 +18,7 @@
 # with the LIBRARIES primary in a "simple" way.
 # Keep this in sync with sister test `posixsubst-ltlibraries.test'.
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/posixsubst-ltlibraries.test 
b/tests/posixsubst-ltlibraries.test
index e95023c..b601672 100755
--- a/tests/posixsubst-ltlibraries.test
+++ b/tests/posixsubst-ltlibraries.test
@@ -18,7 +18,7 @@
 # with the LTLIBRARIES primary in a "simple" way.
 # Keep this in sync with sister test `posixsubst-libraries.test'.
 
-required='libtool libtoolize'
+required='cc libtool libtoolize'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/posixsubst-programs.test b/tests/posixsubst-programs.test
index 947cf79..2b50e36 100755
--- a/tests/posixsubst-programs.test
+++ b/tests/posixsubst-programs.test
@@ -17,6 +17,7 @@
 # Test that POSIX variable expansion `$(var:str=rpl)' works when used
 # with the PROGRAMS primary.
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/posixsubst-sources.test b/tests/posixsubst-sources.test
index aef4c2f..62e9d3d 100755
--- a/tests/posixsubst-sources.test
+++ b/tests/posixsubst-sources.test
@@ -17,6 +17,7 @@
 # Test that POSIX variable expansion `$(var:str=rpl)' works when used
 # with the SOURCES primary.
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/postproc.test b/tests/postproc.test
index 0a8b1f3..2208d66 100755
--- a/tests/postproc.test
+++ b/tests/postproc.test
@@ -18,6 +18,7 @@
 # Check to make sure we recognize a Makefile.in, even if post-processed
 # and renamed.
 
+required=cc
 . ./defs || Exit 1
 
 cat >configure.in <<END
@@ -41,7 +42,7 @@ mv myMakefile.in myMakefile.old
 echo '# Post-processed by post-processor 3.14.' > myMakefile.in
 cat myMakefile.old >> myMakefile.in
 
-./configure || Exit $?
+./configure
 
 test -f .deps/fred.Po || test -f _deps/fred.Po || Exit 1
 
diff --git a/tests/pr204.test b/tests/pr204.test
index c0db1b4..1c4b0fa 100755
--- a/tests/pr204.test
+++ b/tests/pr204.test
@@ -17,7 +17,7 @@
 # For PR 204.
 # Sources derived from nodist_ sources should not be distributed.
 
-required=yacc
+required='cc yacc'
 . ./defs || Exit 1
 
 cat >> configure.in <<'EOF'
diff --git a/tests/pr220.test b/tests/pr220.test
index 6e8040e..b068c10 100755
--- a/tests/pr220.test
+++ b/tests/pr220.test
@@ -25,24 +25,14 @@
 
 . ./defs || Exit 1
 
-cat > main.c << 'EOF'
-int main (void)
-{
-  return 0;
-}
-EOF
-
 cat > Makefile.am << 'EOF'
 if NEVER_TRUE
-NEVER_DEFINED = missingfile.c
+NEVER_DEFINED = foo.txt
 endif
-
-bin_PROGRAMS = main
-main_SOURCES = main.c $(NEVER_DEFINED)
+data_DATA = $(NEVER_DEFINED)
 EOF
 
 cat >> configure.in << 'EOF'
-AC_PROG_CC
 AC_ARG_ENABLE([foo],
 [  --enable-foo          Enable foo],
 [ if test "foo" = "bar" ; then
diff --git a/tests/pr224.test b/tests/pr224.test
index 8e9414a..bf24935 100755
--- a/tests/pr224.test
+++ b/tests/pr224.test
@@ -23,6 +23,7 @@
 # `$(top_srcdir)/build', the location of the `.deps' directory
 # should be `$(top_builddir)/bar/.deps'.
 
+required=cc
 . ./defs || Exit 1
 
 mkdir foo
diff --git a/tests/pr243.test b/tests/pr243.test
index 30b0d70..2b11fb7 100755
--- a/tests/pr243.test
+++ b/tests/pr243.test
@@ -27,6 +27,7 @@
 # the AM_OUTPUT_DEPENDENCY_COMMANDS macro cannot cope with
 # the colon in the CONFIG_FILES variable.
 
+required=cc
 . ./defs || Exit 1
 
 cat > configure.in << END
@@ -50,8 +51,7 @@ END
 $ACLOCAL
 $AUTOMAKE
 $AUTOCONF
-# FIXME: require compiler in $required rather than skipping here
-./configure || Exit $?
+./configure
 
 test -f .deps/fx64.Po
 
diff --git a/tests/pr266.test b/tests/pr266.test
index c3fd559..cff6bca 100755
--- a/tests/pr266.test
+++ b/tests/pr266.test
@@ -18,6 +18,7 @@
 # Test for PR 266.
 # Dependency tracking -vs- nonstandard Makefile names
 
+required=cc
 . ./defs || Exit 1
 
 cat > configure.in << END
@@ -39,8 +40,7 @@ END
 $ACLOCAL
 $AUTOMAKE
 $AUTOCONF
-# FIXME: require compiler in $required rather than skipping here
-./configure --enable-dependency-tracking || Exit $?
+./configure --enable-dependency-tracking
 
 test -f .deps/fx64.Po
 
diff --git a/tests/pr287.test b/tests/pr287.test
index 3358702..fc987f6 100755
--- a/tests/pr287.test
+++ b/tests/pr287.test
@@ -19,7 +19,6 @@
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
-AC_PROG_CC
 AC_OUTPUT
 END
 
diff --git a/tests/pr300-lib.test b/tests/pr300-lib.test
index 951ec52..c27c2be 100755
--- a/tests/pr300-lib.test
+++ b/tests/pr300-lib.test
@@ -17,6 +17,7 @@
 # Make sure that installing subdirectory libraries works.
 # PR/300
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/pr300-ltlib.test b/tests/pr300-ltlib.test
index 1ac26af..43a1b8d 100755
--- a/tests/pr300-ltlib.test
+++ b/tests/pr300-ltlib.test
@@ -18,7 +18,7 @@
 # Make sure that installing subdirectory libtool libraries works.
 # PR/300
 
-required=libtoolize
+required='cc libtoolize'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/pr300-prog.test b/tests/pr300-prog.test
index c663012..7a2aa99 100755
--- a/tests/pr300-prog.test
+++ b/tests/pr300-prog.test
@@ -18,6 +18,7 @@
 # Make sure that installing subdirectory programs works.
 # PR/300
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/pr401.test b/tests/pr401.test
index e150190..b2f3c11 100755
--- a/tests/pr401.test
+++ b/tests/pr401.test
@@ -19,6 +19,7 @@
 # (pr401b.test and pr401c.test do the same for LTLIBOBJS and ALLOCA)
 
 parallel_tests=no
+required=cc
 . ./defs || Exit 1
 
 mkdir lib src
diff --git a/tests/pr401b.test b/tests/pr401b.test
index 58b3d8a..ccd5cbd 100755
--- a/tests/pr401b.test
+++ b/tests/pr401b.test
@@ -19,7 +19,7 @@
 # (pr401.test and pr401c.test do the same for LIBOBJS and ALLOCA)
 
 parallel_tests=no
-required=libtoolize
+required='cc libtoolize'
 . ./defs || Exit 1
 
 mkdir lib src
diff --git a/tests/pr401c.test b/tests/pr401c.test
index 91156cd..0ab785e 100755
--- a/tests/pr401c.test
+++ b/tests/pr401c.test
@@ -19,6 +19,7 @@
 # (pr401.test and pr401b.test do the same for LIBOBJS and LTLIBOBJS)
 
 parallel_tests=no
+required=cc
 . ./defs || Exit 1
 
 mkdir lib src
diff --git a/tests/pr87.test b/tests/pr87.test
index c8c2e91..9c92c71 100755
--- a/tests/pr87.test
+++ b/tests/pr87.test
@@ -18,6 +18,7 @@
 # Test for PR automake/87.
 # "make distcheck" fails when two source dirs exist.
 
+required=cc
 . ./defs || Exit 1
 
 subdirs="foo bar"
diff --git a/tests/primary3.test b/tests/primary3.test
index 0b0aacf..a7a915f 100755
--- a/tests/primary3.test
+++ b/tests/primary3.test
@@ -16,6 +16,7 @@
 
 # Make sure we can build programs ending in `.la'
 
+required=cc
 . ./defs || Exit 1
 
 cat >>configure.in <<EOF
diff --git a/tests/python-virtualenv.test b/tests/python-virtualenv.test
index d7f8706..c36c2b7 100755
--- a/tests/python-virtualenv.test
+++ b/tests/python-virtualenv.test
@@ -17,17 +17,15 @@
 # Check that python support can work well with virtualenvs.
 # This test also works as a mild stress-test on the python support.
 
-required='python virtualenv'
+required='cc python virtualenv'
 . ./defs || Exit 1
 
 # In case the user's config.site defines pythondir or pyexecdir.
 CONFIG_SITE=/dev/null; export CONFIG_SITE
 
 # Skip the test if a proper virtualenv cannot be created.
-virtualenv --verbose virtenv \
-  || skip_ "virtualenv program not found"
-test -f virtenv/bin/activate \
-  || skip_ "creation of python virtual environment failed"
+virtualenv --verbose virtenv && test -f virtenv/bin/activate \
+  || skip_ "coulnd't create python virtual environment"
 
 # Activate the virtualenv.
 . ./virtenv/bin/activate
diff --git a/tests/regex.test b/tests/regex.test
index ff78691..586ab5a 100755
--- a/tests/regex.test
+++ b/tests/regex.test
@@ -16,6 +16,7 @@
 
 # Make sure AM_WITH_REGEX compiles and runs.
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/remake-gnulib-add-acsubst.test 
b/tests/remake-gnulib-add-acsubst.test
index 74bd202..6b3549f 100755
--- a/tests/remake-gnulib-add-acsubst.test
+++ b/tests/remake-gnulib-add-acsubst.test
@@ -21,6 +21,7 @@
 #  <http://lists.gnu.org/archive/html/bug-gnulib/2011-04/msg00005.html>
 # for more info).
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in <<'END'
diff --git a/tests/remake-gnulib-add-header.test 
b/tests/remake-gnulib-add-header.test
index 597a19a..7b0110c 100755
--- a/tests/remake-gnulib-add-header.test
+++ b/tests/remake-gnulib-add-header.test
@@ -21,6 +21,7 @@
 #  <http://lists.gnu.org/archive/html/bug-gnulib/2011-04/msg00005.html>
 # for more info).
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in <<'END'
diff --git a/tests/remake-gnulib-remove-header.test 
b/tests/remake-gnulib-remove-header.test
index ab77f11..de5a2fa 100755
--- a/tests/remake-gnulib-remove-header.test
+++ b/tests/remake-gnulib-remove-header.test
@@ -22,6 +22,7 @@
 #  <http://lists.gnu.org/archive/html/bug-gnulib/2011-04/msg00005.html>
 # for more info).
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in <<'END'
diff --git a/tests/repeated-options.test b/tests/repeated-options.test
index c3c2e29..4667d0d 100755
--- a/tests/repeated-options.test
+++ b/tests/repeated-options.test
@@ -17,7 +17,7 @@
 # Check that automake does not complain on repeated options, nor
 # generate broken or incorrect makefiles.
 
-required=bzip2
+required='cc bzip2'
 . ./defs || Exit 1
 
 cat >configure.in <<END
diff --git a/tests/self-check-exit.test b/tests/self-check-exit.test
index 73f3ea5..f8c5334 100755
--- a/tests/self-check-exit.test
+++ b/tests/self-check-exit.test
@@ -21,6 +21,8 @@
 
 . ./defs-static || exit 99
 
+unset am_explicit_skips
+
 for st in 1 2 3 4 5 77 99 126 127 128 129 130 255; do
 
   echo "* Try: Exit $st"
diff --git a/tests/self-check-explicit-skips.test 
b/tests/self-check-explicit-skips.test
new file mode 100755
index 0000000..15bf2d9
--- /dev/null
+++ b/tests/self-check-explicit-skips.test
@@ -0,0 +1,52 @@
+#! /bin/sh
+# Copyright (C) 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/>.
+
+# Sanity check for the automake testsuite.
+# Check creation/removal of temporary test working directory by `./defs'.
+
+. ./defs || Exit 1
+
+test x"$sh_errexit_works" = x"yes" || skip_ "no working shell exit trap"
+
+# We still need a little hack to make ./defs work outside automake's
+# tree `tests' subdirectory.  Not a big deal.
+sed "s|^testbuilddir=.*|testbuilddir='`pwd`'|" ../defs-static >defs-static
+diff ../defs-static defs-static && Exit 99
+cp ../defs .
+
+set +e
+
+unset am_explicit_skips stderr_fileno_
+
+$SHELL -c '. ./defs; (exit 77); exit 77' dummy.test
+test $? -eq 77 || Exit 1
+
+am_explicit_skips=no $SHELL -c '. ./defs; sh -c "exit 77"' dummy.test
+test $? -eq 77 || Exit 1
+
+am_explicit_skips=yes $SHELL -c '. ./defs; (exit 77); exit 77' dummy.test
+test $? -eq 78 || Exit 1
+
+am_explicit_skips=y $SHELL -c '. ./defs; sh -c "exit 77"' dummy.test
+test $? -eq 78 || Exit 1
+
+am_explicit_skips=yes $SHELL -c '. ./defs; Exit 77' dummy.test
+test $? -eq 77 || Exit 1
+
+am_explicit_skips=y $SHELL -c '. ./defs; skip_ "foo"' dummy.test
+test $? -eq 77 || Exit 1
+
+:
diff --git a/tests/silent-lex-generic.test b/tests/silent-lex-generic.test
index a619698..7e74d64 100755
--- a/tests/silent-lex-generic.test
+++ b/tests/silent-lex-generic.test
@@ -17,7 +17,7 @@
 # Check silent-rules mode for Lex.
 # Keep this in sync with sister test `silent-lex-gcc.test'.
 
-required='flex'
+required='cc flex'
 . ./defs || Exit 1
 
 mkdir sub
diff --git a/tests/silent-many-generic.test b/tests/silent-many-generic.test
index b886479..9897b0c 100755
--- a/tests/silent-many-generic.test
+++ b/tests/silent-many-generic.test
@@ -22,8 +22,8 @@
 # sister test `silent-many-gcc.test', which requires the GNU compilers
 # and forces the use of gcc depmode.
 
-# FIXME: generic C++/Fortran compilers should suffice here
-required='g++ gfortran flex yacc'
+# FIXME: generic Fortran compilers should suffice here
+required='cc c++ gfortran flex yacc'
 . ./defs || Exit 1
 
 # Avoids too much code duplication.
diff --git a/tests/silent-yacc-generic.test b/tests/silent-yacc-generic.test
index 76a290f..6579911 100755
--- a/tests/silent-yacc-generic.test
+++ b/tests/silent-yacc-generic.test
@@ -17,7 +17,7 @@
 # Check silent-rules mode for Yacc.
 # Keep this in sync with sister test `silent-yacc-gcc.test'.
 
-required=yacc
+required='cc yacc'
 . ./defs || Exit 1
 
 mkdir sub
diff --git a/tests/silent.test b/tests/silent.test
index f590347..b958727 100755
--- a/tests/silent.test
+++ b/tests/silent.test
@@ -18,6 +18,7 @@
 
 # Please keep this file in sync with silent2.test.
 
+required=cc
 . ./defs || Exit 1
 
 mkdir sub
diff --git a/tests/silent3.test b/tests/silent3.test
index c0a9192..24edaf7 100755
--- a/tests/silent3.test
+++ b/tests/silent3.test
@@ -18,7 +18,7 @@
 
 # Please keep this file in sync with silent4.test and silent9.test.
 
-required=libtoolize
+required='cc libtoolize'
 . ./defs || Exit 1
 
 mkdir sub
diff --git a/tests/silent9.test b/tests/silent9.test
index cb62136..62c4d89 100755
--- a/tests/silent9.test
+++ b/tests/silent9.test
@@ -18,7 +18,7 @@
 
 # Please keep this file in sync with silent3.test and silent4.test.
 
-required="libtoolize"
+required='cc libtoolize'
 . ./defs || Exit 1
 
 mkdir sub
diff --git a/tests/silentcxx-gcc.test b/tests/silentcxx-gcc.test
index 1f5768c..55f296d 100755
--- a/tests/silentcxx-gcc.test
+++ b/tests/silentcxx-gcc.test
@@ -18,6 +18,7 @@
 # This test requires the GNU C++ compiler; keep it in sync with sister
 # test `silentcxx.test', which should work with generic compilers.
 
+required=g++
 . ./defs || Exit 1
 
 mkdir sub
diff --git a/tests/silentcxx.test b/tests/silentcxx.test
index b4919c7..14825db 100755
--- a/tests/silentcxx.test
+++ b/tests/silentcxx.test
@@ -19,6 +19,7 @@
 # sister test `silentcxx-gcc.test', which requires the GNU C++ compiler
 # and forces the use of gcc depmode.
 
+required=c++
 . ./defs || Exit 1
 
 mkdir sub
diff --git a/tests/specflg10.test b/tests/specflg10.test
index 3a05716..eaac391 100755
--- a/tests/specflg10.test
+++ b/tests/specflg10.test
@@ -16,7 +16,7 @@
 
 # AM_DEFAULT_SOURCE_EXT
 
-required=g++ #FIXME: a generic C++ compiler should be enough.
+required='cc c++'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/specflg7.test b/tests/specflg7.test
index a7aa38a..60c1a9d 100755
--- a/tests/specflg7.test
+++ b/tests/specflg7.test
@@ -16,7 +16,7 @@
 
 # The true/false example from the manual, plus a check for _SHORTNAME.
 
-required=native
+required='cc native'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/specflg8.test b/tests/specflg8.test
index 7f8aa14..f46224a 100755
--- a/tests/specflg8.test
+++ b/tests/specflg8.test
@@ -18,7 +18,7 @@
 # with one extra indirection in the sources (PR/315), and
 # use of _CPPFLAGS (PR/337).
 
-required=native
+required='cc native'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/stdinc.test b/tests/stdinc.test
index 2b619d8..1a0b485 100755
--- a/tests/stdinc.test
+++ b/tests/stdinc.test
@@ -17,6 +17,7 @@
 # Test to make sure the standard include order is stable.
 # Report by Kent Boortz.
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/strip.test b/tests/strip.test
index c63af43..84ae5e9 100755
--- a/tests/strip.test
+++ b/tests/strip.test
@@ -16,6 +16,7 @@
 
 # Test for install-strip.
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/strip2.test b/tests/strip2.test
index 01f66f1..9e1c5ff 100755
--- a/tests/strip2.test
+++ b/tests/strip2.test
@@ -17,7 +17,7 @@
 # Ensure install-strip works when STRIP consists of more than one word.
 # This test needs GNU binutils strip.  See sister test strip3.
 
-required=strip
+required='cc strip'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/strip3.test b/tests/strip3.test
index 5f6f163..51e04d5 100755
--- a/tests/strip3.test
+++ b/tests/strip3.test
@@ -17,7 +17,7 @@
 # Ensure install-strip works when STRIP consists of more than one word.
 # This test needs GNU binutils strip.  Libtool variant.
 
-required='libtoolize strip'
+required='cc libtoolize strip'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/subdir5.test b/tests/subdir5.test
index 9d223d4..42c9ad6 100755
--- a/tests/subdir5.test
+++ b/tests/subdir5.test
@@ -27,28 +27,14 @@ required=GNUmake
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
-AC_PROG_CC
-AM_PROG_CC_C_O
 AC_OUTPUT
 END
 
-cat > Makefile.am << 'END'
-bin_PROGRAMS = wish
-wish_SOURCES = a.c
-END
-
-cat > a.c << 'END'
-#include <stdio.h>
-int main ()
-{
-   printf ("hi liver!\n");
-   return 0;
-}
-END
+: > Makefile.am
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE --include-deps --copy --add-missing
+$AUTOMAKE
 ./configure
 $MAKE
 
diff --git a/tests/subdir8.test b/tests/subdir8.test
index 1bb4c3c..dc13c2b 100755
--- a/tests/subdir8.test
+++ b/tests/subdir8.test
@@ -27,8 +27,6 @@ required=GNUmake
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
-AC_PROG_CC
-AM_PROG_CC_C_O
 m4_include([confiles.m4])
 MORE_DEFS
 AC_OUTPUT
@@ -43,26 +41,14 @@ END
 
 mkdir sub
 
-cat > sub/Makefile.am << 'END'
-bin_PROGRAMS = wish
-wish_SOURCES = a.c
-END
-
-cat > sub/a.c << 'END'
-#include <stdio.h>
-int main ()
-{
-   printf ("hi liver!\n");
-   return 0;
-}
-END
+: > sub/Makefile.am
 
 mkdir m4
 echo 'AC_DEFUN([MORE_DEFS], [])' > m4/moredefs.m4
 
 $ACLOCAL -I m4
 $AUTOCONF
-$AUTOMAKE --copy --add-missing
+$AUTOMAKE
 ./configure
 $MAKE
 
diff --git a/tests/subdirbuiltsources.test b/tests/subdirbuiltsources.test
index 18cacd9..5401f97 100755
--- a/tests/subdirbuiltsources.test
+++ b/tests/subdirbuiltsources.test
@@ -18,6 +18,7 @@
 # A bug occurred where subdirs do not have all-recursive or
 # all-recursive-am which depended on BUILT_SOURCES.
 
+required=cc
 . ./defs || Exit 1
 
 mkdir lib
diff --git a/tests/subobj11a.test b/tests/subobj11a.test
index fc674b8..60ad5a5 100755
--- a/tests/subobj11a.test
+++ b/tests/subobj11a.test
@@ -26,6 +26,7 @@
 # See also sister "grepping" test `subobj11b.test', and related test
 # `subobj11c.test'.
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/subobj3.test b/tests/subobj3.test
index 404965f..bb08beb 100755
--- a/tests/subobj3.test
+++ b/tests/subobj3.test
@@ -17,7 +17,7 @@
 
 # Test of subdir objects with ansi2knr.
 
-required=native
+required='cc native'
 . ./defs || Exit 1
 
 cat > configure.in << END
diff --git a/tests/subobj5.test b/tests/subobj5.test
index 1b05db3..00402db 100755
--- a/tests/subobj5.test
+++ b/tests/subobj5.test
@@ -18,6 +18,7 @@
 # Test of subdir make dist rules.
 # From Robert Collins
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
@@ -28,20 +29,43 @@ AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
 bin_PROGRAMS = wish
 wish_SOURCES = generic/a.c
+
+.PHONY: test-distdir test-build
+test-distdir: distdir
+       ls -l $(distdir) $(distdir)/* ;: For debugging.
+       test ! -r $(distdir)/a.c
+       test -f $(distdir)/generic/a.c
+test-build: all
+       ls -l . generic ;: For debugging.
+       test -f generic/a.$(OBJEXT)
+       test -f wish$(EXEEXT)
+       test ! -r a.$(OBJEXT)
+       test ! -r a$(EXEEXT)
+       test ! -r generic/wish$(EXEEXT)
+       test ! -r generic/a$(EXEEXT)
 END
 
 mkdir generic
-: > generic/a.c
 : > generic/Makefile.am
 
+cat > generic/a.c << 'END'
+int main (void)
+{
+  return 0;
+}
+END
+
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --include-deps --copy --add-missing
 
 ./configure
 
+$MAKE test-distdir
 $MAKE dist
+$MAKE test-build
 
 :
diff --git a/tests/subobj6.test b/tests/subobj6.test
index 9686bf0..fff5151 100755
--- a/tests/subobj6.test
+++ b/tests/subobj6.test
@@ -18,6 +18,7 @@
 # Test of subdir make distclean rules.
 # From Robert Collins
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/subobj9.test b/tests/subobj9.test
index f0e9007..9bab174 100755
--- a/tests/subobj9.test
+++ b/tests/subobj9.test
@@ -16,8 +16,14 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Test for PR 312.
+#
+# == Report ==
+# When using non-recursive make to build a libtoolize-library from
+# sources in a subdirectory, 'make distcheck' fails because of incomplete
+# cleanup. "make clean" tries to remove `*.o' and `.../<file>.lo' but
+# forgets `.../<file>.o'.
 
-required=libtoolize
+required='c++ libtoolize'
 . ./defs || Exit 1
 
 cat > configure.in << END
@@ -60,8 +66,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 
-# Skip this test on configure errors (e.g., broken C++ compilers).
-./configure || skip_ "configure failure"
+./configure
 
 # Ensure './libtool --help' will use the right tool versions.
 export AUTOCONF AUTOMAKE
diff --git a/tests/subpkg.test b/tests/subpkg.test
index a89d0cf..5987ac3 100755
--- a/tests/subpkg.test
+++ b/tests/subpkg.test
@@ -17,7 +17,7 @@
 
 # Check subpackage handling.
 
-required=yacc
+required='cc yacc'
 . ./defs || Exit 1
 
 mkdir m4
diff --git a/tests/subst2.test b/tests/subst2.test
index 1dbb511..d64d8c0 100755
--- a/tests/subst2.test
+++ b/tests/subst2.test
@@ -16,6 +16,8 @@
 
 # Make sure a multi-line definition cannot be terminated by an empty
 # line (when there are @substitutions@ inside).
+
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/subst3.test b/tests/subst3.test
index d6964a2..d87f744 100755
--- a/tests/subst3.test
+++ b/tests/subst3.test
@@ -17,6 +17,7 @@
 
 # Test installation with substitutions.  This test is based on nobase.test.
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in <<'EOF'
diff --git a/tests/substre2.test b/tests/substre2.test
index 10179cc..ec92062 100755
--- a/tests/substre2.test
+++ b/tests/substre2.test
@@ -17,6 +17,7 @@
 # Test for bug in variable substitution references, where
 # undefined variables break later substitutions.
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/substref.test b/tests/substref.test
index 694563b..47f4d41 100755
--- a/tests/substref.test
+++ b/tests/substref.test
@@ -18,6 +18,7 @@
 # pattern is null.
 # Report from Richard Boulton
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/suffix10.test b/tests/suffix10.test
index 026da24..bd870f3 100755
--- a/tests/suffix10.test
+++ b/tests/suffix10.test
@@ -17,7 +17,7 @@
 # Make sure that derivations work with .lo too.
 # (related to PR/37)
 
-required='libtoolize yacc'
+required='cc libtoolize yacc'
 . ./defs || Exit 1
 
 cat >>configure.in <<EOF
diff --git a/tests/suffix11.test b/tests/suffix11.test
index daeba1c..c53e256 100755
--- a/tests/suffix11.test
+++ b/tests/suffix11.test
@@ -18,6 +18,7 @@
 # PR/371 and PR/372: Reported by Duncan Gibson.
 # We also check for suffixes containing `-'.
 
+required=cc
 . ./defs || Exit 1
 
 cat >>configure.in <<EOF
diff --git a/tests/suffix12.test b/tests/suffix12.test
index a515f41..c14b842 100755
--- a/tests/suffix12.test
+++ b/tests/suffix12.test
@@ -18,6 +18,7 @@
 # Tests that Automake understands suffix rules with subdir objects.
 # Reported by John Ratliff.
 
+required=cc
 . ./defs || Exit 1
 
 cat >>configure.in <<EOF
diff --git a/tests/suffix13.test b/tests/suffix13.test
index 228d04a..542f892 100755
--- a/tests/suffix13.test
+++ b/tests/suffix13.test
@@ -23,6 +23,7 @@
 # and subdir objects.
 # Reported by Florian Briegel.
 
+required=cc
 . ./defs || Exit 1
 
 cat >>configure.in <<EOF
diff --git a/tests/suffix3.test b/tests/suffix3.test
index e0c01f6..70385fe 100755
--- a/tests/suffix3.test
+++ b/tests/suffix3.test
@@ -17,6 +17,7 @@
 
 # Test to make sure that suffix rules chain.
 
+required=c++
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/suffix5.test b/tests/suffix5.test
index 60417e4..e9d733d 100755
--- a/tests/suffix5.test
+++ b/tests/suffix5.test
@@ -18,7 +18,7 @@
 # from user-defined implicit rules.
 # Based on a report from Arkadiusz Miskiewicz <address@hidden>.
 
-required=libtool
+required='cc libtool'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/suffix8.test b/tests/suffix8.test
index 921c641..27ac884 100755
--- a/tests/suffix8.test
+++ b/tests/suffix8.test
@@ -18,7 +18,7 @@
 # same suffix.
 # From PR/37.
 
-required=libtoolize
+required='cc libtoolize'
 . ./defs || Exit 1
 
 cat >>configure.in <<'END'
diff --git a/tests/target-cflags.test b/tests/target-cflags.test
index 499b752..cbb5e33 100755
--- a/tests/target-cflags.test
+++ b/tests/target-cflags.test
@@ -18,6 +18,7 @@
 # Test to make sure target specific CFLAGS work
 # Assar Westerlund <address@hidden>
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/transform.test b/tests/transform.test
index 67da70e..fb15503 100755
--- a/tests/transform.test
+++ b/tests/transform.test
@@ -17,6 +17,7 @@
 
 # Make sure that --program-transform works.
 
+required=cc
 . ./defs || Exit 1
 
 cat >>configure.in <<'END'
diff --git a/tests/transform2.test b/tests/transform2.test
index d6411d2..010ca40 100755
--- a/tests/transform2.test
+++ b/tests/transform2.test
@@ -18,6 +18,7 @@
 # Make sure that --program-transform works even when multiple files are
 # collapsed.
 
+required=cc
 . ./defs || Exit 1
 
 cat >>configure.in <<'END'
diff --git a/tests/upc.test b/tests/upc.test
index ad072bf..547aa79 100755
--- a/tests/upc.test
+++ b/tests/upc.test
@@ -17,6 +17,7 @@
 # A simple Hello World for UPC.
 
 . ./defs || Exit 1
+
 cat >> configure.in << 'END'
 AM_PROG_UPC
 AC_OUTPUT
@@ -43,5 +44,7 @@ $ACLOCAL
 $AUTOMAKE
 $AUTOCONF
 
-./configure
+./configure || Exit $?
 $MAKE distcheck
+
+:
diff --git a/tests/upc3.test b/tests/upc3.test
index 4692398..3c2acfd 100755
--- a/tests/upc3.test
+++ b/tests/upc3.test
@@ -17,6 +17,7 @@
 # Test that C and Unified Parallel C link safely.
 
 . ./defs || Exit 1
+
 cat >> configure.in << 'END'
 AC_PROG_CC
 AM_PROG_UPC
@@ -58,5 +59,7 @@ $ACLOCAL
 $AUTOMAKE
 $AUTOCONF
 
-./configure
+./configure || Exit $?
 $MAKE distcheck
+
+:
diff --git a/tests/vala4.test b/tests/vala4.test
index acd4f7e..a7e6a71 100755
--- a/tests/vala4.test
+++ b/tests/vala4.test
@@ -50,7 +50,7 @@ libtoolize
 $ACLOCAL
 $AUTOMAKE -a
 $AUTOCONF
-./configure "VALAC=$cwd/valac"
+./configure "VALAC=$cwd/valac" || Exit $?
 
 sed 's/AM_PROG_VALAC.*/AM_PROG_VALAC([9999.9])/' < configure.in >t
 mv -f t configure.in
@@ -60,5 +60,6 @@ $AUTOCONF --force
 sed 's/AM_PROG_VALAC.*/AM_PROG_VALAC([1.2.3])/' < configure.in >t
 mv -f t configure.in
 $AUTOCONF --force
-./configure "VALAC=$cwd/valac"
+./configure "VALAC=$cwd/valac" || Exit $?
+
 :
diff --git a/tests/yacc-basic.test b/tests/yacc-basic.test
index 16caeb2..6ce8256 100755
--- a/tests/yacc-basic.test
+++ b/tests/yacc-basic.test
@@ -16,7 +16,7 @@
 
 # Basic semantic checks on Yacc support.
 
-required=yacc
+required='cc yacc'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/yacc-clean.test b/tests/yacc-clean.test
index a05e5f2..f97e182 100755
--- a/tests/yacc-clean.test
+++ b/tests/yacc-clean.test
@@ -18,7 +18,7 @@
 # are cleaned by "make clean", while .c and .h files derived from
 # distributed .y sources are cleaned by "make maintainer-clean".
 
-required=yacc
+required='cc yacc'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/yacc-d-basic.test b/tests/yacc-d-basic.test
index 015c44c..e705f06 100755
--- a/tests/yacc-d-basic.test
+++ b/tests/yacc-d-basic.test
@@ -17,7 +17,7 @@
 # Tests on basic Yacc support for when we have -d in YFLAGS, AM_YFLAGS
 # or maude_YFLAGS.
 
-required=yacc
+required='cc yacc'
 . ./defs || Exit 1
 
 tab='  '
diff --git a/tests/yacc-d-vpath.test b/tests/yacc-d-vpath.test
index 401998e..2e38529 100755
--- a/tests/yacc-d-vpath.test
+++ b/tests/yacc-d-vpath.test
@@ -22,7 +22,7 @@
 
 # Please keep this in sync with sister test `yaccvpath.test'.
 
-required=yacc
+required='cc yacc'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/yacc-dist-nobuild.test b/tests/yacc-dist-nobuild.test
index 7961a5f..acdba6a 100755
--- a/tests/yacc-dist-nobuild.test
+++ b/tests/yacc-dist-nobuild.test
@@ -17,7 +17,7 @@
 # Check that distributed Yacc-generated parsers are not uselessly
 # remade from an unpacked distributed tarball.
 
-required=yacc
+required='cc yacc'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/yacc-nodist.test b/tests/yacc-nodist.test
index c55f400..83f63dd 100755
--- a/tests/yacc-nodist.test
+++ b/tests/yacc-nodist.test
@@ -16,7 +16,7 @@
 
 # Checks for .c and .h files derived from non-distributed .y sources.
 
-required=yacc
+required='cc yacc'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/yacc4.test b/tests/yacc4.test
index b663300..eee210e 100755
--- a/tests/yacc4.test
+++ b/tests/yacc4.test
@@ -16,7 +16,7 @@
 
 # Some simple tests of ylwrap functionality.
 
-required=yacc
+required='cc yacc'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/yacc7.test b/tests/yacc7.test
index 5cea7af..0bd0b64 100755
--- a/tests/yacc7.test
+++ b/tests/yacc7.test
@@ -21,7 +21,7 @@
 # Also check that the sources of the generated parser are distributed.
 # PR/47.
 
-required=yacc
+required='cc yacc'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/yacc8.test b/tests/yacc8.test
index 88e4123..c7cedc7 100755
--- a/tests/yacc8.test
+++ b/tests/yacc8.test
@@ -17,7 +17,7 @@
 
 # Test for subdir parsers.
 
-required=yacc
+required='cc yacc'
 
 . ./defs || Exit 1
 
diff --git a/tests/yaccdry.test b/tests/yaccdry.test
index f30e7f3..fed10d3 100755
--- a/tests/yaccdry.test
+++ b/tests/yaccdry.test
@@ -16,7 +16,7 @@
 
 # Removal recovery rules for headers should not remove files with `make -n'.
 
-required=yacc
+required='cc yacc'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/yaccvpath.test b/tests/yaccvpath.test
index c998373..aaebcaa 100755
--- a/tests/yaccvpath.test
+++ b/tests/yaccvpath.test
@@ -23,7 +23,7 @@
 
 # Please keep this in sync with sister test `yacc-d-vpath.test'.
 
-required=yacc
+required='cc yacc'
 . ./defs || Exit 1
 
 distdir=$me-1.0
diff --git a/tests/yflags-cmdline-override.test 
b/tests/yflags-cmdline-override.test
index aecff9f..accebe3 100755
--- a/tests/yflags-cmdline-override.test
+++ b/tests/yflags-cmdline-override.test
@@ -17,7 +17,7 @@
 # Check that automake can cope with user-redefinition of $(YFLAGS)
 # at configure time and/or at make time.
 
-required=yacc
+required='cc yacc'
 . ./defs || Exit 1
 
 unset YFLAGS || :
diff --git a/tests/yflags-force-conditional.test 
b/tests/yflags-force-conditional.test
index dd3b2de..a5b3599 100755
--- a/tests/yflags-force-conditional.test
+++ b/tests/yflags-force-conditional.test
@@ -20,7 +20,7 @@
 . ./defs || Exit 1
 
 cat >> configure.in <<'END'
-AC_PROG_CC
+AC_SUBST([CC], [false])
 AC_PROG_YACC
 AM_CONDITIONAL([COND], [test x"$cond" = x"yes"])
 AC_OUTPUT
@@ -37,6 +37,7 @@ PATH=`pwd`/bin$PATH_SEPARATOR$PATH; export PATH
 YACC=fake-yacc; export YACC
 
 cat > Makefile.am <<'END'
+AUTOMAKE_OPTIONS = no-dependencies
 bin_PROGRAMS = foo bar
 foo_SOURCES = foo.y main.c
 bar_SOURCES = $(foo_SOURCES)
@@ -50,13 +51,6 @@ bar_yflags2 = __bar_cond_no__
 endif !COND
 END
 
-cat > main.c <<'END'
-int main (void)
-{
-  return 0;
-}
-END
-
 : > foo.y
 
 $ACLOCAL
@@ -66,9 +60,8 @@ $AUTOMAKE -a -Wno-unsupported
 $EGREP '(YFLAGS|yflags|am__append)' Makefile.in # For debugging.
 
 ./configure cond=yes
-$MAKE
+$MAKE foo.c bar-foo.c
 
-ls -l
 cat foo.c
 cat bar-foo.c
 
@@ -80,9 +73,8 @@ $MAKE maintainer-clean
 ls -l
 
 ./configure cond=no
-$MAKE
+$MAKE foo.c bar-foo.c
 
-ls -l
 cat foo.c
 cat bar-foo.c
 
diff --git a/tests/yflags-force-override.test b/tests/yflags-force-override.test
index b76b529..cf30f46 100755
--- a/tests/yflags-force-override.test
+++ b/tests/yflags-force-override.test
@@ -18,7 +18,7 @@
 # in Makefile.am (even if that is extremely bad practice, because that
 # variable is user-reserved).
 
-required=yacc
+required='cc yacc'
 . ./defs || Exit 1
 
 cat >> configure.in <<'END'
diff --git a/tests/yflags.test b/tests/yflags.test
index aac1986..bf5611d 100755
--- a/tests/yflags.test
+++ b/tests/yflags.test
@@ -33,13 +33,14 @@ chmod a+x fake-yacc
 unset YACC || :
 
 cat >> configure.in <<'END'
-AC_PROG_CC
+AC_SUBST([CC], [false])
 # Simulate presence of Yacc using our fake-yacc script.
 AC_SUBST([YACC], ['$(abs_top_srcdir)'/fake-yacc])
 AC_OUTPUT
 END
 
 cat > Makefile.am <<'END'
+AUTOMAKE_OPTIONS = no-dependencies
 bin_PROGRAMS = foo bar
 foo_SOURCES = main.c foo.y
 bar_SOURCES = main.c bar.y
@@ -53,19 +54,17 @@ $AUTOMAKE -a
 grep '\$(YFLAGS).*\$(bar_YFLAGS)' Makefile.in && Exit 1
 grep '\$(YFLAGS).*\$(AM_YFLAGS)' Makefile.in && Exit 1
 
-echo 'int main(void){ return 0; }' > main.c
 : > foo.y
 : > bar.y
 
 $AUTOCONF
 ./configure
-env YFLAGS=__user_flags__ $MAKE -e
-
-ls -l
+env YFLAGS=__user_flags__ $MAKE -e foo.c bar-bar.c
 
 cat foo.c
-grep '__am_flags__.*__user_flags__' foo.c
 cat bar-bar.c
+
+grep '__am_flags__.*__user_flags__' foo.c
 grep '__bar_flags__.*__user_flags__' bar-bar.c
 
 :
diff --git a/tests/yflags2.test b/tests/yflags2.test
index 803cecc..8e17d08 100755
--- a/tests/yflags2.test
+++ b/tests/yflags2.test
@@ -33,13 +33,14 @@ chmod a+x fake-yacc
 unset YACC || :
 
 cat >> configure.in <<'END'
-AC_PROG_CXX
+AC_SUBST([CXX], [false])
 # Simulate presence of Yacc using our fake-yacc script.
 AC_SUBST([YACC], ['$(abs_top_srcdir)'/fake-yacc])
 AC_OUTPUT
 END
 
 cat > Makefile.am <<'END'
+AUTOMAKE_OPTIONS = no-dependencies
 bin_PROGRAMS = foo bar
 foo_SOURCES = main.cc foo.yy
 bar_SOURCES = main.cc bar.y++
@@ -53,19 +54,17 @@ $AUTOMAKE -a
 grep '\$(YFLAGS).*\$(bar_YFLAGS)' Makefile.in && Exit 1
 grep '\$(YFLAGS).*\$(AM_YFLAGS)' Makefile.in && Exit 1
 
-echo 'int main(void) { return 0; }' > main.cc
 : > foo.yy
 : > bar.y++
 
 $AUTOCONF
 ./configure
-env YFLAGS=__user_flags__ $MAKE -e
-
-ls -l
+env YFLAGS=__user_flags__ $MAKE -e foo.cc bar-bar.c++
 
 cat foo.cc
-grep '__am_flags__.*__user_flags__' foo.cc
 cat bar-bar.c++
+
+grep '__am_flags__.*__user_flags__' foo.cc
 grep '__bar_flags__.*__user_flags__' bar-bar.c++
 
 :


hooks/post-receive
-- 
GNU Automake



reply via email to

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