summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog919
-rw-r--r--CheckListOfTests.am76
-rw-r--r--Makefile.am23
-rw-r--r--Makefile.in24
-rw-r--r--THANKS1
-rwxr-xr-xbootstrap1
-rwxr-xr-xconfigure45
-rw-r--r--configure.ac8
-rw-r--r--doc/Makefile.in5
-rw-r--r--lib/Automake/Makefile.in5
-rw-r--r--lib/Automake/tests/Makefile.am5
-rw-r--r--lib/Automake/tests/Makefile.in75
-rw-r--r--lib/Makefile.in5
-rw-r--r--lib/am/Makefile.in5
-rw-r--r--m4/Makefile.in5
-rw-r--r--tests/.gitignore1
-rw-r--r--tests/Makefile.am115
-rw-r--r--tests/Makefile.in306
-rw-r--r--tests/README40
-rwxr-xr-xtests/acloca14.test1
-rwxr-xr-xtests/acloca22.test10
-rwxr-xr-xtests/aclocal4.test9
-rwxr-xr-xtests/ansi.test1
-rwxr-xr-xtests/ansi10.test2
-rwxr-xr-xtests/ansi3.test13
-rwxr-xr-xtests/ansi3b.test10
-rwxr-xr-xtests/ansi5.test7
-rwxr-xr-xtests/ansi6.test2
-rwxr-xr-xtests/ansi7.test2
-rwxr-xr-xtests/ansi9.test15
-rwxr-xr-xtests/autohdr4.test31
-rwxr-xr-xtests/autohdrdry.test1
-rwxr-xr-xtests/backcompat6.test6
-rwxr-xr-xtests/canon7.test16
-rwxr-xr-xtests/ccnoco.test63
-rwxr-xr-xtests/ccnoco2.test6
-rwxr-xr-xtests/ccnoco3.test10
-rwxr-xr-xtests/check-subst-prog.test (renamed from tests/check9.test)29
-rwxr-xr-xtests/check-subst.test87
-rwxr-xr-xtests/check.test8
-rwxr-xr-xtests/check10.test8
-rwxr-xr-xtests/check11.test6
-rwxr-xr-xtests/check2.test14
-rwxr-xr-xtests/check3.test16
-rwxr-xr-xtests/check4.test34
-rwxr-xr-xtests/check5.test17
-rwxr-xr-xtests/check6.test3
-rwxr-xr-xtests/check7.test26
-rwxr-xr-xtests/check8.test22
-rwxr-xr-xtests/color.test2
-rwxr-xr-xtests/color2.test8
-rwxr-xr-xtests/comment6.test4
-rwxr-xr-xtests/compile2.test9
-rwxr-xr-xtests/compile5.test11
-rwxr-xr-xtests/cond.test4
-rwxr-xr-xtests/cond10.test6
-rwxr-xr-xtests/cond11.test22
-rwxr-xr-xtests/cond13.test8
-rwxr-xr-xtests/cond14.test5
-rwxr-xr-xtests/cond15.test2
-rwxr-xr-xtests/cond16.test35
-rwxr-xr-xtests/cond17.test10
-rwxr-xr-xtests/cond18.test31
-rwxr-xr-xtests/cond19.test45
-rwxr-xr-xtests/cond2.test11
-rwxr-xr-xtests/cond20.test12
-rwxr-xr-xtests/cond21.test10
-rwxr-xr-xtests/cond22.test22
-rwxr-xr-xtests/cond23.test4
-rwxr-xr-xtests/cond24.test7
-rwxr-xr-xtests/cond25.test2
-rwxr-xr-xtests/cond26.test2
-rwxr-xr-xtests/cond27.test2
-rwxr-xr-xtests/cond28.test2
-rwxr-xr-xtests/cond29.test31
-rwxr-xr-xtests/cond3.test14
-rwxr-xr-xtests/cond30.test32
-rwxr-xr-xtests/cond31.test30
-rwxr-xr-xtests/cond32.test37
-rwxr-xr-xtests/cond33.test22
-rwxr-xr-xtests/cond34.test39
-rwxr-xr-xtests/cond35.test21
-rwxr-xr-xtests/cond36.test13
-rwxr-xr-xtests/cond37.test12
-rwxr-xr-xtests/cond38.test16
-rwxr-xr-xtests/cond39.test2
-rwxr-xr-xtests/cond4.test38
-rwxr-xr-xtests/cond40.test2
-rwxr-xr-xtests/cond41.test8
-rwxr-xr-xtests/cond42.test34
-rwxr-xr-xtests/cond43.test5
-rwxr-xr-xtests/cond46.test36
-rwxr-xr-xtests/cond6.test33
-rwxr-xr-xtests/cond8.test43
-rwxr-xr-xtests/cond9.test11
-rwxr-xr-xtests/condd.test7
-rwxr-xr-xtests/condman3.test33
-rwxr-xr-xtests/cygnus-dependency-tracking.test1
-rw-r--r--tests/defs199
-rw-r--r--tests/defs-static.in13
-rwxr-xr-xtests/dejagnu4.test6
-rwxr-xr-xtests/dejagnu7.test4
-rwxr-xr-xtests/depcomp10.test90
-rwxr-xr-xtests/depcomp2.test6
-rwxr-xr-xtests/depcomp6.test4
-rwxr-xr-xtests/depcomp7.test2
-rwxr-xr-xtests/depcomp8a.test5
-rwxr-xr-xtests/depcomp8b.test2
-rwxr-xr-xtests/depcomp9.test92
-rwxr-xr-xtests/depdist.test1
-rwxr-xr-xtests/depend2.test12
-rwxr-xr-xtests/depend5.test1
-rwxr-xr-xtests/depmod-data.test (renamed from tests/condman.test)31
-rwxr-xr-xtests/depmod-tests.sh225
-rwxr-xr-xtests/distcleancheck.test1
-rwxr-xr-xtests/distlinks.test5
-rwxr-xr-xtests/distlinksbrk.test5
-rwxr-xr-xtests/distname.test1
-rwxr-xr-xtests/exeext.test1
-rwxr-xr-xtests/exeext4.test1
-rwxr-xr-xtests/extra-programs-empty.test53
-rwxr-xr-xtests/extradep.test1
-rwxr-xr-xtests/extradep2.test2
-rwxr-xr-xtests/fn99.test22
-rwxr-xr-xtests/fn99subdir.test24
-rwxr-xr-xtests/forcemiss2.test5
-rwxr-xr-xtests/fort5.test7
-rwxr-xr-xtests/gen-parallel-tests10
-rwxr-xr-xtests/gettext3.test2
-rwxr-xr-xtests/gnits2.test14
-rwxr-xr-xtests/gnits3.test11
-rwxr-xr-xtests/install2.test2
-rwxr-xr-xtests/installdir.test4
-rwxr-xr-xtests/instdir-ltlib.test2
-rwxr-xr-xtests/instdir-prog.test1
-rwxr-xr-xtests/instdir-texi.test6
-rwxr-xr-xtests/instfail-info.test2
-rwxr-xr-xtests/instfail-java.test2
-rwxr-xr-xtests/instfail-libtool.test4
-rwxr-xr-xtests/instfail.test3
-rwxr-xr-xtests/instmany-mans.test2
-rwxr-xr-xtests/instmany-python.test2
-rwxr-xr-xtests/instmany.test2
-rwxr-xr-xtests/instsh3.test4
-rwxr-xr-xtests/instspc-data.test15
-rwxr-xr-xtests/instspc-tests.sh76
-rwxr-xr-xtests/lex-lib.test67
-rwxr-xr-xtests/lex-libobj.test75
-rwxr-xr-xtests/lex-noyywrap.test72
-rwxr-xr-xtests/lex-subobj-nodep.test2
-rwxr-xr-xtests/lex3.test22
-rwxr-xr-xtests/lex5.test2
-rwxr-xr-xtests/lexvpath.test14
-rwxr-xr-xtests/lflags.test12
-rwxr-xr-xtests/lflags2.test12
-rwxr-xr-xtests/libobj-basic.test1
-rwxr-xr-xtests/libobj10.test1
-rwxr-xr-xtests/libobj14.test1
-rwxr-xr-xtests/libobj16a.test1
-rwxr-xr-xtests/libobj16b.test3
-rwxr-xr-xtests/libobj17.test1
-rwxr-xr-xtests/libobj19.test1
-rwxr-xr-xtests/libobj2.test1
-rwxr-xr-xtests/libobj7.test1
-rwxr-xr-xtests/libtoo10.test3
-rwxr-xr-xtests/libtoo11.test4
-rwxr-xr-xtests/libtool3.test6
-rwxr-xr-xtests/libtool7.test14
-rwxr-xr-xtests/libtool9.test16
-rwxr-xr-xtests/ltcond.test4
-rwxr-xr-xtests/ltcond2.test37
-rwxr-xr-xtests/ltconv.test14
-rwxr-xr-xtests/ltinit.test10
-rwxr-xr-xtests/ltlibsrc.test17
-rwxr-xr-xtests/ltorder.test3
-rwxr-xr-xtests/makej2.test2
-rwxr-xr-xtests/mdate6.test3
-rwxr-xr-xtests/mkinst3.test4
-rwxr-xr-xtests/mmodely.test2
-rwxr-xr-xtests/nobase-libtool.test6
-rwxr-xr-xtests/nobase.test6
-rwxr-xr-xtests/nostdinc.test11
-rwxr-xr-xtests/parallel-tests-ext-driver-prog.test (renamed from tests/parallel-tests7.test)24
-rwxr-xr-xtests/parallel-tests-ext-driver.test136
-rwxr-xr-xtests/parallel-tests-reset-term.test2
-rwxr-xr-xtests/parallel-tests-suffix-prog.test77
-rwxr-xr-xtests/parallel-tests-suffix.test (renamed from tests/parallel-tests4.test)24
-rwxr-xr-xtests/parallel-tests-unreadable-log.test2
-rwxr-xr-xtests/parallel-tests.test6
-rwxr-xr-xtests/parallel-tests10.test3
-rwxr-xr-xtests/parallel-tests2.test7
-rwxr-xr-xtests/parallel-tests3.test17
-rwxr-xr-xtests/parallel-tests5.test19
-rwxr-xr-xtests/parallel-tests8.test6
-rwxr-xr-xtests/parallel-tests9.test7
-rwxr-xr-xtests/posixsubst-ldadd.test3
-rwxr-xr-xtests/posixsubst-libraries.test1
-rwxr-xr-xtests/posixsubst-ltlibraries.test2
-rwxr-xr-xtests/posixsubst-programs.test1
-rwxr-xr-xtests/posixsubst-sources.test1
-rwxr-xr-xtests/postproc.test3
-rwxr-xr-xtests/pr204.test2
-rwxr-xr-xtests/pr220.test18
-rwxr-xr-xtests/pr224.test7
-rwxr-xr-xtests/pr243.test4
-rwxr-xr-xtests/pr266.test4
-rwxr-xr-xtests/pr287.test1
-rwxr-xr-xtests/pr300-lib.test2
-rwxr-xr-xtests/pr300-ltlib.test10
-rwxr-xr-xtests/pr300-prog.test2
-rwxr-xr-xtests/pr401.test17
-rwxr-xr-xtests/pr401b.test24
-rwxr-xr-xtests/pr401c.test23
-rwxr-xr-xtests/pr87.test21
-rwxr-xr-xtests/primary3.test2
-rwxr-xr-xtests/programs-primary-rewritten.test (renamed from tests/subst2.test)50
-rwxr-xr-xtests/python-virtualenv.test6
-rwxr-xr-xtests/regex.test1
-rwxr-xr-xtests/remake-all-1.test67
-rwxr-xr-xtests/remake-all-2.test75
-rwxr-xr-xtests/remake-gnulib-add-acsubst.test1
-rwxr-xr-xtests/remake-gnulib-add-header.test1
-rwxr-xr-xtests/remake-gnulib-remove-header.test6
-rwxr-xr-xtests/remake-renamed-m4-macro-and-file.test2
-rwxr-xr-xtests/remake10a.test16
-rwxr-xr-xtests/remake10b.test16
-rwxr-xr-xtests/remake10c.test17
-rwxr-xr-xtests/remake12.test34
-rwxr-xr-xtests/remake1a.test1
-rwxr-xr-xtests/remake5.test15
-rwxr-xr-xtests/remake8a.test5
-rwxr-xr-xtests/remake8b.test5
-rwxr-xr-xtests/remake9a.test12
-rwxr-xr-xtests/remake9b.test12
-rwxr-xr-xtests/remake9c.test12
-rwxr-xr-xtests/remake9d.test12
-rwxr-xr-xtests/repeated-options.test2
-rwxr-xr-xtests/self-check-cleanup.test1
-rwxr-xr-xtests/self-check-exit.test2
-rwxr-xr-xtests/self-check-explicit-skips.test52
-rwxr-xr-xtests/self-check-report.test2
-rwxr-xr-xtests/silent-lex-gcc.test9
-rwxr-xr-xtests/silent-lex-generic.test11
-rwxr-xr-xtests/silent-many-gcc.test16
-rwxr-xr-xtests/silent-many-generic.test8
-rwxr-xr-xtests/silent-yacc-generic.test2
-rwxr-xr-xtests/silent.test1
-rwxr-xr-xtests/silent3.test2
-rwxr-xr-xtests/silent9.test2
-rwxr-xr-xtests/silentcxx-gcc.test109
-rwxr-xr-xtests/silentcxx.test19
-rwxr-xr-xtests/silentf77.test2
-rwxr-xr-xtests/silentf90.test2
-rwxr-xr-xtests/specflg10.test2
-rwxr-xr-xtests/specflg7.test4
-rwxr-xr-xtests/specflg8.test4
-rwxr-xr-xtests/stdinc.test1
-rwxr-xr-xtests/strip.test1
-rwxr-xr-xtests/strip2.test2
-rwxr-xr-xtests/strip3.test2
-rwxr-xr-xtests/subdir5.test20
-rwxr-xr-xtests/subdir8.test20
-rwxr-xr-xtests/subdirbuiltsources.test1
-rwxr-xr-xtests/subobj11a.test1
-rwxr-xr-xtests/subobj3.test10
-rwxr-xr-xtests/subobj5.test26
-rwxr-xr-xtests/subobj6.test2
-rwxr-xr-xtests/subobj9.test11
-rwxr-xr-xtests/subpkg.test11
-rwxr-xr-xtests/subst-no-trailing-empty-line.test89
-rwxr-xr-xtests/subst3.test4
-rwxr-xr-xtests/substre2.test2
-rwxr-xr-xtests/substref.test12
-rwxr-xr-xtests/suffix10.test2
-rwxr-xr-xtests/suffix11.test1
-rwxr-xr-xtests/suffix12.test1
-rwxr-xr-xtests/suffix13.test1
-rwxr-xr-xtests/suffix3.test1
-rwxr-xr-xtests/suffix5.test2
-rwxr-xr-xtests/suffix8.test2
-rwxr-xr-xtests/symlink2.test5
-rwxr-xr-xtests/tar.test4
-rwxr-xr-xtests/tar2.test4
-rwxr-xr-xtests/target-cflags.test17
-rwxr-xr-xtests/targetclash.test1
-rwxr-xr-xtests/transform.test8
-rwxr-xr-xtests/transform2.test1
-rwxr-xr-xtests/txinfo21.test6
-rwxr-xr-xtests/txinfo26.test4
-rwxr-xr-xtests/upc.test5
-rwxr-xr-xtests/upc3.test5
-rwxr-xr-xtests/vala2.test2
-rwxr-xr-xtests/vala3.test4
-rwxr-xr-xtests/vala4.test5
-rwxr-xr-xtests/vala5.test3
-rwxr-xr-xtests/vtexi4.test11
-rwxr-xr-xtests/yacc-basic.test8
-rwxr-xr-xtests/yacc-clean.test2
-rwxr-xr-xtests/yacc-d-basic.test2
-rwxr-xr-xtests/yacc-d-vpath.test2
-rwxr-xr-xtests/yacc-dist-nobuild.test2
-rwxr-xr-xtests/yacc-nodist.test2
-rwxr-xr-xtests/yacc4.test9
-rwxr-xr-xtests/yacc7.test2
-rwxr-xr-xtests/yacc8.test2
-rwxr-xr-xtests/yaccdry.test2
-rwxr-xr-xtests/yaccvpath.test2
-rwxr-xr-xtests/yflags-cmdline-override.test2
-rwxr-xr-xtests/yflags-force-conditional.test16
-rwxr-xr-xtests/yflags-force-override.test2
-rwxr-xr-xtests/yflags.test11
-rwxr-xr-xtests/yflags2.test12
312 files changed, 4338 insertions, 1517 deletions
diff --git a/ChangeLog b/ChangeLog
index cb8adbcc3..281afa214 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -48,12 +48,504 @@
the `DESTDIR' variable, is poorly chosen, if not downright wrong.
Rewrite it to use `prefix' as the overridden variable instead.
+2011-05-29 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests: don't require gfortran if any fortran compiler is enough
+ * tests/silentf90.test ($required): Require `fortran', not
+ `gfortran'.
+ * tests/silentf77.test ($required): Require `fortran77', not
+ `gfortran'.
+ * tests/silent-many-generic.test ($required): Require `fortran'
+ and `fortran77' rather than `gfortran'.
+
+2011-05-27 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests: improve `ccnoco*.test', better cross-compiling support
+ * tests/ccnoco3.test (Mycomp): Use the `$CC' chosen by `tests/defs'
+ instead of forcing `gcc' unconditionally. This ensures better
+ coverage in case of cross-compiling, when GCC can be named e.g.,
+ `i586-mingw32msvc-gcc', instead of simply `gcc'.
+ * tests/ccnoco.test: Likewise. Remove redundant checks. Modernize
+ the created `configure.in'. Run tests both in-tree and in VPATH.
+ Export `CC' to the overridden value only once.
+ * tests/ccnoco2.test: Slightly stricter grepping of automake
+ stderr. Add trailing `:' command.
+
2011-05-27 Stefano Lattarini <stefano.lattarini@gmail.com>
testsuite: each test case depends on `defs-static'
* tests/Makefile.am ($(TEST_LOGS)): Depends on `defs-static' too.
Simplify comments.
+2011-05-27 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ testsuite: use $SHELL to run tests which are shell scripts
+ * tests/Makefile.am (TEST_LOG_COMPILER): Define so that the
+ configure-time $SHELL is used to run the tests.
+ * tests/defs: Add code to re-execute by default the running
+ test script with configure-time $SHELL. Updated comments.
+ * configure.ac: Check that `set -e' is working for $SHELL,
+ not for /bin/sh.
+ * tests/defs-static.in: Update comments.
+ * tests/README (Supported shells): Updated.
+ (Getting details from failures): Don't tell that tests are
+ run by /bin/sh by default.
+
+2011-05-26 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests: split 'subst2.test' to improve modularity and coverage
+ * tests/subst2.test: Test removed, split into ...
+ * tests/programs-primary-rewritten.test: ... this test ...
+ * tests/subst-no-trailing-empty-line.test: ... and this one ...
+ * tests/extra-programs-empty.test: ... and this one.
+ * tests/Makefile.am (TESTS): Update.
+
+2011-05-26 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests: tweak and improve tests on Automake conditionals
+ The "avoid the requirement of a working compiler" we refer about
+ below is obtained by disabling automatic dependency tracking and
+ defining `CC' (and `EXEEXT', `OBJEXT', `CXX', etc., if needed) to
+ dummy values, either directly in the `Makefile.am', or by AC_SUBST
+ in `configure.in'.
+ The "cosmetic changes" we refer about below consists in, e.g.,
+ adding a trailing `:' command to a script, using proper m4 quoting
+ in `configure.in' files, adding commands that offer more debugging
+ output, explicitly declaring phony targets as such in Makefiles,
+ making use of idioms more consistent with those employed in other
+ tests, following the GNU formatting standards more closely, etc.
+ * tests/cond.test: Cosmetic changes.
+ * tests/cond3.test: Likewise.
+ * tests/cond10.test: Likewise.
+ * tests/cond14.test: Likewise.
+ * tests/cond15.test: Likewise.
+ * tests/cond17.test: Likewise.
+ * tests/cond40.test: Likewise.
+ * tests/cond13.test: Likewise, and make grepping of the generated
+ `Makefile.in' slightly stricter.
+ * tests/cond6.test: Extend by also running ./configure, make and
+ "make install". Few cosmetic changes.
+ * tests/cond8.test: Likewise.
+ * tests/cond2.test: Do few cosmetic changes. Make grepping of
+ automake stderr stricter.
+ * tests/cond20.test: Likewise.
+ * tests/cond23.test: Likewise.
+ * tests/cond24.test: Likewise.
+ * tests/cond42.test: Likewise.
+ * tests/cond46.test: Likewise.
+ * tests/cond9.test: Move more checks in the `Makefile.am' instead
+ of grepping make's output.
+ * tests/cond38.test: Likewise.
+ * tests/cond11.test: Likewise. Avoid the requirement of a working
+ C compiler.
+ * tests/cond16.test: Likewise.
+ * tests/cond22.test: Likewise.
+ * tests/cond30.test: Likewise.
+ * tests/cond31.test: Likewise.
+ * tests/cond4.test: Likewise, and drop the now-useless GNU make
+ requirement as well.
+ * tests/cond18.test: Likewise.
+ * tests/cond19.test: Likewise.
+ * tests/cond22.test: Likewise.
+ * tests/cond25.test: Add trailing `:' command.
+ * tests/cond26.test: Likewise.
+ * tests/cond27.test: Likewise.
+ * tests/cond28.test: Likewise.
+ * tests/cond29.test: Use `unindent' function for better formatting.
+ Other minor cosmetic changes. Use a `timeout' program (if it's
+ available) to determine whether the script takes too long, instead
+ of just hoping that the user will notice an abnormally long test
+ execution time.
+ * tests/cond33.test: Extend a bit. Fix heading comments. Few more
+ cosmetic changes.
+ * tests/cond37.test: Ensure verbose printing of captured make
+ output. Minor cosmetic changes.
+ * tests/cond34.test: Likewise. Avoid the requirement of a working
+ C compiler. Make grepping of make output slightly stricter.
+ * tests/cond35.test: Quote literal dots in grep regexp. Add extra
+ debugging output. Minor cosmetic changes.
+ * tests/cond36.test: Likewise.
+ * tests/cond41.test: Do not simply check that aclocal fails, but
+ also grep its stderr for the expected error message.
+ * tests/cond43.test: Likewise (but the program being automake).
+ Few cosmetic changes.
+ * tests/condd.test: Avoid the requirement of a working C compiler.
+ * tests/condman3.test: Extend by using more man pages and more
+ manpage sections.
+ * tests/condman.test: Removed, it's completely superseded by
+ `condman3.test'.
+ * tests/Makefile.am (TESTS): Update.
+
+2011-05-25 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ lex tests: avoid spurious failures when LEXLIB isn't found
+ The AC_PROG_LEX Autoconf macro does not diagnose a failure to find
+ the "lex library" expected to provide a `yywrap' function (function
+ which is required to link most lex-generated programs). On the
+ contrary, when all the link attempts (i.e., with `-ll' and `-lfl')
+ fail, configure declares that no lex library is needed, and simply
+ proceeds with the configuration process -- only for the build to
+ possibly fail later, at make time.
+ This behaviour might be (partly) intended; the Autoconf manual
+ reads:
+ ``You are encouraged to use Flex in your sources, since it is
+ both more pleasant to use than plain Lex and the C source
+ it produces is portable. In order to ensure portability,
+ however, you must either provide a function `yywrap' or, if
+ you don't use it (e.g., your scanner has no `#include'-like
+ feature), simply include a `%noyywrap' statement in the
+ scanner's source.''
+ This AC_PROG_LEX behaviour is causing some spurious failures of the
+ Automake testsuite in environments which lack a proper library
+ providing `yywrap' (this happens for example in Linux->MinGW cross
+ compilations). But at this point is clear that a proper workaround
+ is to simply provide a fall-back implementation of `yywrap' in our
+ lexers.
+ * tests/cond35.test: Provide a dummy `yywrap' function.
+ * tests/lex3.test: Likewise.
+ * tests/lexvpath.test: Likewise.
+ * tests/silent-many-gcc.test: Likewise.
+ * tests/silent-many-generic.test: Likewise.
+ * tests/silent-lex-gcc.test: Likewise, and a dummy `main' too.
+ * tests/silent-lex-generic.test: Likewise.
+ * tests/lex-lib.test: New test.
+ * tests/lex-libobj.test: New test.
+ * tests/lex-nowrap.test: New test.
+ * tests/Makefile.am (TESTS): Update.
+ * THANKS: Update.
+ Thanks to Russ Allbery for the suggestion.
+
+2011-05-25 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ 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 <stefano.lattarini@gmail.com>
+
+ 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 <stefano.lattarini@gmail.com>
+
+ 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 <stefano.lattarini@gmail.com>
+
+ 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 <stefano.lattarini@gmail.com>
+
+ 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 <stefano.lattarini@gmail.com>
+
+ 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 <stefano.lattarini@gmail.com>
+
+ tests/README: small consistency improvement
+ * tests/README (Section "User interface" subsection "Running the
+ tests"): In examples, be more consistent w.r.t. the differences
+ between GNU and non-GNU make.
+
+2011-05-21 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests/README: suggest how to run tests in cross-compile mode
+ * tests/README (Section "User interface" subsection "Running the
+ tests"): Briefly explain how to override 'host_alias' at runtime
+ to force the use of cross-compilers by the testsuite. Give an
+ example.
+
+2011-05-21 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ test defs: better detection of cross-compile mode
+ * configure.ac (AC_CANONICAL_HOST): New, probably not strictly
+ necessary, but useful to complements AC_CANONICAL_BUILD.
+ * tests/defs-static.in ($host_alias, $build_alias): New variables,
+ exported, user-overridable, defaults AC_SUBST'd by configure.
+ * tests/defs (cross_compiling): Consider cross-compilation mode
+ active only if `$host_alias' is not empty *and* it differs from
+ `$build_alias'. This is more faithful to the way configure
+ determines whether it is cross-compiling, but still allows the
+ user to easily force cross-compilation by overriding `host_alias'
+ and `build_alias' at runtime.
+ From a report by Ralf Wildenhues.
+
2011-05-20 Stefano Lattarini <stefano.lattarini@gmail.com>
testsuite: avoid re-running few tests with 'parallel-tests' option
@@ -94,6 +586,64 @@
and 'ANSI2KNR' in the example; instead, use the more common
and typical `DESTDIR'.
+2011-05-18 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests: avoid spurious failures in cross-compile mode
+ * tests/depcomp2.test: Ensure verbose printing of captured stderr
+ from configure.
+ * tests/ansi3.test ($required): Add 'native', as the ansi2knr
+ functionality is not meant to work with a cross-compiler.
+ * tests/ansi3b.test: Likewise.
+ * tests/ansi5.test: Likewise.
+ * tests/ansi6.test: Likewise.
+ * tests/ansi7.test: Likewise.
+ * tests/ansi8.test: Likewise.
+ * tests/ansi10.test: Likewise.
+ * tests/subobj3.test: Likewise.
+ * tests/check8.test ($required): Add 'native', as this test is
+ not meant to work with a cross-compiler.
+ * tests/gnits2.test: Likewise.
+ * tests/ltconv.test: Likewise.
+ * tests/ltcond2.test: Likewise.
+ * tests/parallel-tests5.test: Likewise.
+ * tests/specflg7.test: Likewise.
+ * tests/specflg8.test: Likewise.
+ * tests/check5.test: Likewise. Also, ensure verbose printing of
+ captured make output, and thrown in few cosmetic and consistency
+ improvements.
+ * tests/ltinit.test: Be laxer in grepping configure output, to
+ avoid spurious failures on systems which lack POSIX dynamic
+ linking (e.g., MinGW), or when cross-compiling for such systems.
+ * tests/ansi9.test: Skip parts of the test that would require a
+ native compiler.
+ * tests/backcompat6.test: Likewise.
+ * tests/depcomp8a.test: Likewise.
+ * tests/pr401.test: Likewise.
+ * tests/pr401b.test: Likewise.
+ * tests/pr401c.test: Likewise.
+ * tests/target-cflags.test: Likewise.
+ * tests/lex3.test: Likewise.
+ * tests/yacc-basic.test: Likewise.
+ * tests/autohdr4.test: Likewise. Also, extend the test to ensure
+ more coverage in cross-compile mode.
+ * tests/canon7.test: Likewise.
+ * tests/check9.test: Removed, split into two new tests ...
+ * tests/check-subst-prog.test: ... this one, which requires a
+ native C compiler ...
+ * tests/check-subst.test: ... and this one, which doesn't require
+ any compiler.
+ * tests/parallel-tests4.test: Removed, split into two new tests ...
+ * tests/parallel-tests-suffix-prog.test: ... this one, which
+ requires a native C compiler ...
+ * tests/parallel-tests-suffix.test: ... and this one, which
+ doesn't require any compiler.
+ * tests/parallel-tests7.test: Removed, split into two new tests ...
+ * tests/parallel-tests-ext-driver-prog.test: ... this one, which
+ requires a native C compiler ...
+ * tests/parallel-tests-ext-driver.test: ... and this one, which
+ doesn't require any compiler.
+ * tests/Makefile.am (TESTS): Update.
+
2011-05-19 Stefano Lattarini <stefano.lattarini@gmail.com>
test defs: rename requirement 'non-cross' -> 'native'
@@ -120,6 +670,17 @@
2011-05-07 Stefano Lattarini <stefano.lattarini@gmail.com>
+ tests: fix spurious failure of extradep.test on FreeBSD
+ * tests/extradep.test: When using `ls -t' to determine whether a
+ file has been updated, make sure to use as reference a file whose
+ timestamp is expected to be *strictly* older that that of the file
+ being checked. This is required because at least FreeBSD `ls' do
+ not sort files with the same timestamp in alphabetical order when
+ using the `-t' option.
+ * tests/extradep2.test: Likewise.
+
+2011-05-07 Stefano Lattarini <stefano.lattarini@gmail.com>
+
tests: fix spurious failure of txinfo21.test on FreeBSD
* tests/txinfo21.test: Use the `is_newest' subroutine instead of
the `ls -t' hack to to determine whether a file has been updated.
@@ -129,14 +690,29 @@
2011-05-07 Stefano Lattarini <stefano.lattarini@gmail.com>
- tests: fix spurious failure of extradep.test on FreeBSD
- * tests/extradep.test: When using `ls -t' to determine whether a
- file has been updated, make sure to use as reference a file whose
- timestamp is expected to be *strictly* older that that of the file
- being checked. This is required because at least FreeBSD `ls' do
- not sort files with the same timestamp in alphabetical order when
- using the `-t' option.
- * tests/extradep2.test: Likewise.
+ tests: fix syntax error in 'silentcxx-gcc.test'
+ * tests/silentcxx-gcc.test (for config_args in ...): Remove extra
+ trailing backslash from the list of looped-on items.
+
+2011-05-07 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ depmod tests: fix bug in depmodes list extraction
+ * tests/depmod-tests.sh (get_depmodes): Use `echo $all_depmodes'
+ instead of `... | tr "$nl" "$sp"' to strip extra whitespaces and
+ newlines from `$all_depmodes'. The latter idiom with `tr' is
+ wrong since it gets run before `./defs' is sourced, and thus `$nl'
+ and `$sp' are undefined.
+ Bug revealad by FreeBSD tr(1) implementation, which doesn't accept
+ empty strings as arguments.
+
+2011-05-04 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests: add excerpts from few original bug reports, for clarity.
+ * tests/comment6.test: Add excerpts and/or details from the
+ original bug report that prompted this tests to be added and/or
+ extended.
+ * tests/dejagnu4.test: Likewise.
+ * tests/installdir.test: Likewise.
2011-05-04 Stefano Lattarini <stefano.lattarini@gmail.com>
@@ -153,6 +729,40 @@
implementation, looking for a generic `lex' program, will follow
in the future.
+2011-05-04 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests: 'silent-many-gcc.test' improved and made more robust
+ * tests/silent-many-gcc.test: Also force "fast" gcc depmode
+ for C++ compilations. Add sanity checks verifying that the
+ cache variables we force are really used by configure. Fix
+ typo in comments.
+
+2011-05-04 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests: drop useless requirements of 'g++'
+ * tests/lflags2.test ($required): Remove 'g++', as any working
+ C++ compiler should be enough, and ./configure will cause the
+ test to skip if no working C++ compiler is found.
+ * tests/yflags2.test: Likewise.
+ * tests/subobj9.test: Likewise.
+ * tests/silentcxx.test: Likewise. Also, do not force depmodes
+ that could cause non-GNU C++ compilers to fail.
+ * tests/silentcxx-gcc.test: New test, like `silentcxx.test',
+ but forcing "fast" gcc depmode (and thus requiring the GNU C++
+ compiler).
+ * tests/specflg10.test: Add proper "fixme" comment telling that
+ we should make this test work with a generic C++ compiler.
+ * tests/Makefile.am (TESTS): Update.
+
+2011-05-03 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests defs: one more environment sanitization (corner case)
+ * tests/defs (am__using_gmake): Initialize. The `using_gmake'
+ subroutine was using this variable for caching, but wasn't
+ initializing it, which could cause problems in the (admittedly
+ very unlikely) case in which it was pre-existent in the
+ environment.
+
2011-05-03 Stefano Lattarini <stefano.lattarini@gmail.com>
tests: add forgotten test scripts to $(TESTS)
@@ -169,12 +779,238 @@
2011-05-03 Stefano Lattarini <stefano.lattarini@gmail.com>
+ maintcheck: consistency of list of test scripts
+ * CheckListOfTests.am: New file.
+ (maintainer-check-list-of-tests): New target,
+ check for consistency between list of tests defined in the
+ including Makefile and list of tests on the filesystem.
+ (clean-maintcheck-testslist-tmp): New rule, to clean up the
+ temporary files that might be left around by the rules associated
+ with the previous target.
+ (clean-local): Depend on it.
+ * lib/Automake/tests/Makefile.am: Include `CheckListOfTests.am'.
+ (maintainer-check): Added dependency from the new target
+ `maintainer-check-list-of-tests'.
+ * tests/Makefile.am: Likewise. Also ...
+ (checked_test_extensions): Define to `.test'.
+ (expected_test_list): Define properly.
+ * Makefile.am (maintainer-check-list-of-test): New target,
+ calling recursively into `tests/' and `lib/Automake/tests/',
+ using ...
+ (TEST_SUBDIRS): ... this new variable.
+
+2011-05-03 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests: drop useless requirements of gcc (plus testsuite tweakings)
+ * tests/libobj14.test ($required): Remove 'gcc', as we never run
+ the C compiler.
+ * tests/targetclash.test: Likewise.
+ * tests/ansi6.test ($required): Remove 'gcc', as any working
+ C compiler should be enough.
+ * tests/ansi7.test: Likewise.
+ * tests/ansi9.test: Likewise.
+ * tests/ansi10.test: Likewise.
+ * tests/lex5.test: Likewise.
+ * tests/lexvpath.test: Likewise.
+ * tests/mmodely.test: Likewise.
+ * tests/pr204.test: Likewise.
+ * tests/pr300-lib.test: Likewise.
+ * tests/pr300-prog.test: Likewise.
+ * tests/primary3.test: Likewise.
+ * tests/specflg7.test: Likewise.
+ * tests/specflg8.test: Likewise.
+ * tests/subdir5.test: Likewise.
+ * tests/subdir8.test: Likewise.
+ * tests/subobj6.test: Likewise.
+ * tests/subst3.test: Likewise.
+ * tests/substre2.test: Likewise.
+ * tests/yacc6.test: Likewise.
+ * tests/yacc8.test: Likewise.
+ * tests/depcomp2.test: Likewise. Also, avoid clobbering user-set
+ CFLAGS.
+ * tests/lex3.test: Likewise.
+ * tests/ansi3.test: Likewise. Also, avoid 'CC=gcc' in configure.
+ * tests/ansi3b.test: Likewise.
+ * tests/ansi5.test: Likewise.
+ * tests/autohdr4.test ($required): Remove 'gcc', as any working
+ C compiler should be enough.
+ Also, do not reject slow dependency extractors (which we might
+ be forced to use now that $CC is not necessarily gcc anymore).
+ * tests/cond16.test ($required): Remove 'gcc', as any working
+ C compiler should be enough.
+ Since we are at it, throw in few minor tweakings (mostly cosmetic,
+ stylistic, or consistency-related).
+ * tests/cond18.test: Likewise.
+ * tests/cond35.test: Likewise.
+ * tests/gnits2.test: Likewise.
+ * tests/libtool3.test: Likewise.
+ * tests/libtool7.test: Likewise.
+ * tests/libtool9.test: Likewise.
+ * tests/ltcond.test: Likewise.
+ * tests/ltcond2.test: Likewise.
+ * tests/ltconv.test: Likewise.
+ * tests/ltlibsrc.test: Likewise.
+ * tests/nobase.test: Likewise.
+ * tests/nobase-libtool.test: Likewise.
+ * tests/pr220.test: Likewise.
+ * tests/pr224.test: Likewise.
+ * tests/pr300-ltlib.test: Likewise.
+ * tests/pr401.test: Likewise.
+ * tests/pr401b.test: Likewise.
+ * tests/pr401c.test: Likewise.
+ * tests/subpkg.test: Likewise.
+ * tests/target-cflags.test: Likewise.
+ * tests/transform.test: Likewise.
+ * tests/yacc4.test: Likewise.
+ * tests/cond19.test: Likewise. Also, avoid clobbering user-set
+ CFLAGS.
+ * tests/cond4.test: Likewise.
+ * tests/depend2.test: Likewise.
+ * tests/pr87.test: Likewise.
+ * tests/subobj3.test: Likewise.
+ * tests/substref.test: Likewise.
+
+2011-05-03 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ test defs: increase coverage w.r.t. GNU make
+ * tests/defs (GNUmake): Instead of just skipping the tests
+ requiring GNU make if $MAKE is not GNU make, try to look for
+ it and, if found, redefine $MAKE accordingly. This will help
+ to transparently increase coverage on non-GNU systems which
+ have GNU make available in PATH.
+
+2011-05-03 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests: improve few inter-tests references
+ * tests/acloca22.test: Improve and extend the heading comments.
+ Add reference to related tests 'remake-deleted-m4-file.test' and
+ 'remake-renamed-m4-macro-and-file.test'. Since we are at it,
+ add trailing `:' command, and few blank lines for readability.
+ * tests/remake-renamed-m4-macro-and-file.test: In the heading
+ comments, add reference to the related test 'acloca22.test'.
+
+2011-05-03 Stefano Lattarini <stefano.lattarini@gmail.com>
+
tests: fix spurious failure in 'color2.test'
* tests/color2.test: If $MAKE contains command-line arguments (as
in e.g., "make -j2"), expect's directive "spawn $env(MAKE)" fails
spuriously, because it tries to run "$MAKE" as a single command.
Fix this with proper uses of the TCL `eval' builtin.
+2011-05-03 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests: few more checks on automatic remake support
+ * tests/remake-all-1.test: New test, check that the "all" target
+ triggers rebuilt of outdated Makefiles.
+ * tests/remake-all-2.test: Likewise, but for when the makefiles
+ are not named `Makefile'.
+ * tests/Makefile.am (TESTS): Update.
+
+2011-05-03 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests: check some remake features with non-GNU make too
+ * tests/acloca14.test ($required): Drop "GNUmake". This test
+ works as-is with non-GNU make implementations.
+ * tests/remake1a.test: Likewise.
+ * tests/aclocal4.test ($required): Drop "GNUmake".
+ Modify the test to have it work also with non-GNU make.
+ * tests/remake5.test: Likewise.
+ * tests/remake8a.test: Likewise.
+ * tests/remake8b.test: Likewise.
+ * tests/remake9a.test: Likewise.
+ * tests/remake9b.test: Likewise.
+ * tests/remake9c.test: Likewise.
+ * tests/remake9d.test: Likewise.
+ * tests/remake10a.test: Likewise.
+ * tests/remake10b.test: Likewise.
+ * tests/remake10c.test: Likewise.
+ * tests/remake12.test: ($required): Drop "GNUmake".
+ Adapt the test to make it work also with non-GNU make (if
+ it supports an "include" directive).
+
+2011-05-01 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests: extend tests on dependency tracking with VPATH
+ * tests/depmod-tests.sh: New script, fulfilling a threefold role:
+ 1. it is called to generate a Makefile.am snippet, containing the
+ definition of proper lists of tests;
+ 2. it is called to set up a directory containing some common data
+ files and autotools-generated files used by the aforementioned
+ tests (this is done for speed reasons only); and
+ 3. it is called to properly run those tests, one at a time.
+ * tests/depcomp9.test: Delete, it's obsolete now.
+ * tests/depcomp10.test: Likewise.
+ * tests/Makefile.am ($(srcdir)/depmod-tests.am): Include this
+ snippet, which defines ...
+ (depmode_tests): ... this new macro, containing the list of the
+ newly generated `*.depmod' tests.
+ (TESTS_EXTENSIONS): Add `.depmod'.
+ (DEPMOD_LOG_COMPILER): Define. It calls `depmod-tests.sh', so that
+ the "depmode tests" will be executed by passing that driver script
+ a proper parameter.
+ ($(depmod_tests)): New dependency declaration (dummy, but required
+ in order to have make actually produce expected log files from the
+ `.depmod.log' suffix rule).
+ (TESTS): Add $(depmod_tests).
+ (EXTRA_DIST): Distribute depmod-tests.sh.
+ Other minor cosmetic changes and reorderings.
+ * bootstrap: Generate depmod-tests.am.
+ * tests/.gitignore: Updated.
+
+2011-05-01 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests: avoid extra test generation (for `instspc' tests)
+ We don't really need to generate tons and tons of wrapper test
+ scripts (presently, ~ 90) just to run what is basically a single
+ test (specifically, `instspc-tests.sh') with different parameters.
+ In fact, the possibility of running a single driver script with
+ multiple files/configurations/parameters is one of the major
+ selling points of the 'parallel-tests' testsuite driver of
+ automake. So why not use ourselves more extensively the best
+ features we provide?
+ * tests/instspc-tests.sh: Update heading comments. Expect
+ to be executed, not sourced. Update handling of command-line
+ arguments. Adjust to reflect the renaming of "instspc tests"
+ from `instspc-*.test' to `*.instspc'.
+ * tests/instspc-data.test: Update heading comments. Execute
+ driver script `instspc-tests.sh', instead of sourcing it.
+ Give more informative messages in case of internal errors.
+ * tests/Makefile.am (TESTS_EXTENSIONS): Define explicitly (to
+ `.test' and `.instspc').
+ (TESTS): Add `$(instspc_tests)'.
+ (generated_tests): Remove `$(instspc_tests)'.
+ (INSTSPC_LOG_COMPILER): Define. Calls `instspc-tests.sh', so
+ that the "instspc tests" will be now executed by passing that
+ driver script a proper parameter.
+ ($(instspc_tests)): Remove, we don't need anymore to generate
+ this tests.
+ ($(instspc_tests:.test=.log)): Remove, substituted by ...
+ ($(instspc_tests:.instspc=.log)): ... this.
+ ($(instspc_tests)): New dependency declaration (dummy, but
+ required in order to have make actually produce expected log
+ files from the `.instspc.log' suffix rule).
+ (MAINTAINERCLEANFILES, generated_tests): Don't extend with
+ $(instspc_tests) anymore.
+ Update comments.
+
+2011-05-01 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ build: improve the definition of the list of testcases
+ * tests/Makefile.am (handwritten_tests): New variable.
+ (generated_tests): Likewise.
+ (TESTS): Redefine as the union of the above.
+ (EXTRA_DIST): Extend using $(handwritten_tests) and
+ $(generated_tests) rather than $(TESTS).
+ * tests/gen-parallel-tests: Update accordingly, and
+ make more robust.
+
+2011-05-01 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests skips: shorter and clearer messages
+ * tests/defs: Use shorter messages when giving reasons for test
+ skipping; it turns out these shorter messages are also clearer.
+ If more info might be useful, send them to the log file only.
+
2011-05-01 Stefano Lattarini <stefano.lattarini@gmail.com>
tests: fix self check spurious failure with older bash versions
@@ -183,6 +1019,73 @@
and 3.2.39) fail to correctly remove the temporary directory in
the exit trap.
+2011-05-01 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests: add sanity check to 'self-check-cleanup.test'
+ * tests/self-check-cleanup.test: Check that the "hacked" file
+ `defs-static' used by the test differs from the "vanilla" one
+ in builddir. This also offers a little more debugging output.
+
+2011-05-01 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ testsuite: display reasons for skips to the console
+ * tests/Makefile.am (AM_TESTS_ENVIRONMENT): Open file descriptor
+ `9' to the original stderr; define `stderr_fileno_' to `9', and
+ export it.
+ * tests/self-check-report.test: Prevent new spurious failures by
+ removing from the environment any definition of `stderr_fileno_'.
+
+2011-05-01 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ testsuite: use `skip_' for skipping of tests
+ * tests/defs: Use the `skip_' subroutine for test skipping. Also
+ give sometimes more detailed messages about the reasons for the
+ skipping.
+ * tests/canon7.test: Likewise.
+ * tests/color.test: Likewise.
+ * tests/color2.test: Likewise.
+ * tests/compile2.test: Likewise.
+ * tests/dejagnu7.test: Likewise.
+ * tests/depcomp6.test: Likewise.
+ * tests/depcomp9.test: Likewise.
+ * tests/depcomp10.test: Likewise.
+ * tests/distlinks.test: Likewise.
+ * tests/distlinksbrk.test: Likewise.
+ * tests/fn99.test: Likewise.
+ * tests/fn99subdir.test: Likewise.
+ * tests/forcemiss2.test: Likewise.
+ * tests/fort5.test: Likewise.
+ * tests/gettext3.test: Likewise.
+ * tests/install2.test: Likewise.
+ * tests/instfail-info.test: Likewise.
+ * tests/instfail-java.test: Likewise.
+ * tests/instfail-libtool.test: Likewise.
+ * tests/instfail.test: Likewise.
+ * tests/instmany-mans.test: Likewise.
+ * tests/instmany-python.test: Likewise.
+ * tests/instmany.test: Likewise.
+ * tests/instsh3.test: Likewise.
+ * tests/ltinit.test: Likewise.
+ * tests/makej2.test: Likewise.
+ * tests/mdate6.test: Likewise.
+ * tests/mkinst3.test: Likewise.
+ * tests/parallel-tests3.test: Likewise.
+ * tests/parallel-tests-reset-term.test: Likewise.
+ * tests/parallel-tests-unreadable-log.test: Likewise,
+ * tests/python-virtualenv.test: Likewise.
+ * tests/remake-gnulib-remove-header.test: Likewise.
+ * tests/subobj9.test: Likewise.
+ * tests/symlink2.test: Likewise.
+ * tests/tar.test: Likewise.
+ * tests/tar2.test: Likewise.
+ * tests/txinfo26.test: Likewise.
+ * tests/vala2.test: Likewise.
+ * tests/vala3.test: Likewise.
+ * tests/vala5.test: Likewise.
+ * tests/vtexi4.test: Likewise.
+ * tests/instdir-texi.test: Likewise.
+ * tests/txinfo21.test: Likewise.
+
2011-04-29 Stefano Lattarini <stefano.lattarini@gmail.com>
testsuite: more environment sanitization
diff --git a/CheckListOfTests.am b/CheckListOfTests.am
new file mode 100644
index 000000000..28cb79558
--- /dev/null
+++ b/CheckListOfTests.am
@@ -0,0 +1,76 @@
+## -*- Automake -*-
+##
+## 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/>.
+##
+
+## Temporary files used in the `check-list-of-tests' target.
+am__tmk = tests-in-makefile-list.tmp
+am__tfs = tests-on-filesystem-list.tmp
+am__tdf = diff-in-tests-lists.tmp
+
+## Check that the list of tests given in the Makefile is equal to the
+## list of all test scripts in the Automake testsuite.
+.PHONY: maintainer-check-list-of-tests
+maintainer-check-list-of-tests:
+## Prefer unified diffs over plain diffs, for readability.
+ @if diff -u /dev/null /dev/null >/dev/null 2>&1; then \
+ diff='diff -u'; \
+ else \
+ diff='diff'; \
+ fi; \
+## Determine which files are to be considered test scripts.
+## Do not blindly look for `$(TEST_EXTENSIONS)', because the parallel
+## testsuite driver provided by Automake allow entries in `$(TESTS)'
+## not to be real files, but rather paramaters for the corresponding
+## LOG_COMPILER (well, sort of).
+ set X $(checked_test_extensions); shift; \
+ if test $$# -eq 0; then \
+ set X $(TEST_EXTENSIONS); shift; \
+ fi; \
+ if test $$# -eq 0; then \
+ echo '$@: internal error: $$(checked_test_extensions) and' \
+ '$$(TEST_EXTENSIONS) are both undefined or empty' >&2; \
+ exit 255; \
+ fi; \
+## List of tests in Makefile.
+ lst='$(expected_list_of_tests)'; \
+ test -n "$$lst" || lst='$(TESTS)'; \
+ for t in $$lst; do \
+ echo "$$t"; \
+ done | sort >$(am__tmk); \
+## List of tests on filesystem. Be careful to cater for VPATH builds too.
+ for ext in $$*; do \
+ ls *$$ext 2>/dev/null; \
+ if test $(srcdir) != $(builddir); then \
+ (cd $(srcdir) && ls *$$ext 2>/dev/null); \
+ fi; \
+ done | sort | uniq >$(am__tfs); \
+## Compare the two lists, complain if they differ.
+ if $$diff $(am__tmk) $(am__tfs) >$(am__tdf); then \
+ result=0; \
+ else \
+ echo '$@: list of tests in Makefile an on filesystem differ' >&2; \
+ echo "+ $$diff in-makefile on-filesystem" >&2; \
+ cat $(am__tdf) >&2; \
+ result=1; \
+ fi; \
+ rm -f $(am__tmk) $(am__tfs) $(am__tdf); \
+ exit $$result;
+
+.PHONY: clean-maintcheck-testslist-tmp
+clean-local: clean-maintcheck-testslist-tmp
+clean-maintcheck-testslist-tmp:
+ rm -f $(am__tmk) $(am__tfs) $(am__tdf)
diff --git a/Makefile.am b/Makefile.am
index ff258ecbd..2d4d4436d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -24,6 +24,8 @@
## run aclocal and automake.
SUBDIRS = lib . doc m4 tests
+TEST_SUBDIRS = lib/Automake/tests tests
+
bin_SCRIPTS = automake aclocal
CLEANFILES = $(bin_SCRIPTS)
@@ -101,8 +103,6 @@ INSTALL: lib/INSTALL
$(AM_V_GEN)cp $(srcdir)/lib/INSTALL $@
## recheck: convenience proxy target for the test suites.
-TEST_SUBDIRS = lib/Automake/tests tests
-
.PHONY: recheck
recheck:
@failcom='exit 1'; \
@@ -207,7 +207,24 @@ sc_at_in_texi
.PHONY: $(syntax_check_rules)
$(syntax_check_rules): automake aclocal
-maintainer-check: $(syntax_check_rules)
+
+## Check that the list of tests given in the Makefile is equal to the
+## list of all test scripts in the Automake testsuite.
+.PHONY: maintainer-check-list-of-tests
+maintainer-check-list-of-tests:
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ for subdir in $(TEST_SUBDIRS); do \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@) || eval $$failcom; \
+ done; \
+ test -z "$$fail"
+
+maintainer-check: $(syntax_check_rules) maintainer-check-list-of-tests
## Look for test whose names can cause spurious failures when used as
## first argument to AC_INIT (chiefly because they might contain an
diff --git a/Makefile.in b/Makefile.in
index 30a06c93b..1a179ab42 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -49,6 +49,7 @@ NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
+host_triplet = @host@
subdir = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS COPYING \
@@ -222,7 +223,11 @@ datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
+host = @host@
host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
@@ -249,6 +254,7 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = lib . doc m4 tests
+TEST_SUBDIRS = lib/Automake/tests tests
bin_SCRIPTS = automake aclocal
CLEANFILES = $(bin_SCRIPTS)
AUTOMAKESOURCES = automake.in aclocal.in
@@ -280,7 +286,6 @@ do_subst = sed \
-e 's,[@]configure_input[@],Generated from $@.in; do not edit by hand.,g' \
-e 's,[@]datadir[@],$(datadir),g'
-TEST_SUBDIRS = lib/Automake/tests tests
# Perl coverage statistics.
PERL_COVERAGE_DB = $(abs_top_builddir)/cover_db
@@ -1029,7 +1034,22 @@ clean-local: clean-coverage
.PHONY: $(syntax_check_rules)
$(syntax_check_rules): automake aclocal
-maintainer-check: $(syntax_check_rules)
+
+.PHONY: maintainer-check-list-of-tests
+maintainer-check-list-of-tests:
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ for subdir in $(TEST_SUBDIRS); do \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@) || eval $$failcom; \
+ done; \
+ test -z "$$fail"
+
+maintainer-check: $(syntax_check_rules) maintainer-check-list-of-tests
sc_test_names:
@m4_builtin_rx=`echo $(m4_builtins) | sed 's/ /|/g'`; \
m4_macro_rx="\\<($$m4_builtin_rx)\\>|\\<_?(A[CUMHS]|m4)_"; \
diff --git a/THANKS b/THANKS
index c3cc55ce7..0f4499dcd 100644
--- a/THANKS
+++ b/THANKS
@@ -311,6 +311,7 @@ Roberto Bagnara bagnara@cs.unipr.it
Roman Fietze roman.fietze@telemotive.de
Ronald Landheer ronald@landheer.com
Roumen Petrov bugtrack@roumenpetrov.info
+Russ Allbery rra@stanford.edu
Rusty Ballinger rusty@rlyeh.engr.sgi.com
Ryan T. Sammartino ryants@shaw.ca
Sam Hocevar sam@zoy.org
diff --git a/bootstrap b/bootstrap
index 41f1f4e75..95e51d1ba 100755
--- a/bootstrap
+++ b/bootstrap
@@ -107,6 +107,7 @@ dosubst automake.in automake.tmp
cd tests
$BOOTSTRAP_SHELL ./gen-parallel-tests > parallel-tests.am
$BOOTSTRAP_SHELL ./instspc-tests.sh --generate-makefile > instspc-tests.am
+$BOOTSTRAP_SHELL ./depmod-tests.sh --generate-makefile > depmod-tests.am
cd ..
# Run the autotools.
diff --git a/configure b/configure
index c3024839d..499015d83 100755
--- a/configure
+++ b/configure
@@ -610,6 +610,10 @@ am_AUTOHEADER
am_AUTORECONF
am_AUTOM4TE
am_AUTOCONF
+host_os
+host_vendor
+host_cpu
+host
build_os
build_vendor
build_cpu
@@ -1266,6 +1270,7 @@ Program names:
System types:
--build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
_ACEOF
fi
@@ -1784,6 +1789,40 @@ IFS=$ac_save_IFS
case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$host_alias" = x; then
+ ac_cv_host=$ac_cv_build
+else
+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
# Save the AUTOCONF setting before AM_INIT_AUTOMAKE overrides it; this
# way we can run Autoconf tests from configure (or from the test
@@ -2767,12 +2806,12 @@ $as_echo "$ac_cv_path_FGREP" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether /bin/sh has working 'set -e' with exit trap" >&5
-$as_echo_n "checking whether /bin/sh has working 'set -e' with exit trap... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $SHELL has working 'set -e' with exit trap" >&5
+$as_echo_n "checking whether $SHELL has working 'set -e' with exit trap... " >&6; }
if ${am_cv_sh_errexit_works+:} false; then :
$as_echo_n "(cached) " >&6
else
- if /bin/sh -ec "trap 'exit \$?' 0; (exit 77); exit 77"; test $? = 77
+ if $SHELL -ec "trap 'exit \$?' 0; (exit 77); exit 77"; test $? = 77
then
am_cv_sh_errexit_works=yes
else
diff --git a/configure.ac b/configure.ac
index 437ce9f67..cf3df4d6a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,8 @@
# Process this file with autoconf to produce a configure script.
# Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-# 2004, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# 2004, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
+# Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -24,6 +25,7 @@ m4_ifndef([AC_PACKAGE_URL],
AC_CONFIG_SRCDIR(automake.in)
AC_CONFIG_AUX_DIR(lib)
+AC_CANONICAL_HOST
AC_CANONICAL_BUILD
# Save the AUTOCONF setting before AM_INIT_AUTOMAKE overrides it; this
@@ -181,9 +183,9 @@ AC_SUBST([MODIFICATION_DELAY])
AC_PROG_EGREP
AC_PROG_FGREP
-AC_CACHE_CHECK([whether /bin/sh has working 'set -e' with exit trap],
+AC_CACHE_CHECK([whether $SHELL has working 'set -e' with exit trap],
[am_cv_sh_errexit_works],
-[if /bin/sh -ec "trap 'exit \$?' 0; (exit 77); exit 77"; test $? = 77
+[if $SHELL -ec "trap 'exit \$?' 0; (exit 77); exit 77"; test $? = 77
then
am_cv_sh_errexit_works=yes
else
diff --git a/doc/Makefile.in b/doc/Makefile.in
index ff0162551..1e539707d 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -48,6 +48,7 @@ NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
+host_triplet = @host@
subdir = doc
DIST_COMMON = $(automake_TEXINFOS) $(dist_doc_DATA) $(dist_man1_MANS) \
$(dist_noinst_DATA) $(srcdir)/Makefile.am \
@@ -207,7 +208,11 @@ datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
+host = @host@
host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
diff --git a/lib/Automake/Makefile.in b/lib/Automake/Makefile.in
index 8719084de..76c82df6a 100644
--- a/lib/Automake/Makefile.in
+++ b/lib/Automake/Makefile.in
@@ -49,6 +49,7 @@ NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
+host_triplet = @host@
subdir = lib/Automake
DIST_COMMON = $(dist_perllib_DATA) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in
@@ -206,7 +207,11 @@ datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
+host = @host@
host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
diff --git a/lib/Automake/tests/Makefile.am b/lib/Automake/tests/Makefile.am
index b4f09f1c7..c6254a347 100644
--- a/lib/Automake/tests/Makefile.am
+++ b/lib/Automake/tests/Makefile.am
@@ -1,6 +1,7 @@
## Process this file with automake to create Makefile.in
-# Copyright (C) 2002, 2003, 2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2008, 2009, 2010 Free Software Foundation,
+# Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -42,3 +43,5 @@ Version2.pl \
Version3.pl
EXTRA_DIST = $(TESTS)
+
+include $(top_srcdir)/CheckListOfTests.am
diff --git a/lib/Automake/tests/Makefile.in b/lib/Automake/tests/Makefile.in
index 32741220e..fa58350a4 100644
--- a/lib/Automake/tests/Makefile.in
+++ b/lib/Automake/tests/Makefile.in
@@ -15,7 +15,8 @@
@SET_MAKE@
-# Copyright (C) 2002, 2003, 2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2008, 2009, 2010 Free Software Foundation,
+# Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -47,8 +48,10 @@ NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
+host_triplet = @host@
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(top_srcdir)/CheckListOfTests.am
subdir = lib/Automake/tests
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \
$(top_srcdir)/m4/auxdir.m4 $(top_srcdir)/m4/init.m4 \
@@ -254,7 +257,11 @@ datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
+host = @host@
host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
@@ -306,11 +313,14 @@ Version2.pl \
Version3.pl
EXTRA_DIST = $(TESTS)
+am__tmk = tests-in-makefile-list.tmp
+am__tfs = tests-on-filesystem-list.tmp
+am__tdf = diff-in-tests-lists.tmp
all: all-am
.SUFFIXES:
.SUFFIXES: .html .log .pl
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/CheckListOfTests.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
@@ -547,7 +557,7 @@ maintainer-clean-generic:
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
-clean-am: clean-generic mostlyclean-am
+clean-am: clean-generic clean-local mostlyclean-am
distclean: distclean-am
-rm -f Makefile
@@ -615,17 +625,60 @@ uninstall-am:
recheck-html
.PHONY: all all-am check check-TESTS check-am check-html clean \
- clean-generic distclean distclean-generic distdir dvi dvi-am \
- html html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
+ clean-generic clean-local distclean distclean-generic distdir \
+ dvi dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
pdf-am ps ps-am recheck recheck-html uninstall uninstall-am
+.PHONY: maintainer-check-list-of-tests
+maintainer-check-list-of-tests:
+ @if diff -u /dev/null /dev/null >/dev/null 2>&1; then \
+ diff='diff -u'; \
+ else \
+ diff='diff'; \
+ fi; \
+ set X $(checked_test_extensions); shift; \
+ if test $$# -eq 0; then \
+ set X $(TEST_EXTENSIONS); shift; \
+ fi; \
+ if test $$# -eq 0; then \
+ echo '$@: internal error: $$(checked_test_extensions) and' \
+ '$$(TEST_EXTENSIONS) are both undefined or empty' >&2; \
+ exit 255; \
+ fi; \
+ lst='$(expected_list_of_tests)'; \
+ test -n "$$lst" || lst='$(TESTS)'; \
+ for t in $$lst; do \
+ echo "$$t"; \
+ done | sort >$(am__tmk); \
+ for ext in $$*; do \
+ ls *$$ext 2>/dev/null; \
+ if test $(srcdir) != $(builddir); then \
+ (cd $(srcdir) && ls *$$ext 2>/dev/null); \
+ fi; \
+ done | sort | uniq >$(am__tfs); \
+ if $$diff $(am__tmk) $(am__tfs) >$(am__tdf); then \
+ result=0; \
+ else \
+ echo '$@: list of tests in Makefile an on filesystem differ' >&2; \
+ echo "+ $$diff in-makefile on-filesystem" >&2; \
+ cat $(am__tdf) >&2; \
+ result=1; \
+ fi; \
+ rm -f $(am__tmk) $(am__tfs) $(am__tdf); \
+ exit $$result;
+
+.PHONY: clean-maintcheck-testslist-tmp
+clean-local: clean-maintcheck-testslist-tmp
+clean-maintcheck-testslist-tmp:
+ rm -f $(am__tmk) $(am__tfs) $(am__tdf)
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/lib/Makefile.in b/lib/Makefile.in
index 91e9baef9..737be4a33 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -49,6 +49,7 @@ NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
+host_triplet = @host@
subdir = lib
DIST_COMMON = $(dist_pkgvdata_DATA) $(dist_script_DATA) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in COPYING INSTALL \
@@ -209,7 +210,11 @@ datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
+host = @host@
host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
diff --git a/lib/am/Makefile.in b/lib/am/Makefile.in
index 674d4bf95..35e5471f3 100644
--- a/lib/am/Makefile.in
+++ b/lib/am/Makefile.in
@@ -49,6 +49,7 @@ NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
+host_triplet = @host@
subdir = lib/am
DIST_COMMON = $(dist_am_DATA) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in
@@ -166,7 +167,11 @@ datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
+host = @host@
host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
diff --git a/m4/Makefile.in b/m4/Makefile.in
index 679930b54..2b3b06a31 100644
--- a/m4/Makefile.in
+++ b/m4/Makefile.in
@@ -49,6 +49,7 @@ NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
+host_triplet = @host@
subdir = m4
DIST_COMMON = $(dist_m4data_DATA) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in
@@ -166,7 +167,11 @@ datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
+host = @host@
host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
diff --git a/tests/.gitignore b/tests/.gitignore
index 026e261e4..c309c2227 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -3,6 +3,7 @@ automake-*
defs-static
instspc-tests.am
parallel-tests.am
+depmod-tests.am
*.dir
*.log
*.log-t
diff --git a/tests/Makefile.am b/tests/Makefile.am
index d1a3cda7a..3d1e5c45e 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -19,6 +19,10 @@
MAINTAINERCLEANFILES =
EXTRA_DIST = ChangeLog-old
+TEST_EXTENSIONS = .test
+# Run the tests with the shell detected at configure time.
+TEST_LOG_COMPILER = $(SHELL)
+
XFAIL_TESTS = \
all.test \
auxdir2.test \
@@ -63,51 +67,74 @@ EXTRA_DIST += gen-parallel-tests
include $(srcdir)/instspc-tests.am
+TEST_EXTENSIONS += .instspc
+INSTSPC_LOG_COMPILER = $(SHELL) $(srcdir)/instspc-tests.sh
+EXTRA_DIST += instspc-tests.sh
+
$(srcdir)/instspc-tests.am: instspc-tests.sh Makefile.am
$(AM_V_GEN)($(am__cd) $(srcdir) \
&& $(SHELL) ./instspc-tests.sh --generate-makefile) >$@
-$(instspc_tests): Makefile.am
- $(AM_V_at)rm -f $@ $@-t
- $(AM_V_GEN) :; \
- base=`expr 'x/$@' : 'x.*/instspc-\(.*\)\.test$$'`; \
- name=`expr x"$$base" : x'\(.*\)-'`; \
- action=`expr x"$$base" : x'.*-\(.*\)'`; \
- { \
- echo '#!/bin/sh'; \
- echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \
- echo; \
- echo '# Ensure proper definition of $$testsrcdir.'; \
- echo '. ./defs-static || exit 99'; \
- echo 'test -n "$$testsrcdir" || exit 99 # sanity check'; \
- echo; \
- echo "instspc_test_name='$$name'"; \
- echo "instspc_action='test-$$action'"; \
- echo ". \$$testsrcdir/instspc-tests.sh"; \
- } > $@-t
- $(AM_V_at)chmod a+rx $@-t && mv -f $@-t $@
-
-# All instspc-*.test tests work by sourcing the `instspc-tests.sh'
-# script. Also, they all use shared data generated by the helper
-# test `instspc-data.test', for reasons of speed.
+# All `*.instspc' tests work by calling the script `instspc-tests.sh'.
+# Also, they all use shared data generated by the `instspc-data.test'
+# helper test (for reasons of speed).
instspc-data.log: instspc-tests.sh
-$(instspc_tests:.test=.log): instspc-tests.sh instspc-data.log
+$(instspc_tests:.instspc=.log): instspc-tests.sh instspc-data.log
+# This dummy declaration is required to have make actually produce
+# expected log files from the `.instspc.log' suffix rule.
+$(instspc_tests):
-MAINTAINERCLEANFILES += $(instspc_tests)
-EXTRA_DIST += instspc-tests.sh
XFAIL_TESTS += $(instspc_xfail_tests)
+include $(srcdir)/depmod-tests.am
+
+$(srcdir)/depmod-tests.am: depmod-tests.sh Makefile.am
+ $(AM_V_GEN)($(am__cd) $(srcdir) \
+ && $(SHELL) ./depmod-tests.sh --generate-makefile) >$@
+
+TEST_EXTENSIONS += .depmod
+DEPMOD_LOG_COMPILER = $(SHELL) $(srcdir)/depmod-tests.sh
+EXTRA_DIST += depmod-tests.sh
+
+# All `*.depmod' tests work by calling the script `depmod-tests.sh'.
+# Also, they all use shared data generated by the `depmod-data.test'
+# helper test (for reasons of speed).
+depmod-data.log: depmod-tests.sh
+$(depmod_tests:.depmod=.log): depmod-tests.sh depmod-data.log
+# This dummy declaration is required to have make actually produce
+# expected log files from the `.depmod.log' suffix rule.
+$(depmod_tests):
+
+
# Some testsuite-influential variables should be overridable from the
# test scripts, but not from the environment.
+# We want warning messages and explanations for skipped tests to go to
+# the console if possible, so set up `stderr_fileno_' properly.
+# The `AM_TESTS_REEXEC=no' setting tells the tests not to needlessly
+# re-execute themselves with the shell detected at configure time, since
+# we are already running them under it explicitly in our setup (see e.g.
+# the definition of TEST_LOG_COMPILER above).
AM_TESTS_ENVIRONMENT = \
test x"$$me" = x || unset me; \
test x"$$required" = x || unset required; \
test x"$$parallel_tests" = x || unset parallel_tests; \
test x"$$original_AUTOMAKE" = x || unset original_AUTOMAKE; \
- test x"$$original_ACLOCAL" = x || unset original_ACLOCAL;
+ test x"$$original_ACLOCAL" = x || unset original_ACLOCAL; \
+ AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC; \
+ exec 9>&2; stderr_fileno_=9; export stderr_fileno_;
TESTS = \
+ $(handwritten_tests) \
+ $(generated_tests) \
+ $(depmod_tests) \
+ $(instspc_tests)
+
+EXTRA_DIST += $(handwritten_tests) $(generated_tests)
+
+generated_tests = $(parallel_tests)
+
+handwritten_tests = \
aclocal.test \
aclocal3.test \
aclocal4.test \
@@ -227,10 +254,11 @@ check5.test \
check6.test \
check7.test \
check8.test \
-check9.test \
check10.test \
check11.test \
check12.test \
+check-subst.test \
+check-subst-prog.test \
check-exported-srcdir.test \
check-tests-in-builddir.test \
check-tests_environment.test \
@@ -321,7 +349,6 @@ condhook2.test \
condinc.test \
condinc2.test \
condlib.test \
-condman.test \
condman2.test \
condman3.test \
configure.test \
@@ -381,8 +408,7 @@ depcomp6.test \
depcomp7.test \
depcomp8a.test \
depcomp8b.test \
-depcomp9.test \
-depcomp10.test \
+depmod-data.test \
depdist.test \
depend.test \
depend2.test \
@@ -442,6 +468,7 @@ extra9.test \
extra10.test \
extra11.test \
extra12.test \
+extra-programs-empty.test \
extradep.test \
extradep2.test \
f90only.test \
@@ -526,7 +553,6 @@ instmany.test \
instmany-mans.test \
instmany-python.test \
instspc-data.test \
-$(instspc_tests) \
interp.test \
interp2.test \
java.test \
@@ -547,6 +573,9 @@ lex5.test \
lexcpp.test \
lexvpath.test \
lex-subobj-nodep.test \
+lex-lib.test \
+lex-libobj.test \
+lex-noyywrap.test \
lflags.test \
lflags2.test \
libexec.test \
@@ -705,13 +734,15 @@ parallel-am3.test \
parallel-tests.test \
parallel-tests2.test \
parallel-tests3.test \
-parallel-tests4.test \
parallel-tests5.test \
parallel-tests6.test \
-parallel-tests7.test \
parallel-tests8.test \
parallel-tests9.test \
parallel-tests10.test \
+parallel-tests-suffix.test \
+parallel-tests-suffix-prog.test \
+parallel-tests-ext-driver.test \
+parallel-tests-ext-driver-prog.test \
parallel-tests-am_tests_environment.test \
parallel-tests-unreadable-log.test \
parallel-tests-subdir.test \
@@ -769,6 +800,7 @@ primary.test \
primary2.test \
primary3.test \
proginst.test \
+programs-primary-rewritten.test \
python.test \
python2.test \
python3.test \
@@ -807,6 +839,8 @@ remake10b.test \
remake10c.test \
remake11.test \
remake12.test \
+remake-all-1.test \
+remake-all-2.test \
remake-gnulib-add-acsubst.test \
remake-gnulib-add-header.test \
remake-gnulib-remove-header.test \
@@ -827,6 +861,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 \
@@ -844,6 +879,7 @@ silent7.test \
silent8.test \
silent9.test \
silentcxx.test \
+silentcxx-gcc.test \
silentf77.test \
silentf90.test \
silent-many-gcc.test \
@@ -912,10 +948,10 @@ subpkg2.test \
subpkg3.test \
subpkg4.test \
subst.test \
-subst2.test \
subst3.test \
subst4.test \
subst5.test \
+subst-no-trailing-empty-line.test \
substref.test \
substre2.test \
substtarg.test \
@@ -1043,11 +1079,14 @@ yflags-conditional.test \
yflags-d-false-positives.test \
yflags-force-override.test \
yflags-force-conditional.test \
-yflags-var-expand.test \
-$(parallel_tests)
+yflags-var-expand.test
-EXTRA_DIST += $(TESTS)
+## Checking the test of tests.
+checked_test_extensions = .test
+expected_list_of_tests = $(handwritten_tests) $(generated_tests)
+include $(top_srcdir)/CheckListOfTests.am
+maintainer-check-list-of-tests: $(expected_list_of_tests)
# Dependencies valid for each test case.
$(TEST_LOGS): defs defs-static aclocal-$(APIVERSION) automake-$(APIVERSION)
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 44f8c9744..e9f49bb7b 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -48,10 +48,12 @@ NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
+host_triplet = @host@
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/aclocal.in $(srcdir)/automake.in $(srcdir)/defs \
- $(srcdir)/defs-static.in $(srcdir)/instspc-tests.am \
- $(srcdir)/parallel-tests.am
+ $(srcdir)/defs-static.in $(srcdir)/depmod-tests.am \
+ $(srcdir)/instspc-tests.am $(srcdir)/parallel-tests.am \
+ $(top_srcdir)/CheckListOfTests.am
subdir = tests
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \
@@ -186,11 +188,16 @@ RECHECK_LOGS = $(TEST_LOGS)
AM_RECURSIVE_TARGETS = check check-html recheck recheck-html
TEST_SUITE_LOG = test-suite.log
TEST_SUITE_HTML = $(TEST_SUITE_LOG:.log=.html)
-TEST_EXTENSIONS = .test
am__test_logs1 = $(TESTS:=.log)
-TEST_LOGS = $(am__test_logs1:.test.log=.log)
+am__test_logs2 = $(am__test_logs1:.test.log=.log)
TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
$(TEST_LOG_FLAGS)
+am__test_logs3 = $(am__test_logs2:.instspc.log=.log)
+INSTSPC_LOG_COMPILE = $(INSTSPC_LOG_COMPILER) $(AM_INSTSPC_LOG_FLAGS) \
+ $(INSTSPC_LOG_FLAGS)
+TEST_LOGS = $(am__test_logs3:.depmod.log=.log)
+DEPMOD_LOG_COMPILE = $(DEPMOD_LOG_COMPILER) $(AM_DEPMOD_LOG_FLAGS) \
+ $(DEPMOD_LOG_FLAGS)
TEST_LOGS_TMP = $(TEST_LOGS:.log=.log-t)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
@@ -261,7 +268,11 @@ datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
+host = @host@
host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
@@ -287,94 +298,111 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-MAINTAINERCLEANFILES = $(parallel_tests) $(instspc_tests)
+MAINTAINERCLEANFILES = $(parallel_tests)
EXTRA_DIST = ChangeLog-old gen-parallel-tests instspc-tests.sh \
- $(TESTS)
+ depmod-tests.sh $(handwritten_tests) $(generated_tests)
+TEST_EXTENSIONS = .test .instspc .depmod
+# Run the tests with the shell detected at configure time.
+TEST_LOG_COMPILER = $(SHELL)
XFAIL_TESTS = all.test auxdir2.test cond17.test gcj6.test \
override-conditional-2.test pr8365-remake-timing.test \
yacc-dist-nobuild-subdir.test txinfo5.test \
$(instspc_xfail_tests)
parallel_tests = backcompat5-p.test check-exported-srcdir-p.test \
+ check-subst-prog-p.test check-subst-p.test \
check-tests-in-builddir-p.test check-tests_environment-p.test \
check-p.test check10-p.test check11-p.test check12-p.test \
check2-p.test check3-p.test check4-p.test check5-p.test \
- check6-p.test check7-p.test check8-p.test check9-p.test \
- color-p.test color2-p.test comment9-p.test dejagnu-p.test \
- exeext4-p.test maken3-p.test maken4-p.test \
- posixsubst-tests-p.test
-instspc_tests = instspc-squote-build.test instspc-squote-install.test \
- instspc-dquote-build.test instspc-dquote-install.test \
- instspc-bquote-build.test instspc-bquote-install.test \
- instspc-sharp-build.test instspc-sharp-install.test \
- instspc-dollar-build.test instspc-dollar-install.test \
- instspc-bang-build.test instspc-bang-install.test \
- instspc-bslash-build.test instspc-bslash-install.test \
- instspc-ampersand-build.test instspc-ampersand-install.test \
- instspc-percent-build.test instspc-percent-install.test \
- instspc-leftpar-build.test instspc-leftpar-install.test \
- instspc-rightpar-build.test instspc-rightpar-install.test \
- instspc-pipe-build.test instspc-pipe-install.test \
- instspc-caret-build.test instspc-caret-install.test \
- instspc-tilde-build.test instspc-tilde-install.test \
- instspc-qmark-build.test instspc-qmark-install.test \
- instspc-star-build.test instspc-star-install.test \
- instspc-plus-build.test instspc-plus-install.test \
- instspc-minus-build.test instspc-minus-install.test \
- instspc-comma-build.test instspc-comma-install.test \
- instspc-colon-build.test instspc-colon-install.test \
- instspc-semicol-build.test instspc-semicol-install.test \
- instspc-equal-build.test instspc-equal-install.test \
- instspc-less-build.test instspc-less-install.test \
- instspc-more-build.test instspc-more-install.test \
- instspc-at-build.test instspc-at-install.test \
- instspc-lqbrack-build.test instspc-lqbrack-install.test \
- instspc-rqbrack-build.test instspc-rqbrack-install.test \
- instspc-lcbrack-build.test instspc-lcbrack-install.test \
- instspc-rcbrack-build.test instspc-rcbrack-install.test \
- instspc-space-build.test instspc-space-install.test \
- instspc-tab-build.test instspc-tab-install.test \
- instspc-linefeed-build.test instspc-linefeed-install.test \
- instspc-backspace-build.test instspc-backspace-install.test \
- instspc-formfeed-build.test instspc-formfeed-install.test \
- instspc-carriageret-build.test \
- instspc-carriageret-install.test \
- instspc-quadrigraph0-build.test \
- instspc-quadrigraph0-install.test \
- instspc-quadrigraph1-build.test \
- instspc-quadrigraph1-install.test \
- instspc-quadrigraph2-build.test \
- instspc-quadrigraph2-install.test \
- instspc-quadrigraph3-build.test \
- instspc-quadrigraph3-install.test \
- instspc-quadrigraph4-build.test \
- instspc-quadrigraph4-install.test instspc-a_b-build.test \
- instspc-a_b-install.test instspc-a__b-build.test \
- instspc-a__b-install.test instspc-a_lf_b-build.test \
- instspc-a_lf_b-install.test instspc-dotdotdot-build.test \
- instspc-dotdotdot-install.test instspc-dosdrive-build.test \
- instspc-dosdrive-install.test instspc-miscglob1-build.test \
- instspc-miscglob1-install.test instspc-miscglob2-build.test \
- instspc-miscglob2-install.test
-instspc_xfail_tests = instspc-squote-build.test \
- instspc-dquote-build.test instspc-bquote-build.test \
- instspc-sharp-build.test instspc-dollar-build.test \
- instspc-bslash-build.test instspc-ampersand-build.test \
- instspc-linefeed-build.test instspc-quadrigraph0-build.test \
- instspc-a_lf_b-build.test instspc-squote-install.test \
- instspc-dquote-install.test instspc-bquote-install.test \
- instspc-sharp-install.test instspc-dollar-install.test \
- instspc-linefeed-install.test instspc-a_lf_b-install.test
+ check6-p.test check7-p.test check8-p.test color-p.test \
+ color2-p.test comment9-p.test dejagnu-p.test exeext4-p.test \
+ maken3-p.test maken4-p.test posixsubst-tests-p.test
+instspc_tests = build-squote.instspc install-squote.instspc \
+ build-dquote.instspc install-dquote.instspc \
+ build-bquote.instspc install-bquote.instspc \
+ build-sharp.instspc install-sharp.instspc build-dollar.instspc \
+ install-dollar.instspc build-bang.instspc install-bang.instspc \
+ build-bslash.instspc install-bslash.instspc \
+ build-ampersand.instspc install-ampersand.instspc \
+ build-percent.instspc install-percent.instspc \
+ build-leftpar.instspc install-leftpar.instspc \
+ build-rightpar.instspc install-rightpar.instspc \
+ build-pipe.instspc install-pipe.instspc build-caret.instspc \
+ install-caret.instspc build-tilde.instspc \
+ install-tilde.instspc build-qmark.instspc \
+ install-qmark.instspc build-star.instspc install-star.instspc \
+ build-plus.instspc install-plus.instspc build-minus.instspc \
+ install-minus.instspc build-comma.instspc \
+ install-comma.instspc build-colon.instspc \
+ install-colon.instspc build-semicol.instspc \
+ install-semicol.instspc build-equal.instspc \
+ install-equal.instspc build-less.instspc install-less.instspc \
+ build-more.instspc install-more.instspc build-at.instspc \
+ install-at.instspc build-lqbrack.instspc \
+ install-lqbrack.instspc build-rqbrack.instspc \
+ install-rqbrack.instspc build-lcbrack.instspc \
+ install-lcbrack.instspc build-rcbrack.instspc \
+ install-rcbrack.instspc build-space.instspc \
+ install-space.instspc build-tab.instspc install-tab.instspc \
+ build-linefeed.instspc install-linefeed.instspc \
+ build-backspace.instspc install-backspace.instspc \
+ build-formfeed.instspc install-formfeed.instspc \
+ build-carriageret.instspc install-carriageret.instspc \
+ build-quadrigraph0.instspc install-quadrigraph0.instspc \
+ build-quadrigraph1.instspc install-quadrigraph1.instspc \
+ build-quadrigraph2.instspc install-quadrigraph2.instspc \
+ build-quadrigraph3.instspc install-quadrigraph3.instspc \
+ build-quadrigraph4.instspc install-quadrigraph4.instspc \
+ build-a_b.instspc install-a_b.instspc build-a__b.instspc \
+ install-a__b.instspc build-a_lf_b.instspc \
+ install-a_lf_b.instspc build-dotdotdot.instspc \
+ install-dotdotdot.instspc build-dosdrive.instspc \
+ install-dosdrive.instspc build-miscglob1.instspc \
+ install-miscglob1.instspc build-miscglob2.instspc \
+ install-miscglob2.instspc
+instspc_xfail_tests = build-squote.instspc build-dquote.instspc \
+ build-bquote.instspc build-sharp.instspc build-dollar.instspc \
+ build-bslash.instspc build-ampersand.instspc \
+ build-linefeed.instspc build-quadrigraph0.instspc \
+ build-a_lf_b.instspc install-squote.instspc \
+ install-dquote.instspc install-bquote.instspc \
+ install-sharp.instspc install-dollar.instspc \
+ install-linefeed.instspc install-a_lf_b.instspc
+INSTSPC_LOG_COMPILER = $(SHELL) $(srcdir)/instspc-tests.sh
+depmod_tests = depcomp-gcc3.depmod depcomp-gcc.depmod \
+ depcomp-hp.depmod depcomp-sgi.depmod depcomp-aix.depmod \
+ depcomp-icc.depmod depcomp-hp2.depmod depcomp-tru64.depmod \
+ depcomp-msvc7.depmod depcomp-msvc7msys.depmod \
+ depcomp-nosideeffect.depmod depcomp-dashmstdout.depmod \
+ depcomp-dashXmstdout.depmod depcomp-makedepend.depmod \
+ depcomp-cpp.depmod depcomp-msvisualcpp.depmod \
+ depcomp-msvcmsys.depmod
+DEPMOD_LOG_COMPILER = $(SHELL) $(srcdir)/depmod-tests.sh
# Some testsuite-influential variables should be overridable from the
# test scripts, but not from the environment.
+# We want warning messages and explanations for skipped tests to go to
+# the console if possible, so set up `stderr_fileno_' properly.
+# The `AM_TESTS_REEXEC=no' setting tells the tests not to needlessly
+# re-execute themselves with the shell detected at configure time, since
+# we are already running them under it explicitly in our setup (see e.g.
+# the definition of TEST_LOG_COMPILER above).
AM_TESTS_ENVIRONMENT = \
test x"$$me" = x || unset me; \
test x"$$required" = x || unset required; \
test x"$$parallel_tests" = x || unset parallel_tests; \
test x"$$original_AUTOMAKE" = x || unset original_AUTOMAKE; \
- test x"$$original_ACLOCAL" = x || unset original_ACLOCAL;
+ test x"$$original_ACLOCAL" = x || unset original_ACLOCAL; \
+ AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC; \
+ exec 9>&2; stderr_fileno_=9; export stderr_fileno_;
TESTS = \
+ $(handwritten_tests) \
+ $(generated_tests) \
+ $(depmod_tests) \
+ $(instspc_tests)
+
+generated_tests = $(parallel_tests)
+handwritten_tests = \
aclocal.test \
aclocal3.test \
aclocal4.test \
@@ -494,10 +522,11 @@ check5.test \
check6.test \
check7.test \
check8.test \
-check9.test \
check10.test \
check11.test \
check12.test \
+check-subst.test \
+check-subst-prog.test \
check-exported-srcdir.test \
check-tests-in-builddir.test \
check-tests_environment.test \
@@ -588,7 +617,6 @@ condhook2.test \
condinc.test \
condinc2.test \
condlib.test \
-condman.test \
condman2.test \
condman3.test \
configure.test \
@@ -648,8 +676,7 @@ depcomp6.test \
depcomp7.test \
depcomp8a.test \
depcomp8b.test \
-depcomp9.test \
-depcomp10.test \
+depmod-data.test \
depdist.test \
depend.test \
depend2.test \
@@ -709,6 +736,7 @@ extra9.test \
extra10.test \
extra11.test \
extra12.test \
+extra-programs-empty.test \
extradep.test \
extradep2.test \
f90only.test \
@@ -793,7 +821,6 @@ instmany.test \
instmany-mans.test \
instmany-python.test \
instspc-data.test \
-$(instspc_tests) \
interp.test \
interp2.test \
java.test \
@@ -814,6 +841,9 @@ lex5.test \
lexcpp.test \
lexvpath.test \
lex-subobj-nodep.test \
+lex-lib.test \
+lex-libobj.test \
+lex-noyywrap.test \
lflags.test \
lflags2.test \
libexec.test \
@@ -972,13 +1002,15 @@ parallel-am3.test \
parallel-tests.test \
parallel-tests2.test \
parallel-tests3.test \
-parallel-tests4.test \
parallel-tests5.test \
parallel-tests6.test \
-parallel-tests7.test \
parallel-tests8.test \
parallel-tests9.test \
parallel-tests10.test \
+parallel-tests-suffix.test \
+parallel-tests-suffix-prog.test \
+parallel-tests-ext-driver.test \
+parallel-tests-ext-driver-prog.test \
parallel-tests-am_tests_environment.test \
parallel-tests-unreadable-log.test \
parallel-tests-subdir.test \
@@ -1036,6 +1068,7 @@ primary.test \
primary2.test \
primary3.test \
proginst.test \
+programs-primary-rewritten.test \
python.test \
python2.test \
python3.test \
@@ -1074,6 +1107,8 @@ remake10b.test \
remake10c.test \
remake11.test \
remake12.test \
+remake-all-1.test \
+remake-all-2.test \
remake-gnulib-add-acsubst.test \
remake-gnulib-add-header.test \
remake-gnulib-remove-header.test \
@@ -1094,6 +1129,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 \
@@ -1111,6 +1147,7 @@ silent7.test \
silent8.test \
silent9.test \
silentcxx.test \
+silentcxx-gcc.test \
silentf77.test \
silentf90.test \
silent-many-gcc.test \
@@ -1179,10 +1216,10 @@ subpkg2.test \
subpkg3.test \
subpkg4.test \
subst.test \
-subst2.test \
subst3.test \
subst4.test \
subst5.test \
+subst-no-trailing-empty-line.test \
substref.test \
substre2.test \
substtarg.test \
@@ -1310,14 +1347,18 @@ yflags-conditional.test \
yflags-d-false-positives.test \
yflags-force-override.test \
yflags-force-conditional.test \
-yflags-var-expand.test \
-$(parallel_tests)
+yflags-var-expand.test
+checked_test_extensions = .test
+expected_list_of_tests = $(handwritten_tests) $(generated_tests)
+am__tmk = tests-in-makefile-list.tmp
+am__tfs = tests-on-filesystem-list.tmp
+am__tdf = diff-in-tests-lists.tmp
all: all-am
.SUFFIXES:
-.SUFFIXES: .html .log .test
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/parallel-tests.am $(srcdir)/instspc-tests.am $(am__configure_deps)
+.SUFFIXES: .depmod .html .instspc .log .test
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/parallel-tests.am $(srcdir)/instspc-tests.am $(srcdir)/depmod-tests.am $(top_srcdir)/CheckListOfTests.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
@@ -1488,6 +1529,10 @@ recheck recheck-html:
$(MAKE) $(AM_MAKEFLAGS) $$target AM_MAKEFLAGS='$(AM_MAKEFLAGS) TEST_LOGS="'"$$list"'"'
.test.log:
@p='$<'; $(am__check_pre) $(TEST_LOG_COMPILE) "$$tst" $(am__check_post)
+.instspc.log:
+ @p='$<'; $(am__check_pre) $(INSTSPC_LOG_COMPILE) "$$tst" $(am__check_post)
+.depmod.log:
+ @p='$<'; $(am__check_pre) $(DEPMOD_LOG_COMPILE) "$$tst" $(am__check_post)
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -1641,6 +1686,8 @@ uninstall-am:
backcompat5-p.log: backcompat5.test
check-exported-srcdir-p.log: check-exported-srcdir.test
+check-subst-prog-p.log: check-subst-prog.test
+check-subst-p.log: check-subst.test
check-tests-in-builddir-p.log: check-tests-in-builddir.test
check-tests_environment-p.log: check-tests_environment.test
check-p.log: check.test
@@ -1654,7 +1701,6 @@ check5-p.log: check5.test
check6-p.log: check6.test
check7-p.log: check7.test
check8-p.log: check8.test
-check9-p.log: check9.test
color-p.log: color.test
color2-p.log: color2.test
comment9-p.log: comment9.test
@@ -1693,31 +1739,71 @@ $(srcdir)/instspc-tests.am: instspc-tests.sh Makefile.am
$(AM_V_GEN)($(am__cd) $(srcdir) \
&& $(SHELL) ./instspc-tests.sh --generate-makefile) >$@
-$(instspc_tests): Makefile.am
- $(AM_V_at)rm -f $@ $@-t
- $(AM_V_GEN) :; \
- base=`expr 'x/$@' : 'x.*/instspc-\(.*\)\.test$$'`; \
- name=`expr x"$$base" : x'\(.*\)-'`; \
- action=`expr x"$$base" : x'.*-\(.*\)'`; \
- { \
- echo '#!/bin/sh'; \
- echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \
- echo; \
- echo '# Ensure proper definition of $$testsrcdir.'; \
- echo '. ./defs-static || exit 99'; \
- echo 'test -n "$$testsrcdir" || exit 99 # sanity check'; \
- echo; \
- echo "instspc_test_name='$$name'"; \
- echo "instspc_action='test-$$action'"; \
- echo ". \$$testsrcdir/instspc-tests.sh"; \
- } > $@-t
- $(AM_V_at)chmod a+rx $@-t && mv -f $@-t $@
-
-# All instspc-*.test tests work by sourcing the `instspc-tests.sh'
-# script. Also, they all use shared data generated by the helper
-# test `instspc-data.test', for reasons of speed.
+# All `*.instspc' tests work by calling the script `instspc-tests.sh'.
+# Also, they all use shared data generated by the `instspc-data.test'
+# helper test (for reasons of speed).
instspc-data.log: instspc-tests.sh
-$(instspc_tests:.test=.log): instspc-tests.sh instspc-data.log
+$(instspc_tests:.instspc=.log): instspc-tests.sh instspc-data.log
+# This dummy declaration is required to have make actually produce
+# expected log files from the `.instspc.log' suffix rule.
+$(instspc_tests):
+
+$(srcdir)/depmod-tests.am: depmod-tests.sh Makefile.am
+ $(AM_V_GEN)($(am__cd) $(srcdir) \
+ && $(SHELL) ./depmod-tests.sh --generate-makefile) >$@
+
+# All `*.depmod' tests work by calling the script `depmod-tests.sh'.
+# Also, they all use shared data generated by the `depmod-data.test'
+# helper test (for reasons of speed).
+depmod-data.log: depmod-tests.sh
+$(depmod_tests:.depmod=.log): depmod-tests.sh depmod-data.log
+# This dummy declaration is required to have make actually produce
+# expected log files from the `.depmod.log' suffix rule.
+$(depmod_tests):
+
+.PHONY: maintainer-check-list-of-tests
+maintainer-check-list-of-tests:
+ @if diff -u /dev/null /dev/null >/dev/null 2>&1; then \
+ diff='diff -u'; \
+ else \
+ diff='diff'; \
+ fi; \
+ set X $(checked_test_extensions); shift; \
+ if test $$# -eq 0; then \
+ set X $(TEST_EXTENSIONS); shift; \
+ fi; \
+ if test $$# -eq 0; then \
+ echo '$@: internal error: $$(checked_test_extensions) and' \
+ '$$(TEST_EXTENSIONS) are both undefined or empty' >&2; \
+ exit 255; \
+ fi; \
+ lst='$(expected_list_of_tests)'; \
+ test -n "$$lst" || lst='$(TESTS)'; \
+ for t in $$lst; do \
+ echo "$$t"; \
+ done | sort >$(am__tmk); \
+ for ext in $$*; do \
+ ls *$$ext 2>/dev/null; \
+ if test $(srcdir) != $(builddir); then \
+ (cd $(srcdir) && ls *$$ext 2>/dev/null); \
+ fi; \
+ done | sort | uniq >$(am__tfs); \
+ if $$diff $(am__tmk) $(am__tfs) >$(am__tdf); then \
+ result=0; \
+ else \
+ echo '$@: list of tests in Makefile an on filesystem differ' >&2; \
+ echo "+ $$diff in-makefile on-filesystem" >&2; \
+ cat $(am__tdf) >&2; \
+ result=1; \
+ fi; \
+ rm -f $(am__tmk) $(am__tfs) $(am__tdf); \
+ exit $$result;
+
+.PHONY: clean-maintcheck-testslist-tmp
+clean-local: clean-maintcheck-testslist-tmp
+clean-maintcheck-testslist-tmp:
+ rm -f $(am__tmk) $(am__tfs) $(am__tdf)
+maintainer-check-list-of-tests: $(expected_list_of_tests)
# Dependencies valid for each test case.
$(TEST_LOGS): defs defs-static aclocal-$(APIVERSION) automake-$(APIVERSION)
diff --git a/tests/README b/tests/README
index 4d5288e43..d74a72512 100644
--- a/tests/README
+++ b/tests/README
@@ -26,11 +26,21 @@ Running the tests
To run only selected tests:
- make -k check TESTS="foo.test bar.test"
+ make -k check TESTS="foo.test bar.test" (GNU make)
+ env TESTS="foo.test bar.test" make -e -k check (non-GNU make)
- For non-GNU make, you might have to use this instead:
+ To run the tests in cross-compilation mode:
- env TESTS="foo.test bar.test" make -e -k check
+ make -k check host_alias="$host_alias" (GNU make)
+ env host_alias="$host_alias" make -e -k check (non-GNU make)
+
+ Here `$host_alias' should be defined to a proper value different from
+ configure-determined `$build_alias', and should refer to a set of
+ cross-compilers you have available on your system; for example, if
+ on Linux you have a set of MinGW-targeted cross-compilers named
+ 'i586-mingw32msvc-cc', 'i586-mingw32msvc-c++', etc., you could use:
+
+ make -k check host_alias='i586-mingw32msvc'
Interpretation
@@ -51,10 +61,10 @@ Interpretation
Getting details from failures
-----------------------------
- Each test is a shell script, and by default is run by /bin/sh.
- In a non-VPATH build you can run them directly, they will be verbose.
- By default, verbose output of a test foo.test is retained in the log
- file foo.log. A summary log is created in the file test-suite.log.
+ Each test is a shell script. In a non-VPATH build you can run the
+ tests directly, they will be verbose. By default, verbose output of
+ a test foo.test is retained in the log file foo.log. A summary log
+ is created in the file test-suite.log.
You can limit the set of files using the TESTS variable, and enable
detailed test output at the end of the test run with the VERBOSE
@@ -66,6 +76,20 @@ Getting details from failures
Supported shells
----------------
+ By default, the tests are run by the $SHELL detected at configure
+ time. They also take care to re-execute themselves with that shell,
+ unless told not to. So, to run the tests with a different shell, say
+ `/path/to/another/sh', the user must use:
+
+ AM_TESTS_REEXEC=no /path/to/another/sh ./foo.test
+
+ to run a test directly, and:
+
+ make check TEST_LOG_COMPILER=/path/to/sh (GNU make)
+ TEST_LOG_COMPILER=/path/to/sh make -e check (non-GNU make)
+
+ to run the test(s) through the makefile test driver.
+
The test scripts are written with portability in mind, so that they
should run with any decent Bourne-compatible shell.
@@ -77,7 +101,7 @@ Supported shells
version of Zsh is used. Thus, if you want to run a test script, say
foo.test, with Zsh 4.2, you *can't* simply do `zsh foo.test', but
you *must* resort to:
- zsh -o no_function_argzero foo.test
+ AM_TESTS_REEXEC=no zsh -o no_function_argzero foo.test
Note that this problem does not occur if Zsh is executed through
a symlink with a basename of `sh', since in that case Zsh starts
diff --git a/tests/acloca14.test b/tests/acloca14.test
index 0371ef58f..d919aabd4 100755
--- a/tests/acloca14.test
+++ b/tests/acloca14.test
@@ -17,7 +17,6 @@
# Make sure m4_included files are also scanned for definitions.
# Report from Phil Edwards.
-required=GNUmake
. ./defs || Exit 1
cat >> configure.in << 'END'
diff --git a/tests/acloca22.test b/tests/acloca22.test
index 8fbd57f28..cf1662756 100755
--- a/tests/acloca22.test
+++ b/tests/acloca22.test
@@ -14,8 +14,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Make sure the "deleted header file" issue is fixed wrt. aclocal.m4
-# dependencies.
+# Make sure the "deleted header file" issue is fixed w.r.t. aclocal.m4
+# dependencies. See also related the tests `remake-deleted-m4-file.test'
+# and 'remake-renamed-m4-macro-and-file.test'.
. ./defs || Exit 1
@@ -32,16 +33,21 @@ EOF
cat >Makefile.am <<EOF
ACLOCAL_AMFLAGS = -I .
EOF
+
$ACLOCAL -I .
$AUTOMAKE
$AUTOCONF
+
./configure
$MAKE
grep GREPFOO Makefile
grep GREPBAR Makefile && Exit 1
+
sed 's/FOO/BAR/' < configure.in > t
mv -f t configure.in
rm -f foo.m4
$MAKE
grep GREPFOO Makefile && Exit 1
grep GREPBAR Makefile
+
+:
diff --git a/tests/aclocal4.test b/tests/aclocal4.test
index e18684b7c..aa16aba9c 100755
--- a/tests/aclocal4.test
+++ b/tests/aclocal4.test
@@ -17,8 +17,7 @@
# Make sure dependencies on aclocal.m4 are set correctly.
# Report from Jim Meyering.
-# We need GNU make for the `rebuild rules' to be triggered.
-required=GNUmake
+required=cc
. ./defs || Exit 1
cat >>configure.in <<EOF
@@ -63,11 +62,13 @@ $AUTOMAKE
$MAKE check-not-foo
# Update one of the macros. This should cause ./configure, Makefile.in,
-# Makefile, lib/Makefile.in, and lib/Makfile to be updated. This assumes
-# GNU make.
+# Makefile, lib/Makefile.in, and lib/Makefile to be updated.
cat >m4/mymacro.m4 <<'EOF'
AC_DEFUN([MY_MACRO], [AC_LIBOBJ([foo])])
EOF
+using_gmake || $MAKE
$MAKE check-foo
+
+:
diff --git a/tests/ansi.test b/tests/ansi.test
index 066337adb..aa2eb7f73 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 eabe544b5..208bbc538 100755
--- a/tests/ansi10.test
+++ b/tests/ansi10.test
@@ -16,7 +16,7 @@
# Make sure ansi2knr works with $(LIBOBJS).
-required=gcc
+required='cc native'
. ./defs || Exit 1
cat >> configure.in << 'END'
diff --git a/tests/ansi3.test b/tests/ansi3.test
index ba05d719e..4aca8a250 100755
--- a/tests/ansi3.test
+++ b/tests/ansi3.test
@@ -15,10 +15,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Actual test of ansi2knr functionality. Relies on existence
-# of working gcc.
+# Actual test of ansi2knr functionality.
-required=gcc
+required='cc native'
. ./defs || Exit 1
cat >> configure.in << 'END'
@@ -42,17 +41,11 @@ main (int argc, char *argv[])
}
END
-# Ignore user CFLAGS.
-CFLAGS=
-export CFLAGS
-
-# We use gcc and not gcc -traditional as the latter fails on some
-# Linux boxes (Red Hat 5.1 in particular).
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a 2>stderr || { cat stderr >&2; Exit 1; }
cat stderr >&2
grep 'Makefile.am:1:.*ansi2knr\.c' stderr
-CC='gcc' ./configure
+./configure
ANSI2KNR=./ansi2knr U=_ $MAKE -e
./hello
diff --git a/tests/ansi3b.test b/tests/ansi3b.test
index 18bf628ac..48ca7cbe7 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=gcc
+required='cc native'
. ./defs || Exit 1
cat > configure.in << 'END'
@@ -43,17 +43,11 @@ main (int argc, char *argv[])
}
END
-# Ignore user CFLAGS.
-CFLAGS=
-export CFLAGS
-
-# We use gcc and not gcc -traditional as the latter fails on some
-# Linux boxes (Red Hat 5.1 in particular).
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a 2>stderr || { cat stderr >&2; Exit 1; }
cat stderr >&2
grep 'configure.in:2:.*ansi2knr\.1' stderr
-CC='gcc' ./configure
+./configure
ANSI2KNR=./ansi2knr U=_ $MAKE -e
./hello
diff --git a/tests/ansi5.test b/tests/ansi5.test
index 09ffc5032..4490d8b5e 100755
--- a/tests/ansi5.test
+++ b/tests/ansi5.test
@@ -16,7 +16,7 @@
# Test for ansi2knr in another directory.
-required=gcc
+required='cc native'
. ./defs || Exit 1
cat > configure.in << 'END'
@@ -66,10 +66,7 @@ END
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
-# Ignore user CFLAGS.
-CFLAGS=
-export CFLAGS
-CC=gcc ./configure
+./configure
# This is ugly! If we set U at make time then the "wrong" file gets
# included.
diff --git a/tests/ansi6.test b/tests/ansi6.test
index d6f637b6f..7892d2be0 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=gcc
+required='cc native'
. ./defs || Exit 1
cat > configure.in << 'END'
diff --git a/tests/ansi7.test b/tests/ansi7.test
index 02a768bf9..231d8c81d 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=gcc
+required='cc native'
. ./defs || Exit 1
cat > configure.in << 'END'
diff --git a/tests/ansi9.test b/tests/ansi9.test
index 9023bf370..52a68e877 100755
--- a/tests/ansi9.test
+++ b/tests/ansi9.test
@@ -18,7 +18,7 @@
# can still be deansified.
# Report from Paul D. Smith.
-required=gcc
+required=cc
. ./defs || Exit 1
cat >>configure.in <<EOF
@@ -55,6 +55,13 @@ $FGREP 'loadavg-loadavg$U.o: loadavg$U.c' Makefile.in
# The following rule should not exist, because the
# default .o.c: inference rule is enough.
$FGREP 'sub/sub$U.o: sub/sub$U.c' Makefile.in && Exit 1
-# Force ansi2knr's use, regardless of the compiler.
-./configure ac_cv_prog_cc_stdc=no
-$MAKE sub/sub_.c
+
+if cross_compiling; then
+ :
+else
+ # Force ansi2knr's use, regardless of the compiler.
+ ./configure ac_cv_prog_cc_stdc=no
+ $MAKE sub/sub_.c
+fi
+
+:
diff --git a/tests/autohdr4.test b/tests/autohdr4.test
index bd753dab2..430d75c54 100755
--- a/tests/autohdr4.test
+++ b/tests/autohdr4.test
@@ -17,7 +17,7 @@
# Check rebuild rules for AC_CONFIG_HEADERS.
# (This should also work without GNU Make.)
-required=gcc
+required=cc
. ./defs || Exit 1
cat >>configure.in <<'EOF'
@@ -33,16 +33,25 @@ mkdir sub1 sub2 sub3
: > sub1/config.top
echo '#define NAME "grepme1"' >sub2/config.bot
-echo SUBDIRS = sub3 >Makefile.am
-echo noinst_PROGRAMS = run >sub3/Makefile.am
+
+cat > Makefile.am <<'END'
+SUBDIRS = sub3
+.PHONY: test-prog-updated
+test-prog-updated:
+ stat older sub3/run$(EXEEXT) || : For debugging.
+ test `ls -t older sub3/run$(EXEEXT) | sed 1q` = sub3/run$(EXEEXT)
+END
+
+cat > sub3/Makefile.am <<'END'
+noinst_PROGRAMS = run
+END
cat >sub3/run.c <<'EOF'
#include <defs.h>
#include <config.h>
#include <stdio.h>
-int
-main ()
+int main (void)
{
puts (NAME); /* from config.h */
puts (PACKAGE); /* from defs.h */
@@ -55,13 +64,19 @@ $AUTOCONF
$AUTOHEADER
$AUTOMAKE
-./configure
+# Do not reject slow dependency extractors: we need dependency tracking.
+./configure --enable-dependency-tracking
$MAKE
-sub3/run | grep grepme1
+# Sanity check.
+cross_compiling || { sub3/run | grep grepme1; }
+: > older
$sleep
echo '#define NAME "grepme2"' > sub2/config.bot
$MAKE
-sub3/run | grep grepme2
+cross_compiling || { sub3/run | grep grepme2; }
+$MAKE test-prog-updated
$MAKE distcheck
+
+:
diff --git a/tests/autohdrdry.test b/tests/autohdrdry.test
index c77315464..b6208ff51 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 389bc4ba4..343fd4e31 100755
--- a/tests/backcompat6.test
+++ b/tests/backcompat6.test
@@ -16,9 +16,10 @@
# Backward-compatibility test: try to build and distribute a package
# using obsoleted forms of AC_INIT, AM_INIT_AUTOMAKE and AC_OUTPUT.
-# This script can also serve as mild stress-testing for Automke.
+# 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
@@ -36,6 +37,7 @@ three=3
AC_SUBST(three)
AC_PROG_CC
AC_CONFIG_HEADERS(config.h:config.hin)
+AM_CONDITIONAL(CROSS_COMPILING, test "$cross_compiling" = yes)
AC_OUTPUT(Makefile foo.got:foo1.in:foo2.in:foo3.in)
END
@@ -54,12 +56,14 @@ foo_SOURCES = quux.c
check-local:
test x'$(PACKAGE)' = x'nonesuch-zardoz'
test x'$(VERSION)' = x'nonesuch-0.1'
+if ! CROSS_COMPILING
./foo
## Do not anchor the regexps w.r.t. the end of line, because on
## MinGW/MSYS, grep may assume LF line endings only, while our
## `foo' program may generate CRLF line endings.
./foo | grep '^PACKAGE = nonesuch-zardoz!'
./foo | echo '^VERSION = nonesuch-0\.1!'
+endif
END
cat > quux.c <<'END'
diff --git a/tests/canon7.test b/tests/canon7.test
index 4e700df1e..4a4d66ff4 100755
--- a/tests/canon7.test
+++ b/tests/canon7.test
@@ -16,18 +16,22 @@
# Stress test on canonicalization.
-required='libtool libtoolize'
+required='cc libtool libtoolize'
. ./defs || Exit 1
cat >> configure.in << 'END'
AC_PROG_CC
AC_PROG_RANLIB dnl: for static libraries
AC_PROG_LIBTOOL dnl: for libtool libraries
+AM_CONDITIONAL([CROSS_COMPILING], [test "$cross_compiling" = yes])
AC_OUTPUT
END
-touch ,foo-bar libb.az+baz lib~zardoz,, || Exit 77
-rm -f ,foo-bar libb.az+baz lib~zardoz,,
+if touch ,foo-bar libb.az+baz lib~zardoz,,; then
+ rm -f ,foo-bar libb.az+baz lib~zardoz,,
+else
+ skip_ "cannot create regular files with \"tricky\" names"
+fi
cat > Makefile.am << 'END'
noinst_PROGRAMS = dummy_static dummy_dynamic ,foo-bar
@@ -46,12 +50,18 @@ lib_zardoz___la_SOURCES = libd.c
check-local:
ls -l
+if CROSS_COMPILING
+ test -f ./,foo-bar$(EXEEXT)
+ test -f ./dummy_static$(EXEEXT)
+ test -f ./dummy_dynamic$(EXEEXT)
+else !CROSS_COMPILING
./,foo-bar
./dummy_static
./dummy_dynamic
./,foo-bar | grep 'Hello, FooBar!'
./dummy_static | grep 'Hello from Static!'
./dummy_dynamic | grep 'Hello from Dynamic!'
+endif !CROSS_COMPILING
END
cat > foobar.c << 'END'
diff --git a/tests/ccnoco.test b/tests/ccnoco.test
index fb22ba74f..bcd18fcda 100755
--- a/tests/ccnoco.test
+++ b/tests/ccnoco.test
@@ -20,22 +20,12 @@
required=gcc
. ./defs || Exit 1
-cat > configure.1 << 'END'
-AC_INIT(a.c)
-AM_INIT_AUTOMAKE(nonesuch, 0.23)
+cat >> configure.in << 'END'
AC_PROG_CC
AM_PROG_CC_C_O
-AC_OUTPUT(Makefile)
-END
-
-# This one makes sure that $CC can be used after AM_PROG_CC_C_O.
-cat > configure.3 << 'END'
-AC_INIT(a.c)
-AM_INIT_AUTOMAKE(nonesuch, 0.23)
-AC_PROG_CC
-AM_PROG_CC_C_O
-$CC -v > Hi 2>&1 || exit 1
-AC_OUTPUT(Makefile)
+# Make sure that $CC can be used after AM_PROG_CC_C_O.
+$CC -v || exit 1
+AC_OUTPUT
END
cat > Makefile.am << 'END'
@@ -54,16 +44,17 @@ int main ()
}
END
-cat > Mycomp << 'END'
+cat > Mycomp << END
#!/bin/sh
-case " "$* in
+case " \$* " in
*\ -c*\ -o* | *\ -o*\ -c*)
exit 1
;;
esac
-exec gcc "$@"
+# Use '$CC', not 'gcc', to honour the compiler chosen by 'tests/defs'.
+exec $CC "\$@"
END
chmod +x Mycomp
@@ -72,25 +63,25 @@ chmod +x Mycomp
CFLAGS=
export CFLAGS
-for conf in configure.1 configure.3; do
- cp $conf configure.in
-
- $ACLOCAL
- $AUTOCONF
- $AUTOMAKE --copy --add-missing
-
- rm -rf build
- mkdir build
- cd build
-
- # Make sure the compiler doesn't understand `-c -o'
- CC=`pwd`/../Mycomp
- export CC
-
- ../configure
- $MAKE
-
- cd ..
+# Make sure the compiler doesn't understand `-c -o'
+CC=`pwd`/Mycomp
+export CC
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --copy --add-missing
+
+for vpath in : false; do
+ if $vpath; then
+ srcdir=..
+ mkdir build
+ cd build
+ else
+ srcdir=.
+ fi
+ $srcdir/configure
+ $MAKE
+ cd $srcdir
done
:
diff --git a/tests/ccnoco2.test b/tests/ccnoco2.test
index a724448f2..4c6b22bbb 100755
--- a/tests/ccnoco2.test
+++ b/tests/ccnoco2.test
@@ -35,7 +35,7 @@ touch a.c
$ACLOCAL
$AUTOCONF
AUTOMAKE_fails --copy --add-missing
-grep 'Makefile.am:2:.*per-target.*AM_PROG_CC_C_O' stderr
+grep '^Makefile\.am:2:.*per-target.*AM_PROG_CC_C_O' stderr
cat >Makefile.am <<EOF
@@ -50,4 +50,6 @@ $AUTOMAKE --copy --add-missing
echo 'AUTOMAKE_OPTIONS = subdir-objects' >> Makefile.am
AUTOMAKE_fails --copy --add-missing
-grep 'Makefile.am:2:.*subdir.*AM_PROG_CC_C_O' stderr
+grep '^Makefile\.am:2:.*subdir.*AM_PROG_CC_C_O' stderr
+
+:
diff --git a/tests/ccnoco3.test b/tests/ccnoco3.test
index 92ccf79b4..2a32f6b1f 100755
--- a/tests/ccnoco3.test
+++ b/tests/ccnoco3.test
@@ -23,6 +23,7 @@ required=gcc
cat >> configure.in << 'END'
AC_PROG_CC
AM_PROG_CC_C_O
+$CC --version; $CC -v; # For debugging.
AC_OUTPUT
END
@@ -43,16 +44,17 @@ int main ()
}
END
-cat > Mycomp << 'END'
+cat > Mycomp << END
#!/bin/sh
-case " "$* in
+case " \$* " in
*\ -c*\ -o* | *\ -o*\ -c*)
exit 1
;;
esac
-exec gcc "$@"
+# Use '$CC', not 'gcc', to honour the compiler chosen by 'tests/defs'.
+exec $CC "\$@"
END
chmod +x Mycomp
@@ -77,4 +79,4 @@ $MAKE 2>stderr || { cat stderr >&2; Exit 1; }
cat stderr >&2
grep 'mv.*the same file' stderr && Exit 1
-Exit 0
+:
diff --git a/tests/check9.test b/tests/check-subst-prog.test
index 07ea4e42f..245a2512f 100755
--- a/tests/check9.test
+++ b/tests/check-subst-prog.test
@@ -14,17 +14,21 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Check @substituted@ TESTS.
-# Note that in this test, we rely on the .test extension for the
-# substituted names: this is necessary for parallel-tests.
+# Check @substituted@ TESTS, some of which are also PROGRAMS.
+# See also sister test `check-subst.test'.
+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
@@ -35,11 +39,11 @@ check_PROGRAMS = pass-prog xfail-prog @prog_tests@
EXTRA_PROGRAMS = subst-pass-prog.test subst-xfail-prog.test
END
-cat >>pass-script.test <<'END'
+cat > pass-script.test <<'END'
#! /bin/sh
exit 0
END
-cat >>xfail-script.test <<'END'
+cat > xfail-script.test <<'END'
#! /bin/sh
exit 1
END
@@ -47,12 +51,12 @@ chmod a+x pass-script.test xfail-script.test
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; }
+cat > pass-prog.c <<'END'
+int main (void) { return 0; }
END
-cat >>xfail-prog.c <<'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
@@ -73,4 +77,5 @@ cd build
$MAKE all
$MAKE check
$MAKE distclean
+
:
diff --git a/tests/check-subst.test b/tests/check-subst.test
new file mode 100755
index 000000000..63ed689cc
--- /dev/null
+++ b/tests/check-subst.test
@@ -0,0 +1,87 @@
+#! /bin/sh
+# Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Check @substituted@ TESTS.
+# Note that in this test, we rely on the .test extension for the
+# substituted names: this is necessary for parallel-tests.
+# See also sister test `check-subst-prog.test'.
+
+. ./defs || Exit 1
+
+cat >> configure.in << 'END'
+AC_SUBST([script_tests], ['subst-pass-script.sh subst-xfail-script.sh'])
+AC_SUBST([xfail_tests], ['xfail-script.test subst-xfail-script.sh'])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+TESTS = pass-script.test xfail-script.test @script_tests@
+XFAIL_TESTS = @xfail_tests@
+END
+
+if test "$parallel_tests" = yes; then
+ unindent >> Makefile.am <<'END'
+ TEST_EXTENSIONS = .sh .test
+ SH_LOG_COMPILER = $(SHELL)
+END
+fi
+
+cat > pass-script.test <<'END'
+#! /bin/sh
+exit 0
+END
+cat > xfail-script.test <<'END'
+#! /bin/sh
+exit 1
+END
+cp pass-script.test subst-pass-script.sh
+cp xfail-script.test subst-xfail-script.sh
+chmod a+x pass-script.test xfail-script.test
+
+if test "$parallel_tests" != yes; then
+ chmod a+x subst-pass-script.sh subst-xfail-script.sh
+fi
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+for vpath in false : ; do
+
+ if $vpath; then
+ mkdir build
+ cd build
+ srcdir=..
+ else
+ srcdir=.
+ fi
+
+ $srcdir/configure
+ $MAKE all
+ $MAKE check
+ if test "$parallel_tests" = yes; then
+ ls -l
+ test -f pass-script.log
+ test -f xfail-script.log
+ test -f subst-pass-script.log
+ test -f subst-xfail-script.log
+ fi
+ $MAKE distclean
+ cd $srcdir
+
+done
+
+:
diff --git a/tests/check.test b/tests/check.test
index 54432eca9..2f9f8b11a 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 7025b9863..0705188c0 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 912b619f1..5305c96c2 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 9b8bfb1b5..d21551890 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 be40e3fae..b4f4f9d2e 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 99adb23b7..417b2e458 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 2db74d18d..a10989cf8 100755
--- a/tests/check5.test
+++ b/tests/check5.test
@@ -17,6 +17,7 @@
# Test TESTS = $(check_PROGRAMS)
+required='cc native'
. ./defs || Exit 1
cat >> configure.in << 'END'
@@ -31,6 +32,7 @@ check-local:
test -f one$(EXEEXT)
test -f two$(EXEEXT)
touch ok
+.PHONY: print-tests
print-tests:
echo BEG: $(TESTS) :END
END
@@ -39,17 +41,22 @@ $ACLOCAL
$AUTOCONF
$AUTOMAKE -a
-cat >one.c <<END
-int main() { return 0; }
+cat > one.c << 'END'
+int main (void)
+{
+ return 0;
+}
END
cp one.c two.c
./configure
$MAKE check
test -f ok
-EXEEXT=.bin $MAKE -e print-tests >output
-cat output
+EXEEXT=.bin $MAKE -e print-tests >stdout || { cat stdout; Exit 1; }
+cat stdout
+$FGREP 'BEG: one.bin two.bin :END' stdout
# No am__EXEEXT_* variable is needed.
grep '_EXEEXT_[1-9]' Makefile.in && Exit 1
-grep 'BEG: one.bin two.bin :END' output
$FGREP 'TESTS = $(check_PROGRAMS)' Makefile.in
+
+:
diff --git a/tests/check6.test b/tests/check6.test
index b3ba9d872..9687008d7 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 5c5f4f34f..e0b37c9c8 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 4ff71a77a..225816100 100755
--- a/tests/check8.test
+++ b/tests/check8.test
@@ -16,6 +16,7 @@
# Check subdir TESTS.
+required='cc native'
. ./defs || Exit 1
cat >> configure.in << 'END'
@@ -33,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
@@ -93,4 +94,5 @@ grep '^[^X]*PASS.*bar' stdout
grep '^[^X]*PASS.*sub/bar' stdout
grep '^[^X]*FAIL.*baz' stdout
grep 'XFAIL.*sub/baz' stdout
+
:
diff --git a/tests/color.test b/tests/color.test
index 570b21d66..d912aa2da 100755
--- a/tests/color.test
+++ b/tests/color.test
@@ -33,7 +33,7 @@ std=''
# GNU or BSD 'grep -a' works on files, but is not portable.
case `echo "$std" | grep .` in
"$std") ;;
- *) echo "$me: grep can't parse nonprinting characters" >&2; Exit 77;;
+ *) skip_ "grep can't parse nonprinting characters";;
esac
cat >>configure.in <<END
diff --git a/tests/color2.test b/tests/color2.test
index eb9c52788..26df9b2c0 100755
--- a/tests/color2.test
+++ b/tests/color2.test
@@ -33,7 +33,7 @@ std=''
# GNU or BSD 'grep -a' works on files, but is not portable.
case `echo "$std" | grep .` in
"$std") ;;
- *) echo "$me: grep can't parse nonprinting characters" >&2; Exit 77;;
+ *) skip_ "grep can't parse nonprinting characters";;
esac
# Check that we have a working expect program.
@@ -42,10 +42,8 @@ cat >expect-check <<'END'
eval spawn $env(THE_SYSTEM_SHELL) -c :
expect eof
END
-THE_SYSTEM_SHELL=/bin/sh expect -f expect-check || {
- echo "$me: failed to find a working expect program" >&2
- Exit 77
-}
+THE_SYSTEM_SHELL=/bin/sh expect -f expect-check \
+ || skip_ "$me: failed to find a working expect program"
# Do the tests.
diff --git a/tests/comment6.test b/tests/comment6.test
index 089576819..1c46c8669 100755
--- a/tests/comment6.test
+++ b/tests/comment6.test
@@ -15,6 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Test for PR/322.
+# Automake 1.6.1 seems to have a problem parsing comments that use
+# '\' to span multiple lines.
. ./defs || Exit 1
@@ -62,3 +64,5 @@ $AUTOMAKE
$MAKE
grep '# SOME_FILES' Makefile
grep '# *file3' Makefile
+
+:
diff --git a/tests/compile2.test b/tests/compile2.test
index 04fee9084..a466dc413 100755
--- a/tests/compile2.test
+++ b/tests/compile2.test
@@ -63,8 +63,13 @@ test -f "$amtest_object"
# Absolute w32 paths should be accepted.
# Do not actually run this test on anything that could be w32.
-test -d "C:\\" && Exit 77
-case $PATH_SEPARATOR in ';'|':');; *) Exit 77;; esac
+if test -d 'C:\'; then
+ skip_ "this test shouldn't run on a win32-like system"
+fi
+case $PATH_SEPARATOR in
+ ';'|':');;
+ *) skip_ "unrecognized PATH separator \`$PATH_SEPARATOR'"
+esac
amtest_source='C:\libltdl\libltdl\slist.c'
amtest_object='C:\libltdl\libltdl\libltdl_libltdl_la-slist.obj'
diff --git a/tests/compile5.test b/tests/compile5.test
index 6f4f4bdd2..cd8baee3c 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/cond.test b/tests/cond.test
index f4567f114..6bc1e7002 100755
--- a/tests/cond.test
+++ b/tests/cond.test
@@ -20,7 +20,7 @@
. ./defs || Exit 1
cat >> configure.in << 'END'
-AM_CONDITIONAL(TEST, true)
+AM_CONDITIONAL([TEST], [true])
AC_OUTPUT
END
@@ -39,3 +39,5 @@ grep '^TEST_FALSE' Makefile.in && Exit 1
grep '^TEST_TRUE' Makefile.in && Exit 1
grep '^@TEST_TRUE@VAR = true$' Makefile.in
grep '^@TEST_FALSE@VAR = false$' Makefile.in
+
+:
diff --git a/tests/cond10.test b/tests/cond10.test
index 49a3d6b7c..ac2ffe34b 100755
--- a/tests/cond10.test
+++ b/tests/cond10.test
@@ -20,8 +20,8 @@
cat >> configure.in << 'END'
AC_PROG_CC
-AM_CONDITIONAL(USE_A,[test x = y])
-AM_CONDITIONAL(USE_B,[test x = z])
+AM_CONDITIONAL([USE_A], [test x = y])
+AM_CONDITIONAL([USE_B], [test x = z])
AC_OUTPUT
END
@@ -43,3 +43,5 @@ END
$ACLOCAL
$AUTOMAKE -a
grep 'USE_A_FALSE.*USE_B_FALSE.*output_c\...OBJEXT.' Makefile.in
+
+:
diff --git a/tests/cond11.test b/tests/cond11.test
index 1df840aab..89ab4825e 100755
--- a/tests/cond11.test
+++ b/tests/cond11.test
@@ -21,14 +21,13 @@
. ./defs || Exit 1
cat >> configure.in << 'END'
-AC_PROG_CC
+AC_SUBST([CC], [false])
AM_CONDITIONAL([USE_A], [test -z "$two"])
AC_SUBST([SUBSTVAR], [bar])
AC_OUTPUT
END
cat > Makefile.am << 'END'
-
if USE_A
foolibs=faz.la
else
@@ -39,8 +38,11 @@ noinst_PROGRAMS = foo
foo_SOURCES = foo.c
LDADD = $(SUBSTVAR) $(foolibs)
-print:
- @echo BEG: $(foo_DEPENDENCIES) :END
+.PHONY: test1 test2
+test1:
+ test faz.la = $(foo_DEPENDENCIES)
+test2:
+ test -z "`echo $(foo_DEPENDENCIES)`"
END
: > config.guess
@@ -49,14 +51,12 @@ END
$ACLOCAL
$AUTOCONF
-$AUTOMAKE
+$AUTOMAKE --ignore-deps
./configure
-$MAKE -e print > stdout
-cat stdout
-grep 'BEG: faz.la :END' stdout
+$MAKE test1
./configure two=yes
-$MAKE -e print > stdout
-cat stdout
-grep 'BEG: :END' stdout
+$MAKE test2
+
+:
diff --git a/tests/cond13.test b/tests/cond13.test
index 193b02d40..190f1e689 100755
--- a/tests/cond13.test
+++ b/tests/cond13.test
@@ -23,8 +23,8 @@ cat >> configure.in << 'END'
AC_PROG_CC
AC_PROG_CXX
AC_PROG_RANLIB
-AM_CONDITIONAL(COND1, true)
-AM_CONDITIONAL(COND2, true)
+AM_CONDITIONAL([COND1], [true])
+AM_CONDITIONAL([COND2], [true])
END
cat > Makefile.am << 'END'
@@ -50,4 +50,6 @@ END
$ACLOCAL
$AUTOMAKE
-grep 'am_libtest_a_OBJECTS = .*$' Makefile.in
+grep '^am_libtest_a_OBJECTS =' Makefile.in
+
+:
diff --git a/tests/cond14.test b/tests/cond14.test
index f5a5e2474..6e552c1d2 100755
--- a/tests/cond14.test
+++ b/tests/cond14.test
@@ -25,7 +25,6 @@ AM_CONDITIONAL([COND1], [true])
END
cat > Makefile.am << 'END'
-
if COND1
BUILD_helldl = helldl
helldl_SOURCES = dlmain.c
@@ -46,7 +45,7 @@ END
$ACLOCAL
$AUTOMAKE
-num=`grep 'helldl$(EXEEXT):' Makefile.in | wc -l`
-test $num -eq 2
+$FGREP helldl Makefile.in # For debugging.
+test `$FGREP -c 'helldl$(EXEEXT):' Makefile.in` -eq 2
:
diff --git a/tests/cond15.test b/tests/cond15.test
index fbd5e04e2..d5fb0a0e8 100755
--- a/tests/cond15.test
+++ b/tests/cond15.test
@@ -25,7 +25,6 @@ AM_CONDITIONAL([COND2], [true])
END
cat > Makefile.am << 'END'
-
if COND1
if COND2
bin_SCRIPTS = helldl
@@ -53,6 +52,7 @@ END
$ACLOCAL
$AUTOMAKE
+$FGREP helldl Makefile.in # For debugging.
num1=`$FGREP 'helldl$(EXEEXT):' Makefile.in | wc -l`
num2=`$FGREP '@COND1_FALSE@@COND2_TRUE@helldl$(EXEEXT):' Makefile.in | wc -l`
test $num1 -eq 4
diff --git a/tests/cond16.test b/tests/cond16.test
index 9a60e029b..89182c409 100755
--- a/tests/cond16.test
+++ b/tests/cond16.test
@@ -14,24 +14,23 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Test for bug in conditionals in SOURCES with variable substitution references.
+# Test for bug in conditionals in SOURCES with variable substitution
+# references.
# Report from Richard Boulton
-required=gcc
. ./defs || Exit 1
-cat > configure.in << 'END'
-AC_INIT(hello.c)
-AM_INIT_AUTOMAKE(hello,0.23)
-AC_PROG_CC
-AM_CONDITIONAL(COND1, true)
-AC_OUTPUT(Makefile)
+cat >> configure.in << 'END'
+AM_CONDITIONAL([COND1], [true])
+AC_OUTPUT
END
-cat > hello.c << 'END'
-END
+: > hello.c
cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = no-dependencies
+CC = false
+OBJEXT = o
if COND1
var = foo.c
@@ -42,21 +41,15 @@ endif
bin_PROGRAMS = hell
hell_SOURCES = $(var:=)
-echorule:
- @echo $(hell_SOURCES) $(hell_OBJECTS)
-
+.PHONY: test
+test:
+ test "`echo $(hell_SOURCES) $(hell_OBJECTS)`" = "foo.c foo.o"
END
-# Ignore user CFLAGS.
-CFLAGS=
-export CFLAGS
-
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
-
./configure
+$MAKE test
-val=`$MAKE -s echorule`;
-echo $val
-test "x$val" = "xfoo.c foo.o"
+:
diff --git a/tests/cond17.test b/tests/cond17.test
index 90a38e6ce..c934ee8d5 100755
--- a/tests/cond17.test
+++ b/tests/cond17.test
@@ -20,13 +20,11 @@
. ./defs || Exit 1
-cat > configure.in << 'END'
-AC_INIT(Makefile.am)
-AM_INIT_AUTOMAKE(hello,0.23)
+cat >> configure.in << 'END'
AC_PROG_CC
AC_PROG_CXX
-AM_CONDITIONAL(COND1, true)
-AC_OUTPUT(Makefile)
+AM_CONDITIONAL([COND1], [true])
+AC_OUTPUT
END
cat > Makefile.am << 'END'
@@ -40,3 +38,5 @@ END
$ACLOCAL
$AUTOMAKE -a
+
+:
diff --git a/tests/cond18.test b/tests/cond18.test
index 545038933..9c404a4bd 100755
--- a/tests/cond18.test
+++ b/tests/cond18.test
@@ -17,19 +17,18 @@
# Regression test for substitution references to conditional variables.
# Report from Richard Boulton
-required='GNUmake gcc'
. ./defs || Exit 1
-cat > configure.in << 'END'
-AC_INIT(Makefile.am)
-AM_INIT_AUTOMAKE(hello,0.23)
-AC_PROG_CC
-AM_CONDITIONAL(COND1, true)
-AM_CONDITIONAL(COND2, true)
-AC_OUTPUT(Makefile)
+cat >> configure.in << 'END'
+AM_CONDITIONAL([COND1], [true])
+AM_CONDITIONAL([COND2], [true])
+AC_OUTPUT
END
cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = no-dependencies
+CC = false
+OBJEXT = obj
var1 = dlmain
@@ -47,22 +46,18 @@ endif
helldl_SOURCES = $(var3)
-echorule:
- @echo $(helldl_SOURCES) $(helldl_OBJECTS)
+.PHONY: test
+test:
+ test x"`echo $(helldl_SOURCES) $(helldl_OBJECTS)`" = \
+ x"dlmain.c foo.c dlmain.obj foo.obj"
bin_PROGRAMS = helldl
END
-# Ignore user CFLAGS.
-CFLAGS=
-export CFLAGS
-
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
-
./configure
+$MAKE test
-val=`$MAKE --no-print-directory echorule`;
-echo $val
-test "x$val" = "xdlmain.c foo.c dlmain.o foo.o"
+:
diff --git a/tests/cond19.test b/tests/cond19.test
index ef01c91a8..50ae9cbb9 100755
--- a/tests/cond19.test
+++ b/tests/cond19.test
@@ -17,19 +17,18 @@
# Regression test for substitution references to conditional variables.
# Report from Richard Boulton
-required='GNUmake gcc'
. ./defs || Exit 1
-cat > configure.in << 'END'
-AC_INIT(Makefile.am)
-AM_INIT_AUTOMAKE(hello,0.23)
-AC_PROG_CC
-AM_CONDITIONAL(COND1, test "x$CONDITION1" = "xtrue")
-AM_CONDITIONAL(COND2, test "x$CONDITION2" = "xtrue")
-AC_OUTPUT(Makefile)
+cat >> configure.in << 'END'
+AC_SUBST([CC], [false])
+AC_SUBST([OBJEXT], [o])
+AM_CONDITIONAL([COND1], [test "x$CONDITION1" = "xtrue"])
+AM_CONDITIONAL([COND2], [test "x$CONDITION2" = "xtrue"])
+AC_OUTPUT
END
cat > Makefile.am << 'END'
+bin_PROGRAMS = helldl
var1 = dlmain
@@ -49,34 +48,24 @@ endif
helldl_SOURCES = $(var3:.c=1.c) $(var4:.c=2.c)
-echorule:
- @echo $(helldl_SOURCES) $(helldl_OBJECTS)
+got = `echo $(helldl_SOURCES) $(helldl_OBJECTS)`
-bin_PROGRAMS = helldl
+.PHONY: test
+test:
+ test x"$(exp)" = x"$(got)"
END
-# Ignore user CFLAGS.
-CFLAGS=
-export CFLAGS
-
$ACLOCAL
$AUTOCONF
-$AUTOMAKE -a
+$AUTOMAKE -a -i
CONDITION1=true CONDITION2=true ./configure
-vala=`$MAKE --no-print-directory echorule`;
+$MAKE test exp='dlmaina1.c dlmainb2.c dlmaina1.o dlmainb2.o'
CONDITION1=true CONDITION2=false ./configure
-valb=`$MAKE --no-print-directory echorule`;
+$MAKE test exp='dlmainb1.c dlmaina2.c dlmainb1.o dlmaina2.o'
CONDITION1=false CONDITION2=true ./configure
-valc=`$MAKE --no-print-directory echorule`;
+$MAKE test exp='dlmaina1.c dlmainb2.c dlmaina1.o dlmainb2.o'
CONDITION1=false CONDITION2=false ./configure
-vald=`$MAKE --no-print-directory echorule`;
+$MAKE test exp='dlmainb1.c dlmaina2.c dlmainb1.o dlmaina2.o'
-echo $vala
-echo $valb
-echo $valc
-echo $vald
-test "x$vala" = "xdlmaina1.c dlmainb2.c dlmaina1.o dlmainb2.o" || Exit 1
-test "x$valb" = "xdlmainb1.c dlmaina2.c dlmainb1.o dlmaina2.o" || Exit 1
-test "x$valc" = "xdlmaina1.c dlmainb2.c dlmaina1.o dlmainb2.o" || Exit 1
-test "x$vald" = "xdlmainb1.c dlmaina2.c dlmainb1.o dlmaina2.o" || Exit 1
+:
diff --git a/tests/cond2.test b/tests/cond2.test
index b47e3245b..0f0235bb6 100755
--- a/tests/cond2.test
+++ b/tests/cond2.test
@@ -19,11 +19,8 @@
. ./defs || Exit 1
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
-AM_CONDITIONAL(TEST, true)
-AC_OUTPUT(Makefile)
+cat >> configure.in << 'END'
+AM_CONDITIONAL([TEST], [true])
END
cat > Makefile.am << 'END'
@@ -39,4 +36,6 @@ mkdir dir1
$ACLOCAL
AUTOMAKE_fails
-grep 'Makefile.am:4:.*dir2.*does not exist' stderr
+grep '^Makefile\.am:4:.*dir2.*does not exist' stderr
+
+:
diff --git a/tests/cond20.test b/tests/cond20.test
index f0e1dd8ea..cd2ec0bf0 100755
--- a/tests/cond20.test
+++ b/tests/cond20.test
@@ -19,16 +19,12 @@
. ./defs || Exit 1
-cat > configure.in << 'END'
-AC_INIT(Makefile.am)
-AM_INIT_AUTOMAKE(hello,0.23)
+cat >> configure.in << 'END'
AC_PROG_CC
-AM_CONDITIONAL(COND1, true)
-AC_OUTPUT(Makefile)
+AM_CONDITIONAL([COND1], [true])
END
cat > Makefile.am << 'END'
-
var1 = $(var2)
if COND1
@@ -45,4 +41,6 @@ END
$ACLOCAL
$AUTOCONF
AUTOMAKE_fails -a
-grep "recursively defined" stderr
+grep "variable.*var2.*recursively defined" stderr
+
+:
diff --git a/tests/cond21.test b/tests/cond21.test
index 5d1db769c..cf204527e 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 335407724..72120eb4c 100755
--- a/tests/cond22.test
+++ b/tests/cond22.test
@@ -20,10 +20,11 @@
. ./defs || Exit 1
cat >> configure.in << 'END'
-AC_PROG_CC
-AM_CONDITIONAL(ONE, true)
-AM_CONDITIONAL(TWO, false)
-AM_CONDITIONAL(THREE, false)
+CC=false; AC_SUBST([CC])
+OBJEXT=oo; AC_SUBST([OBJEXT])
+AM_CONDITIONAL([ONE], [true])
+AM_CONDITIONAL([TWO], [false])
+AM_CONDITIONAL([THREE], [false])
AC_OUTPUT
END
@@ -54,14 +55,15 @@ endif
targ_SOURCES = $(SONE) $(STWO) $(STHREE) $(STHREE2)
-echo:
- echo BEG: $(targ_OBJECTS) :END;
+.PHONY: test
+test:
+ test "`echo $(targ_OBJECTS)`" = "one.oo two.oo three.oo three2.oo"
END
$ACLOCAL
$AUTOCONF
-$AUTOMAKE
+$AUTOMAKE --ignore-deps
./configure
-OBJEXT=oo $MAKE -e echo > output
-cat output
-$FGREP 'BEG: one.oo two.oo three.oo three2.oo :END' output
+$MAKE test
+
+:
diff --git a/tests/cond23.test b/tests/cond23.test
index 7cb8292e2..db209b23d 100755
--- a/tests/cond23.test
+++ b/tests/cond23.test
@@ -32,4 +32,6 @@ EOF
$ACLOCAL
AUTOMAKE_fails
-grep 'libdir was already defined' stderr
+grep '^Makefile\.am:2:.* libdir was already defined' stderr
+
+:
diff --git a/tests/cond24.test b/tests/cond24.test
index 7bfa89f58..11f8d8701 100755
--- a/tests/cond24.test
+++ b/tests/cond24.test
@@ -22,15 +22,18 @@
cat >>configure.in <<EOF
AC_SUBST([foo], [bar])
AM_CONDITIONAL([COND], [true])
-AC_OUTPUT
EOF
cat >Makefile.am <<EOF
if COND
+## A dummy comment to change line numer.
foo = baz
endif
EOF
$ACLOCAL
AUTOMAKE_fails
-grep 'foo was already defined' stderr
+grep '^Makefile\.am:3:.* foo was already defined' stderr
+grep '^configure\.in:4:.*foo.* previously defined here' stderr
+
+:
diff --git a/tests/cond25.test b/tests/cond25.test
index 9d1686d04..fe03745bc 100755
--- a/tests/cond25.test
+++ b/tests/cond25.test
@@ -35,3 +35,5 @@ EOF
$ACLOCAL
$AUTOMAKE
+
+:
diff --git a/tests/cond26.test b/tests/cond26.test
index 7252dbd0b..3c29b59d9 100755
--- a/tests/cond26.test
+++ b/tests/cond26.test
@@ -34,3 +34,5 @@ EOF
$ACLOCAL
$AUTOMAKE
+
+:
diff --git a/tests/cond27.test b/tests/cond27.test
index 141723c47..74f2e485f 100755
--- a/tests/cond27.test
+++ b/tests/cond27.test
@@ -34,3 +34,5 @@ $ACLOCAL
AUTOMAKE_fails
grep ' USE_FOO' stderr && Exit 1
grep '!USE_FOO' stderr
+
+:
diff --git a/tests/cond28.test b/tests/cond28.test
index e5f254e1c..0c6cd29d3 100755
--- a/tests/cond28.test
+++ b/tests/cond28.test
@@ -34,3 +34,5 @@ EOF
$ACLOCAL
$AUTOMAKE
+
+:
diff --git a/tests/cond29.test b/tests/cond29.test
index f2488504c..222743c98 100755
--- a/tests/cond29.test
+++ b/tests/cond29.test
@@ -21,11 +21,12 @@
# possible combinations of conditionals (it would do this five times,
# to define a01_DEPENDENCIES, a02_DEPENDENCIES, a03_OBJECTS,
# a04_OBJECTS, and to rewrite bin_PROGRAM), eating all memory, swap,
-# or cpu time it can found. Although this test won't print `FAIL' if
-# it fails, it will take long enough so it can't go unnoticed.
+# or cpu time it can found.
. ./defs || Exit 1
+timeout 10s true || skip_ "timeout command not found"
+
echo AC_PROG_CC >>configure.in
cat >Makefile.am <<EOF
@@ -35,17 +36,23 @@ a03_SOURCES =
EOF
for i in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22; do
-cat >>Makefile.am <<EOF
-if C$i
-bin_PROGRAMS += a$i
-a01_LDADD = foo${i}.o
-a02_LDADD += bar${i}.o
-a03_SOURCES += baz${i}.c
-a04_SOURCES = quux${i}.c
-endif C$i
+ unindent >>Makefile.am <<EOF
+ if C$i
+ bin_PROGRAMS += a$i
+ a01_LDADD = foo${i}.o
+ a02_LDADD += bar${i}.o
+ a03_SOURCES += baz${i}.c
+ a04_SOURCES = quux${i}.c
+ endif C$i
EOF
-echo "AM_CONDITIONAL([C$i], [:])" >>configure.in
+ echo "AM_CONDITIONAL([C$i], [:])" >>configure.in
done
$ACLOCAL
-$AUTOMAKE
+# Be lax w.r.t. the timeout for low-priority processes on heavily
+# loaded systems.
+niceness=`nice || echo 0`
+case $niceness in [0-9]*);; *) niceness=0;; esac
+timeout `expr 60 '+' $niceness '*' 20`s $AUTOMAKE
+
+:
diff --git a/tests/cond3.test b/tests/cond3.test
index 2a75d432c..7e9b3aeb9 100755
--- a/tests/cond3.test
+++ b/tests/cond3.test
@@ -20,14 +20,12 @@
. ./defs || Exit 1
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+cat >> configure.in << 'END'
AC_PROG_CC
-AM_CONDITIONAL(ONE, true)
-AM_CONDITIONAL(TWO, false)
-AM_CONDITIONAL(THREE, maybe)
-AC_OUTPUT(Makefile)
+AM_CONDITIONAL([ONE], [true])
+AM_CONDITIONAL([TWO], [false])
+AM_CONDITIONAL([THREE], [maybe])
+AC_OUTPUT
END
cat > Makefile.am << 'END'
@@ -78,3 +76,5 @@ targ_OBJECTS = $(am_targ_OBJECTS)
EOF
diff expected produced
+
+:
diff --git a/tests/cond30.test b/tests/cond30.test
index d15629761..fb44bf63a 100755
--- a/tests/cond30.test
+++ b/tests/cond30.test
@@ -19,13 +19,16 @@
. ./defs || Exit 1
cat >>configure.in <<'EOF'
-AC_PROG_CC
-AM_CONDITIONAL(C1, [test -z "$two"])
-AM_CONDITIONAL(C2, [test -n "$two"])
+AM_CONDITIONAL([C1], [test -z "$two"])
+AM_CONDITIONAL([C2], [test -n "$two"])
AC_OUTPUT
EOF
-cat >>Makefile.am <<'EOF'
+cat > Makefile.am <<'EOF'
+AUTOMAKE_OPTIONS = no-dependencies
+CC = false
+EXEEXT = .foo
+
if C1
bin_PROGRAMS = a
endif
@@ -33,23 +36,24 @@ if C2
bin_PROGRAMS = b $(undefined)
endif
-print:
- @echo 'BEG: $(bin_PROGRAMS) :END'
+.PHONY: test-a test-b
+test-a:
+ test a.foo = $(bin_PROGRAMS)
+test-b:
+ test b.foo = $(bin_PROGRAMS)
EOF
$ACLOCAL
$AUTOCONF
$AUTOMAKE
+$FGREP 'a_SOURCES = a.c' Makefile.in
+$FGREP 'b_SOURCES = b.c' Makefile.in
+
./configure
-EXEEXT=.foo $MAKE -e print > stdout
-cat stdout
-grep 'BEG: a.foo :END' stdout
+$MAKE test-a
./configure two=yes
-EXEEXT=.foo $MAKE -e print > stdout
-cat stdout
-grep 'BEG: b.foo :END' stdout
+$MAKE test-b
-grep 'a_SOURCES = a.c' Makefile.in
-grep 'b_SOURCES = b.c' Makefile.in
+:
diff --git a/tests/cond31.test b/tests/cond31.test
index 7deb999a7..5110ab187 100755
--- a/tests/cond31.test
+++ b/tests/cond31.test
@@ -16,16 +16,18 @@
# Make sure we define conditional _DEPENDENCIES correctly.
+required=cc
. ./defs || Exit 1
cat >>configure.in <<'EOF'
-AC_PROG_CC
-AM_CONDITIONAL(C1, [test -z "$two"])
-AM_CONDITIONAL(C2, [test -n "$two"])
+AC_SUBST([CC], [false])
+AC_SUBST([OBJEXT], [o])
+AM_CONDITIONAL([C1], [test -z "$two"])
+AM_CONDITIONAL([C2], [test -n "$two"])
AC_OUTPUT
EOF
-cat >>Makefile.am <<'EOF'
+cat > Makefile.am <<'EOF'
bin_PROGRAMS = a
a_LDADD = c0.o -L/some/where
if C1
@@ -34,20 +36,22 @@ endif
if C2
a_LDADD += c2.o -dlopen c3.la
endif
-print:
- @echo BEG: $(a_DEPENDENCIES) :END
+
+.PHONY: test1 test2
+test1:
+ test "`echo $(a_DEPENDENCIES)`" = "c0.o c1.o"
+test2:
+ test "`echo $(a_DEPENDENCIES)`" = "c0.o c2.o c3.la"
EOF
$ACLOCAL
$AUTOCONF
-$AUTOMAKE
+$AUTOMAKE --ignore-deps
./configure
-$MAKE -e print > stdout
-cat stdout
-grep 'BEG: c0.o c1.o :END' stdout
+$MAKE test1
./configure two=yes
-$MAKE -e print > stdout
-cat stdout
-grep 'BEG: c0.o c2.o c3.la :END' stdout
+$MAKE test2
+
+:
diff --git a/tests/cond32.test b/tests/cond32.test
index 0e5e5d2a6..30fde1151 100755
--- a/tests/cond32.test
+++ b/tests/cond32.test
@@ -19,22 +19,28 @@
. ./defs || Exit 1
cat >>configure.in <<'EOF'
-AC_PROG_CC
-AM_CONDITIONAL(C1, [test -z "$two"])
-AM_CONDITIONAL(C2, [test -n "$two"])
-AM_CONDITIONAL(C3, [test -z "$three"])
-AC_SUBST([MYSUB], [foo.o])
+AM_CONDITIONAL([C1], [test -z "$two"])
+AM_CONDITIONAL([C2], [test -n "$two"])
+AM_CONDITIONAL([C3], [test -z "$three"])
+# We define CC in Makefile.am, but OBJEXT here.
+OBJEXT=o; AC_SUBST([OBJEXT])
+AC_SUBST([MYSUB], ["foo.$OBJEXT"])
AC_OUTPUT
EOF
cat >>Makefile.am <<'EOF'
+AUTOMAKE_OPTIONS = no-dependencies
+CC = :
+
bin_PROGRAMS = a
+
if C1
a_LDADD = $(MYSUB)
a_DEPENDENCIES = $(MYSUB) nonsense.a
# Note that `nonsense.a' is there just to make sure Automake insn't
# using some self computed a_DEPENDENCIES variable.
endif
+
if C2
if C3
BAR = bar.o
@@ -43,8 +49,11 @@ BAR = baz.o
endif
a_LDADD = $(BAR)
endif
-print:
- @echo BEG: $(a_DEPENDENCIES) :END
+
+got = `echo $(a_DEPENDENCIES)`
+test:
+ test "$(exp)" = "$(got)"
+.PHONY: test
EOF
$ACLOCAL
@@ -52,16 +61,12 @@ $AUTOCONF
$AUTOMAKE
./configure
-$MAKE -e print > stdout
-cat stdout
-grep 'BEG: foo.o nonsense.a :END' stdout
+$MAKE test exp='foo.o nonsense.a'
./configure two=yes three=
-$MAKE -e print > stdout
-cat stdout
-grep 'BEG: bar.o :END' stdout
+$MAKE test exp='bar.o'
./configure two=yes three=yes
-$MAKE -e print > stdout
-cat stdout
-grep 'BEG: baz.o :END' stdout
+$MAKE test exp='baz.o'
+
+:
diff --git a/tests/cond33.test b/tests/cond33.test
index 6f822aa61..126a4c198 100755
--- a/tests/cond33.test
+++ b/tests/cond33.test
@@ -14,7 +14,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Check for conditional library with a conditional directory.
+# Check that $(mkdir_p) handles well conditionally-defined install
+# directories.
# Report from Ralf Corsepius
. ./defs || Exit 1
@@ -24,7 +25,7 @@ AM_CONDITIONAL([INC], [test -z "$two"])
AC_OUTPUT
EOF
-cat >>Makefile.am <<'EOF'
+cat > Makefile.am <<'EOF'
if INC
include_foodir = $(includedir)/foo
include_foo_HEADERS = foo.h
@@ -35,6 +36,8 @@ endif
foo.h x.sh:
:>$@
+
+.PHONY: distdircheck
distdircheck: distdir
test -f $(distdir)/foo.h
test -f $(distdir)/x.sh
@@ -44,9 +47,12 @@ $ACLOCAL
$AUTOCONF
$AUTOMAKE
+cwd=`pwd` || Exit 99
mkdir nowhere
chmod a-w nowhere
-./configure "--prefix=`pwd`/nowhere" "--bindir=`pwd`/bin" "--includedir=`pwd`/inc"
+
+./configure --prefix="$cwd"/nowhere --bindir="$cwd"/bin \
+ --includedir="$cwd"/inc
$MAKE installdirs
test ! -d bin
test -d inc/foo
@@ -55,13 +61,19 @@ rm -rf inc
$MAKE install
test ! -d bin
test -f inc/foo/foo.h
+$MAKE distdircheck
+
rm -rf inc
-./configure two=two \
- "--prefix=`pwd`/nowhere" "--bindir=`pwd`/bin" "--includedir=`pwd`/inc"
+
+./configure two=two --prefix="$cwd"/nowhere --bindir="$cwd"/bin \
+ --includedir="$cwd"/inc
$MAKE install
test ! -d inc
test -f bin/x.sh
+rm -rf inc
$MAKE installdirs
test ! -d inc
test -d bin
$MAKE distdircheck
+
+:
diff --git a/tests/cond34.test b/tests/cond34.test
index 9b951f54d..1e030e834 100755
--- a/tests/cond34.test
+++ b/tests/cond34.test
@@ -14,19 +14,20 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Check for _DEPDENDENCIES definition with conditional _LDADD.
+# Check for _DEPENDENCIES definition with conditional _LDADD.
# Report from Elena A. Vengerova
. ./defs || Exit 1
cat >>configure.in <<'EOF'
-AM_CONDITIONAL([TWO], test -n "$two")
-AC_PROG_CC
+AM_CONDITIONAL([TWO], [test -n "$two"])
AC_OUTPUT
EOF
-cat >>Makefile.am <<'EOF'
+cat > Makefile.am <<'EOF'
OBJEXT=z
+CC=false
+AUTOMAKE_OPTIONS=no-dependencies
bin_PROGRAMS = test1 test2
@@ -41,26 +42,34 @@ endif !TWO
test1_DEPENDENCIES = $(test1_LDADD) somethingelse.a
+.PHONY: dep-test1 dep-test2
dep-test1:
echo BEG: $(test1_DEPENDENCIES) :END
dep-test2:
echo BEG: $(test2_DEPENDENCIES) :END
-
EOF
-:> test.c
-
$ACLOCAL
$AUTOCONF
$AUTOMAKE
./configure
-$MAKE dep-test1 >out
-grep 'BEG: one.z somethingelse.a :END' out
-$MAKE dep-test2 >out
-grep 'BEG: three.z :END' out
+
+$MAKE dep-test1 >stdout || { cat stdout; Exit 1; }
+cat stdout
+$FGREP 'BEG: one.z somethingelse.a :END' stdout
+
+$MAKE dep-test2 >stdout || { cat stdout; Exit 1; }
+cat stdout
+$FGREP 'BEG: three.z :END' stdout
./configure two=2
-$MAKE dep-test1 >out
-grep 'BEG: two.z somethingelse.a :END' out
-$MAKE dep-test2 >out
-grep 'BEG: two.z somethingelse.a :END' out
+
+$MAKE dep-test1 >stdout || { cat stdout; Exit 1; }
+cat stdout
+$FGREP 'BEG: two.z somethingelse.a :END' stdout
+
+$MAKE dep-test2 >stdout || { cat stdout; Exit 1; }
+cat stdout
+$FGREP 'BEG: two.z somethingelse.a :END' stdout
+
+:
diff --git a/tests/cond35.test b/tests/cond35.test
index c3c5f0bb5..143c082bd 100755
--- a/tests/cond35.test
+++ b/tests/cond35.test
@@ -17,18 +17,18 @@
# Check rules output for parser defined conditionally.
# Report from Roman Fietze.
-required='flex yacc gcc'
+required='cc flex yacc'
. ./defs || Exit 1
cat >>configure.in <<'EOF'
-AM_CONDITIONAL([CASE_A], test -z "$case_B")
+AM_CONDITIONAL([CASE_A], [test -z "$case_B"])
AC_PROG_CC
AM_PROG_LEX
AC_PROG_YACC
AC_OUTPUT
EOF
-cat >>Makefile.am <<'EOF'
+cat > Makefile.am <<'EOF'
AM_YFLAGS = -d
BUILT_SOURCES = tparse.h
@@ -54,11 +54,18 @@ $ACLOCAL
$AUTOCONF
$AUTOMAKE --add-missing
-test `grep tparse.h: Makefile.in | wc -l` = 1
+$FGREP 'tparse.h' Makefile.in # For debugging.
+test `$FGREP -c 'tparse.h:' Makefile.in` = 1
cat > tscan.l << 'END'
%%
"END" return EOF;
+%%
+/* Avoid possible link errors. */
+int yywrap (void)
+{
+ return 0;
+}
END
cat > tparse.y << 'END'
@@ -70,8 +77,8 @@ void yyerror (char *s) {}
foobar : 'f' 'o' 'o' 'b' 'a' 'r' EOF {};
END
-cat >ta.c <<'END'
-int main()
+cat > ta.c << 'END'
+int main (void)
{
return 0;
}
@@ -86,3 +93,5 @@ $MAKE test-ta
./configure case_B=yes
$MAKE
$MAKE test-tb
+
+:
diff --git a/tests/cond36.test b/tests/cond36.test
index 06d5a604e..b4a9a3172 100755
--- a/tests/cond36.test
+++ b/tests/cond36.test
@@ -19,14 +19,14 @@
. ./defs || Exit 1
cat >>configure.in <<'EOF'
-AM_CONDITIONAL([CASE_A], test -z "$case_B")
+AM_CONDITIONAL([CASE_A], [test -z "$case_B"])
AC_PROG_CC
AM_PROG_LEX
AC_PROG_YACC
AC_OUTPUT
EOF
-cat >>Makefile.am <<'EOF'
+cat > Makefile.am <<'EOF'
AM_YFLAGS = -d
BUILT_SOURCES = tparse.h
@@ -49,12 +49,13 @@ $ACLOCAL
# Presently Automake doesn't fully support partially overriden rules
# and should complain.
AUTOMAKE_fails --add-missing
-grep 'tparse.h.*already defined' stderr
+grep 'tparse\.h.*already defined' stderr
$AUTOMAKE -Wno-error
# Still and all, it should generate two rules.
-test `grep tparse.h: Makefile.in | wc -l` = 2
-grep '@CASE_A_TRUE@tparse.h:' Makefile.in
-grep '@CASE_A_FALSE@tparse.h:' Makefile.in
+$FGREP 'tparse.h' Makefile.in # For debugging.
+test `$FGREP -c 'tparse.h:' Makefile.in` = 2
+$FGREP '@CASE_A_TRUE@tparse.h:' Makefile.in
+$FGREP '@CASE_A_FALSE@tparse.h:' Makefile.in
:
diff --git a/tests/cond37.test b/tests/cond37.test
index 59923e8f8..e639231a9 100755
--- a/tests/cond37.test
+++ b/tests/cond37.test
@@ -20,11 +20,11 @@
. ./defs || Exit 1
cat >>configure.in <<'EOF'
-AM_CONDITIONAL([CASE_A], test -n "$case_A")
+AM_CONDITIONAL([CASE_A], [test -n "$case_A"])
AC_OUTPUT
EOF
-cat >>Makefile.am <<'EOF'
+cat > Makefile.am <<'EOF'
if CASE_A
check-local:
@echo GrepMe1
@@ -39,18 +39,18 @@ $AUTOCONF
$AUTOMAKE
./configure
-$MAKE check >stdout
+$MAKE check >stdout || { cat stdout; Exit 1; }
cat stdout
grep GrepMe1 stdout && Exit 1
-$MAKE install >stdout
+$MAKE install >stdout || { cat stdout; Exit 1; }
cat stdout
grep GrepMe2 stdout
./configure case_A=1
-$MAKE check >stdout
+$MAKE check >stdout || { cat stdout; Exit 1; }
cat stdout
grep GrepMe1 stdout
-$MAKE install >stdout
+$MAKE install >stdout || { cat stdout; Exit 1; }
cat stdout
grep GrepMe2 stdout && Exit 1
diff --git a/tests/cond38.test b/tests/cond38.test
index 222007d5a..8638daee5 100755
--- a/tests/cond38.test
+++ b/tests/cond38.test
@@ -25,7 +25,7 @@ AM_CONDITIONAL([CASE_B], :)
AC_OUTPUT
EOF
-cat >>Makefile.am <<'EOF'
+cat > Makefile.am <<'EOF'
SUBDIRS = a
if CASE_A
SUBDIRS += b
@@ -46,8 +46,10 @@ if CASE_B
SUBDIRS += iXYZ
SUBDIRS += jZYX
endif
-print:
- @echo BEG: $(SUBDIRS) :END
+
+.PHONY: test
+test:
+ test "`echo $(SUBDIRS)`" = 'a b c d e f g h iXYZ jZYX'
EOF
mkdir a b c d e f g h iXYZ jZYX
@@ -57,9 +59,9 @@ $AUTOCONF
$AUTOMAKE
./configure
-$MAKE print >stdout
-cat stdout
-# Check good ordering
-grep 'BEG: a b c d e f g h iXYZ jZYX :END' stdout
# Make sure no extra variable was created for the last 3 items.
grep 'append.*=.* h iXYZ jZYX' Makefile
+# Check good ordering.
+$MAKE test
+
+:
diff --git a/tests/cond39.test b/tests/cond39.test
index 3deb1cfd4..f6a916e01 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 76187dd1a..7d2aaea3e 100755
--- a/tests/cond4.test
+++ b/tests/cond4.test
@@ -17,11 +17,11 @@
# Another sources-in-conditional test. Report from Tim Goodwin.
-required='GNUmake gcc'
. ./defs || Exit 1
cat >> configure.in << 'END'
-AC_PROG_CC
+AC_SUBST([CC], [false])
+AC_SUBST([OBJEXT], [o])
AM_CONDITIONAL([ONE], [test "x$CONDITION1" = "xtrue"])
AM_CONDITIONAL([TWO], [test "x$CONDITION2" = "xtrue"])
AC_OUTPUT
@@ -40,39 +40,29 @@ endif
targ_SOURCES = main.c $(OPT1) $(OPT2)
-echo-objects:
- @echo $(targ_OBJECTS)
+got = `echo $(targ_OBJECTS)`
+
+.PHONY: test
+test:
+ test x"$(exp)" = x"$(got)"
END
$ACLOCAL
-$AUTOMAKE
+$AUTOMAKE -i
# We should not output useless definitions.
-test "`grep '^@TWO_FALSE@' Makefile.in | wc -l`" -eq 0
+grep '^@ONE_FALSE@' Makefile.in && Exit 1
+grep '^@TWO_FALSE@' Makefile.in && Exit 1
$AUTOCONF
-# Ignore user CFLAGS.
-CFLAGS=
-export CFLAGS
-
CONDITION1=true CONDITION2=true ./configure
-msgtt=`$MAKE --no-print-directory echo-objects`
+$MAKE test exp='main.o one.o two.o'
CONDITION1=true CONDITION2=false ./configure
-msgtf=`$MAKE --no-print-directory echo-objects`
+$MAKE test exp='main.o one.o'
CONDITION1=false CONDITION2=true ./configure
-msgft=`$MAKE --no-print-directory echo-objects`
+$MAKE test exp='main.o two.o'
CONDITION1=false CONDITION2=false ./configure
-msgff=`$MAKE --no-print-directory echo-objects`
-
-: msgtt = $msgtt
-: msgtf = $msgtf
-: msgft = $msgft
-: msgff = $msgff
-
-test x"$msgtt" = x"main.o one.o two.o"
-test x"$msgtf" = x"main.o one.o"
-test x"$msgft" = x"main.o two.o"
-test x"$msgff" = x"main.o"
+$MAKE test exp='main.o'
:
diff --git a/tests/cond40.test b/tests/cond40.test
index 267d1eb31..e0ffbd2bf 100755
--- a/tests/cond40.test
+++ b/tests/cond40.test
@@ -21,6 +21,7 @@
# Test AM_COND_IF.
. ./defs || Exit 1
+
cat >>configure.in <<'END'
AC_DEFUN([FOO],
[AC_CONFIG_FILES([$1])])
@@ -82,4 +83,5 @@ $MAKE file3 && Exit 1
test ! -f file1
test -f file2
test ! -f file3
+
:
diff --git a/tests/cond41.test b/tests/cond41.test
index b68573fca..c3778c1a1 100755
--- a/tests/cond41.test
+++ b/tests/cond41.test
@@ -21,11 +21,15 @@
# AM_COND_IF with an undefined condition should fail.
. ./defs || Exit 1
+
cat >>configure.in <<'END'
-AM_COND_IF([COND],
+AM_COND_IF([BAD_COND],
[AC_CONFIG_FILES([file1])])
AC_OUTPUT
END
-$ACLOCAL && Exit 1
+$ACLOCAL 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+grep '^configure\.in:4:.*AM_COND_IF.* no such condition.*BAD_COND' stderr
+
:
diff --git a/tests/cond42.test b/tests/cond42.test
index 265ab2905..9ae88cc12 100755
--- a/tests/cond42.test
+++ b/tests/cond42.test
@@ -23,35 +23,41 @@
# but better to be safe.
. ./defs || Exit 1
+
cat >>configure.in <<'END'
AM_CONDITIONAL([COND], [:])
-# next line needed so that cond-if.m4 is pulled in.
+# The next line is needed so that cond-if.m4 is pulled in.
AM_COND_IF([COND])
_AM_COND_IF([COND])
AC_OUTPUT
END
+
+edit_configure_in ()
+{
+ sed "$@" < configure.in >configure.int
+ mv -f configure.int configure.in
+ rm -rf autom4te*.cache
+}
+
: >Makefile.am
$ACLOCAL
AUTOMAKE_fails
-grep 'condition stack' stderr
+grep '^configure\.in:8:.* condition stack' stderr
-sed 's/_AM_COND_IF/_AM_COND_ELSE/' < configure.in >configure.int
-mv -f configure.int configure.in
-rm -rf autom4te*.cache
+edit_configure_in 's/_AM_COND_IF/_AM_COND_ELSE/'
AUTOMAKE_fails
-grep 'else without if' stderr
+grep '^configure\.in:7:.* else without if' stderr
-sed 's/_AM_COND_ELSE/_AM_COND_ENDIF/' < configure.in >configure.int
-mv -f configure.int configure.in
-rm -rf autom4te*.cache
+edit_configure_in 's/_AM_COND_ELSE/_AM_COND_ENDIF/'
AUTOMAKE_fails
-grep 'endif without if' stderr
+grep '^configure\.in:7:.* endif without if' stderr
-sed 's/\(_AM_COND_ENDIF\).*/_AM_COND_IF\
-_AM_COND_ENDIF/' < configure.in >configure.int
-mv -f configure.int configure.in
-rm -rf autom4te*.cache
+edit_configure_in 's/\(_AM_COND_ENDIF\).*/_AM_COND_IF\
+_AM_COND_ENDIF/'
AUTOMAKE_fails
+grep '^configure\.in:7:.* not enough arguments.* _AM_COND_IF' stderr
+grep '^configure\.in:8:.* not enough arguments.* _AM_COND_ENDIF' stderr
test 2 = `grep -c 'not enough arguments' stderr`
+
:
diff --git a/tests/cond43.test b/tests/cond43.test
index befa165f9..d112bd77d 100755
--- a/tests/cond43.test
+++ b/tests/cond43.test
@@ -21,6 +21,7 @@
# Ensure an error with underquoted usage of AM_COND_IF in configure.ac.
. ./defs || Exit 1
+
cat >>configure.in <<'END'
AM_CONDITIONAL([COND1], [:])
AM_CONDITIONAL([COND2], [:])
@@ -29,10 +30,12 @@ AM_COND_IF([COND1],
)
AC_OUTPUT
END
+
: >Makefile.am
$ACLOCAL
AUTOMAKE_fails
+$EGREP '^configure\.in:7:.* missing m4 quoting.*macro depth 2( |$)' stderr
sed '/.AM_COND_IF/{
s/^/[/
@@ -41,3 +44,5 @@ sed '/.AM_COND_IF/{
mv -f configure.int configure.in
rm -rf autom4te*.cache
$AUTOMAKE
+
+:
diff --git a/tests/cond46.test b/tests/cond46.test
index ffeebd23e..5b15979fa 100755
--- a/tests/cond46.test
+++ b/tests/cond46.test
@@ -19,11 +19,13 @@
. ./defs || Exit 1
cat >> configure.in << 'END'
-AM_CONDITIONAL([USE_A],[test x = y])
-AM_CONDITIONAL([USE_B],[test x = z])
+AM_CONDITIONAL([USE_A], [test x = y])
+AM_CONDITIONAL([USE_B], [test x = z])
AC_OUTPUT
END
+notcompat="incompatible with current conditional"
+
$ACLOCAL
cat > Makefile.am << 'END'
@@ -32,7 +34,7 @@ endif !USE_A
END
AUTOMAKE_fails
-grep 'endif.*incompatible with current conditional' stderr
+grep "^Makefile\\.am:2:.*endif.*!USE_A.*$notcompat.*[^!]USE_A" stderr
cat > Makefile.am << 'END'
if USE_A
@@ -40,7 +42,7 @@ endif USE_B
END
AUTOMAKE_fails
-grep 'endif.*incompatible with current conditional' stderr
+grep "^Makefile\\.am:2:.*endif.*[^!]USE_B.*$notcompat.*[^!]USE_A" stderr
cat > Makefile.am << 'END'
if USE_A
@@ -49,7 +51,7 @@ endif USE_A
END
AUTOMAKE_fails
-grep 'endif.*incompatible with current conditional' stderr
+grep "^Makefile\\.am:3:.*endif.*[^!]USE_A.*$notcompat.*USE_A" stderr
cat > Makefile.am << 'END'
if USE_A
@@ -68,7 +70,7 @@ endif
END
AUTOMAKE_fails
-grep 'endif.*incompatible with current conditional' stderr
+grep "^Makefile\\.am:4:.*endif.*!USE_A.*$notcompat.*USE_B" stderr
cat > Makefile.am << 'END'
if USE_A
@@ -77,32 +79,34 @@ endif
END
AUTOMAKE_fails
-grep 'else.*incompatible with current conditional' stderr
+grep "^Makefile\\.am:2:.*else.*[^!]USE_A.*$notcompat.*[^!]USE_A" stderr
cat > Makefile.am << 'END'
if USE_A
-else USE_B
+else !USE_A
endif
END
-AUTOMAKE_fails
-grep 'else.*incompatible with current conditional' stderr
+$AUTOMAKE
cat > Makefile.am << 'END'
if USE_A
-if USE_B
-else USE_A
-endif
+else USE_B
endif
END
AUTOMAKE_fails
-grep 'else.*incompatible with current conditional' stderr
+grep "^Makefile\\.am:2:.*else.*[^!]USE_B.*$notcompat.*[^!]USE_A" stderr
cat > Makefile.am << 'END'
if USE_A
-else !USE_A
+if USE_B
+else USE_A
+endif
endif
END
-$AUTOMAKE
+AUTOMAKE_fails
+grep "^Makefile\\.am:3:.*else.*[^!]USE_A.*$notcompat.*[^!]USE_B" stderr
+
+:
diff --git a/tests/cond6.test b/tests/cond6.test
index 4a576b46f..60436ab68 100755
--- a/tests/cond6.test
+++ b/tests/cond6.test
@@ -19,10 +19,9 @@
. ./defs || Exit 1
-echo 'AM_CONDITIONAL(FOO, true)' >> configure.in
+echo 'AM_CONDITIONAL([FOO], [true])' >> configure.in
cat > Makefile.am << 'END'
-
if FOO
helpdir = $(prefix)/Help
@@ -36,7 +35,37 @@ helpdir = $(prefix)/help
help_DATA = foo
endif
+
+a b c d e f g h:
+ touch $@
+
+.PHONY: print-data
+print-data:
+ echo BEG: $(help_DATA) :END
END
+
+# Older versions of this test checked that automake could process the above
+# Makefile.am even with no AC_OUTPUT in configure. So continue to do this
+# check, for completeness.
$ACLOCAL
$AUTOMAKE
+
+rm -rf autom4te*.cache
+
+echo AC_OUTPUT >> configure.in
+$AUTOCONF
+$AUTOMAKE Makefile
+
+./configure --prefix="`pwd`/_inst"
+
+$MAKE print-data >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep '^BEG: a b c d e f g h :END$' stdout
+
+$MAKE install
+for x in a b c d e f g h; do
+ test -f _inst/Help/$x
+done
+
+:
diff --git a/tests/cond8.test b/tests/cond8.test
index 3a81a287a..3fe7b5c9e 100755
--- a/tests/cond8.test
+++ b/tests/cond8.test
@@ -22,7 +22,8 @@
cat >> configure.in << 'END'
AC_PROG_CC
-AM_CONDITIONAL(X, false)
+AM_CONDITIONAL([X], [test "$x" = yes])
+AC_OUTPUT
END
cat > Makefile.am << 'END'
@@ -31,7 +32,47 @@ bin_PROGRAMS = x y
else
noinst_PROGRAMS = x y
endif
+
+.PHONY: get-built get-install not-install
+get-built:
+ test -f x.$(OBJEXT)
+ test -f y.$(OBJEXT)
+ test -f x$(EXEEXT)
+ test -f y$(EXEEXT)
+get-installed:
+ test -f $(bindir)/x$(EXEEXT)
+ test -f $(bindir)/y$(EXEEXT)
+not-installed:
+ if find $(prefix) -type f | grep .; then exit 1; else :; fi
END
$ACLOCAL
$AUTOMAKE
+$AUTOCONF
+
+cat > x.c <<'END'
+int main (void)
+{
+ return 0;
+}
+END
+
+cp x.c y.c
+
+instdir=`pwd`/_inst || Exit 99
+
+# Skip the rest of the test in case of e.g. missing C compiler.
+./configure --prefix="$instdir" x=yes || Exit $?
+$MAKE install
+$MAKE get-built
+$MAKE get-installed
+
+$MAKE distclean
+rm -rf _inst
+
+./configure --prefix="$instdir" x=no
+$MAKE install
+$MAKE get-built
+$MAKE not-installed
+
+:
diff --git a/tests/cond9.test b/tests/cond9.test
index 22792aeb5..c0398719b 100755
--- a/tests/cond9.test
+++ b/tests/cond9.test
@@ -20,7 +20,7 @@
. ./defs || Exit 1
cat >> configure.in << 'END'
-AM_CONDITIONAL(WRONG, [test x = y])
+AM_CONDITIONAL([WRONG], [test x = y])
AC_OUTPUT
END
@@ -31,12 +31,15 @@ else
this=is_something_interesting
endif
-echo-something:
- echo '$(this)'
+.PHONY: test-this
+test-this:
+ test '$(this)' = is_something_interesting
END
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
./configure
-$MAKE echo-something | grep interesting > /dev/null
+$MAKE test-this
+
+:
diff --git a/tests/condd.test b/tests/condd.test
index ef5f7c71f..b0cf6f027 100755
--- a/tests/condd.test
+++ b/tests/condd.test
@@ -20,17 +20,19 @@
. ./defs || Exit 1
cat >> configure.in << 'END'
-AC_PROG_CC
dnl Define a macro with the same name as the conditional to exhibit
dnl any underquoted bug.
AC_DEFUN([COND1], ["some'meaningless;characters`])
-AM_CONDITIONAL([COND1], false)
+AM_CONDITIONAL([COND1], [false])
AC_CONFIG_FILES([foo/Makefile])
AC_CONFIG_FILES([bar/Makefile])
AC_OUTPUT
END
cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = no-dependencies
+CC = false
+
SUBDIRS = foo
if COND1
SUBDIRS += bar
@@ -45,6 +47,7 @@ else
hello_SOURCES += hello-generic.c
endif
+.PHONY: test
test: distdir
test -f $(distdir)/foo/Makefile.am
test -f $(distdir)/bar/Makefile.am
diff --git a/tests/condman3.test b/tests/condman3.test
index 2482d8d55..cfba3f802 100755
--- a/tests/condman3.test
+++ b/tests/condman3.test
@@ -26,37 +26,48 @@ END
cat > Makefile.am << 'END'
if COND
man_MANS = foo.1
+man4_MANS = 6.man
else
-man_MANS = bar.2
+man_MANS = bar.2 baz.1
+man5_MANS = zap.5
endif
.PHONY: test1 test2
test1:
+ find $(mandir) ;: For debugging.
test -f $(mandir)/man1/foo.1
+ test -f $(mandir)/man4/6.4
test ! -f $(mandir)/man2/bar.2
+ test ! -f $(mandir)/man1/baz.1
+ test ! -f $(mandir)/man5/zap.5
test2:
- test ! -f $(mandir)/man1/foo.1
+ find $(mandir) ;: For debugging.
test -f $(mandir)/man2/bar.2
+ test -f $(mandir)/man1/baz.1
+ test -f $(mandir)/man5/zap.5
+ test ! -f $(mandir)/man1/foo.1
+ test ! -f $(mandir)/man4/6.4
+ test ! -f $(mandir)/man4/6.man
END
$ACLOCAL
$AUTOMAKE
$AUTOCONF
-mkdir dir1
-cd dir1
+$EGREP 'MANS|\.([123456789]|man)' Makefile.in # For debugging.
+
+mkdir build
+cd build
../configure FOO=true --prefix="`pwd`/_inst"
-sed -n '/man_MANS/p' Makefile # useful for debugging
-: > foo.1
+$EGREP 'MANS|\.([123456789]|man)' Makefile # For debugging.
+touch foo.1 6.man
$MAKE install
$MAKE test1
cd ..
-mkdir dir2
-cd dir2
-../configure FOO=false --prefix="`pwd`/_inst"
-sed -n '/man_MANS/p' Makefile # useful for debugging
-: > bar.2
+./configure FOO=false --prefix="`pwd`/_inst"
+$EGREP 'MANS|\.([123456789]|man)' Makefile # For debugging.
+touch bar.2 baz.1 zap.5
$MAKE install
$MAKE test2
diff --git a/tests/cygnus-dependency-tracking.test b/tests/cygnus-dependency-tracking.test
index 1bfec252c..e5df33c66 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 47d8c8992..5494625b0 100644
--- a/tests/defs
+++ b/tests/defs
@@ -17,6 +17,12 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# IMPORTANT NOTE: This file should execute correctly with any system's
+# /bin/sh shell, and not only with configure-time detected $CONFIG_SHELL,
+# until differently and explicitly specified.
+
+
## -------------------------------------------------------- ##
## Source static setup and definitions for the testsuite. ##
## -------------------------------------------------------- ##
@@ -42,9 +48,9 @@ if test -z "$me"; then
|| { echo "$argv0: failed to define \$me" >&2; exit 99; }
fi
-## ---------------------------------------- ##
-## Sanity checks and environment cleanup. ##
-## ---------------------------------------- ##
+## ---------------------- ##
+## Early sanity checks. ##
+## ---------------------- ##
# A single whitespace character.
sp=' '
@@ -70,6 +76,48 @@ test -f "$testbuilddir/defs-static" || {
exit 99
}
+# Ensure we can find ourselves.
+test -f "$0" || {
+ echo "$me: unable to find myself: $0" >&2
+ exit 1
+}
+
+
+## ------------------------------------ ##
+## Ensure we run with a proper shell. ##
+## ------------------------------------ ##
+
+# Make sure we run with the shell detected at configure time (unless
+# the user forbids it).
+case ${AM_TESTS_REEXEC-yes} in
+ n|no|false|0)
+ ;;
+ *)
+ AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC
+ # Cannot simply do `opts=$-', since the content of $- is not
+ # portable among different shells. So try to propagate only
+ # the portable and interesting options.
+ case $- in
+ *x*v*|*v*x) opts=-vx;;
+ *v*) opts=-v;;
+ *x*) opts=-x;;
+ *) opts=;;
+ esac
+ echo $me: exec $SHELL $opts "$0" "$*"
+ exec $SHELL $opts "$0" ${1+"$@"}
+ echo "$me: failed to re-execute with $SHELL" >&2
+ exit 99
+ ;;
+esac
+
+# NOTE: From this point on, we can assume this file is being executed
+# by the configure-time detected $CONFIG_SHELL.
+
+
+## ---------------------- ##
+## Environment cleanup. ##
+## ---------------------- ##
+
# Unset some MAKE... variables that may cause $MAKE to act like a
# recursively invoked sub-make. Any $MAKE invocation in a test is
# conceptually an independent invocation, not part of the main
@@ -103,6 +151,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 +163,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
@@ -135,7 +188,7 @@ framework_failure_ () { warn_ "$me: set-up failure: $@"; Exit 99; }
# tests (or portions of them) that requires a native compiler.
cross_compiling ()
{
- test x"$host_alias" != x
+ test x"$host_alias" != x && test x"$build_alias" != x"$host_alias"
}
# is_newest FILE FILES
@@ -199,6 +252,7 @@ using_gmake ()
Exit 99;;
esac
}
+am__using_gmake="" # Avoid interferences from the environment.
commented_sed_unindent_prog='
/^$/b # Nothing to do for empty lines.
@@ -255,24 +309,31 @@ 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"
- bzip2 --help || exit 77
+ bzip2 --help \
+ || skip_ "required program \`bzip2' not available"
;;
cl)
CC=cl
export CC
echo "$me: running $CC -?"
- $CC -? || exit 77
+ $CC -? || skip_ "Microsoft C compiler \`$CC' not available"
;;
cscope)
# Sun cscope is interactive without redirection.
echo "$me: running cscope --version </dev/null"
- cscope --version </dev/null || exit 77
+ cscope --version </dev/null \
+ || skip_ "required program \`cscope' not available"
;;
etags)
# Exuberant Ctags will create a TAGS file even
@@ -280,11 +341,19 @@ do
# does not have such problem.) Use -o /dev/null
# to make sure we do not pollute the tests/ directory.
echo "$me: running etags --version -o /dev/null"
- etags --version -o /dev/null || exit 77
+ etags --version -o /dev/null \
+ || skip_ "required program \`etags' not available"
;;
GNUmake)
- echo "$me: determine if $MAKE is GNU make"
- using_gmake || exit 77
+ for make_ in "$MAKE" gmake gnumake :; do
+ MAKE=$make_ am__using_gmake=''
+ test "$MAKE" = : && break
+ echo "$me: determine whether $MAKE is GNU make"
+ using_gmake && break
+ done
+ test "$MAKE" = : && skip_ "this test requires GNU make"
+ export MAKE
+ unset make_
;;
gcc)
# When gcc is required, export `CC=gcc' so that ./configure
@@ -294,25 +363,25 @@ do
CC=${am__tool_prefix}gcc
export CC
echo "$me: running $CC --version"
- $CC --version || exit 77
+ $CC --version || skip_ "GNU C compiler not available"
echo "$me: running $CC -v"
- $CC -v || exit 77
+ $CC -v || skip_ "botched installation for GNU C compiler"
;;
gcj)
GCJ=${am__tool_prefix}gcj
export GCJ
echo "$me: running $GCJ --version"
- $GCJ --version || exit 77
+ $GCJ --version || skip_ "GNU Java compiler not available"
echo "$me: running $GCJ -v"
- $GCJ -v || exit 77
+ $GCJ -v || skip_ "botched installation for GNU Java compiler"
;;
g++)
CXX=${am__tool_prefix}g++
export CXX
echo "$me: running $CXX --version"
- $CXX --version || exit 77
+ $CXX --version || skip_ "GNU C++ compiler not available"
echo "$me: running $CXX -v"
- $CXX -v || exit 77
+ $CXX -v || skip_ "botched installation for GNU C++ compiler"
;;
gfortran)
FC=${am__tool_prefix}gfortran
@@ -346,7 +415,7 @@ do
# it will try link *nothing* and complain it cannot find
# main(); funny). Use -help so it does not try linking anything.
echo "$me: running $CC -V -help"
- $CC -V -help || exit 77
+ $CC -V -help || skip_ "Intel C compiler \`$CC' not available"
;;
javac)
# The Java compiler from JDK 1.5 (and presumably earlier versions)
@@ -354,16 +423,19 @@ do
# telling that source files are missing. Adding also the `-help'
# option seems to solve the problem.
echo "$me: running javac -version -help"
- javac -version -help || exit 77
+ javac -version -help || skip_ "Sun Java compiler not available"
;;
makedepend)
echo "$me: running makedepend -f-"
- makedepend -f- || exit 77
+ makedepend -f- \
+ || skip_ "required program \`makedepend' not available"
;;
makeinfo-html)
- # Make sure makeinfo understands --html.
+ # Make sure we have makeinfo, and it understands `--html'.
echo "$me: running makeinfo --html --version"
- makeinfo --html --version || exit 77
+ makeinfo --html --version \
+ || skip_ "cannot find a makeinfo program that groks the" \
+ "\`--html' option"
;;
non-root)
# Skip this test case if the user is root.
@@ -375,15 +447,13 @@ do
overwrite_status=$?
rm -f $priv_check_temp
if test $overwrite_status -eq 0; then
- echo "$me: cannot drop file write permissions" >&2
- exit 77
+ skip_ "cannot drop file write permissions"
fi
unset priv_check_temp overwrite_status
;;
perl-threads)
if test "$WANT_NO_THREADS" = "yes"; then
- echo "$me: skip with Devel::Cover: cannot cope with threads" >&2
- exit 77
+ skip_ "Devel::Cover cannot cope with threads"
fi
;;
native)
@@ -392,7 +462,7 @@ do
python)
# Python doesn't support --version, it has -V
echo "$me: running python -V"
- python -V || exit 77
+ python -V || skip_ "python interpreter not available"
;;
ro-dir)
# Skip this test case if read-only directories aren't supported
@@ -404,8 +474,7 @@ do
create_status=$?
rm -rf $ro_dir_temp
if test $create_status -eq 0; then
- echo "$me: cannot drop directory write permissions" >&2
- exit 77
+ skip_ "cannot drop directory write permissions"
fi
unset ro_dir_temp create_status
;;
@@ -416,8 +485,7 @@ do
echo "$me: running $r2h --version"
$r2h --version && break 2
done
- echo "$me: no proper rst2html program found" >&2
- exit 77
+ skip_ "no proper rst2html program found"
done
unset r2h
;;
@@ -426,20 +494,21 @@ do
# the program on the runtest command-line. This requires
# DejaGnu 1.4.3 or later.
echo "$me: running runtest SOMEPROGRAM=someprogram --version"
- runtest SOMEPROGRAM=someprogram --version || exit 77
+ runtest SOMEPROGRAM=someprogram --version \
+ || skip_ "DejaGnu is not available"
;;
tex)
# No all versions of Tex support `--version', so we use
# a configure check.
if test -z "$TEX"; then
- echo "$me: TeX is required, but it wasn't found by configure" >&2
- exit 77
+ skip_ "TeX is required, but it wasn't found by configure"
fi
;;
texi2dvi-o)
# Texi2dvi supports `-o' since Texinfo 4.1.
echo "$me: running texi2dvi -o /dev/null --version"
- texi2dvi -o /dev/null --version || exit 77
+ texi2dvi -o /dev/null --version \
+ || skip_ "required program \`texi2dvi' not available"
;;
xsi-shell)
# Try some XSI features.
@@ -449,7 +518,8 @@ do
test "${_am_dummy##*/},${_am_dummy%/*},${_am_dummy#??}"${_am_dummy%"$_am_dummy"}, \
= c,a/b,b/c, \
&& eval 'test $(( 1 + 1 )) -eq 2 \
- && test "${#_am_dummy}" -eq 5' ) || exit 77
+ && test "${#_am_dummy}" -eq 5' ) \
+ || skip_ "the shell lacks some required XSI features"
;;
flex|lex)
# Since flex is required, we pick LEX for ./configure.
@@ -459,19 +529,15 @@ 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.
- echo "$me: \$YACC is \"no\", skipping test" >&2
- exit 77
- 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.
YACC='bison -y'
export YACC
echo "$me: running bison --version"
- bison --version || exit 77
+ bison --version || skip_ "required program \`bison' not available"
fi
;;
*)
@@ -480,7 +546,7 @@ do
# It is not likely but possible that $tool is a special builtin,
# in which case the shell is allowed to exit after an error.
# So, please leave the subshell here.
- ( $tool --version ) || exit 77
+ ($tool --version) || skip_ "required program \`$tool' not available"
;;
esac
done
@@ -492,10 +558,7 @@ case $testbuilddir in
*\ *|*\ *)
case " $required " in
*' libtool '* | *' libtoolize '* )
- echo "$me: libtool/libtoolized cannot cope correctly" >&2
- echo "$me: with spaces in the build tree" >&2
- exit 77
- ;;
+ skip_ "libtool has problems with spaces in builddir name";;
esac
;;
esac
@@ -508,10 +571,7 @@ case $testsrcdir in
*\ * |*\ *)
case " $required " in
*' libtool '* | *' libtoolize '* | *' gettext '* )
- echo "$me: our testsuite setup cannot cope correctly with spaces" >&2
- echo "$me: in the source tree for libtool/gettext tests" >&2
- exit 77
- ;;
+ skip_ "spaces in srcdir name: libtool/gettext tests won't work";;
esac
;;
esac
@@ -548,16 +608,18 @@ case " $required " in
case " $required " in
*' libtool '*|*' libtoolize '*)
if test $libtool_found != yes; then
- echo "$me: libtool/libtoolize is required, but libtool.m4 wasn't" >&2
- echo "$me: found in directories $aclocaldir $extra_includes" >&2
- exit 77
+ # Write more diagnostic to the log file than to the console.
+ echo "$me: \`libtool.m4' wasn't found in directories" \
+ "$aclocaldir $extra_includes"
+ skip_ "libtool m4 macros won't be found by aclocal"
fi
;;
*' gettext '*)
if test $gettext_found != yes; then
- echo "$me: gettext is required, but gettext.m4 wasn't found" >&2
- echo "$me: in directories $aclocaldir $extra_includes" >&2
- exit 77
+ # Write more diagnostic to the log file than to the console.
+ echo "$me: \`gettext.m4' wasn't found in directories" \
+ "$aclocaldir $extra_includes"
+ skip_ "gettext m4 macros won't be found by aclocal"
fi
;;
esac
@@ -595,6 +657,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/defs-static.in b/tests/defs-static.in
index 6d829560a..53d9f9354 100644
--- a/tests/defs-static.in
+++ b/tests/defs-static.in
@@ -19,8 +19,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Defines and minimal setup for Automake testing environment.
-# Multiple inclusions of this file should be idempotent!
-# This code needs to be 'set -e' clean.
+
+# IMPORTANT NOTES AND REQUIREMENTS
+# - Multiple inclusions of this file should be idempotent.
+# - This code has to be 'set -e' clean.
+# - This file should execute correctly with any system's /bin/sh
+# shell, not only with configure-time detected $CONFIG_SHELL.
# Be more Bourne compatible.
# (Snippet inspired to configure's initialization in Autoconf 2.64)
@@ -83,6 +87,9 @@ testprefix='@prefix@'
APIVERSION='@APIVERSION@'
PATH_SEPARATOR='@PATH_SEPARATOR@'
+host_alias=${host_alias-'@host_alias@'}; export host_alias
+build_alias=${build_alias-'@build_alias@'}; export build_alias
+
# Make sure we override the user shell.
SHELL='@SHELL@'; export SHELL
# User can override various tools used.
@@ -132,7 +139,7 @@ FGREP='@FGREP@'
# this variable.
TEX='@TEX@'
-# Whether /bin/sh has working 'set -e' with exit trap.
+# Whether $SHELL has working 'set -e' with exit trap.
sh_errexit_works='@sh_errexit_works@'
# The amount we should wait after modifying files depends on the platform.
diff --git a/tests/dejagnu4.test b/tests/dejagnu4.test
index 0d6a1bde2..02eb4448a 100755
--- a/tests/dejagnu4.test
+++ b/tests/dejagnu4.test
@@ -16,6 +16,12 @@
# Check that the DejaGnu rules work for a simple program and test case.
# Also check PR 488: Failure of the first of several tools tested.
+# From the original bug report:
+# ``If you use dejagnu for testing and have multiple tools (i.e.,
+# multiple entries in the DEJATOOL variable) then the success/failure
+# of "make check" is only dependent on the success/failure of the
+# tests on the final tool. Thus there may be failures in the tests on
+# previous tools, but at first glance "make check" has passed.''
required=runtest
. ./defs || Exit 1
diff --git a/tests/dejagnu7.test b/tests/dejagnu7.test
index d2f36e155..d16e02d2a 100755
--- a/tests/dejagnu7.test
+++ b/tests/dejagnu7.test
@@ -20,8 +20,8 @@
required=runtest
. ./defs || Exit 1
-# Check whether DejaGnu supports --status
-runtest --help | grep '.*--status' || Exit 77
+runtest --help | grep '.*--status' \
+ || skip_ "dejagnu lacks support for '--status'"
cat > failtcl << 'END'
#! /bin/sh
diff --git a/tests/depcomp10.test b/tests/depcomp10.test
deleted file mode 100755
index 0fa6c6a46..000000000
--- a/tests/depcomp10.test
+++ /dev/null
@@ -1,90 +0,0 @@
-#! /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/>.
-
-# hp depmode should work with GNU make in VPATH mode (bug similar to
-# depcomp9.test).
-# For automake bug#8473.
-
-# Here's the bug: hp depmode will prefix VPATH to the object file name,
-# thus the second gmake will invoke depcomp with object='../../src/foo.o',
-# causing errors such as (broken on multiple lines for clarity):
-# cpp: "", line 0: error 4066: Cannot create
-# "../../gllib/.deps/nonblocking.TPo" file for
-# "-M../../gllib/.deps/nonblocking.TPo" option.
-# (No such file or directory[errno=2])
-
-required=GNUmake
-. ./defs || Exit 1
-
-mkdir src src/sub build
-
-cat >> configure.in << 'END'
-AC_PROG_CC
-AM_PROG_CC_C_O
-AC_CONFIG_FILES([src/Makefile])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-SUBDIRS = src
-END
-
-cat > src/Makefile.am << 'END'
-AUTOMAKE_OPTIONS = subdir-objects
-bin_PROGRAMS = foo
-foo_SOURCES = foo.c foo.h sub/subfoo.c
-END
-
-cat > src/foo.h <<EOF
-extern int subfoo (void);
-EOF
-
-cat >src/foo.c <<EOF
-#include "foo.h"
-int main (void)
-{
- return subfoo ();
-}
-EOF
-
-cat >src/sub/subfoo.c <<EOF
-#include "foo.h"
-int subfoo (void)
-{
- return 0;
-}
-EOF
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a
-
-cd build
-../configure am_cv_CC_dependencies_compiler_type=hp
-# Do not error out with the first make, as the forced 'hp' depmode might
-# not actually work, but we have overridden the _AM_DEPENDENCIES tests.
-$MAKE || Exit 77
-
-# We must clean and rebuild, as the actual error only happens the second
-# time the objects are built because 'depcomp' has silently messed up the
-# .Po files the first time.
-$MAKE clean
-
-$MAKE >out 2>&1 || { cat out; Exit 1; }
-cat out
-grep 'src/[._]deps' out && Exit 1
-
-:
diff --git a/tests/depcomp2.test b/tests/depcomp2.test
index 2efa2ad0e..2bceaaf26 100755
--- a/tests/depcomp2.test
+++ b/tests/depcomp2.test
@@ -17,7 +17,7 @@
# Test to make sure that depcomp is not used when it's not installed
# From Pavel Roskin.
-required=gcc
+required=cc
. ./defs || Exit 1
cat >> configure.in << 'END'
@@ -40,13 +40,11 @@ END
: > subdir/foo.c
-# Ignore user CFLAGS.
-unset CFLAGS || :
-
$ACLOCAL
$AUTOMAKE --add-missing
$AUTOCONF
./configure 2>stderr || { cat stderr >&2; Exit 1; }
+cat stderr >&2
test ! -s stderr
:
diff --git a/tests/depcomp6.test b/tests/depcomp6.test
index b937b9fe8..13e8c83d4 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'
@@ -86,9 +87,8 @@ $AUTOMAKE -a
./configure --enable-dependency-tracking
$MAKE
-# Check that dependency tracking works.
if grep 'depmode=none' Makefile; then
- Exit 77
+ skip_ "automatic dependency tracking couldn't be activated"
fi
cd sub2
diff --git a/tests/depcomp7.test b/tests/depcomp7.test
index f404039ea..87f86b93e 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 0f9b7f557..9866cfdc2 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'
@@ -54,7 +55,7 @@ $AUTOCONF
# Don't reject slower dependency extractors, for better coverage.
./configure --enable-dependency-tracking
$MAKE
-./zardoz
+cross_compiling || ./zardoz
$MAKE DISTCHECK_CONFIGURE_FLAGS='--enable-dependency-tracking' distcheck
# Try again with subdir-objects option.
@@ -73,7 +74,7 @@ $AUTOCONF
# Don't reject slower dependency extractors, for better coverage.
./configure --enable-dependency-tracking
$MAKE
-./zardoz
+cross_compiling || ./zardoz
$MAKE DISTCHECK_CONFIGURE_FLAGS='--enable-dependency-tracking' distcheck
:
diff --git a/tests/depcomp8b.test b/tests/depcomp8b.test
index e4cd632e8..15dd109ce 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/depcomp9.test b/tests/depcomp9.test
deleted file mode 100755
index 9972c3da8..000000000
--- a/tests/depcomp9.test
+++ /dev/null
@@ -1,92 +0,0 @@
-#! /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/>.
-
-# makedepend should work in VPATH mode.
-
-# Here's the bug: makedepend will prefix VPATH to the object file name,
-# thus the second make will invoke depcomp with object='../../src/foo.o',
-# causing errors such as:
-# touch: cannot touch `../../src/.deps/foo.TPo': No such file or directory
-# makedepend: error: cannot open "../../src/.deps/foo.TPo"
-# ../../depcomp: line 560: ../../src/.deps/foo.TPo: No such file or directory
-
-# We include subfoo only to be sure that we don't remove too much
-# from the object file name.
-
-required='makedepend'
-. ./defs || Exit 1
-
-mkdir src src/sub build
-
-cat >> configure.in << 'END'
-AC_PROG_CC
-AM_PROG_CC_C_O
-AC_CONFIG_FILES([src/Makefile])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-SUBDIRS = src
-END
-
-cat > src/Makefile.am << 'END'
-AUTOMAKE_OPTIONS = subdir-objects
-bin_PROGRAMS = foo
-foo_SOURCES = foo.c foo.h sub/subfoo.c
-END
-
-cat > src/foo.h <<EOF
-extern int subfoo (void);
-EOF
-
-cat >src/foo.c <<EOF
-#include "foo.h"
-int main (void)
-{
- return subfoo ();
-}
-EOF
-
-cat >src/sub/subfoo.c <<EOF
-#include "foo.h"
-int subfoo (void)
-{
- return 0;
-}
-EOF
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a
-
-cd build
-../configure am_cv_CC_dependencies_compiler_type=makedepend
-
-# Do not error out with the first make, as the forced 'makedepend'
-# depmode might not actually work, but we have overridden the
-# _AM_DEPENDENCIES tests.
-$MAKE || Exit 77
-
-# We must clean and rebuild, as the actual error only happens the second
-# time the objects are built because 'makedepend' has silently messed up
-# the .Po files the first time.
-$MAKE clean
-
-$MAKE >out 2>&1 || { cat out; Exit 1; }
-cat out
-grep 'src/[._]deps' out && Exit 1
-
-:
diff --git a/tests/depdist.test b/tests/depdist.test
index 338763a65..d5644dee3 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 dd8fe6e1d..995680426 100755
--- a/tests/depend2.test
+++ b/tests/depend2.test
@@ -19,7 +19,7 @@
# --disable-dependency-tracking.
# Report from Robert Boehne
-required=gcc
+required=cc
. ./defs || Exit 1
cat >> configure.in << 'END'
@@ -37,8 +37,7 @@ END
cat > hello.c << 'END'
#include "hello.h"
-int
-main (int argc, char *argv[])
+int main (int argc, char *argv[])
{
printf ("yeah, yeah\n");
return 0;
@@ -49,10 +48,7 @@ $ACLOCAL
$AUTOCONF
$AUTOMAKE -a
-# Ignore user CFLAGS.
-CFLAGS=
-export CFLAGS
-
./configure --disable-dependency-tracking
-
$MAKE
+
+:
diff --git a/tests/depend5.test b/tests/depend5.test
index bd14c72d5..9d1bb4151 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/condman.test b/tests/depmod-data.test
index 85840144c..fdaa52b04 100755
--- a/tests/condman.test
+++ b/tests/depmod-data.test
@@ -1,6 +1,5 @@
#! /bin/sh
-# Copyright (C) 1998, 2001, 2002, 2010, 2011 Free Software Foundation,
-# Inc.
+# 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
@@ -15,23 +14,17 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Make sure conditionals work with man pages.
+# Helper testcase which generate input data for the other tests
+# `*.depmod'. It basically delegates the work to the helper script
+# `depmod-test.sh'.
-. ./defs || Exit 1
+# Ensure proper definition of $testsrcdir.
+. ./defs-static || exit 99
-cat >> configure.in << 'END'
-AM_CONDITIONAL([FRED], [true])
-END
+# Sanity check.
+if test x"$testsrcdir" = x; then
+ echo "$0: \$testsrcdir not set after sourcing of ./defs-static" >&2
+ exit 99
+fi
-cat > Makefile.am << 'END'
-if FRED
-man_MANS = foo.1
-else
-man_MANS = joe.1
-endif
-END
-
-$ACLOCAL
-$AUTOMAKE
-
-:
+exec $SHELL $testsrcdir/depmod-tests.sh --generate-data
diff --git a/tests/depmod-tests.sh b/tests/depmod-tests.sh
new file mode 100755
index 000000000..36b57190f
--- /dev/null
+++ b/tests/depmod-tests.sh
@@ -0,0 +1,225 @@
+#! /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/>.
+
+# Driver script to generate and run tests checking that dependency
+# tracking in various flavours works with VPATH builds.
+#
+# This script fulfills a threefold role:
+# 1. It is called to generate a Makefile.am snippet, containing the
+# definition of proper lists of tests.
+# 2. It is called to set up a directory containing some common data
+# files and autotools-generated files used by the aforementioned
+# tests (this is done for speed reasons only).
+# 3. It is called to properly run those tests, one at a time.
+#
+# Examples of reported failures follows ...
+
+# <http://lists.gnu.org/archive/html/automake-patches/2011-04/msg00028.html>
+#
+# Here's the bug: makedepend will prefix VPATH to the object file name,
+# thus the second make will invoke depcomp with object='../../src/foo.o',
+# causing errors such as:
+# touch: cannot touch `../../src/.deps/foo.TPo': No such file or directory
+# makedepend: error: cannot open "../../src/.deps/foo.TPo"
+# ../../depcomp: line 560: ../../src/.deps/foo.TPo: No such file or directory
+
+# <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8473>
+# <http://lists.gnu.org/archive/html/automake-patches/2011-04/msg00079.html>
+#
+# Here's the bug: hp depmode will prefix VPATH to the object file name,
+# thus the second gmake will invoke depcomp with object='../../src/foo.o',
+# causing errors such as (broken on multiple lines for clarity):
+# cpp: "", line 0: error 4066: Cannot create
+# "../../gllib/.deps/nonblocking.TPo" file for
+# "-M../../gllib/.deps/nonblocking.TPo" option.
+# (No such file or directory[errno=2])
+
+# Be more Bourne compatible (snippet copied from `tests/defs').
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+
+set -e
+
+case $# in
+ 0) echo "$0: missing argument" >&2; exit 99;;
+ 1) ;;
+ *) echo "$0: too many arguments" >&2; exit 99;;
+esac
+
+case $1 in
+ --generate-makefile|--generate-data)
+ action=`expr x"$1" : x'--\(.*\)'`
+ ;;
+ depcomp-*.depmod|*/depcomp-*.depmod)
+ action=run-test
+ depmode=`expr /"$1" : '.*/depcomp-\(.*\)\.depmod'`
+ ;;
+ *)
+ echo "$0: invalid argument '$1'" >&2
+ exit 99
+ ;;
+esac
+
+# Helper subroutines for creation of input data files.
+
+create_input_data ()
+{
+ mkdir src src/sub
+
+ unindent > configure.in << 'END'
+ AC_INIT([depcomp], [1.0])
+ AM_INIT_AUTOMAKE
+ AC_CONFIG_FILES([Makefile src/Makefile])
+ AC_PROG_CC
+ AM_PROG_CC_C_O
+ AC_OUTPUT
+END
+
+ echo 'SUBDIRS = src' > Makefile.am
+
+ unindent > src/Makefile.am << 'END'
+ AUTOMAKE_OPTIONS = subdir-objects
+ bin_PROGRAMS = foo
+ foo_SOURCES = foo.c foo.h sub/subfoo.c
+END
+
+ echo 'extern int subfoo (void);' > src/foo.h
+
+ unindent > src/foo.c << 'END'
+ #include "foo.h"
+ int main (void)
+ {
+ return subfoo ();
+ }
+END
+
+ # We include subfoo only to be sure that we don't remove too much
+ # from the object file name.
+ unindent > src/sub/subfoo.c << 'END'
+ #include "foo.h"
+ int subfoo (void)
+ {
+ return 0;
+ }
+END
+
+ $ACLOCAL
+ $AUTOCONF
+ $AUTOMAKE -a
+
+ # Sanity check: make sure the cache variable we force is used
+ # by configure.
+ grep am_cv_CC_dependencies_compiler_type configure
+
+ : > success
+}
+
+# Usage: get_depmodes DEPCOMP-FILE PROGRAM-NAME
+get_depmodes ()
+{
+ # Keep this in sync with the contents of depend.m4.
+ all_depmodes=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < "$1" \
+ | grep -v '^none$'` \
+ && : Turn newlines and tabs into spaces, and strip extra whitespace. \
+ && all_depmodes=`echo $all_depmodes` \
+ && test -n "$all_depmodes" || {
+ echo "$2: failed to extract list of valid depmodes from '$1'" >&2
+ exit 99
+ }
+}
+
+if test x"$action" = x"generate-makefile"; then
+ # We must generate a makefile fragment on stdout. It must refer
+ # to all tests at once, hence the loop below.
+ get_depmodes ../lib/depcomp
+ echo '## Generated by depmode-tests.sh. DO NOT EDIT!'
+ echo 'depmod_tests ='
+ for depmode in $all_depmodes; do
+ echo "depmod_tests += depcomp-$depmode.depmod"
+ done
+ exit 0
+fi
+
+# We'll need the full setup provided by `tests/defs'. Temporarily disable
+# 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
+. ./defs || Exit 99
+set -e
+
+# The directory set up by the `generate-data' action should contain all
+# the files we need. So remove the other files created by ./defs. And
+# check we really are in a temporary `*.dir' directory in the build tree,
+# since the last thing we want is to remove some random user files!
+test -f ../defs-static && test -f ../defs || Exit 99
+case `pwd` in *.dir);; *) Exit 99;; esac
+rm -f *
+
+if test x"$action" = x"generate-data"; then
+ # We must *not* remove the test directory, since its contents must be
+ # used by following dependent tests.
+ keep_testdirs=yes
+ create_input_data
+ Exit 0
+fi
+
+get_depmodes "$top_testsrcdir/lib/depcomp" "$me"
+case " $all_depmodes " in
+ *" $depmode "*) ;;
+ *) echo "$me: invalid depmode '$depmode'" >&2; exit 99;;
+esac
+
+### If we are still here, we have to run a test ...
+
+test -f ../depmod-data.dir/success || {
+ echo "$me: setup by depmod-data.test failed" >&2
+ Exit 99
+}
+
+../depmod-data.dir/configure am_cv_CC_dependencies_compiler_type=$depmode
+
+# Do not error out with the first make, as the depmode we've forced might
+# not actually work, but we have overridden the _AM_DEPENDENCIES tests.
+$MAKE || skip_ "forced depmode '$depmode' doesn't work"
+
+# We must clean and rebuild, as the actual error only happens the second
+# time the objects are built because 'depcomp' has silently messed up the
+# .Po files the first time.
+$MAKE clean
+
+$MAKE >out 2>&1 || { cat out; Exit 1; }
+cat out
+grep 'src/[._]deps' out && Exit 1
+
+:
diff --git a/tests/distcleancheck.test b/tests/distcleancheck.test
index b27ab07a1..cf2b0fe48 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/distlinks.test b/tests/distlinks.test
index 3021cae13..0f68bee1c 100755
--- a/tests/distlinks.test
+++ b/tests/distlinks.test
@@ -21,10 +21,7 @@
echo text > file
-ln -s file lnk || {
- echo "$me: cannot create symlinks to files" >&2
- Exit 77
-}
+ln -s file lnk || skip_ "cannot create symlinks to files"
mkdir A
mkdir B
diff --git a/tests/distlinksbrk.test b/tests/distlinksbrk.test
index 45755717d..ac0dc28c3 100755
--- a/tests/distlinksbrk.test
+++ b/tests/distlinksbrk.test
@@ -27,10 +27,7 @@ lnk2=${lnk_base}__002
lnka=${lnk_base}__aaa
lnkb=${lnk_base}__bbb
-ln -s nonesuch $lnk1 || {
- echo "$me: cannot create broken symlinks" >&2
- Exit 77
-}
+ln -s nonesuch $lnk1 || skip_ "cannot create broken symlinks"
ln -s "`pwd`/nonesuch" $lnk2
diff --git a/tests/distname.test b/tests/distname.test
index f940045a6..d090fe9a0 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 70d7efa2e..08cc0346a 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 c3f968c42..e78a508b7 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 @substitutions@.
+required=cc
. ./defs || Exit 1
cat >> configure.in << 'END'
diff --git a/tests/extra-programs-empty.test b/tests/extra-programs-empty.test
new file mode 100755
index 000000000..992c5ee42
--- /dev/null
+++ b/tests/extra-programs-empty.test
@@ -0,0 +1,53 @@
+#! /bin/sh
+# Copyright (C) 2003, 2006, 2011 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Test that EXTRA_PROGRAMS doesn't get removed because it is empty.
+# This check hs been introduced in commit `Release-1-9-254-g9d0eaef'
+# into the former test `subst2.test'.
+
+. ./defs || Exit 1
+
+cat >> configure.in << 'END'
+AC_CONFIG_FILES([Makefile2 Makefile3])
+AC_SUBST([prog])
+AC_PROG_CC
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+EXTRA_PROGRAMS =
+END
+
+cat > Makefile2.am <<'END'
+bin_PROGRAMS = a @prog@ b
+EXTRA_PROGRAMS =
+END
+
+cat > Makefile3.am <<'END'
+empty =
+EXTRA_PROGRAMS = $(empty)
+END
+
+$ACLOCAL
+$AUTOMAKE
+
+grep '^EXTRA_PROGRAMS = *$' Makefile.in
+grep '^EXTRA_PROGRAMS = *$' Makefile2.in
+# Be laxer here, since EXTRA_PROGRAMS might be internally rewritten
+# by Automake when it contains references to other variables.
+grep '^EXTRA_PROGRAMS =' Makefile3.in
+
+:
diff --git a/tests/extradep.test b/tests/extradep.test
index 623d73a62..7f3478ed3 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 9a97de4ec..86caa5d28 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/fn99.test b/tests/fn99.test
index c2afd2e29..c04880284 100755
--- a/tests/fn99.test
+++ b/tests/fn99.test
@@ -25,15 +25,13 @@ AUTOMAKE_OPTIONS = filename-length-max=99
EXTRA_DIST = 12345678
END
-(for i in 1 2 3 4 5 6 7 8 9
-do
- mkdir -p 12345678 || Exit 77
- cd 12345678
- touch x
-done) || Exit 77
+(for i in 1 2 3 4 5 6 7 8 9; do
+ mkdir -p 12345678 && cd 12345678 && touch x || Exit 1
+done) || skip_ "failed to create deep directory hierarchy"
# AIX 5.3 `cp -R' is too buggy for `make dist'.
-cp -R 12345678 t || Exit 77
+cp -R 12345678 t \
+ || skip_ "'cp -R' failed to copy deep directory hierarchy"
$ACLOCAL
$AUTOCONF
@@ -41,15 +39,13 @@ $AUTOMAKE
./configure
$MAKE distcheck
-(for i in 1 2 3 4 5 6 7 8 9 10 11
-do
- mkdir -p 12345678 || Exit 77
- cd 12345678
- touch x
-done) || Exit 77
+(for i in 1 2 3 4 5 6 7 8 9 10 11; do
+ mkdir -p 12345678 && cd 12345678 && touch x || Exit 1
+done) || skip_ "failed to create deeper directory hierarchy"
$MAKE dist 2>stderr && { cat stderr >&2; Exit 1; }
cat stderr >&2
grep 'filenames are too long' stderr
test 2 = `grep 12345678 stderr | wc -l`
+
:
diff --git a/tests/fn99subdir.test b/tests/fn99subdir.test
index a040e5801..3f793c8d8 100755
--- a/tests/fn99subdir.test
+++ b/tests/fn99subdir.test
@@ -46,15 +46,14 @@ AUTOMAKE_OPTIONS = filename-length-max=99
EXTRA_DIST = 12345678
END
-(cd ${subdirname}; for i in 1 2 3 4 5 6 7 8
-do
- mkdir -p 12345678 || Exit 77
- cd 12345678
- touch x
-done)
+(cd ${subdirname} || Exit 1
+for i in 1 2 3 4 5 6 7 8; do
+ mkdir -p 12345678 && cd 12345678 && touch x || Exit 1
+done) || skip_ "failed to create deep directory hierarchy"
# AIX 5.3 `cp -R' is too buggy for `make dist'.
-cp -R ${subdirname} t || Exit 77
+cp -R ${subdirname} t \
+ || skip_ "'cp -R' failed to copy deep directory hierarchy"
for init_dir in ${subdirname} .; do
(
@@ -67,15 +66,14 @@ done
./configure
$MAKE distcheck
-(cd ${subdirname}; for i in 1 2 3 4 5 6 7 8 9
-do
- mkdir -p 12345678 || Exit 77
- cd 12345678
- touch x
-done)
+(cd ${subdirname} || Exit 1
+for i in 1 2 3 4 5 6 7 8 9; do
+ mkdir -p 12345678 && cd 12345678 && touch x || Exit 1
+done) || skip_ "failed to create deeper directory hierarchy"
$MAKE dist 2>stderr && { cat stderr >&2; Exit 1; }
cat stderr >&2
grep 'filenames are too long' stderr
test 1 = `grep 12345678 stderr | wc -l`
+
:
diff --git a/tests/forcemiss2.test b/tests/forcemiss2.test
index 0b6b77529..80d78d3ba 100755
--- a/tests/forcemiss2.test
+++ b/tests/forcemiss2.test
@@ -25,10 +25,7 @@ rm -f install-sh
echo zot > foo
cp foo foo2
-ln -s foo2 install-sh || {
- echo "$me: cannot create symlinks to files" >&2
- Exit 77
-}
+ln -s foo2 install-sh || skip_ "cannot create symlinks to files"
: > Makefile.am
diff --git a/tests/fort5.test b/tests/fort5.test
index c4a4b55ed..de68a6cd5 100755
--- a/tests/fort5.test
+++ b/tests/fort5.test
@@ -78,14 +78,13 @@ $AUTOMAKE -a
$AUTOCONF
# This test requires Libtool >= 2.0. Earlier Libtool does not
-# have the LT_PREREQ macro to cause autoconf failure, so let's
-# skip in this case:
-grep LT_PREREQ configure && Exit 77
+# have the LT_PREREQ macro to cause autoconf failure.
+grep LT_PREREQ configure && skip_ "libtool is too old (probably < 2.0)"
# Ensure we use --tag for f90, too.
grep " --tag=FC" Makefile.in
-# configure may Exit 77 if no compiler is found,
+# configure may exit with status 77 if no compiler is found,
# or if the compiler cannot compile Fortran 90 files).
./configure
$MAKE
diff --git a/tests/gen-parallel-tests b/tests/gen-parallel-tests
index 19b0a107a..0c96228f5 100755
--- a/tests/gen-parallel-tests
+++ b/tests/gen-parallel-tests
@@ -1,7 +1,7 @@
#! /bin/sh
# Generate parallel-tests.am.
#
-# Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -30,7 +30,13 @@
set -e
-tests=`sed -n '/^TESTS =/,/^$/s/\(.*\.test\).*/\1/p' Makefile.am`
+tests=`sed -n '/^handwritten_tests =/,/^$/s/\(.*\.test\).*/\1/p' Makefile.am`
+
+if test -z "$tests"; then
+ echo "$0: failed to obtain list of tests" >&2
+ exit 1
+fi
+
{
grep -l '^TESTS ' $tests
grep -l ' TESTS ' $tests
diff --git a/tests/gettext3.test b/tests/gettext3.test
index 46b3cbc8c..66a32a8d6 100755
--- a/tests/gettext3.test
+++ b/tests/gettext3.test
@@ -30,7 +30,7 @@ mkdir po
# if aclocal fails, assume the gettext macros are too old and do not
# define AM_GNU_GETTEXT_INTL_SUBDIR.
-$ACLOCAL || Exit 77
+$ACLOCAL || skip_ "your gettext macros are probably too old"
# config.rpath is required.
: >config.rpath
diff --git a/tests/gnits2.test b/tests/gnits2.test
index b5e750fcb..255ba7b0f 100755
--- a/tests/gnits2.test
+++ b/tests/gnits2.test
@@ -17,7 +17,7 @@
# Test to ensure std-options checking is correct.
-required=gcc
+required='cc native'
. ./defs || Exit 1
cat >> configure.in << 'END'
@@ -39,7 +39,7 @@ bin_SCRIPTS = sub/scriptok.sh sub/scriptnok.sh
grep-stderr:
grep 'pfubar$(EXEEXT) does not support' stderr
grep 'pfubar3$(EXEEXT) does not support' stderr
- grep 'pscriptnok.sh does not support' stderr
+ grep 'pscriptnok\.sh does not support' stderr
## Only three failures please.
test `grep 'does not support --help' stderr | wc -l` = 3
test `grep 'does not support --version' stderr | wc -l` = 3
@@ -49,12 +49,16 @@ test-install: install
test ! -f ../inst-dir/bin/fine$(EXEEXT)
END
-echo 'int main () { return 0; }' > fubar.c
+cat > fubar.c <<'END'
+int main (void)
+{
+ return 0;
+}
+END
cat > fine.c << 'END'
#include <stdio.h>
-int
-main ()
+int main (void)
{
puts ("Which version? Which usage?");
return 0;
diff --git a/tests/gnits3.test b/tests/gnits3.test
index d9965eee4..5813527a0 100755
--- a/tests/gnits3.test
+++ b/tests/gnits3.test
@@ -16,7 +16,7 @@
# Check that AM_INSTALLCHECK_STD_OPTIONS_EXEMPT works.
-required=gcc
+required=cc
. ./defs || Exit 1
cat >> configure.in << 'END'
@@ -40,13 +40,18 @@ AM_INSTALLCHECK_STD_OPTIONS_EXEMPT = nok$(EXEEXT) nok.sh
grep-stderr:
grep 'sub/pnok$(EXEEXT) does not support' stderr
- grep 'sub/pnok.sh does not support' stderr
+ grep 'sub/pnok\.sh does not support' stderr
## Only two failures please.
test `grep 'does not support --help' stderr | wc -l` = 2
test `grep 'does not support --version' stderr | wc -l` = 2
END
-echo 'int main () { return 0; }' > nok.c
+cat > nok.c <<'END'
+int main (void)
+{
+ return 0;
+}
+END
mkdir sub
diff --git a/tests/install2.test b/tests/install2.test
index 2afdd375d..a04c0afc4 100755
--- a/tests/install2.test
+++ b/tests/install2.test
@@ -39,7 +39,7 @@ $AUTOMAKE -a
chmod 000 Makefile.am
# On some systems (like DOS and Windows), files are always readable.
-test ! -r Makefile.am || Exit 77
+test ! -r Makefile.am || skip_ "cannot drop file read permissions"
./configure
diff --git a/tests/installdir.test b/tests/installdir.test
index ff4ced5ce..faa074d96 100755
--- a/tests/installdir.test
+++ b/tests/installdir.test
@@ -15,6 +15,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Test for PR 203.
+# == Report ==
+# Some standard targets are missing `-local' hooks. For instance,
+# installdirs is missing this. Ideally this would be an automatic
+# feature of any exported target.
. ./defs || Exit 1
diff --git a/tests/instdir-ltlib.test b/tests/instdir-ltlib.test
index a90536dbd..0d9afd6b3 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 eb52933ae..9ca67ad69 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/instdir-texi.test b/tests/instdir-texi.test
index 9de8428c2..5e9ee9d6b 100755
--- a/tests/instdir-texi.test
+++ b/tests/instdir-texi.test
@@ -20,8 +20,10 @@
required='makeinfo-html tex texi2dvi'
. ./defs || Exit 1
-dvips --help || Exit 77
-pdfetex --help || pdftex --help || Exit 77
+dvips --help \
+ || skip_ "dvips is missing"
+pdfetex --version || pdftex --version \
+ || skip_ "pdeftex and pdftex are both missing"
cat >>configure.in <<'END'
AC_OUTPUT
diff --git a/tests/instfail-info.test b/tests/instfail-info.test
index becf59b00..3ac29860c 100755
--- a/tests/instfail-info.test
+++ b/tests/instfail-info.test
@@ -55,7 +55,7 @@ $MAKE uninstall
for file in info1.info
do
chmod a-r $file
- test ! -r $file || Exit 77
+ test ! -r $file || skip_ "cannot drop file read permissions"
$MAKE install-data && Exit 1
chmod u+r $file
done
diff --git a/tests/instfail-java.test b/tests/instfail-java.test
index a57029713..a584d647d 100755
--- a/tests/instfail-java.test
+++ b/tests/instfail-java.test
@@ -53,7 +53,7 @@ $MAKE uninstall
for file in java1.class
do
chmod a-r $file
- test ! -r $file || Exit 77
+ test ! -r $file || skip_ "cannot drop file read permissions"
$MAKE install-data && Exit 1
chmod u+r $file
done
diff --git a/tests/instfail-libtool.test b/tests/instfail-libtool.test
index b580c400e..3d520f1c7 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
@@ -64,7 +64,7 @@ $MAKE uninstall
for file in liblt1.la libltn1.la
do
chmod a-r $file
- test ! -r $file || Exit 77
+ test ! -r $file || skip_ "cannot drop file read permissions"
$MAKE install-exec && Exit 1
chmod u+r $file
done
diff --git a/tests/instfail.test b/tests/instfail.test
index d7fa73641..76312437e 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
@@ -68,7 +69,7 @@ $MAKE uninstall
for file in lib1.a libn1.a
do
chmod a-r $file
- test ! -r $file || Exit 77
+ test ! -r $file || skip_ "cannot drop file read permissions"
$MAKE install-exec && Exit 1
chmod u+r $file
done
diff --git a/tests/instmany-mans.test b/tests/instmany-mans.test
index b8f52a3ff..4a475c656 100755
--- a/tests/instmany-mans.test
+++ b/tests/instmany-mans.test
@@ -134,7 +134,7 @@ srcdir=../../$subdir
for file in page3.1 page$nfiles.1 npage3.1 npage$nfiles.1; do
chmod a-r $srcdir/$file
- test ! -r $srcdir/$file || Exit 77
+ test ! -r $srcdir/$file || skip_ "cannot drop file read permissions"
$MAKE install-man1 && Exit 1
chmod u+r $srcdir/$file
done
diff --git a/tests/instmany-python.test b/tests/instmany-python.test
index ab4aa73a0..26a6b16dd 100755
--- a/tests/instmany-python.test
+++ b/tests/instmany-python.test
@@ -121,7 +121,7 @@ srcdir=../../$subdir
for file in python3.py python$nfiles.py
do
chmod a-r $srcdir/$file
- test ! -r $srcdir/$file || Exit 77
+ test ! -r $srcdir/$file || skip_ "cannot drop file read permissions"
$MAKE install && Exit 1
chmod u+r $srcdir/$file
done
diff --git a/tests/instmany.test b/tests/instmany.test
index effee8289..5c55165b1 100755
--- a/tests/instmany.test
+++ b/tests/instmany.test
@@ -149,7 +149,7 @@ srcdir=../../$subdir
for file in script3 script$nfiles
do
chmod a-r $srcdir/$file
- test ! -r $srcdir/$file || Exit 77
+ test ! -r $srcdir/$file || skip_ "cannot drop file read permissions"
$MAKE install-binSCRIPTS && Exit 1
chmod u+r $srcdir/$file
done
diff --git a/tests/instsh3.test b/tests/instsh3.test
index a2bb9d344..da5041905 100755
--- a/tests/instsh3.test
+++ b/tests/instsh3.test
@@ -18,8 +18,10 @@
required=non-root
. ./defs || Exit 1
+
# Solaris /usr/ucb/touch does not accept -t.
-touch -t $old_timestamp foo || Exit 77
+touch -t $old_timestamp foo \
+ || skip_ "touch utility doesn't accept '-t' option"
./install-sh -d d1
diff --git a/tests/instspc-data.test b/tests/instspc-data.test
index 1c165d836..54f796c1c 100755
--- a/tests/instspc-data.test
+++ b/tests/instspc-data.test
@@ -14,13 +14,16 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Helper testcase which generate input data for the other test
-# `instspc-*.test'. It basically delegates the work to the helper
-# script `instspc-test.sh'.
+# Helper testcase which generate input data for the `*.instspc' tests.
+# It basically delegates the work to the driver script `instspc-test.sh'.
# Ensure proper definition of $testsrcdir.
. ./defs-static || exit 99
-test -n "$testsrcdir" || exit 99 # sanity check
-instspc_action=generate-data
-. $testsrcdir/instspc-tests.sh
+# Sanity check.
+if test x"$testsrcdir" = x; then
+ echo "$0: \$testsrcdir not set after sourcing of ./defs-static" >&2
+ exit 99
+fi
+
+exec $SHELL $testsrcdir/instspc-tests.sh --generate-data
diff --git a/tests/instspc-tests.sh b/tests/instspc-tests.sh
index 2c4089f50..c57efb792 100755
--- a/tests/instspc-tests.sh
+++ b/tests/instspc-tests.sh
@@ -15,24 +15,19 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-# Driver script to generate and run tests checking that building from,
-# or installing to, directories with shell metacharacters succeed.
+# Driver script to run tests checking that building from, or installing
+# to, directories with shell metacharacters succeed.
#
# Original report from James Amundson about file names with spaces.
# Other characters added by Paul Eggert.
#
# This script fulfills a threefold role:
-# 1. It generates a Makefile.am snippet, containing the definition
-# of proper lists of tests.
-# 2. It sets up a directory containing some common data files and
-# autotools-generated files used by said generated tests (this
-# is done for speed reasons only).
-# 3. It is sourced by said generated tests with proper parameters
-# pre-set, to run the "meat" of the checks.
-# This setup might seem a tricky and over-engineered abuse, but past
-# (painful) experiences showed that it is indeed required, because
-# the test generation code and test execution code tend to be
-# inextricably coupled and intertwined.
+# 1. It is called to generate a Makefile.am snippet, containing the
+# definition of proper lists of tests.
+# 2. It is called to set up a directory containing some common data
+# files and autotools-generated files used by the aforementioned
+# tests (this is done for speed reasons only).
+# 3. It is called to properly run those tests, one at a time.
#
# Be more Bourne compatible (snippet copied from `tests/defs').
@@ -50,30 +45,26 @@ fi
set -e
-# Sanity and usage checks.
-if test x"$instspc_action" = x; then
- if test "$#,$1" = "1,--generate-makefile"; then
- instspc_action=generate-makefile
- else
- echo "$0: empty action and no proper command line" >&2
- exit 99
- fi
-elif test $# -gt 0; then
- echo "$0: action specified and command line arguments used" >&2
- exit 99
-fi
+case $# in
+ 0) echo "$0: missing argument" >&2; exit 99;;
+ 1) ;;
+ *) echo "$0: too many arguments" >&2; exit 99;;
+esac
-case $instspc_action in
- generate-makefile|generate-data)
+case $1 in
+ --generate-makefile|--generate-data)
+ instspc_action=`expr x"$1" : x'--\(.*\)'`
;;
- test-build|test-install)
- if test x"$instspc_test_name" = x; then
- echo "$0: test name undefined for action '$instspc_action'" >&2
- exit 99
- fi
+ build-*.instspc|*/build-*.instspc)
+ instspc_action=test-build
+ instspc_test_name=`expr /"$1" : '.*/build-\(.*\)\.instspc'`
+ ;;
+ install-*.instspc|*/install-*.instspc)
+ instspc_action=test-install
+ instspc_test_name=`expr /"$1" : '.*/install-\(.*\)\.instspc'`
;;
*)
- echo "$0: invalid action: '$instspc_action'"
+ echo "$0: invalid argument '$1'" >&2
exit 99
;;
esac
@@ -261,21 +252,30 @@ if test x"$instspc_action" = x"generate-makefile"; then
echo 'instspc_tests ='
echo 'instspc_xfail_tests ='
for test_name in $instspc_names_list; do
- echo "instspc_tests += instspc-$test_name-build.test"
- echo "instspc_tests += instspc-$test_name-install.test"
+ echo "instspc_tests += build-$test_name.instspc"
+ echo "instspc_tests += install-$test_name.instspc"
done
for test_name in $instspc_xfail_builds_list; do
- echo "instspc_xfail_tests += instspc-$test_name-build.test"
+ echo "instspc_xfail_tests += build-$test_name.instspc"
done
for test_name in $instspc_xfail_installs_list; do
- echo "instspc_xfail_tests += instspc-$test_name-install.test"
+ echo "instspc_xfail_tests += install-$test_name.instspc"
done
exit 0
fi
# We'll need the full setup provided by `tests/defs'. Temporarily disable
# the errexit flag, since the setup code might not be prepared to deal
-# with it.
+# 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
. ./defs || Exit 99
set -e
diff --git a/tests/lex-lib.test b/tests/lex-lib.test
new file mode 100755
index 000000000..07af3ff19
--- /dev/null
+++ b/tests/lex-lib.test
@@ -0,0 +1,67 @@
+#! /bin/sh
+# Copyright (C) 1999, 2001, 2002, 2003, 2004, 2010, 2011 Free Software
+# Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# 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/>.
+
+# Check that we can provide a personal `yywrap' function in a custom
+# library.
+
+required='cc lex'
+. ./defs || Exit 1
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_RANLIB
+LEXLIB=libmylex.a
+AC_PROG_LEX
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = lexer
+lexer_SOURCES = foo.l
+lexer_LDADD = $(LEXLIB)
+EXTRA_lexer_DEPENDENCIES = $(LEXLIB)
+noinst_LIBRARIES = libmylex.a
+libmylex_a_SOURCES = mu.c
+END
+
+cat > mu.c << 'END'
+int yywrap (void)
+{
+ return 0;
+}
+END
+
+cat > foo.l <<'END'
+%%
+.
+%%
+int main (void)
+{
+ return 0;
+}
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+$MAKE
+test -f foo.c
+test -f libmylex.a
+
+:
diff --git a/tests/lex-libobj.test b/tests/lex-libobj.test
new file mode 100755
index 000000000..1ca1d4c9b
--- /dev/null
+++ b/tests/lex-libobj.test
@@ -0,0 +1,75 @@
+#! /bin/sh
+# Copyright (C) 1999, 2001, 2002, 2003, 2004, 2010, 2011 Free Software
+# Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# 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/>.
+
+# Check that we can provide a personal `yywrap' function through the
+# LIBOBJ machinery.
+
+required='cc lex'
+. ./defs || Exit 1
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_PROG_LEX
+save_LIBS=$LIBS
+LIBS="$LEXLIB $LIBS"
+AC_REPLACE_FUNCS([yywrap])
+LIBS=$save_LIBS
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+noinst_PROGRAMS = foo
+foo_SOURCES = foo.l
+foo_LDADD = $(LEXLIB) $(LIBOBJS)
+END
+
+cat > yywrap.c << 'END'
+int yywrap (void)
+{
+ return 0;
+}
+END
+
+cat > foo.l <<'END'
+%%
+.
+%%
+int main (void)
+{
+ return 0;
+}
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+grep LIBOBJS Makefile # For debugging.
+$MAKE
+$MAKE distclean
+
+# Force no "system lex library".
+./configure LEXLIB='-L /lib'
+grep LIBOBJS Makefile # For debugging.
+grep '^LIBOBJS *=.*yywrap.*\.o' Makefile # Sanity check.
+$MAKE
+
+$MAKE distcheck
+
+:
diff --git a/tests/lex-noyywrap.test b/tests/lex-noyywrap.test
new file mode 100755
index 000000000..9431970f9
--- /dev/null
+++ b/tests/lex-noyywrap.test
@@ -0,0 +1,72 @@
+#! /bin/sh
+# Copyright (C) 1999, 2001, 2002, 2003, 2004, 2010, 2011 Free Software
+# Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# 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/>.
+
+# Check Lex support with flex using the `%noyywrap' option.
+
+required='cc flex'
+. ./defs || Exit 1
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AM_PROG_LEX
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = foo
+foo_SOURCES = foo.l
+
+.PHONY: test-no-lexlib
+check-local: test-no-lexlib
+test-no-lexlib:
+ test x'$(LEXLIB)' = x'none needed'
+END
+
+cat > foo.l << 'END'
+%option noyywrap
+%%
+"GOOD" return EOF;
+.
+%%
+int main (void)
+{
+ /* We don't use a 'while' loop here (like a real lexer would do)
+ to avoid possible hangs. */
+ if (yylex () == EOF)
+ return 0;
+ else
+ return 1;
+}
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure LEXLIB="none needed"
+
+# Program should build and run.
+$MAKE
+if cross_compiling; then :; else
+ echo GOOD | ./foo
+ echo BAD | ./foo && Exit 1
+fi
+
+# Sanity check on distribution.
+$MAKE distcheck DISTCHECK_CONFIGURE_FLAGS='LEXLIB="none needed"'
+
+:
diff --git a/tests/lex-subobj-nodep.test b/tests/lex-subobj-nodep.test
index 5f201cbbd..322ae96e3 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 f7028646d..9c2f5b492 100755
--- a/tests/lex3.test
+++ b/tests/lex3.test
@@ -19,13 +19,9 @@
# Test associated with PR 19.
# From Matthew D. Langston.
-required='gcc flex GNUmake'
+required='cc flex GNUmake'
. ./defs || Exit 1
-# Ignore user CFLAGS.
-CFLAGS=
-export CFLAGS
-
cat >> configure.in << 'END'
AC_PROG_CC
AM_PROG_LEX
@@ -43,8 +39,8 @@ cat > foo.l << 'END'
"GOOD" return EOF;
.
%%
-int
-main ()
+
+int main (void)
{
/* We don't use a 'while' loop here (like a real lexer would do)
to avoid possible hangs. */
@@ -53,6 +49,12 @@ main ()
else
return 1;
}
+
+/* Avoid possible link errors. */
+int yywrap (void)
+{
+ return 0;
+}
END
$ACLOCAL
@@ -63,8 +65,10 @@ $AUTOMAKE -a
# Program should build and run.
$MAKE
-echo GOOD | ./foo
-echo BAD | ./foo && Exit 1
+if cross_compiling; then :; else
+ echo GOOD | ./foo
+ echo BAD | ./foo && Exit 1
+fi
# The generated file `foo.c' must be shipped.
$MAKE distdir
diff --git a/tests/lex5.test b/tests/lex5.test
index 220bf50f6..ee4306fb8 100755
--- a/tests/lex5.test
+++ b/tests/lex5.test
@@ -17,7 +17,7 @@
# Test for subdir lexers.
-required='gcc GNUmake flex'
+required='cc GNUmake flex'
. ./defs || Exit 1
cat >> configure.in << 'END'
diff --git a/tests/lexvpath.test b/tests/lexvpath.test
index 300a476db..93902b303 100755
--- a/tests/lexvpath.test
+++ b/tests/lexvpath.test
@@ -22,7 +22,7 @@
# Please keep this in sync with sister test `yaccvapth.test'.
-required='gcc flex'
+required='cc flex'
. ./defs || Exit 1
cat > lexoutroot.in << 'END'
@@ -52,7 +52,15 @@ cat > lexer.l << 'END'
END
cat > foo.c << 'END'
-int main () { return 0; }
+int main (void)
+{
+ return 0;
+}
+/* Avoid possible link errors. */
+int yywrap (void)
+{
+ return 0;
+}
END
$ACLOCAL
@@ -61,7 +69,7 @@ $AUTOMAKE -a
mkdir sub
-# We must run configure early, to find out whay $LEX_OUTPUT_ROOT is.
+# We must run configure early, to find out why $LEX_OUTPUT_ROOT is.
cd sub
../configure
. ./lexoutroot
diff --git a/tests/lflags.test b/tests/lflags.test
index da207fb2e..42e6da0a4 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 9e339f37c..f78de85cc 100755
--- a/tests/lflags2.test
+++ b/tests/lflags2.test
@@ -19,7 +19,6 @@
# Please keep this in sync with the sister tests lflags.test, yflags.test
# and yflags2.test
-required=g++ # FIXME: any working C++ compiler should be OK
. ./defs || Exit 1
cat >fake-lex <<'END'
@@ -34,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])
@@ -43,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++
@@ -56,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 0fe0278c7..157dd01ec 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 f891e85f4..85b3d8a96 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/libobj14.test b/tests/libobj14.test
index 4f05871ec..daeaa2560 100755
--- a/tests/libobj14.test
+++ b/tests/libobj14.test
@@ -19,7 +19,6 @@
# that uses it.
# Report from Bill Davidson
-required=gcc
. ./defs || Exit 1
cat >>configure.in <<'EOF'
diff --git a/tests/libobj16a.test b/tests/libobj16a.test
index 9946bc5b0..9b7c6fbdc 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 1039558e0..9f6088358 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 4f9db57f9..c753f7da6 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 bc495b5b5..8e595c2c0 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 66ca0d04e..350f60516 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 b7556b70b..22207d7a2 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 72310bb72..0d999dce8 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 4cfcda5bd..e7b7354dc 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 3a6a40eab..86a04b428 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 gcc'
+required='cc libtoolize'
. ./defs || Exit 1
cat >> configure.in << 'END'
@@ -50,7 +50,7 @@ cat > sub/1.c << 'END'
int zero ();
int
-main ()
+main (void)
{
return zero ();
}
@@ -85,3 +85,5 @@ $FGREP 'a.lo:' Makefile.in
$MAKE
$MAKE distcheck
+
+:
diff --git a/tests/libtool7.test b/tests/libtool7.test
index 970062862..90ae862a1 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 gcc'
+required='cc libtoolize'
. ./defs || Exit 1
cat >> configure.in << 'END'
@@ -42,6 +42,7 @@ bin_PROGRAMS = prg
prg_SOURCES = prg.c
prg_LDADD = -dlopen libmod1.la -dlpreopen mod2.la
+.PHONY: print
print:
@echo 1BEG: $(prg_DEPENDENCIES) :END1
@echo 2BEG: $(libmod1_la_DEPENDENCIES) :END2
@@ -51,24 +52,21 @@ END
mkdir sub liba
cat > sub/mod1.c << 'END'
-int
-mod1 ()
+int mod1 (void)
{
return 1;
}
END
cat > mod2.c << 'END'
-int
-mod2 ()
+int mod2 (void)
{
return 2;
}
END
cat > prg.c << 'END'
-int
-main ()
+int main (void)
{
return 0;
}
@@ -105,3 +103,5 @@ env LIBTOOLFLAGS=--silent $MAKE uninstall >output 2>&1 || {
}
cat output
grep 'silent.*silent.*libmod1' output
+
+:
diff --git a/tests/libtool9.test b/tests/libtool9.test
index 46009c146..ab6266eb8 100755
--- a/tests/libtool9.test
+++ b/tests/libtool9.test
@@ -16,9 +16,10 @@
# Make sure xxx_LINK is defined for each target that requires specific
# flags.
-# Quite similar to libtool7.test, using AM_LDFLAGS in addition to xxx_LDFLAGS.
+# Quite similar to libtool7.test, using AM_LDFLAGS in addition to
+# xxx_LDFLAGS.
-required='libtoolize gcc'
+required='cc libtoolize'
. ./defs || Exit 1
cat >> configure.in << 'END'
@@ -57,24 +58,21 @@ END
mkdir liba
cat > mod1.c << 'END'
-int
-mod1 ()
+int mod1 (void)
{
return 1;
}
END
cat > mod2.c << 'END'
-int
-mod2 ()
+int mod2 (void)
{
return 2;
}
END
cat > prg.c << 'END'
-int
-main ()
+int main (void)
{
return 0;
}
@@ -99,3 +97,5 @@ grep '5BEG: :END5' output
grep '6BEG:.* prg2_cflags cflags .*am_ldflags ldflags.* :END6' output
grep '6BEG: .*am_cflags.* :END6' output && Exit 1
$MAKE
+
+:
diff --git a/tests/ltcond.test b/tests/ltcond.test
index 8ede51b22..2dc64e0e0 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 gcc'
+required='cc libtoolize'
. ./defs || Exit 1
cat >>configure.in <<'END'
@@ -100,3 +100,5 @@ test ! -f lib1foo.la
test ! -f lib1bar.la
test ! -f lib2foo.la
test ! -f lib3foo.la
+
+:
diff --git a/tests/ltcond2.test b/tests/ltcond2.test
index d4bf0647b..42da11bb1 100755
--- a/tests/ltcond2.test
+++ b/tests/ltcond2.test
@@ -16,14 +16,14 @@
# Test for bug in conditionals.
-required='libtoolize gcc'
+required='cc native libtoolize'
. ./defs || Exit 1
cat >> configure.in << 'END'
AC_PROG_CC
AC_PROG_LIBTOOL
AC_SUBST([HELLO_SYSTEM], [hello-generic.lo])
-AM_CONDITIONAL([LINUX], true)
+AM_CONDITIONAL([LINUX], [true])
AC_OUTPUT
END
@@ -54,17 +54,36 @@ check-local:
: > check-ok
END
-echo 'char* str() { return "hello-linux"; }' >hello-linux.c
-echo 'char* str() { return "hello-generic"; }' >hello-generic.c
-cat >hello-common.c <<'END'
+cat > hello-linux.c <<'END'
+const char* str (void)
+{
+ return "hello-linux";
+}
+END
+
+cat > hello-generic.c <<'END'
+const char* str (void)
+{
+ return "hello-generic";
+}
+END
+
+cat > hello-common.c <<'END'
#include <stdio.h>
-char* str();
-void print()
+const char* str (void);
+void print (void)
{
puts (str ());
}
END
-echo 'int main() { print(); return 0; }' >main.c
+
+cat > main.c <<'END'
+int main (void)
+{
+ print();
+ return 0;
+}
+END
libtoolize
$ACLOCAL
@@ -73,3 +92,5 @@ $AUTOMAKE --add-missing
./configure
$MAKE check
test -f check-ok
+
+:
diff --git a/tests/ltconv.test b/tests/ltconv.test
index 2ea2705eb..c0a1099e0 100755
--- a/tests/ltconv.test
+++ b/tests/ltconv.test
@@ -17,16 +17,16 @@
# Test for libtool convenience libraries.
# This example is taken from the manual.
-required='libtoolize gcc'
+required='cc native libtoolize'
. ./defs || Exit 1
cat >>configure.in <<'END'
AC_PROG_CC
AC_PROG_LIBTOOL
-AC_CONFIG_FILES(sub1/Makefile
- sub2/Makefile
- sub2/sub21/Makefile
- sub2/sub22/Makefile)
+AC_CONFIG_FILES([sub1/Makefile
+ sub2/Makefile
+ sub2/sub21/Makefile
+ sub2/sub22/Makefile])
AC_OUTPUT
END
@@ -88,7 +88,7 @@ END
echo 'int sub22 () { return 22; }' > sub2/sub22/sub22.c
-cat >test.c <<EOF
+cat >test.c <<'EOF'
#include <stdio.h>
int main ()
{
@@ -151,3 +151,5 @@ find lib -type f -print > lib.lst
test 0 = `wc -l < lib.lst`
find bin -type f -print > bin.lst
test 0 = `wc -l < bin.lst`
+
+:
diff --git a/tests/ltinit.test b/tests/ltinit.test
index 42c39138e..a6131f94b 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'
@@ -45,7 +45,11 @@ END
libtoolize
# Skip if older libtool (pre-2.0) is used.
{ $ACLOCAL && $AUTOCONF; } || {
- if test $? -eq 63; then Exit 77; else Exit 1; fi
+ if test $? -eq 63; then
+ skip_ "libtool is too old (probably < 2.0)"
+ else
+ Exit 1
+ fi
}
$EGREP 'LT_(INIT|PREREQ)' configure && Exit 1 # Sanity check.
$AUTOMAKE -a
@@ -53,7 +57,7 @@ $AUTOMAKE -a
cwd=`pwd`
./configure --prefix="$cwd/inst" >stdout || { cat stdout; Exit 1; }
cat stdout
-grep '^checking.*dlopen' stdout
+grep '^checking.*dlfcn\.h.* no$' stdout || grep '^checking.*dlopen' stdout
$MAKE
$MAKE install
diff --git a/tests/ltlibsrc.test b/tests/ltlibsrc.test
index 78ac8e2f7..f1506267e 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 gcc'
+required='cc libtool'
. ./defs || Exit 1
cat >> configure.in << 'END'
@@ -37,7 +37,10 @@ $(srcdir)/zoo_d_old2_la.c: $(srcdir)/old_la.c
END
cat > foo.c << 'END'
-int foo (void) { return 0; }
+int foo (void)
+{
+ return 0;
+}
END
cp foo.c zoo.d/bar.c
@@ -47,10 +50,10 @@ libtoolize
$ACLOCAL
$AUTOCONF
AUTOMAKE_fails -a
-grep 'Makefile.am:2:.*old_la.c' stderr
-grep 'Makefile.am:2:.*old.c' stderr
-grep 'Makefile.am:3:.*zoo_d_old2_la.c' stderr
-grep 'Makefile.am:3:.*zoo\.d/old2.c' stderr
+grep '^Makefile\.am:2:.*old_la\.c' stderr
+grep '^Makefile\.am:2:.*old\.c' stderr
+grep '^Makefile\.am:3:.*zoo_d_old2_la\.c' stderr
+grep '^Makefile\.am:3:.*zoo\.d/old2\.c' stderr
$AUTOMAKE -Wno-obsolete
@@ -66,3 +69,5 @@ test -f old.la
test -f zoo.d/old2.la
$MAKE distcheck
+
+:
diff --git a/tests/ltorder.test b/tests/ltorder.test
index c41134137..7c4b78c87 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/makej2.test b/tests/makej2.test
index 2adc75aba..3025c06b9 100755
--- a/tests/makej2.test
+++ b/tests/makej2.test
@@ -37,7 +37,7 @@ mkdir build
cd build
../configure "--prefix=`pwd`/inst"
-$MAKE -j2 || Exit 77
+$MAKE -j2 || skip_ "$MAKE failed to run with two parallel jobs"
$MAKE -j2 distcheck
$MAKE test-distdir-removed
diff --git a/tests/mdate6.test b/tests/mdate6.test
index 17672ee7c..94ddb4dc5 100755
--- a/tests/mdate6.test
+++ b/tests/mdate6.test
@@ -20,7 +20,8 @@
a=
file='file name $a'
-( : > "$file" ) || Exit 77
+( : > "$file" ) \
+ || skip_ "file name with spaces and metacharacters not accepted"
cp "$top_testsrcdir/lib/mdate-sh" .
$SHELL ./mdate-sh "$file" >stdout 2>stderr ||
diff --git a/tests/mkinst3.test b/tests/mkinst3.test
index 8d9efe708..0082b53fb 100755
--- a/tests/mkinst3.test
+++ b/tests/mkinst3.test
@@ -19,8 +19,8 @@
. ./defs || Exit 1
# Make sure the directory we will create can be created...
-mkdir '~a b' || Exit 77
-mkdir '~a b/-x y' || Exit 77
+mkdir '~a b' && mkdir '~a b/-x y' \
+ || skip_ "directory names with spaces and metacharacters not accepted"
rm -rf '~a b'
cp "$top_testsrcdir/lib/mkinstalldirs" .
diff --git a/tests/mmodely.test b/tests/mmodely.test
index 03c5d0f9a..f232058b2 100755
--- a/tests/mmodely.test
+++ b/tests/mmodely.test
@@ -19,7 +19,7 @@
# sources in maintainer mode.
# From Derek R. Price.
-required=gcc
+required=cc
. ./defs || Exit 1
cat >> configure.in << 'END'
diff --git a/tests/nobase-libtool.test b/tests/nobase-libtool.test
index 15d1b4994..c9e057acd 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 gcc'
+required='cc libtoolize'
. ./defs || Exit 1
cat >> configure.in <<'EOF'
@@ -47,6 +47,8 @@ test-install-exec: install-exec
test -f inst/foo/sub/libnobase.la
test ! -f inst/foo/libnobase.la
test -f inst/foo/libbase.la
+
+.PHONY: test-install-exec test-install-data
EOF
mkdir sub
@@ -89,3 +91,5 @@ $MAKE test-install-data
$MAKE test-install-exec
$MAKE uninstall
test `find inst/foo -type f -print | wc -l` = 0
+
+:
diff --git a/tests/nobase.test b/tests/nobase.test
index 2fa9a6059..aca646ace 100755
--- a/tests/nobase.test
+++ b/tests/nobase.test
@@ -17,7 +17,7 @@
# Make sure nobase_* works.
-required='gcc'
+required=cc
. ./defs || Exit 1
cat >> configure.in <<'EOF'
@@ -93,6 +93,8 @@ test-install-exec: install-exec
test -f inst/foo/sub/libnobase.a
test ! -f inst/foo/libnobase.a
test -f inst/foo/libbase.a
+
+.PHONY: test-install-exec test-install-data
EOF
mkdir sub
@@ -141,3 +143,5 @@ $MAKE test-install-data
$MAKE test-install-exec
$MAKE uninstall
test `find inst/foo -type f -print | wc -l` = 0
+
+:
diff --git a/tests/nostdinc.test b/tests/nostdinc.test
index a693003cc..07f91f154 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-tests7.test b/tests/parallel-tests-ext-driver-prog.test
index c29d32c21..e92d26274 100755
--- a/tests/parallel-tests7.test
+++ b/tests/parallel-tests-ext-driver-prog.test
@@ -15,10 +15,14 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Check parallel-tests features:
-# - per-extension test drivers
+# - per-extension test drivers (xxx_LOG_COMPILER and xxx_LOG_FLAGS),
+# when some tests are PROGRAMS.
+# See also related test 'parallel-tests-ext-driver.test'.
parallel_tests=yes
+required='cc native'
. ./defs || Exit 1
+
cat >> configure.in << 'END'
AC_PROG_CC
AC_OUTPUT
@@ -77,12 +81,14 @@ $AUTOCONF
$AUTOMAKE -a
./configure
-$MAKE
-$MAKE check
-grep 'chk-driver *1 *2' foo.log
-grep 'test-driver *3 *4' bar.log
-grep 'noext-driver *5 *6' baz.log
-grep 'test-driver *3 *4' bla.log
-grep 'noext-driver *5 *6' bli.suff.log
-grep 'noext-driver *5 *6' sub/test.log
+$MAKE check || { cat test-suite.log; Exit 1; }
+ls -l . sub
+cat test-suite.log
+grep 'chk-driver *1 *2 ' foo.log
+grep 'test-driver *3 *4 ' bar.log
+grep 'noext-driver *5 *6 ' baz.log
+grep 'test-driver *3 *4 ' bla.log
+grep 'noext-driver *5 *6 ' bli.suff.log
+grep 'noext-driver *5 *6 ' sub/test.log
+
:
diff --git a/tests/parallel-tests-ext-driver.test b/tests/parallel-tests-ext-driver.test
new file mode 100755
index 000000000..b53ccdb53
--- /dev/null
+++ b/tests/parallel-tests-ext-driver.test
@@ -0,0 +1,136 @@
+#! /bin/sh
+# Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Check parallel-tests features:
+# - per-extension test drivers (xxx_LOG_COMPILER and xxx_LOG_FLAGS),
+# also with AC_SUBST'd stuff.
+# See also related test 'parallel-tests-ext-driver-prog.test'
+
+parallel_tests=yes
+. ./defs || Exit 1
+
+cat >> configure.in << 'END'
+AC_SUBST([acsubst_driver], [t-driver])
+AC_CONFIG_LINKS([chk-driver:chk-driver])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+# Note that automake should not match the '/test' part of 'sub/test'
+# as '.test' suffix.
+TESTS = foo.chk bar.test baz bla.t bli.suff sub/test
+
+TEST_EXTENSIONS = .chk .test .t
+
+CHK_LOG_COMPILER = CHK=ok; export CHK; ./chk-driver
+TEST_LOG_COMPILER = CHK=ok $(SHELL) $(srcdir)/test-driver
+T_LOG_COMPILER = @acsubst_driver@
+LOG_COMPILER = @SHELL@ -x $(srcdir)/noext-driver
+
+CHK_LOG_FLAGS = --chk
+
+AM_TEST_LOG_FLAGS = --am-test
+
+T_LOG_FLAGS = --t
+AM_T_LOG_FLAGS = --am-t
+
+AM_LOG_FLAGS = -a
+LOG_FLAGS = -b
+
+# t-driver is deliberately not distributed; it should be available
+# in PATH also from "make distcheck".
+EXTRA_DIST = $(TESTS) chk-driver test-driver noext-driver
+END
+
+unset CHK || :
+
+mkdir sub
+
+cat > chk-driver <<'END'
+#! /bin/sh
+test x"$1" = x"--chk" || {
+ echo "$0: invalid command line: $*" >&2
+ exit 1
+}
+test x"$CHK" = x"ok" || {
+ echo "$0: bad \$CHK value '$CHK'" >&2
+ exit 1
+}
+shift
+exec "$@"
+exit 127
+END
+sed 's/--chk/--am-test/' chk-driver > test-driver
+
+mkdir bin
+PATH=`pwd`/bin$PATH_SEPARATOR$PATH; export PATH
+
+cat > bin/t-driver <<'END'
+#! /bin/sh
+if test x"$1,$2" != x"--am-t,--t"; then
+ echo "$0: invalid command line: $*" >&2
+ exit 1
+fi
+if test x${CHK+"set"} = x"set"; then
+ echo "$0: $CHK is set in the environment" >&2
+ exit 1
+fi
+shift; shift
+exec "$@"
+exit 127
+END
+sed 's/--am-t,--t/-a,-b/' bin/t-driver > noext-driver
+
+chmod a+x chk-driver chk-driver test-driver bin/t-driver noext-driver
+
+cat >foo.chk << 'END'
+#! /bin/sh
+exit 0
+END
+chmod a+x foo.chk
+cp foo.chk bar.test
+cp foo.chk baz
+cp foo.chk bla.t
+cp foo.chk bli.suff
+cp foo.chk sub/test
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+$MAKE check || { cat test-suite.log; Exit 1; }
+ls -l . sub
+cat test-suite.log
+test -f foo.log
+test -f bar.log
+test -f baz.log
+test -f bla.log
+test -f bli.suff.log
+test -f sub/test.log
+
+T_LOG_FLAGS=--bad $MAKE -e check && Exit 1
+cat test-suite.log
+cat bla.log
+# With the above flag overridden, bla.t should fail ...
+$EGREP '(^ *|/)t-driver:.* invalid .*--bad' bla.log
+# ... but no oher test should.
+grep -v '^FAIL: bla\.t ' bla.log | grep 'FAIL:' && Exit 1
+
+# Try also with a VPATH build.
+$MAKE distcheck
+
+:
diff --git a/tests/parallel-tests-reset-term.test b/tests/parallel-tests-reset-term.test
index 3a222c0b8..1544c3f98 100755
--- a/tests/parallel-tests-reset-term.test
+++ b/tests/parallel-tests-reset-term.test
@@ -27,7 +27,7 @@ esc='['
# GNU or BSD 'grep -a' works on files, but is not portable.
case `echo "$esc" | $FGREP "$esc"` in
"$esc") ;;
- *) echo "$me: $FGREP can't parse nonprinting characters" >&2; Exit 77;;
+ *) skip_ "$FGREP can't parse nonprinting characters" ;;
esac
cat >> configure.in << 'END'
diff --git a/tests/parallel-tests-suffix-prog.test b/tests/parallel-tests-suffix-prog.test
new file mode 100755
index 000000000..1ea730acb
--- /dev/null
+++ b/tests/parallel-tests-suffix-prog.test
@@ -0,0 +1,77 @@
+#! /bin/sh
+# Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Check parallel-tests features:
+# - suffix rules, with PROGRAMS involved
+# See also sister test 'parallel-tests-suffix.test'.
+
+parallel_tests=yes
+required='cc native'
+. ./defs || Exit 1
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+## Note that automake should not match the '/test' part of 'sub/test' as
+## '.test' suffix, nor the '/chk' part of 'sub/chk' as '.chk' suffix.
+TESTS = $(dist_TESTS) $(check_PROGRAMS)
+dist_TESTS = foo.chk bar.test sub/test
+check_PROGRAMS = baz bla.test bli.suff sub/chk
+TEST_EXTENSIONS = .chk .test
+EXTRA_DIST = $(dist_TESTS)
+END
+
+mkdir sub
+
+cat >foo.chk << 'END'
+#! /bin/sh
+exit 0
+END
+chmod a+x foo.chk
+cp foo.chk bar.test
+cp foo.chk sub/test
+
+cat >baz.c << 'END'
+int main (void)
+{
+ return 0;
+}
+END
+cp baz.c bla.c
+cp baz.c bli.c
+cp baz.c sub/chk.c
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+$MAKE check
+ls -l . sub
+test -f foo.log
+test -f bar.log
+test -f baz.log
+test -f bla.log
+test -f bli.suff.log
+test -f sub/chk.log
+test -f sub/test.log
+
+$MAKE distcheck
+
+:
diff --git a/tests/parallel-tests4.test b/tests/parallel-tests-suffix.test
index a24bd5135..c56f4bd32 100755
--- a/tests/parallel-tests4.test
+++ b/tests/parallel-tests-suffix.test
@@ -16,20 +16,21 @@
# Check parallel-tests features:
# - suffix rules
+# See also sister test 'parallel-tests-suffix-prog.test'.
parallel_tests=yes
. ./defs || Exit 1
+
cat >> configure.in << 'END'
-AC_PROG_CC
AC_OUTPUT
END
cat > Makefile.am << 'END'
## Note that automake should not match the '/test' part
## of 'sub/test' as '.test' suffix.
-TESTS = foo.chk bar.test $(check_PROGRAMS) sub/test
-check_PROGRAMS = baz bla.test bli.suff
+TESTS = foo.chk bar.test baz bli.suff sub/test
TEST_EXTENSIONS = .chk .test
+EXTRA_DIST = $(TESTS)
END
mkdir sub
@@ -40,28 +41,23 @@ exit 0
END
chmod a+x foo.chk
cp foo.chk bar.test
+cp foo.chk baz
+cp foo.chk bli.suff
cp foo.chk sub/test
-cat >baz.c << 'END'
-int main (void)
-{
- return 0;
-}
-END
-cp baz.c bla.c
-cp baz.c bli.c
-
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
./configure
-$MAKE
$MAKE check
+ls -l . sub
test -f foo.log
test -f bar.log
test -f baz.log
-test -f bla.log
test -f bli.suff.log
test -f sub/test.log
+
+$MAKE distcheck
+
:
diff --git a/tests/parallel-tests-unreadable-log.test b/tests/parallel-tests-unreadable-log.test
index 572f03df5..8560c371d 100755
--- a/tests/parallel-tests-unreadable-log.test
+++ b/tests/parallel-tests-unreadable-log.test
@@ -51,7 +51,7 @@ line=PASS; export line
$MAKE foo.log
$MAKE bar.log
chmod a-r foo.log bar.log
-test ! -r foo.log || Exit 77
+test ! -r foo.log || skip_ "cannot drop file read permissions"
$MAKE test-suite.log >stdout && { cat stdout; Exit 1; }
cat stdout
grep '^2 of 2 tests failed *$' stdout
diff --git a/tests/parallel-tests.test b/tests/parallel-tests.test
index da961e12a..ea92ae7fa 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 cdf148d35..57186111c 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 8fe5d3027..85256c802 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 9f0ce4289..a8004e7c2 100755
--- a/tests/parallel-tests3.test
+++ b/tests/parallel-tests3.test
@@ -21,9 +21,8 @@ parallel_tests=yes
required=GNUmake
. ./defs || Exit 1
-# This test does not work well if $MAKE contains -j.
case $MAKE in
-*\ -j*) Exit 77 ;;
+ *\ -j*) skip_ "\$MAKE contains \`-j'";;
esac
cat >> configure.in << 'END'
@@ -36,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
@@ -79,4 +77,5 @@ do
$sleep
done
$sleep
+
:
diff --git a/tests/parallel-tests5.test b/tests/parallel-tests5.test
index 7d7184166..6b3e70b7a 100755
--- a/tests/parallel-tests5.test
+++ b/tests/parallel-tests5.test
@@ -21,7 +21,7 @@
# It merely serves as demonstration. :-)
parallel_tests=yes
-required=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
@@ -62,4 +62,5 @@ $AUTOMAKE -a
./configure
$MAKE -j4 check
$MAKE distcheck
+
:
diff --git a/tests/parallel-tests8.test b/tests/parallel-tests8.test
index d1d5b748a..84ac460cd 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 e6191d922..b06d36425 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 a418fc26e..9d6cc2dc5 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 418d24175..00283090e 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 e95023c94..b601672cf 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 947cf79bb..2b50e36d5 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 aef4c2f0b..62e9d3d81 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 0a8b1f388..2208d66ab 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 27453e0fe..1c4b0faf4 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 gcc'
+required='cc yacc'
. ./defs || Exit 1
cat >> configure.in <<'EOF'
diff --git a/tests/pr220.test b/tests/pr220.test
index 972f5aa3b..b068c1025 100755
--- a/tests/pr220.test
+++ b/tests/pr220.test
@@ -23,30 +23,22 @@
# to debug the problem.
# Note that this should be also in the documentation.
-required=gcc
. ./defs || Exit 1
-cat > main.c <<'EOF'
-int main() { 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,
+AC_ARG_ENABLE([foo],
[ --enable-foo Enable foo],
[ if test "foo" = "bar" ; then
- AM_CONDITIONAL(NEVER_TRUE, true)
+ AM_CONDITIONAL([NEVER_TRUE], [true])
else
- AM_CONDITIONAL(NEVER_TRUE, false)
+ AM_CONDITIONAL([NEVER_TRUE], [false])
fi
])
AC_OUTPUT
diff --git a/tests/pr224.test b/tests/pr224.test
index d8b7468e7..bf249352f 100755
--- a/tests/pr224.test
+++ b/tests/pr224.test
@@ -23,13 +23,16 @@
# `$(top_srcdir)/build', the location of the `.deps' directory
# should be `$(top_builddir)/bar/.deps'.
-required=gcc
+required=cc
. ./defs || Exit 1
mkdir foo
cat >foo/main.c <<'EOF'
-int main() { return 0; }
+int main (void)
+{
+ return 0;
+}
EOF
cat >Makefile.am <<'EOF'
diff --git a/tests/pr243.test b/tests/pr243.test
index 30b0d70a8..2b11fb704 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 c3fd5598e..cff6bcae1 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 33587022b..fc987f629 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 530f6c45a..c27c2be86 100755
--- a/tests/pr300-lib.test
+++ b/tests/pr300-lib.test
@@ -17,7 +17,7 @@
# Make sure that installing subdirectory libraries works.
# PR/300
-required=gcc
+required=cc
. ./defs || Exit 1
cat >> configure.in << 'END'
diff --git a/tests/pr300-ltlib.test b/tests/pr300-ltlib.test
index 1b3613682..43a1b8d34 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 gcc'
+required='cc libtoolize'
. ./defs || Exit 1
cat >> configure.in << 'END'
@@ -39,9 +39,6 @@ cat > a.c << 'END'
int i = 3;
END
-## A rule in the Makefile should create subdir
-# mkdir subdir
-
libtoolize
$ACLOCAL
$AUTOCONF
@@ -49,8 +46,11 @@ $AUTOMAKE --copy --add-missing
./configure --prefix "`pwd`/inst"
-$MAKE V=1 >stdout || { cat stdout; Exit 1; }
+# A rule in the Makefile should create subdir.
+test ! -d subdir
+$MAKE >stdout || { cat stdout; Exit 1; }
cat stdout
+test -d subdir
grep 'liba.la .*-rpath .*lib' stdout
grep 'liba.la .*-rpath .*lib/subdir' stdout && Exit 1
diff --git a/tests/pr300-prog.test b/tests/pr300-prog.test
index 63eef4117..7a2aa991b 100755
--- a/tests/pr300-prog.test
+++ b/tests/pr300-prog.test
@@ -18,7 +18,7 @@
# Make sure that installing subdirectory programs works.
# PR/300
-required=gcc
+required=cc
. ./defs || Exit 1
cat >> configure.in << 'END'
diff --git a/tests/pr401.test b/tests/pr401.test
index 35511a23a..b2f3c11d4 100755
--- a/tests/pr401.test
+++ b/tests/pr401.test
@@ -19,14 +19,13 @@
# (pr401b.test and pr401c.test do the same for LTLIBOBJS and ALLOCA)
parallel_tests=no
-required=gcc
+required=cc
. ./defs || Exit 1
mkdir lib src
cat >lib/feep.c <<'EOF'
-char *
-feep ()
+const char *feep (void)
{
return "feep";
}
@@ -35,10 +34,9 @@ EOF
cat >src/main.c <<'EOF'
#include <stdio.h>
-extern char *feep ();
+extern const char *feep (void);
-int
-main (int argc, char **argv)
+int main (void)
{
puts (feep ());
return 0;
@@ -54,6 +52,7 @@ AC_LIBOBJ([feep])
AC_LIBSOURCE([feep.c])
AC_PROG_RANLIB
AC_CONFIG_FILES([lib/Makefile src/Makefile])
+AM_CONDITIONAL([CROSS_COMPILING], [test $cross_compiling = yes])
AC_OUTPUT
EOF
@@ -75,7 +74,9 @@ cat >src/Makefile.am <<'EOF'
check_PROGRAMS = main
main_LDADD = ../lib/libfeep.a
+if !CROSS_COMPILING
TESTS = main
+endif
EOF
$ACLOCAL
@@ -133,7 +134,9 @@ libfeep_a_LIBADD = $(LIBOBJS)
check_PROGRAMS = main
main_LDADD = libfeep.a
+if !CROSS_COMPILING
TESTS = main
+endif
EOF
$ACLOCAL
@@ -165,7 +168,9 @@ check_PROGRAMS = src/main
src_main_SOURCES = src/main.c
src_main_LDADD = lib/libfeep.a
+if !CROSS_COMPILING
TESTS = src/main
+endif
check-local:
test -f src/main.$(OBJEXT)
diff --git a/tests/pr401b.test b/tests/pr401b.test
index 3997bc4b0..ccd5cbd4f 100755
--- a/tests/pr401b.test
+++ b/tests/pr401b.test
@@ -19,14 +19,13 @@
# (pr401.test and pr401c.test do the same for LIBOBJS and ALLOCA)
parallel_tests=no
-required='gcc libtoolize'
+required='cc libtoolize'
. ./defs || Exit 1
mkdir lib src
cat >lib/feep.c <<'EOF'
-char *
-feep ()
+const char *feep (void)
{
return "feep";
}
@@ -35,10 +34,9 @@ EOF
cat >src/main.c <<'EOF'
#include <stdio.h>
-extern char *feep ();
+extern const char *feep (void);
-int
-main (int argc, char **argv)
+int main (void)
{
puts (feep ());
return 0;
@@ -54,6 +52,7 @@ AC_LIBOBJ([feep])
AC_LIBSOURCE([feep.c])
AC_PROG_LIBTOOL
AC_CONFIG_FILES([lib/Makefile src/Makefile])
+AM_CONDITIONAL([CROSS_COMPILING], [test $cross_compiling = yes])
AC_OUTPUT
EOF
@@ -75,7 +74,9 @@ cat >src/Makefile.am <<'EOF'
check_PROGRAMS = main
main_LDADD = ../lib/libfeep.la
+if !CROSS_COMPILING
TESTS = main
+endif
EOF
libtoolize
@@ -85,10 +86,9 @@ $AUTOMAKE -a
./configure
$MAKE distcheck
-
-## ------------------------------------------ ##
-## Traditional LIBOBJS with LIBOBJDIR set. ##
-## ------------------------------------------ ##
+## ----------------------------------------- ##
+## Traditional LTLIBOBJS with LIBOBJDIR set. ##
+## ----------------------------------------- ##
# Invocation of AC_CONFIG_LIBOBJ_DIR may be necessary for reasons
# unrelated to Automake or Makefile.am layout.
@@ -134,7 +134,9 @@ libfeep_la_LIBADD = $(LTLIBOBJS)
check_PROGRAMS = main
main_LDADD = libfeep.la
+if !CROSS_COMPILING
TESTS = main
+endif
EOF
$ACLOCAL
@@ -166,7 +168,9 @@ check_PROGRAMS = src/main
src_main_SOURCES = src/main.c
src_main_LDADD = lib/libfeep.la
+if !CROSS_COMPILING
TESTS = src/main
+endif
check-local:
test -f src/main.$(OBJEXT)
diff --git a/tests/pr401c.test b/tests/pr401c.test
index 960de8383..0ab785ec1 100755
--- a/tests/pr401c.test
+++ b/tests/pr401c.test
@@ -19,7 +19,7 @@
# (pr401.test and pr401b.test do the same for LIBOBJS and LTLIBOBJS)
parallel_tests=no
-required=gcc
+required=cc
. ./defs || Exit 1
mkdir lib src
@@ -28,8 +28,7 @@ ac_cv_func_alloca_works=no
export ac_cv_func_alloca_works
cat >lib/alloca.c <<'EOF'
-char *
-feep ()
+const char *feep (void)
{
return "feep";
}
@@ -38,10 +37,9 @@ EOF
cat >src/main.c <<'EOF'
#include <stdio.h>
-extern char *feep ();
+extern const char *feep (void);
-int
-main (int argc, char **argv)
+int main (void)
{
puts (feep ());
return 0;
@@ -56,6 +54,7 @@ AC_PROG_CC
AC_PROG_RANLIB
AC_FUNC_ALLOCA
AC_CONFIG_FILES([lib/Makefile src/Makefile])
+AM_CONDITIONAL([CROSS_COMPILING], [test $cross_compiling = yes])
AC_OUTPUT
EOF
@@ -77,7 +76,9 @@ cat >src/Makefile.am <<'EOF'
check_PROGRAMS = main
main_LDADD = ../lib/libfeep.a
+if !CROSS_COMPILING
TESTS = main
+endif
EOF
$ACLOCAL
@@ -87,9 +88,9 @@ $AUTOMAKE
$MAKE distcheck
-## ------------------------------------------ ##
-## Traditional LIBOBJS with LIBOBJDIR set. ##
-## ------------------------------------------ ##
+## --------------------------------------- ##
+## Traditional ALLOCA with LIBOBJDIR set. ##
+## --------------------------------------- ##
# Invocation of AC_CONFIG_LIBOBJ_DIR may be necessary for reasons
# unrelated to Automake or Makefile.am layout.
@@ -136,7 +137,9 @@ libfeep_a_LIBADD = $(ALLOCA) $(LIBOBJS) # Add LIBOBJS for fun
check_PROGRAMS = main
main_LDADD = libfeep.a
+if !CROSS_COMPILING
TESTS = main
+endif
EOF
$ACLOCAL
@@ -168,7 +171,9 @@ check_PROGRAMS = src/main
src_main_SOURCES = src/main.c
src_main_LDADD = lib/libfeep.a
+if !CROSS_COMPILING
TESTS = src/main
+endif
check-local:
test -f src/main.$(OBJEXT)
diff --git a/tests/pr87.test b/tests/pr87.test
index 3c860bdcc..9c92c71d0 100755
--- a/tests/pr87.test
+++ b/tests/pr87.test
@@ -18,19 +18,22 @@
# Test for PR automake/87.
# "make distcheck" fails when two source dirs exist.
-required=gcc
+required=cc
. ./defs || Exit 1
subdirs="foo bar"
for i in $subdirs; do
mkdir $i
- cat >$i/$i.c <<EOF
-int main() { return 0; }
+ unindent >$i/$i.c <<EOF
+ int main (void)
+ {
+ return 0;
+ }
EOF
- cat >$i/Makefile.am <<EOF
-bin_PROGRAMS = $i
-${i}_SOURCES = $i.c
+ unindent >$i/Makefile.am <<EOF
+ bin_PROGRAMS = $i
+ ${i}_SOURCES = $i.c
EOF
done
@@ -43,10 +46,6 @@ AC_PROG_CC
AC_OUTPUT(Makefile `echo $subdirs | sed 's|\([a-z][a-z]*\)|\1/Makefile|g'`)
EOF
-# Ignore user CFLAGS.
-CFLAGS=
-export CFLAGS
-
mkdir build
$ACLOCAL
@@ -60,7 +59,7 @@ $AUTOMAKE -a
if test -z "$next"; then
Exit 1
else
- : # for shells with broken 'set -e'
+ : # For shells with broken 'set -e'.
fi
break
fi
diff --git a/tests/primary3.test b/tests/primary3.test
index 4340b0842..a7a915fbf 100755
--- a/tests/primary3.test
+++ b/tests/primary3.test
@@ -16,7 +16,7 @@
# Make sure we can build programs ending in `.la'
-required=gcc
+required=cc
. ./defs || Exit 1
cat >>configure.in <<EOF
diff --git a/tests/subst2.test b/tests/programs-primary-rewritten.test
index 1dbb5110a..e52bd569a 100755
--- a/tests/subst2.test
+++ b/tests/programs-primary-rewritten.test
@@ -14,38 +14,48 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Make sure a multi-line definition cannot be terminated by an empty
-# line (when there are @substitutions@ inside).
+# Make sure xxx_PROGRAMS gets properly rewritten where needed. These
+# checks have been introduced in commit `Release-1-9-254-g9d0eaef' into
+# the former test `subst2.test'.
+
. ./defs || Exit 1
cat >> configure.in << 'END'
-AC_PROG_CC
-AC_SUBST([ABCDEFGHIJKLMNOPQRSTUVWX])
-AC_SUBST([ABCDEFGHIJKLMNOPQRSTUVWXY])
-AC_SUBST([ABCDEFGHIJKLMNOPQRSTUVWXYZ])
+AC_SUBST([FOO], [c])
AC_OUTPUT
END
cat >Makefile.am <<'END'
-bin_PROGRAMS = x @ABCDEFGHIJKLMNOPQRSTUVWX@ @ABCDEFGHIJKLMNOPQRSTUVWXY@ @ABCDEFGHIJKLMNOPQRSTUVWXYZ@
+AUTOMAKE_OPTIONS = no-dependencies
+CC = false
+EXEEXT = .bin
+
+check_PROGRAMS = a
+bin_PROGRAMS = b @FOO@
+noinst_PROGRAMS = $(bar) $(baz:=de)
EXTRA_PROGRAMS =
-EXEEXT = .bin
+bar = zardoz
+baz = mau
-print-programs:
- @echo BEG: $(bin_PROGRAMS) :END
+.PHONY: test
+test:
+ test '$(check_PROGRAMS)' = a.bin
+ test '$(bin_PROGRAMS)' = 'b.bin c'
+ test '$(noinst_PROGRAMS)' = 'zardoz.bin maude.bin'
END
$ACLOCAL
-$AUTOCONF
$AUTOMAKE
+
+grep PROGRAMS Makefile.in # For debugging.
+
+# Check that no useless indirections are used.
+grep '^check_PROGRAMS = a$(EXEEXT)$' Makefile.in
+grep '^bin_PROGRAMS = b$(EXEEXT) @FOO@$' Makefile.in
+
+$AUTOCONF
./configure
-EXEEXT=.bin $MAKE print-programs >foo
-cat foo
-grep 'BEG: x.bin :END' foo
-EXEEXT=.bin am__empty=X $MAKE -e print-programs >foo
-cat foo
-grep 'BEG: x.bin X :END' foo
-
-# Test for another bug, where EXTRA_PROGRAMS was removed because it was empty.
-grep EXTRA_PROGRAMS Makefile.in
+$MAKE test
+
+:
diff --git a/tests/python-virtualenv.test b/tests/python-virtualenv.test
index 11055b0b3..c36c2b770 100755
--- a/tests/python-virtualenv.test
+++ b/tests/python-virtualenv.test
@@ -17,15 +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 || Exit 77
-test -f virtenv/bin/activate || Exit 77
+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 ff786914e..586ab5a2e 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-all-1.test b/tests/remake-all-1.test
new file mode 100755
index 000000000..670b46afb
--- /dev/null
+++ b/tests/remake-all-1.test
@@ -0,0 +1,67 @@
+#! /bin/sh
+# Copyright (C) 2010, 2011 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Check that the "all" target triggers rebuilt of outdated Makefiles.
+# See also sister test `remake-all-2.test'.
+
+. ./defs || Exit 1
+
+mkfile=Makefile
+
+magic1=::MagicStringOne::
+magic2=__MagicStringTwo__
+magic3=%%MagicStringThree%%
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([$mkfile sub/$mkfile])
+FOO='$magic1'
+AC_OUTPUT
+END
+
+mkdir sub
+echo SUBDIRS = sub > $mkfile.am
+: > sub/$mkfile.am
+
+$ACLOCAL
+$AUTOMAKE
+
+$EGREP "^all-am:.* $mkfile( |$)" $mkfile.in sub/$mkfile.in
+
+$AUTOCONF
+./configure
+
+$FGREP "$magic1" mkfile.in && Exit 1 # Sanity check.
+
+# Two code paths in configure.am:
+
+# - either a file in $(am__configure_deps) has been updated ...
+$sleep
+echo "AC_SUBST([FOO])" >> configure.in
+$MAKE
+$FGREP FOO $mkfile # For debugging.
+$FGREP $magic1 $mkfile
+
+# - ... or not; i.e., Makefile.am or an included file has.
+$sleep
+echo "# $magic2" >> $mkfile.am
+echo "# $magic3" >> sub/$mkfile.am
+$MAKE
+$FGREP $magic2 $mkfile
+$FGREP $magic3 sub/$mkfile
+
+:
diff --git a/tests/remake-all-2.test b/tests/remake-all-2.test
new file mode 100755
index 000000000..395ef6928
--- /dev/null
+++ b/tests/remake-all-2.test
@@ -0,0 +1,75 @@
+#! /bin/sh
+# Copyright (C) 2010, 2011 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Check that the "all" target triggers rebuilt of outdated makefiles.
+# This handle the case in which the makefiles are not called `Makefile'.
+# See also sister test `remake-all-1.test'.
+
+. ./defs || Exit 1
+
+mkfile=foobar
+
+magic1=::MagicStringOne::
+magic2=__MagicStringTwo__
+magic3=%%MagicStringThree%%
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([$mkfile sub/$mkfile])
+FOO='$magic1'
+AC_OUTPUT
+END
+
+mkdir sub
+
+cat > $mkfile.am <<END
+SUBDIRS = sub
+AM_MAKEFLAGS = -f $mkfile
+END
+
+cat > sub/$mkfile.am <<END
+AM_MAKEFLAGS = -f $mkfile
+END
+
+$ACLOCAL
+$AUTOMAKE
+
+$EGREP "^all-am:.* $mkfile( |$)" $mkfile.in sub/$mkfile.in
+
+$AUTOCONF
+./configure
+
+$FGREP "$magic1" mkfile.in && Exit 1 # Sanity check.
+
+# Two code paths in configure.am:
+
+# - either a file in $(am__configure_deps) has been updated ...
+$sleep
+echo "AC_SUBST([FOO])" >> configure.in
+$MAKE -f $mkfile
+$FGREP FOO $mkfile # For debugging.
+$FGREP $magic1 $mkfile
+
+# - ... or not; i.e., Makefile.am or an included file has.
+$sleep
+echo "# $magic2" >> $mkfile.am
+echo "# $magic3" >> sub/$mkfile.am
+$MAKE -f $mkfile
+$FGREP $magic2 $mkfile
+$FGREP $magic3 sub/$mkfile
+
+:
diff --git a/tests/remake-gnulib-add-acsubst.test b/tests/remake-gnulib-add-acsubst.test
index 74bd20282..6b3549fea 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 597a19afd..7b0110c71 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 c28a078b3..de5a2fa1b 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'
@@ -95,8 +96,9 @@ for vpath in : false; do
# Do not reject slow dependency extractors: we need dependency tracking.
$srcdir/configure --enable-dependency-tracking
- # Skip the test if dependency tracking couldn't be activated.
- $FGREP 'depmode=none' Makefile && Exit 77
+ if $FGREP 'depmode=none' Makefile; then
+ skip_ "automatic dependency tracking couldn't be activated"
+ fi
$MAKE
ls -l
diff --git a/tests/remake-renamed-m4-macro-and-file.test b/tests/remake-renamed-m4-macro-and-file.test
index beedb5844..3c1f86747 100755
--- a/tests/remake-renamed-m4-macro-and-file.test
+++ b/tests/remake-renamed-m4-macro-and-file.test
@@ -16,7 +16,7 @@
# Test remake rules when an m4 file gets renamed and *simultaneously*
# an m4 macro in it gets renamed. Kudos to Bruno Haible for thinking
-# about this situation.
+# about this situation. See also related test `acloca22.test'.
. ./defs || Exit 1
diff --git a/tests/remake10a.test b/tests/remake10a.test
index 7da457cc4..78b15b0e1 100755
--- a/tests/remake10a.test
+++ b/tests/remake10a.test
@@ -18,13 +18,18 @@
# configure.ac.
# Keep in sync with sister tests `remake10b.test' and `remake10c.test'.
-required=GNUmake
. ./defs || Exit 1
magic1=::MagicStringOne::
magic2=__MagicStringTwo__
magic3=%%MagicStringThree%%
+if using_gmake; then
+ remake="$MAKE nil"
+else
+ remake="$MAKE Makefile"
+fi
+
cat >> configure.in <<END
m4_include([foo.m4])
AC_SUBST([FINGERPRINT], [my_fingerprint])
@@ -63,13 +68,13 @@ for vpath in : false; do
$sleep
echo "m4_define([my_fingerprint], [$magic1])" > $top_srcdir/foo.m4
- $MAKE nil
+ $remake
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile
$sleep
echo "m4_define([my_fingerprint], [$magic2])" > $top_srcdir/foo.m4
- $MAKE nil
+ $remake
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile && Exit 1
$FGREP $magic2 Makefile
@@ -77,7 +82,7 @@ for vpath in : false; do
$sleep
echo "m4_include([bar.m4])" > $top_srcdir/foo.m4
echo "m4_define([my_fingerprint], [$magic3])" > $top_srcdir/bar.m4
- $MAKE nil
+ $remake
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile && Exit 1
$FGREP $magic2 Makefile && Exit 1
@@ -85,13 +90,14 @@ for vpath in : false; do
$sleep
echo "m4_define([my_fingerprint], [$magic1])" > $top_srcdir/bar.m4
- $MAKE nil
+ $remake
$FGREP $magic2 Makefile && Exit 1
$FGREP $magic3 Makefile && Exit 1
$FGREP $magic1 Makefile
$sleep
echo "m4_define([my_fingerprint], [DummyValue])" > $top_srcdir/foo.m4
+ using_gmake || $remake
$MAKE distcheck
$FGREP $magic1 Makefile && Exit 1 # sanity check
$FGREP $magic2 Makefile && Exit 1 # likewise
diff --git a/tests/remake10b.test b/tests/remake10b.test
index 0672fc9a4..2c193cd20 100755
--- a/tests/remake10b.test
+++ b/tests/remake10b.test
@@ -18,13 +18,18 @@
# Makefile.am.
# Keep in sync with sister tests `remake10a.test' and `remake10c.test'.
-required=GNUmake
. ./defs || Exit 1
magic1=::MagicStringOne::
magic2=__MagicStringTwo__
magic3=%%MagicStringThree%%
+if using_gmake; then
+ remake="$MAKE nil"
+else
+ remake="$MAKE Makefile"
+fi
+
cat >> configure.in <<'END'
AC_OUTPUT
END
@@ -62,13 +67,13 @@ for vpath in : false; do
$sleep
echo "FINGERPRINT = $magic1" > $top_srcdir/foo.am
- $MAKE nil
+ $remake
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile
$sleep
echo "FINGERPRINT = $magic2" > $top_srcdir/foo.am
- $MAKE nil
+ $remake
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile && Exit 1
$FGREP $magic2 Makefile
@@ -76,7 +81,7 @@ for vpath in : false; do
$sleep
echo 'include $(top_srcdir)/bar.am' > $top_srcdir/foo.am
echo "FINGERPRINT = $magic3" > $top_srcdir/bar.am
- $MAKE nil
+ $remake
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile && Exit 1
$FGREP $magic2 Makefile && Exit 1
@@ -84,13 +89,14 @@ for vpath in : false; do
$sleep
echo "FINGERPRINT = $magic1" > $top_srcdir/bar.am
- $MAKE nil
+ $remake
$FGREP $magic2 Makefile && Exit 1
$FGREP $magic3 Makefile && Exit 1
$FGREP $magic1 Makefile
$sleep
echo "FINGERPRINT = DummyValue" > $top_srcdir/foo.am
+ using_gmake || $remake
$MAKE distcheck
$FGREP $magic1 Makefile && Exit 1 # sanity check
$FGREP $magic2 Makefile && Exit 1 # likewise
diff --git a/tests/remake10c.test b/tests/remake10c.test
index 9b9aca97d..d20c1e8a3 100755
--- a/tests/remake10c.test
+++ b/tests/remake10c.test
@@ -18,13 +18,18 @@
# aclocal.m4.
# Keep in sync with sister tests `remake10a.test' and `remake10b.test'.
-required=GNUmake
. ./defs || Exit 1
magic1=::MagicStringOne::
magic2=__MagicStringTwo__
magic3=%%MagicStringThree%%
+if using_gmake; then
+ remake="$MAKE nil"
+else
+ remake="$MAKE Makefile"
+fi
+
cat >> configure.in <<END
FINGERPRINT='my_fingerprint'
AC_SUBST([FINGERPRINT])
@@ -65,13 +70,13 @@ for vpath in : false; do
$sleep
echo "AC_DEFUN([my_fingerprint], [$magic1])" > $top_srcdir/m4/foo.m4
- $MAKE nil
+ $remake
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile
$sleep
echo "AC_DEFUN([my_fingerprint], [$magic2])" > $top_srcdir/m4/foo.m4
- $MAKE nil
+ $remake
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile && Exit 1
$FGREP $magic2 Makefile
@@ -79,7 +84,7 @@ for vpath in : false; do
$sleep
echo "m4_include([m4/bar.m4])" > $top_srcdir/m4/foo.m4
echo "AC_DEFUN([my_fingerprint], [$magic3])" > $top_srcdir/m4/bar.m4
- $MAKE nil
+ $remake
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile && Exit 1
$FGREP $magic2 Makefile && Exit 1
@@ -87,7 +92,7 @@ for vpath in : false; do
$sleep
echo "AC_DEFUN([my_fingerprint], [$magic1])" > $top_srcdir/m4/bar.m4
- $MAKE nil
+ $remake
$FGREP $magic2 Makefile && Exit 1
$FGREP $magic3 Makefile && Exit 1
$FGREP $magic1 Makefile
@@ -95,7 +100,7 @@ for vpath in : false; do
$sleep
echo "AC_DEFUN([my_fingerprint], [DummyValue])" > $top_srcdir/m4/foo.m4
echo "AC_DEFUN([AM_UNUSED], [NoSuchMacro])" > $top_srcdir/m4/bar.m4
- $MAKE nil # required to work around limitation of GNU make 3.82
+ using_gmake || $remake
$MAKE distcheck
$FGREP $magic1 Makefile && Exit 1 # sanity check
$FGREP $magic2 Makefile && Exit 1 # likewise
diff --git a/tests/remake12.test b/tests/remake12.test
index fe14885b7..d6c1ef20f 100755
--- a/tests/remake12.test
+++ b/tests/remake12.test
@@ -17,13 +17,27 @@
# Test basic remake rules for Makefiles with non-default names
# and/or with multiple sources.
-required=GNUmake
. ./defs || Exit 1
magic1=::MagicStringOne::
magic2=__MagicStringTwo__
magic3=%%MagicStringThree%%
+# See if the user's make implementation support an include directive.
+# We need it in this test.
+echo 'all:; @echo include is supported' > incl.mk
+echo 'include incl.mk' > gnu-style.mk
+echo '.include "incl.mk"' > bsd-style.mk
+if $MAKE -f gnu-style.mk | grep 'include is supported'; then
+ echo "$me: GNU make include style supported"
+ include_zardoz='include zardoz'
+elif $MAKE -f bsd-style.mk | grep 'include is supported'; then
+ echo "$me: BSD make include style supported"
+ include_zardoz='.include "zardoz"'
+else
+ skip_ "make doesn't support any \"include\" directive"
+fi
+
cat > configure.in <<END
AC_INIT([$me], [1.0])
AM_INIT_AUTOMAKE
@@ -38,7 +52,7 @@ EXTRA_DIST = Makefile
END
cat > Makefile <<END
-include zardoz
+$include_zardoz
nil:
.PHONY: nil
END
@@ -49,7 +63,11 @@ $AUTOMAKE
./configure
-$MAKE nil
+if using_gmake; then
+ $MAKE nil
+else
+ $MAKE Makefile
+fi
grep '^#H:' zardoz.in # for debugging
$FGREP $magic1 zardoz
$FGREP $magic1 zardoz.in
@@ -84,7 +102,11 @@ check-local: my-check
END
mv -f t zardoz.am
cat zardoz.am # for debugging
-$MAKE nil
+if using_gmake; then
+ $MAKE nil
+else
+ $MAKE zardoz
+fi
$FGREP my-check zardoz # sanity check
$FGREP $magic1 zardoz zardoz.in && Exit 1
$FGREP $magic2 zardoz
@@ -101,6 +123,7 @@ sed '/^#H:/d' zardoz.am > quux.am
echo 'FOO = dummy' >> quux.am
echo 'BAR = $(BAZ)' > top.in
echo "BAZ = $magic3" > bot.in
+is_gmake || $MAKE zardoz
$MAKE test
$FGREP my-check zardoz # sanity check
$FGREP $magic3 quux.in && Exit 1
@@ -110,11 +133,14 @@ $FGREP $magic2 zardoz && Exit 1
# After the remake above, the files `zardoz.am' and `zardoz.in'
# should be no more needed
echo 'endif' > zardoz.am # put in syntax error
+is_gmake || $MAKE zardoz
$MAKE test
rm -f zardoz.in zardoz.am # get rid of them
+is_gmake || $MAKE zardoz
$MAKE test
echo 'FOO = $(BAR)' >> quux.am
+is_gmake || $MAKE zardoz
$MAKE distcheck
:
diff --git a/tests/remake1a.test b/tests/remake1a.test
index a794a058e..fc5ba6d07 100755
--- a/tests/remake1a.test
+++ b/tests/remake1a.test
@@ -17,7 +17,6 @@
# Make sure remaking rules in subdir are correctly generated.
# See also sister "grepping" test `remake.test'.
-required=GNUmake
. ./defs || Exit 1
fingerprint='=/FiNgErPrInT/='
diff --git a/tests/remake5.test b/tests/remake5.test
index d3bfc1060..2c4571f20 100755
--- a/tests/remake5.test
+++ b/tests/remake5.test
@@ -18,9 +18,14 @@
# but not all.
# Report from Ralf Corsepius.
-required=GNUmake
. ./defs || Exit 1
+if using_gmake; then
+ remake="$MAKE"
+else
+ remake="$MAKE Makefile"
+fi
+
cat >>configure.in <<'EOF'
AM_MAINTAINER_MODE
m4_include([foo.m4])
@@ -46,12 +51,12 @@ $MAKE
# tools are set to false.)
$sleep
touch aclocal.m4 Makefile.am configure.in foo.m4
-$MAKE
+$remake
# Make sure the rebuild rule for Makefile is triggered.
$sleep
echo '# GrEpMe' >>Makefile.in
-$MAKE
+$remake
grep GrEpMe Makefile
# Make sure the rebuild rule for config.status is triggered.
@@ -59,14 +64,14 @@ $sleep
grep 'AUTOCONF.*=.*false' Makefile
: > rebuild_ok
./configure --no-create
-$MAKE
+$remake
grep 'AUTOCONF.*=.*false' Makefile && Exit 1
# Make sure rebuild rules do work if --enable-maintainer-mode is given.
./configure --enable-maintainer-mode
$sleep
echo 'AC_SUBST([YIPPY_YIPPY_YEAH])' >foo.m4
-$MAKE
+$remake
grep YIPPY_YIPPY_YEAH Makefile
# Try the distribution, for completeness.
diff --git a/tests/remake8a.test b/tests/remake8a.test
index c625e32cd..10a6c5a4b 100755
--- a/tests/remake8a.test
+++ b/tests/remake8a.test
@@ -21,7 +21,6 @@
# Keep this in sync with sister test `remake8b.test', which performs the
# same checks for a VPATH build.
-required=GNUmake
. ./defs || Exit 1
mv -f configure.in configure.stub
@@ -71,6 +70,7 @@ check-local:
CLEANFILES = bar
END
+using_gmake || $MAKE Makefile
$MAKE
cat bar
grep '!Baz!' bar
@@ -84,7 +84,6 @@ rm -f bar
$sleep
cat > $srcdir/Makefile.am <<'END'
-all-local: quux
check-local:
cat quux
grep '!Zardoz!' quux
@@ -102,6 +101,7 @@ cat > $srcdir/quux.in <<'END'
!@QUUX@!
END
+using_gmake || $MAKE Makefile
$MAKE
cat quux
grep '!Zardoz!' quux
@@ -119,7 +119,6 @@ mkdir $srcdir/m4
cat > $srcdir/Makefile.am <<'END'
ACLOCAL_AMFLAGS = -I m4
-all-local: quux
check-local:
cat quux
grep '%Foo%' quux
diff --git a/tests/remake8b.test b/tests/remake8b.test
index 86f0f8e86..461940ce1 100755
--- a/tests/remake8b.test
+++ b/tests/remake8b.test
@@ -21,7 +21,6 @@
# Keep this in sync with sister test `remake8a.test', which performs the
# same checks for a in-tree build.
-required=GNUmake
. ./defs || Exit 1
mv -f configure.in configure.stub
@@ -73,6 +72,7 @@ check-local:
CLEANFILES = bar
END
+using_gmake || $MAKE Makefile
$MAKE
cat bar
grep '!Baz!' bar
@@ -86,7 +86,6 @@ rm -f bar
$sleep
cat > $srcdir/Makefile.am <<'END'
-all-local: quux
check-local:
cat quux
grep '!Zardoz!' quux
@@ -104,6 +103,7 @@ cat > $srcdir/quux.in <<'END'
!@QUUX@!
END
+using_gmake || $MAKE Makefile
$MAKE
cat quux
grep '!Zardoz!' quux
@@ -121,7 +121,6 @@ mkdir $srcdir/m4
cat > $srcdir/Makefile.am <<'END'
ACLOCAL_AMFLAGS = -I m4
-all-local: quux
check-local:
cat quux
grep '%Foo%' quux
diff --git a/tests/remake9a.test b/tests/remake9a.test
index d46f31742..9139b461e 100755
--- a/tests/remake9a.test
+++ b/tests/remake9a.test
@@ -17,12 +17,17 @@
# Test remake rules when configure.in or its prerequisites change.
# Keep in sync with the other sister tests `remake9*.test'.
-required=GNUmake
. ./defs || Exit 1
magic1=::MagicStringOne::
magic2=__MagicStringTwo__
+if using_gmake; then
+ remake_() { $MAKE nil; }
+else
+ remake_() { $MAKE Makefile && $MAKE foo.sh; }
+fi
+
cat >> configure.in <<END
FINGERPRINT=BadBadBad
AC_SUBST([FINGERPRINT])
@@ -73,7 +78,7 @@ for vpath in : false; do
$sleep
sed "s/^\\(FINGERPRINT\\)=.*/\\1=$magic1/" $srcdir/configure.in >t
mv -f t $srcdir/configure.in
- $MAKE nil
+ remake_
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile
test x"`./foo.sh`" = x"$magic1"
@@ -81,7 +86,7 @@ for vpath in : false; do
$sleep
echo 'sed "s/^\\(FINGERPRINT\\)=.*/\\1='$magic2'/"' \
> $srcdir/tweak-configure-in
- $MAKE nil
+ remake_
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile && Exit 1
$FGREP $magic2 Makefile
@@ -91,6 +96,7 @@ for vpath in : false; do
echo cat > $srcdir/tweak-configure-in # no-op again
sed "s/^\\(FINGERPRINT\\)=.*/\\1=DummyValue/" $srcdir/configure.in >t
mv -f t $srcdir/configure.in
+ using_gmake || remake_
$MAKE distcheck
$FGREP $magic1 Makefile && Exit 1 # sanity check
$FGREP $magic2 Makefile && Exit 1 # likewise
diff --git a/tests/remake9b.test b/tests/remake9b.test
index 680ce9abc..6c650c4eb 100755
--- a/tests/remake9b.test
+++ b/tests/remake9b.test
@@ -17,9 +17,14 @@
# Test remake rules when Makefile.am or its prerequisites change.
# Keep in sync with the other sister tests `remake9*.test'.
-required=GNUmake
. ./defs || Exit 1
+if using_gmake; then
+ remake_() { $MAKE nil; }
+else
+ remake_() { $MAKE Makefile && $MAKE foo.sh; }
+fi
+
magic1=::MagicStringOne::
magic2=__MagicStringTwo__
@@ -75,7 +80,7 @@ for vpath in : false; do
$sleep
sed "s/^\\(FINGERPRINT\\) *=.*/\\1 = $magic1/" $srcdir/Makefile.am >t
mv -f t $srcdir/Makefile.am
- $MAKE nil
+ remake_
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile
test x"`./foo.sh`" = x"$magic1"
@@ -83,7 +88,7 @@ for vpath in : false; do
$sleep
echo 'sed "s/^\\(FINGERPRINT\\) *=.*/\\1 = '$magic2'/"' \
> $srcdir/tweak-makefile-am
- $MAKE nil
+ remake_
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile && Exit 1
$FGREP $magic2 Makefile
@@ -93,6 +98,7 @@ for vpath in : false; do
echo cat > $srcdir/tweak-makefile-am # no-op again
sed "s/^\\(FINGERPRINT\\) *=.*/\\1 = DummyValue/" $srcdir/Makefile.am >t
mv -f t $srcdir/Makefile.am
+ using_gmake || remake_
$MAKE distcheck
$FGREP $magic1 Makefile && Exit 1 # sanity check
$FGREP $magic2 Makefile && Exit 1 # likewise
diff --git a/tests/remake9c.test b/tests/remake9c.test
index 3328bebcf..6186bfb3f 100755
--- a/tests/remake9c.test
+++ b/tests/remake9c.test
@@ -17,12 +17,17 @@
# Test remake rules when acinclude.m4 or its prerequisites change.
# Keep in sync with the other sister tests `remake9*.test'.
-required=GNUmake
. ./defs || Exit 1
magic1=::MagicStringOne::
magic2=__MagicStringTwo__
+if using_gmake; then
+ remake_() { $MAKE nil; }
+else
+ remake_() { $MAKE Makefile && $MAKE foo.sh; }
+fi
+
cat >> configure.in <<END
FINGERPRINT='my_fingerprint'
AC_SUBST([FINGERPRINT])
@@ -77,7 +82,7 @@ for vpath in : false; do
$sleep
echo "AC_DEFUN([my_fingerprint], [$magic1])" > $srcdir/acinclude.m4
- $MAKE nil
+ remake_
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile
test x"`./foo.sh`" = x"$magic1"
@@ -85,7 +90,7 @@ for vpath in : false; do
$sleep
echo "echo 'AC_DEFUN([my_fingerprint], [$magic2])'" \
> $srcdir/tweak-acinclude-m4
- $MAKE nil
+ remake_
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile && Exit 1
$FGREP $magic2 Makefile
@@ -94,6 +99,7 @@ for vpath in : false; do
$sleep
echo : > $srcdir/tweak-acinclude-m4 # no-op again
echo "AC_DEFUN([my_fingerprint], [DummyValue])" > $srcdir/acinclude.m4
+ using_gmake || remake_
$MAKE distcheck
$FGREP $magic1 Makefile && Exit 1 # sanity check
$FGREP $magic2 Makefile && Exit 1 # likewise
diff --git a/tests/remake9d.test b/tests/remake9d.test
index ecb93d96a..b18db2a05 100755
--- a/tests/remake9d.test
+++ b/tests/remake9d.test
@@ -17,12 +17,17 @@
# Test remake rules when aclocal.m4 or its prerequisites change.
# Keep in sync with the other sister tests `remake9*.test'.
-required=GNUmake
. ./defs || Exit 1
magic1=::MagicStringOne::
magic2=__MagicStringTwo__
+if using_gmake; then
+ remake_() { $MAKE nil; }
+else
+ remake_() { $MAKE Makefile && $MAKE foo.sh; }
+fi
+
cat >> configure.in <<END
FINGERPRINT='my_fingerprint'
AC_SUBST([FINGERPRINT])
@@ -77,7 +82,7 @@ for vpath in : false; do
$sleep
echo "AC_DEFUN([my_fingerprint], [$magic1])dnl %%%" >> $srcdir/aclocal.m4
- $MAKE nil
+ remake_
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile
test x"`./foo.sh`" = x"$magic1"
@@ -85,7 +90,7 @@ for vpath in : false; do
$sleep
echo "sed 's/.*dnl *%%%.*/AC_DEFUN([my_fingerprint], [$magic2])/'" \
> $srcdir/tweak-aclocal-m4
- $MAKE nil
+ remake_
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile && Exit 1
$FGREP $magic2 Makefile
@@ -94,6 +99,7 @@ for vpath in : false; do
$sleep
echo cat > $srcdir/tweak-aclocal-m4 # no-op again
echo 'AC_DEFUN([my_fingerprint], [DummyValue])' >> $srcdir/aclocal.m4
+ using_gmake || remake_
$MAKE distcheck
$FGREP $magic1 Makefile && Exit 1 # sanity check
$FGREP $magic2 Makefile && Exit 1 # likewise
diff --git a/tests/repeated-options.test b/tests/repeated-options.test
index c3c2e29a9..4667d0d63 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-cleanup.test b/tests/self-check-cleanup.test
index 945194fb7..17859e9f3 100755
--- a/tests/self-check-cleanup.test
+++ b/tests/self-check-cleanup.test
@@ -27,6 +27,7 @@ fi
# 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 .
have_symlinks=false
diff --git a/tests/self-check-exit.test b/tests/self-check-exit.test
index 73f3ea5f9..f8c533401 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 000000000..15bf2d9bc
--- /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/self-check-report.test b/tests/self-check-report.test
index 639319ab8..e04c88ec3 100755
--- a/tests/self-check-report.test
+++ b/tests/self-check-report.test
@@ -18,6 +18,8 @@
# Test subroutines to report warnings, and to signal failures, skips
# and hard errors.
+unset stderr_fileno_ || :
+
. ./defs || Exit 1
set +e
diff --git a/tests/silent-lex-gcc.test b/tests/silent-lex-gcc.test
index a55f35802..2a691c314 100755
--- a/tests/silent-lex-gcc.test
+++ b/tests/silent-lex-gcc.test
@@ -55,6 +55,15 @@ cat > foo.l <<'EOF'
"END" return EOF;
.
%%
+/* Avoid possible link errors. */
+int yywrap (void)
+{
+ return 0;
+}
+int main (void)
+{
+ return 0;
+}
EOF
cp foo.l sub/bar.l
diff --git a/tests/silent-lex-generic.test b/tests/silent-lex-generic.test
index a61969827..bc3ffffae 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
@@ -55,6 +55,15 @@ cat > foo.l <<'EOF'
"END" return EOF;
.
%%
+/* Avoid possible link errors. */
+int yywrap (void)
+{
+ return 0;
+}
+int main (void)
+{
+ return 0;
+}
EOF
cp foo.l sub/bar.l
diff --git a/tests/silent-many-gcc.test b/tests/silent-many-gcc.test
index 62dafa196..8cdb35b9f 100755
--- a/tests/silent-many-gcc.test
+++ b/tests/silent-many-gcc.test
@@ -158,6 +158,11 @@ cat > foo5.l <<'EOF'
"END" return EOF;
.
%%
+/* Avoid possible link errors. */
+int yywrap (void)
+{
+ return 0;
+}
EOF
cat > foo6.y <<'EOF'
%{
@@ -180,11 +185,18 @@ $ACLOCAL
$AUTOMAKE --add-missing
$AUTOCONF
+# Sanity check: make sure the cache variables we force are really
+# used by configure.
+$FGREP am_cv_CC_dependencies_compiler_type configure
+$FGREP am_cv_CXX_dependencies_compiler_type configure
+
# Force gcc ("fast") depmode.
+depmodes="am_cv_CC_dependencies_compiler_type=gcc \
+ am_cv_CXX_dependencies_compiler_type=gcc"
# This apparently useless "for" loop is here to simplify the syncing
-# with sister test `silent-many-gcc.test'.
+# with sister test `silent-many-generic.test'.
for config_args in \
- am_cv_CC_dependencies_compiler_type=gcc
+ "$depmodes"
do
./configure $config_args --enable-silent-rules
diff --git a/tests/silent-many-generic.test b/tests/silent-many-generic.test
index b8864793e..7d615acb5 100755
--- a/tests/silent-many-generic.test
+++ b/tests/silent-many-generic.test
@@ -22,8 +22,7 @@
# 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'
+required='cc c++ fortran fortran77 flex yacc'
. ./defs || Exit 1
# Avoids too much code duplication.
@@ -160,6 +159,11 @@ cat > foo5.l <<'EOF'
"END" return EOF;
.
%%
+/* Avoid possible link errors. */
+int yywrap (void)
+{
+ return 0;
+}
EOF
cat > foo6.y <<'EOF'
%{
diff --git a/tests/silent-yacc-generic.test b/tests/silent-yacc-generic.test
index 76a290f48..657991130 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 f590347ef..b958727f9 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 c0a9192cd..24edaf754 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 cb62136e2..62c4d893b 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
new file mode 100755
index 000000000..55f296d0a
--- /dev/null
+++ b/tests/silentcxx-gcc.test
@@ -0,0 +1,109 @@
+#!/bin/sh
+# Copyright (C) 2010, 2011 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Check silent-rules mode for C++.
+# 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
+
+cat >>configure.in <<'EOF'
+AM_SILENT_RULES
+AC_PROG_CXX
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+EOF
+
+cat > Makefile.am <<'EOF'
+# Need generic and non-generic rules.
+bin_PROGRAMS = foo1 foo2
+foo1_SOURCES = foo.cpp baz.cxx quux.cc
+foo2_SOURCES = $(foo1_SOURCES)
+foo2_CXXFLAGS = $(AM_CXXFLAGS)
+SUBDIRS = sub
+EOF
+
+cat > sub/Makefile.am <<'EOF'
+AUTOMAKE_OPTIONS = subdir-objects
+# Need generic and non-generic rules.
+bin_PROGRAMS = bar1 bar2
+bar1_SOURCES = bar.cpp
+bar2_SOURCES = $(bar1_SOURCES)
+bar2_CXXFLAGS = $(AM_CXXFLAGS)
+EOF
+
+cat > foo.cpp <<'EOF'
+using namespace std; /* C compilers fail on this. */
+int main() { return 0; }
+EOF
+
+# let's try out other extensions too
+echo 'class Baz { public: int i; };' > baz.cxx
+echo 'class Quux { public: bool b; };' > quux.cc
+
+cp foo.cpp sub/bar.cpp
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+# Sanity check: make sure the cache variable we force is really used
+# by configure.
+$FGREP am_cv_CXX_dependencies_compiler_type configure
+
+# Force gcc ("fast") depmode.
+# This apparently useless "for" loop is here to simplify the syncing
+# with sister test `silentcxx.test'.
+for config_args in \
+ am_cv_CXX_dependencies_compiler_type=gcc
+do
+ ./configure $config_args --enable-silent-rules
+ $MAKE >stdout || { cat stdout; Exit 1; }
+ cat stdout
+
+ $EGREP ' (-c|-o)' stdout && Exit 1
+ grep 'mv ' stdout && Exit 1
+
+ grep 'CXX .*foo\.' stdout
+ grep 'CXX .*baz\.' stdout
+ grep 'CXX .*quux\.' stdout
+ grep 'CXX .*bar\.' stdout
+ grep 'CXXLD .*foo1' stdout
+ grep 'CXXLD .*bar1' stdout
+ grep 'CXXLD .*foo2' stdout
+ grep 'CXXLD .*bar2' stdout
+
+ # Ensure a clean rebuild.
+ $MAKE clean
+
+ $MAKE V=1 >stdout || { cat stdout; Exit 1; }
+ cat stdout
+
+ grep ' -c ' stdout
+ grep ' -o ' stdout
+
+ $EGREP '(CC|CXX|LD) ' stdout && Exit 1
+
+ # Ensure a clean reconfiguration/rebuild.
+ $MAKE clean
+ $MAKE maintainer-clean
+
+done
+
+:
diff --git a/tests/silentcxx.test b/tests/silentcxx.test
index 14d61ca58..14825db24 100755
--- a/tests/silentcxx.test
+++ b/tests/silentcxx.test
@@ -15,8 +15,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Check silent-rules mode for C++.
+# This test should work with generic C++ compilers; keep it in sync with
+# sister test `silentcxx-gcc.test', which requires the GNU C++ compiler
+# and forces the use of gcc depmode.
-required='g++' # FIXME: any decent C++ compiler should be OK
+required=c++
. ./defs || Exit 1
mkdir sub
@@ -47,7 +50,7 @@ bar2_CXXFLAGS = $(AM_CXXFLAGS)
EOF
cat > foo.cpp <<'EOF'
-using namespace std; /* C compilers fail on this */
+using namespace std; /* C compilers fail on this. */
int main() { return 0; }
EOF
@@ -61,11 +64,15 @@ $ACLOCAL
$AUTOMAKE --add-missing
$AUTOCONF
-# configure once for fastdep, once for non-fastdep, once for nodep
+# Sanity check: make sure the cache variable we force is really used
+# by configure.
+$FGREP am_cv_CXX_dependencies_compiler_type configure
+
+# Force dependency tracking explicitly, so that slow dependency
+# extractors are not rejected. Try also with dependency tracking
+# explicitly disabled.
for config_args in \
- '' \
- am_cv_CC_dependencies_compiler_type=gcc \
- --disable-dependency-tracking
+ --enable-dependency-tracking --disable-dependency-tracking
do
./configure $config_args --enable-silent-rules
$MAKE >stdout || { cat stdout; Exit 1; }
diff --git a/tests/silentf77.test b/tests/silentf77.test
index 75d5777b2..90a8208a3 100755
--- a/tests/silentf77.test
+++ b/tests/silentf77.test
@@ -17,7 +17,7 @@
# Check silent-rules mode for Fortran 77.
# Keep this ins sync with the sister test silentf90.test.
-required='gfortran' # FIXME: any working Fortran compiler should be OK!
+required=fortran77
. ./defs || Exit 1
mkdir sub
diff --git a/tests/silentf90.test b/tests/silentf90.test
index c85f78f7c..6a561756e 100755
--- a/tests/silentf90.test
+++ b/tests/silentf90.test
@@ -17,7 +17,7 @@
# Check silent-rules mode for Fortran 90.
# Keep this ins sync with the sister test silentf77.test.
-required='gfortran' # FIXME: any working Fortran compiler should be OK!
+required=fortran
. ./defs || Exit 1
mkdir sub
diff --git a/tests/specflg10.test b/tests/specflg10.test
index 45753b20f..eaac391c9 100755
--- a/tests/specflg10.test
+++ b/tests/specflg10.test
@@ -16,7 +16,7 @@
# AM_DEFAULT_SOURCE_EXT
-required=g++
+required='cc c++'
. ./defs || Exit 1
cat >> configure.in << 'END'
diff --git a/tests/specflg7.test b/tests/specflg7.test
index 6d422bf9d..60c1a9d4c 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=gcc
+required='cc native'
. ./defs || Exit 1
cat >> configure.in << 'END'
@@ -59,3 +59,5 @@ $MAKE
./false | grep false
test -f ./t-false.o
test -f ./f-false.o
+
+:
diff --git a/tests/specflg8.test b/tests/specflg8.test
index 1defd0bef..f46224a50 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=gcc
+required='cc native'
. ./defs || Exit 1
cat >> configure.in << 'END'
@@ -62,3 +62,5 @@ $AUTOMAKE -a
$MAKE
./true | grep true
./false | grep false
+
+:
diff --git a/tests/stdinc.test b/tests/stdinc.test
index 2b619d854..1a0b48572 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 c63af43ea..84ae5e9f7 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 01f66f186..9e1c5ffe1 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 5f6f163d3..51e04d5a1 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 60730cbe8..42c9ad6dc 100755
--- a/tests/subdir5.test
+++ b/tests/subdir5.test
@@ -23,32 +23,18 @@
# This test assumes that the `make' utility is able to start
# over and reload Makefiles which have been remade (a non-POSIX feature).
# See also the related test subdir8.test.
-required='GNUmake gcc'
+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 98146ba50..dc13c2b55 100755
--- a/tests/subdir8.test
+++ b/tests/subdir8.test
@@ -23,12 +23,10 @@
# This test assumes that the `make' utility is able to start
# over and reload Makefiles which have been remade (a non-POSIX feature).
# See also the related test subdir5.test.
-required='GNUmake gcc'
+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 18cacd91d..5401f97e7 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 fc674b83c..60ad5a51b 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 5ba999c1e..bb08beb27 100755
--- a/tests/subobj3.test
+++ b/tests/subobj3.test
@@ -15,9 +15,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Test of subdir objects with C++.
+# Test of subdir objects with ansi2knr.
-required=gcc
+required='cc native'
. ./defs || Exit 1
cat > configure.in << END
@@ -50,12 +50,6 @@ main (int argc, char *argv[])
}
END
-# Ignore user CFLAGS.
-CFLAGS=
-export CFLAGS
-
-# We use gcc and not gcc -traditional as the latter fails on some
-# Linux boxes (Red Hat 5.1 in particular).
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
diff --git a/tests/subobj5.test b/tests/subobj5.test
index 1b05db39a..00402db44 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 48a0f2d87..fff515174 100755
--- a/tests/subobj6.test
+++ b/tests/subobj6.test
@@ -18,7 +18,7 @@
# Test of subdir make distclean rules.
# From Robert Collins
-required=gcc
+required=cc
. ./defs || Exit 1
cat >> configure.in << 'END'
diff --git a/tests/subobj9.test b/tests/subobj9.test
index a910d22d5..9bab174a1 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 g++'
+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 || Exit 77
+./configure
# Ensure './libtool --help' will use the right tool versions.
export AUTOCONF AUTOMAKE
diff --git a/tests/subpkg.test b/tests/subpkg.test
index 481cbb478..5987ac3d5 100755
--- a/tests/subpkg.test
+++ b/tests/subpkg.test
@@ -17,7 +17,7 @@
# Check subpackage handling.
-required='gcc yacc'
+required='cc yacc'
. ./defs || Exit 1
mkdir m4
@@ -52,10 +52,9 @@ ACLOCAL_AMFLAGS = -I m4
EOF
cat >LDADD.c <<'EOF'
-int lib ();
+int lib (void);
-int
-main ()
+int main (void)
{
return lib ();
}
@@ -102,7 +101,7 @@ cp lib/foo.y lib/bar.y
cat >lib/src/x.c <<'EOF'
#include <config.h>
-int lib ()
+int lib (void)
{
return 0;
}
@@ -125,3 +124,5 @@ $MAKE
$MAKE distcheck
test ! -d subpack-1 # make sure distcheck cleans up after itself
test -f subpack-1.tar.gz
+
+:
diff --git a/tests/subst-no-trailing-empty-line.test b/tests/subst-no-trailing-empty-line.test
new file mode 100755
index 000000000..595644eb4
--- /dev/null
+++ b/tests/subst-no-trailing-empty-line.test
@@ -0,0 +1,89 @@
+#! /bin/sh
+# Copyright (C) 2003, 2006, 2011 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# If the last line of a automake-rewritten definition is made only of
+# @substitutions@, automake should take care of appending an empty
+# variable to make sure that line cannot end up substituted as a blank
+# line (that would confuse HP-UX Make).
+# These checks have been introduced in commit `Release-1-9-254-g9d0eaef'
+# into the former test `subst2.test'.
+
+. ./defs || Exit 1
+
+v1=ABCDEFGHIJKLMNOPQRSTUVWX
+v2=ABCDEFGHIJKLMNOPQRSTUVWXY
+v3=ABCDEFGHIJKLMNOPQRSTUVWXYZ
+bs='\\' # Literal backslash for grep.
+
+cat >> configure.in <<END
+AC_SUBST([A], [''])
+# These are deliberately quite long, so that the xxx_PROGRAMS definition
+# in Makefile.am below will be split on multiple lines, with the last
+# line
+AC_SUBST([$v1], [''])
+AC_SUBST([$v2], [''])
+AC_SUBST([$v3], [''])
+AC_OUTPUT
+END
+
+cat >Makefile.am <<END
+AUTOMAKE_OPTIONS = no-dependencies
+CC = false
+EXEEXT =
+
+noinst_PROGRAMS = x @$v1@ @$v2@ @$v3@
+bin_PROGRAMS = @A@ mu @$v2@ @$v3@
+check_PROGRAMS = zardoz \$(noinst_PROGRAMS)
+
+## Required whenever there are @substituted@ values in the
+## PROGRAMS primary, otherwise automake will complain.
+EXTRA_PROGRAMS =
+
+print-programs:
+ @echo BEG1: \$(noinst_PROGRAMS) :END1
+ @echo BEG2: \$(bin_PROGRAMS) :END2
+ @echo BEG3: \$(check_PROGRAMS) :END3
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+$EGREP -n 'ABCD|am__empty' Makefile.in # For debugging,
+# Sanity check.
+test `$EGREP -c "^[ $tab]*@$v2@ @$v3@[ $tab]*$bs?$" Makefile.in` -eq 2
+
+./configure
+{
+ sed -n '/^noinst_PROGRAMS =/,/[^\\]$/p' Makefile
+ sed -n '/^bin_PROGRAMS =/,/[^\\]$/p' Makefile
+ sed -n '/^check_PROGRAMS =/,/[^\\]$/p' Makefile
+} >t-programs
+cat t-programs
+grep '^ *$' t-programs && Exit 1
+
+$MAKE print-programs >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep '^BEG1: x :END1$' stdout
+grep '^BEG2: mu :END2$' stdout
+grep '^BEG3: zardoz x :END3$' stdout
+
+am__empty=X $MAKE -e print-programs >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep '^BEG1: x X :END1$' stdout
+grep '^BEG2: mu X :END2$' stdout
+grep '^BEG3: zardoz x X :END3$' stdout
+
+:
diff --git a/tests/subst3.test b/tests/subst3.test
index c1b2dfc35..d87f7440f 100755
--- a/tests/subst3.test
+++ b/tests/subst3.test
@@ -17,7 +17,7 @@
# Test installation with substitutions. This test is based on nobase.test.
-required='gcc'
+required=cc
. ./defs || Exit 1
cat >> configure.in <<'EOF'
@@ -173,3 +173,5 @@ test `find inst/foo -type f -print | wc -l` = 0
$MAKE
$MAKE test-install-nothing-data
$MAKE test-install-nothing-exec
+
+:
diff --git a/tests/substre2.test b/tests/substre2.test
index c8ffd38c6..ec920627b 100755
--- a/tests/substre2.test
+++ b/tests/substre2.test
@@ -17,7 +17,7 @@
# Test for bug in variable substitution references, where
# undefined variables break later substitutions.
-required=gcc
+required=cc
. ./defs || Exit 1
cat >> configure.in << 'END'
diff --git a/tests/substref.test b/tests/substref.test
index 12f72e351..47f4d410b 100755
--- a/tests/substref.test
+++ b/tests/substref.test
@@ -18,7 +18,7 @@
# pattern is null.
# Report from Richard Boulton
-required=gcc
+required=cc
. ./defs || Exit 1
cat >> configure.in << 'END'
@@ -30,24 +30,14 @@ cat > hello.c << 'END'
END
cat > Makefile.am << 'END'
-
var1 = dlmain
-
var2 = $(var1:=.)
-
helldl_SOURCES = $(var2:=c)
-
bin_PROGRAMS = helldl
-
got:
@echo $(helldl_SOURCES) $(helldl_OBJECTS) >got
-
END
-# Ignore user CFLAGS.
-CFLAGS=
-export CFLAGS
-
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
diff --git a/tests/suffix10.test b/tests/suffix10.test
index 026da2430..bd870f381 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 daeba1c2c..c53e2565f 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 a515f41bd..c14b84268 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 228d04ad1..542f89288 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 e0c01f618..70385feae 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 60417e46e..e9d733d86 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 <misiek@pld.ORG.PL>.
-required=libtool
+required='cc libtool'
. ./defs || Exit 1
cat >> configure.in << 'END'
diff --git a/tests/suffix8.test b/tests/suffix8.test
index 921c6419e..27ac88467 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/symlink2.test b/tests/symlink2.test
index f2a9b4552..413c60cb4 100755
--- a/tests/symlink2.test
+++ b/tests/symlink2.test
@@ -20,10 +20,7 @@
. ./defs || Exit 1
rm -f install-sh
-ln -s Zardoz install-sh || {
- echo "$me: cannot create broken symlinks" >&2
- Exit 77
-}
+ln -s Zardoz install-sh || skip_ "cannot create broken symlinks"
: > Makefile.am
diff --git a/tests/tar.test b/tests/tar.test
index 3dcf7ba90..22fdcb96f 100755
--- a/tests/tar.test
+++ b/tests/tar.test
@@ -32,7 +32,9 @@ $AUTOCONF
$AUTOMAKE
./configure
-grep 'am__tar.*false' Makefile && Exit 77
+if grep 'am__tar.*false' Makefile; then
+ skip_ "cannot find proper archiver program"
+fi
$MAKE distcheck
test -f tar-1.0.tar.gz
diff --git a/tests/tar2.test b/tests/tar2.test
index 987ff403e..205a37ec4 100755
--- a/tests/tar2.test
+++ b/tests/tar2.test
@@ -32,7 +32,9 @@ $AUTOCONF
$AUTOMAKE
./configure
-grep 'am__tar.*false' Makefile && Exit 77
+if grep 'am__tar.*false' Makefile; then
+ skip_ "cannot find proper archiver program"
+fi
$MAKE distcheck
test -f tar2-1.0.tar.gz
diff --git a/tests/target-cflags.test b/tests/target-cflags.test
index 352808efa..cbb5e3338 100755
--- a/tests/target-cflags.test
+++ b/tests/target-cflags.test
@@ -18,7 +18,7 @@
# Test to make sure target specific CFLAGS work
# Assar Westerlund <assar@sics.se>
-required=gcc
+required=cc
. ./defs || Exit 1
cat >> configure.in << 'END'
@@ -37,7 +37,8 @@ END
cat > foo.c << 'END'
#include <stdio.h>
#ifdef FOO
-int main(void) {
+int main(void)
+{
return 0;
}
#endif
@@ -60,13 +61,17 @@ mkdir build
cd build
../configure
$MAKE
-./foo
-./bar
+if cross_compiling; then :; else
+ ./foo
+ ./bar
+fi
cd ..
./configure
$MAKE
-./foo
-./bar
+if cross_compiling; then :; else
+ ./foo
+ ./bar
+fi
:
diff --git a/tests/targetclash.test b/tests/targetclash.test
index 22a1ad331..c712fd5c7 100755
--- a/tests/targetclash.test
+++ b/tests/targetclash.test
@@ -16,7 +16,6 @@
# Check that target clashes are diagnosed.
-required=gcc
. ./defs || Exit 1
cat >> configure.in << 'END'
diff --git a/tests/transform.test b/tests/transform.test
index 04e8d53a5..fb1550397 100755
--- a/tests/transform.test
+++ b/tests/transform.test
@@ -17,7 +17,7 @@
# Make sure that --program-transform works.
-required=gcc
+required=cc
. ./defs || Exit 1
cat >>configure.in <<'END'
@@ -30,6 +30,7 @@ bin_PROGRAMS = h
bin_SCRIPTS = h.sh
man_MANS = h.1
+.PHONY: test-install
test-install: install
test -f inst/bin/gnu-h$(EXEEXT)
test -f inst/bin/gnu-h.sh
@@ -37,8 +38,7 @@ test-install: install
EOF
cat >h.c <<'EOF'
-int
-main ()
+int main (void)
{
return 0;
}
@@ -62,3 +62,5 @@ rm -rf inst
$MAKE installdirs
test -d inst/bin
test -d inst/man/man1
+
+:
diff --git a/tests/transform2.test b/tests/transform2.test
index d6411d2b5..010ca4013 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/txinfo21.test b/tests/txinfo21.test
index eea48904f..339011a17 100755
--- a/tests/txinfo21.test
+++ b/tests/txinfo21.test
@@ -149,7 +149,7 @@ test ! -f share/txinfo21/dvi/main.dvi
test ! -f share/txinfo21/dvi/main2.dvi
test ! -f share/txinfo21/dvi/main3.dvi
-(dvips --help 2>/dev/null >/dev/null) || Exit 77
+dvips --help || skip_ "dvips is missing"
$MAKE install-ps
test -f share/txinfo21/ps/main.ps
@@ -160,8 +160,8 @@ test ! -f share/txinfo21/ps/main.ps
test ! -f share/txinfo21/ps/main2.ps
test ! -f share/txinfo21/ps/main3.ps
-(pdfetex --help 2>/dev/null >/dev/null) ||
- (pdftex --help 2>/dev/null >/dev/null) || Exit 77
+pdfetex --help || pdftex --help \
+ || skip_ "pdftex and pdfetex are both missing"
$MAKE install-pdf
test -f share/txinfo21/pdf/main.pdf
diff --git a/tests/txinfo26.test b/tests/txinfo26.test
index ba935518d..20a708f12 100755
--- a/tests/txinfo26.test
+++ b/tests/txinfo26.test
@@ -46,9 +46,9 @@ $AUTOCONF
$MAKE
$MAKE distclean
-# We do not require this to work with a directory that contains white space.
case `pwd` in
- *\ * | *\ *) Exit 77;;
+ *\ * | *\ *)
+ skip_ "this test might fail in a directory containing white spaces";;
esac
mkdir build
diff --git a/tests/upc.test b/tests/upc.test
index ad072bf66..547aa79f4 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 4692398b1..3c2acfda7 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/vala2.test b/tests/vala2.test
index d5308e35b..d020c5883 100755
--- a/tests/vala2.test
+++ b/tests/vala2.test
@@ -64,7 +64,7 @@ $ACLOCAL
$AUTOCONF
$AUTOMAKE -a
-./configure || Exit 77
+./configure || skip_ "configure failure"
$MAKE
# test rebuild rules
diff --git a/tests/vala3.test b/tests/vala3.test
index 2d9c85c33..8de96d667 100755
--- a/tests/vala3.test
+++ b/tests/vala3.test
@@ -58,7 +58,7 @@ $ACLOCAL
$AUTOCONF
$AUTOMAKE -a
-./configure || Exit 77
+./configure || skip_ "configure failure"
$MAKE
$MAKE distcheck
$MAKE distclean
@@ -88,7 +88,7 @@ $ACLOCAL
$AUTOCONF
$AUTOMAKE -a
-./configure || Exit 77
+./configure || skip_ "configure failure"
$MAKE
$MAKE distcheck
$MAKE distclean
diff --git a/tests/vala4.test b/tests/vala4.test
index acd4f7ee9..a7e6a7114 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/vala5.test b/tests/vala5.test
index d6ff62954..66cffe70a 100755
--- a/tests/vala5.test
+++ b/tests/vala5.test
@@ -67,6 +67,7 @@ $ACLOCAL
$AUTOCONF
$AUTOMAKE -a
-./configure || Exit 77
+./configure || skip_ "configuration step failure"
$MAKE
+:
diff --git a/tests/vtexi4.test b/tests/vtexi4.test
index b6d970ad1..2bdcc35df 100755
--- a/tests/vtexi4.test
+++ b/tests/vtexi4.test
@@ -32,14 +32,11 @@ $date_is_posix \
&& day=`LC_ALL=C date '+%d'` && test -n "$day" \
&& month=`LC_ALL=C date '+%B'` && test -n "$month" \
&& year=`LC_ALL=C date '+%Y'`&& test -n "$year" \
- || { echo "$me: 'date' is not POSIX-compliant enough"; Exit 77; }
+ || skip_ "'date' is not POSIX-compliant enough"
day=`echo "$day" | sed 's/^0//'`
-# This test requires a grep program that can work on non-text input.
-(echo 'x' | grep x) || {
- echo "$me: grep doesn't work on input that is not pure text" >&2
- Exit 77
-}
+(echo 'x' | grep x) \
+ || skip_ "grep doesn't work on input that is not pure text"
cat > configure.in << END
AC_INIT([$me], [123.456])
@@ -102,7 +99,7 @@ $AUTOMAKE -a
./configure
$MAKE all dvi
-# debugging & sanity checks
+# Debugging & sanity checks.
ls -l
cat version.texi
cat foo.info
diff --git a/tests/yacc-basic.test b/tests/yacc-basic.test
index 351b409fc..6ce8256a3 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'
@@ -59,8 +59,10 @@ $MAKE
# like an "intermediate file" in the GNU make sense).
test -f parse.c
-echo a | ./foo
-echo b | ./foo && Exit 1
+if cross_compiling; then :; else
+ echo a | ./foo
+ echo b | ./foo && Exit 1
+fi
# The generated file `parse.c' must be shipped.
$MAKE echo-distcom
diff --git a/tests/yacc-clean.test b/tests/yacc-clean.test
index a05e5f23d..f97e18245 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 015c44cec..e705f06c6 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 401998ec0..2e38529c0 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 7961a5f69..acdba6aa4 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 c55f40035..83f63dd03 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 06376ec4c..eee210e8d 100755
--- a/tests/yacc4.test
+++ b/tests/yacc4.test
@@ -16,7 +16,7 @@
# Some simple tests of ylwrap functionality.
-required='yacc gcc'
+required='cc yacc'
. ./defs || Exit 1
cat >> configure.in << 'END'
@@ -44,7 +44,7 @@ END
# Second parser.
cat > bar.y << 'END'
%{
-int yylex () {return 0;}
+int yylex () { return 0; }
void yyerror (char *s) {}
%}
%%
@@ -52,7 +52,10 @@ fubar : 'f' 'o' 'o' 'b' 'a' 'r' {};
END
cat > foo.c << 'END'
-int main () { return 0; }
+int main (void)
+{
+ return 0;
+}
END
$ACLOCAL
diff --git a/tests/yacc7.test b/tests/yacc7.test
index 5cea7afc5..0bd0b64d2 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 fecd54b07..c7cedc72f 100755
--- a/tests/yacc8.test
+++ b/tests/yacc8.test
@@ -17,7 +17,7 @@
# Test for subdir parsers.
-required="gcc yacc"
+required='cc yacc'
. ./defs || Exit 1
diff --git a/tests/yaccdry.test b/tests/yaccdry.test
index f30e7f3f2..fed10d38b 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 c998373c6..aaebcaa40 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 aecff9fa7..accebe351 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 dd3b2dea3..a5b3599fb 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 b76b529ea..cf30f4666 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 aac198661..bf5611d3e 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 fe0d4b31f..8e17d08da 100755
--- a/tests/yflags2.test
+++ b/tests/yflags2.test
@@ -19,7 +19,6 @@
# Please keep this in sync with the sister tests yflags.test, lflags.test
# and lflags2.test
-required=g++ # FIXME: any working C++ compiler should be OK
. ./defs || Exit 1
cat >fake-yacc <<'END'
@@ -34,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++
@@ -54,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++
: