From: Stefano Lattarini Date: Sat, 27 Oct 2012 15:52:35 +0000 (+0200) Subject: Merge branch 'master' into ng/master X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0dd85e069d595f169d2e41c98762a6395632c3fb;p=thirdparty%2Fautomake.git Merge branch 'master' into ng/master * master: tests: remove spurious leftover use of 'Exit' tests: remove an obsolete, and probably now wrong, comment tests: remove obsolescent references to './defs' tests: prefer including 'test-init.sh' rather than './defs' Signed-off-by: Stefano Lattarini --- 0dd85e069d595f169d2e41c98762a6395632c3fb diff --cc t/amopts-variable-expansion.sh index a11f57633,d63b5f0fa..44812210e --- a/t/amopts-variable-expansion.sh +++ b/t/amopts-variable-expansion.sh @@@ -16,8 -16,7 +16,8 @@@ # Check that AUTOMAKE_OPTIONS support variable expansion. +am_create_testdir=empty - . ./defs || exit 1 + . test-init.sh # We want complete control over automake options. AUTOMAKE=$am_original_AUTOMAKE diff --cc t/autodist-configure-no-subdir.sh index dbb62c9d5,8fd325beb..bdecc62b2 --- a/t/autodist-configure-no-subdir.sh +++ b/t/autodist-configure-no-subdir.sh @@@ -14,11 -14,11 +14,11 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Check that 'configure', 'configure.ac' and 'configure.in' are *not* -# automatically distributed when placed in a subdirectory. +# Check that 'configure' and 'configure.ac' are *not* automatically +# distributed when placed in a subdirectory. # Related to automake bug#7819. - . ./defs || exit 1 + . test-init.sh cat >> configure.ac < # -# Backported to improve coverage of mainline Automake. - . ./defs || exit 1 -required=GNUmake + . test-init.sh echo AC_OUTPUT >> configure.ac diff --cc t/ccnoco2.sh index e97558b86,523018224..72a2e9231 --- a/t/ccnoco2.sh +++ b/t/ccnoco2.sh @@@ -15,12 -15,11 +15,12 @@@ # along with this program. If not, see . # Make sure Automake requires AM_PROG_CC_C_O when either per-targets -# flags or subdir-objects are used. +# flags or subdir objects are used. - . ./defs || exit 1 + . test-init.sh cat >>configure.ac <. -# Look for a bug where FreeBSD make in concurrent mode reported success -# even when the Automake-generated parallel testsuite harness failed. +# Look for a bug where make in concurrent mode reported success even +# when the Automake-generated parallel testsuite harness failed. +# This issue was originally present only with FreeBSD make, but we +# keep the test anyway, for extra safety. # See automake bug#9245. - . ./defs || exit 1 + . test-init.sh cat >> configure.ac << 'END' AC_OUTPUT diff --cc t/cond30.sh index da954ed6d,09ea343d5..75125690c --- a/t/cond30.sh +++ b/t/cond30.sh @@@ -14,16 -14,13 +14,16 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# For PR/352: make sure we support bin_PROGRAMS being defined conditionally. +# For PR/352: make sure we support bin_PROGRAMS, lib_LIBRARIES and +# lib_LTLIBRARIES being defined conditionally. - . ./defs || exit 1 + . test-init.sh cat >>configure.ac <<'EOF' -AM_CONDITIONAL([C1], [test -z "$two"]) -AM_CONDITIONAL([C2], [test -n "$two"]) +m4_define([AM_PROG_AR], [:]) +AM_PROG_AR +AM_CONDITIONAL([C1], [test x"$two" != x"yes"]) +AM_CONDITIONAL([C2], [test x"$two" = x"yes"]) AC_OUTPUT EOF diff --cc t/conffile-leading-dot.sh index 2146183f9,acdbc1f53..b55b98708 --- a/t/conffile-leading-dot.sh +++ b/t/conffile-leading-dot.sh @@@ -18,7 -18,8 +18,7 @@@ # with a dot (like "./Makefile"), since the remake rules might be subtly # broken in that case. - . ./defs || exit 1 -required=GNUmake + . test-init.sh cat > configure.ac << END AC_INIT([$me], [1.0]) diff --cc t/confh4.sh index 9331fcb16,65c03c548..16dbf2c4f --- a/t/confh4.sh +++ b/t/confh4.sh @@@ -21,60 -21,27 +21,60 @@@ # > How-To-Repeat: # Use AM_CONFIG_HEADER(subdir/config.h) to place configuration # header in subdirectory and observe that it is not included. +# Also check that our preprocessing code is smart enough not to pass +# repeated '-I' options on the compiler command line. - . ./defs || exit 1 + . test-init.sh cat >> configure.ac << 'END' -AC_CONFIG_FILES([include/Makefile]) +AC_CONFIG_FILES([include/Makefile sub/Makefile]) AC_CONFIG_HEADERS([include/config.h]) -AC_PROG_CC +AC_PROG_FGREP +AC_OUTPUT END -cat > Makefile.am << 'END' +mkdir include sub +: > include/config.h.in + +cat > c-defs.am << 'END' +## To bring in the definition of AM_DEFAULT_INCLUDES +CC = who-cares +AUTOMAKE_OPTIONS = no-dependencies bin_PROGRAMS = foo -foo_SOURCES = foo.c END -mkdir include -: > include/Makefile.am -: > include/config.h.in +cat > Makefile.am << 'END' +include $(top_srcdir)/c-defs.am +.PHONY: test-default-includes +test-default-includes: + echo ' ' $(AM_DEFAULT_INCLUDES) ' ' \ + | $(FGREP) ' -I$(top_builddir)/include ' +END + +cp Makefile.am sub + +cat > include/Makefile.am << 'END' +include $(top_srcdir)/c-defs.am +.PHONY: test-default-includes +test-default-includes: + echo ' ' $(AM_DEFAULT_INCLUDES) ' ' | $(FGREP) ' -I. ' + case ' $(AM_DEFAULT_INCLUDES) ' in \ + *'$(top_builddir)'*) exit 1;; \ + *include*) exit 1;; \ + *-I.*-I.*) exit 1;; \ + *' -I. ') exit 0;; \ + *) exit 1;; \ + esac +END $ACLOCAL +$AUTOCONF $AUTOMAKE -grep '^ *DEFAULT_INCLUDES *=.* -I\$(top_builddir)/include' Makefile.in +./configure + +$MAKE test-default-includes +$MAKE -C sub test-default-includes +$MAKE -C include test-default-includes : diff --cc t/conflnk2.sh index e9d00e0af,66b1a49f3..8271f38b0 --- a/t/conflnk2.sh +++ b/t/conflnk2.sh @@@ -17,9 -17,20 +17,9 @@@ # Test to make sure that sources for links created by AC_CONFIG_LINKS # are distributed. - . ./defs || exit 1 + . test-init.sh -cat > Makefile.am << 'END' -SUBDIRS = sdir -.PHONY: test -test: distdir - test -f $(distdir)/src - test -f $(distdir)/src2 - test -f $(distdir)/sdir/src3 - test -f $(distdir)/sdir-no-make/src4 - test 2 -gt `find $(distdir)/sdir -type d | wc -l` - test 2 -gt `find $(distdir)/sdir-no-make -type d | wc -l` - test 4 -gt `find $(distdir) -type d | wc -l` -END +echo SUBDIRS = sdir > Makefile.am : > src : > src2 diff --cc t/dist-formats.tap index 5737227e6,6f217133f..50b0e43a3 --- a/t/dist-formats.tap +++ b/t/dist-formats.tap @@@ -17,13 -17,16 +17,13 @@@ # Check support for different compression formats used by distribution # archives. - . ./defs || exit 1 -am_create_testdir=empty + . test-init.sh -plan_ 70 +plan_ 18 -# ---------------------------------------------------- # -# Common and/or auxiliary subroutines and variables. # -# ---------------------------------------------------- # - -ocwd=$(pwd) || fatal_ "getting current working directory" +# -------------------------------------- # +# Auxiliary subroutines and variables. # +# -------------------------------------- # TAR='' && unset TAR diff --cc t/dist-obsolete-opts.sh index 06bea8d91,46015ed4f..8e5e846a8 --- a/t/dist-obsolete-opts.sh +++ b/t/dist-obsolete-opts.sh @@@ -14,31 -14,28 +14,31 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Check support for no-dist-gzip with lzma. +# Obsolete 'dist-*' and 'no-dist-gzip' options. - . ./defs || exit 1 + . test-init.sh -errmsg='support for lzma.*removed' +$ACLOCAL -echo AUTOMAKE_OPTIONS = dist-lzma > Makefile.am -$ACLOCAL --force -AUTOMAKE_fails -Wnone -Wno-error -grep "^Makefile\\.am:1:.*$errmsg" stderr +for fmt in gzip bzip2 xz lzip zip tarZ lzma shar; do + echo AUTOMAKE_OPTIONS = dist-$fmt > Makefile.am + AUTOMAKE_fails -Wnone -Wno-error + grep "^Makefile\\.am:1:.* 'dist-$fmt' option.* no more supported" stderr + grep "^Makefile\\.am:1:.* use AM_DIST_FORMATS .*instead" stderr +done + +rm -rf autom4te*.cache cat > configure.ac << 'END' -AC_INIT([lzma], [1.0]) -AM_INIT_AUTOMAKE([no-dist-gzip dist-lzma]) +AC_INIT([foo], [1.0]) +AM_INIT_AUTOMAKE([no-dist-gzip dist-xz]) AC_CONFIG_FILES([Makefile]) -AC_OUTPUT END : > Makefile.am - -rm -rf autom4te*.cache $ACLOCAL AUTOMAKE_fails -Wnone -Wno-error -grep "^configure\\.ac:2:.*$errmsg" stderr +grep "^configure\\.ac:2:.* 'no-dist-gzip' option.* no more supported" stderr +grep "^configure\\.ac:2:.* 'dist-xz' option.* no more supported" stderr +grep "^configure\\.ac:2:.*use AM_DIST_FORMATS .*instead" stderr : diff --cc t/distcom-subdir.sh index 3774a7523,b0cbf12de..9b2f7f49d --- a/t/distcom-subdir.sh +++ b/t/distcom-subdir.sh @@@ -17,8 -17,7 +17,8 @@@ # Test to make sure that if an auxfile (here depcomp) is required # by a subdir Makefile.am, it is distributed by that Makefile.am. +required=cc - . ./defs || exit 1 + . test-init.sh cat >> configure.ac << 'END' AC_CONFIG_FILES([subdir/Makefile]) diff --cc t/distcom3.sh index b1fcd8b85,35dc73908..ead374ffa --- a/t/distcom3.sh +++ b/t/distcom3.sh @@@ -17,10 -17,8 +17,10 @@@ # Test to make sure that non-existing common files are distributed # if they are buildable. - . ./defs || exit 1 + . test-init.sh +echo AC_OUTPUT >> configure.ac + cat > Makefile.am << 'END' README: echo 'I bet you are reading me.' > README diff --cc t/distcom5.sh index 23b48e8e0,29ea76c09..43753bc2f --- a/t/distcom5.sh +++ b/t/distcom5.sh @@@ -19,8 -19,23 +19,8 @@@ # a Makefile in that directory. 'distcom4.sh' performs the same # test without Makefile in the directory. - . ./defs || exit 1 + . test-init.sh -extract_distcommon () -{ - sed -n -e '/^DIST_COMMON =.*\\$/ { - :loop - p - n - t clear - :clear - s/\\$/\\/ - t loop - p - n - }' -e '/^DIST_COMMON =/ p' ${1+"$@"} -} - cat >> configure.ac << 'END' AC_CONFIG_FILES([tests/autoconf:tests/wrapper.in], [chmod +x tests/autoconf]) diff --cc t/distdir.sh index 0f46625c9,d4694fbc8..f586f1d81 --- a/t/distdir.sh +++ b/t/distdir.sh @@@ -14,12 -14,14 +14,12 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Test to make sure subdirs in EXTRA_DIST work. Also tests to make -# sure *srcdir is properly handled. Note that using './', as in -# EXTRA_DIST = ./joe -# does not work portably: it fails with HP-UX and Tru64 make. -# Also test DISTFILES containing a directory and a file in it, -# and repeated directories. +# Test to make sure subdirs in EXTRA_DIST work. +# Also tests to make sure *srcdir is properly handled. +# Also test the situation where the list of distributed files contains +# a directory and a file in it, and repeated directories. - . ./defs || exit 1 + . test-init.sh cat >> configure.ac << 'END' AC_OUTPUT diff --cc t/dollar.sh index 214345b96,642c07fe0..430537b45 --- a/t/dollar.sh +++ b/t/dollar.sh @@@ -18,7 -18,10 +18,7 @@@ # Java people need this. # PR/317, reported by Eric Siegerman and Philip Fong. - . ./defs || exit 1 -# Require GNU make for this test. SunOS Make does not support -# '$$' in a target or a dependency (it outputs the empty string instead). -required=GNUmake + . test-init.sh echo AC_OUTPUT >> configure.ac diff --cc t/exeext4.sh index acb16cc23,bd455e092..600655bef --- a/t/exeext4.sh +++ b/t/exeext4.sh @@@ -17,8 -17,8 +17,8 @@@ # Make sure $(EXEEXT) is appended to programs and to tests that are # programs, but not to @substitutions@. -# For gen-testsuite-part: ==> try-with-serial-tests <== +am_serial_tests=yes - . ./defs || exit 1 + . test-init.sh cat >> configure.ac << 'END' AM_CONDITIONAL([COND], [test -n "$cond"]) diff --cc t/extra10.sh index f12b076b2,bd49d3c58..293241470 --- a/t/extra10.sh +++ b/t/extra10.sh @@@ -19,7 -19,8 +19,7 @@@ # See also sister test 'extra11.sh', that checks a similar usage # with the involvement of the $(wildcard) GNU make builtin. - . ./defs || exit 1 -required=GNUmake + . test-init.sh echo AC_OUTPUT >> configure.ac diff --cc t/extra11.sh index 3f97e6bd6,6d42d8df2..3cea106a0 --- a/t/extra11.sh +++ b/t/extra11.sh @@@ -17,7 -17,8 +17,7 @@@ # Check for more complex usage of wildcards in EXTRA_DIST. # Suggested by observations from Braden McDaniel. - . ./defs || exit 1 -required=GNUmake + . test-init.sh echo AC_OUTPUT >> configure.ac diff --cc t/extra12.sh index 67fa1fe4e,0dc817c62..21278fda2 --- a/t/extra12.sh +++ b/t/extra12.sh @@@ -18,7 -18,8 +18,7 @@@ # $srcdir != $builddir, if properly declared. # Suggested by observations from Braden McDaniel. - . ./defs || exit 1 -required=GNUmake + . test-init.sh echo AC_OUTPUT >> configure.ac diff --cc t/flavor.sh index 058e55fe2,383c5c7ab..0085e997f --- a/t/flavor.sh +++ b/t/flavor.sh @@@ -18,9 -18,10 +18,9 @@@ # options like '--ignore-deps' and '--silent-rules' are preserved across # automake reruns. - . ./defs || exit 1 + . test-init.sh cat >> configure.ac << 'END' -AM_MAINTAINER_MODE AC_OUTPUT END diff --cc t/fort2.sh index 6afa5032d,b6c2ead60..68ae86acc --- a/t/fort2.sh +++ b/t/fort2.sh @@@ -19,8 -19,7 +19,8 @@@ # Cf. 'fort1.sh' and 'link_f90_only.sh'. +required=gfortran # Required only in order to run ./configure. - . ./defs || exit 1 + . test-init.sh mkdir sub diff --cc t/gcj.sh index 849302413,f0a389750..885db3c88 --- a/t/gcj.sh +++ b/t/gcj.sh @@@ -16,15 -16,11 +16,15 @@@ # Test of compiled java. +required='gcc gcj' - . ./defs || exit 1 + . test-init.sh cat >> configure.ac << 'END' -_AM_DEPENDENCIES([GCJ]) -AC_SUBST([GCJ]) +# FIXME: AM_PROG_GCJ should cause OBJEXT and EXEEXT to be set, but +# FIXME: it currently does not. See also xfailing test 'gcj6.sh'. +AC_PROG_CC +AM_PROG_GCJ +AC_OUTPUT END cat > Makefile.am << 'END' diff --cc t/gettext-config-rpath.sh index 613ee8276,d73eaec5f..987c02fcc --- a/t/gettext-config-rpath.sh +++ b/t/gettext-config-rpath.sh @@@ -14,15 -14,17 +14,15 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Check to make sure we recognize a Makefile.in, even if post-processed -# and renamed. +# Check the config.rpath requirement. -required=cc +required='gettext' - . ./defs || exit 1 + . test-init.sh -cat >configure.ac <> configure.ac << 'END' +AM_GNU_GETTEXT +# config.rpath is required by versions >= 0.14.3. +AM_GNU_GETTEXT_VERSION([0.14.3]) AC_OUTPUT END diff --cc t/gettext-pr381.sh index 1bb6320f1,d1f116259..75e2ba859 --- a/t/gettext-pr381.sh +++ b/t/gettext-pr381.sh @@@ -14,32 -14,28 +14,32 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Make sure libtool is removed. -# Report from Kevin Dalley. +# Automake gettext support: regression check for PR/381: +# 'SUBDIRS = po intl' must not be required if 'po/' doesn't exist. -required=libtool +required='gettext' - . ./defs || exit 1 + . test-init.sh cat >> configure.ac << 'END' -AC_LIBTOOL_DLOPEN -AC_DISABLE_SHARED -AC_PROG_LIBTOOL -AC_SUBST([LIBTOOL_DEPS]) +AM_GNU_GETTEXT +AC_OUTPUT END -: > Makefile.am +$ACLOCAL -: > ltmain.sh : > config.guess +: > config.rpath : > config.sub -$ACLOCAL +test ! -d po # Sanity check. +mkdir sub +echo 'SUBDIRS = sub' > Makefile.am $AUTOMAKE -grep 'rm -f libtool' Makefile.in +# Still, SUBDIRS must be defined. + +: > Makefile.am +AUTOMAKE_fails +grep '^configure\.ac:.*AM_GNU_GETTEXT used but SUBDIRS not defined' stderr : diff --cc t/gettext.sh index 5f89b6195,7cf62efab..87498436e --- a/t/gettext.sh +++ b/t/gettext.sh @@@ -17,10 -17,11 +17,10 @@@ # Check gettext support. required='gettext' - . ./defs || exit 1 + . test-init.sh -cat >>configure.ac <> configure.ac << 'END' AM_GNU_GETTEXT -AM_GNU_GETTEXT_VERSION([0.14.3]) AC_OUTPUT END diff --cc t/gnumake.sh index 7b1fbfe57,a1447554b..c8433ba11 --- a/t/gnumake.sh +++ b/t/gnumake.sh @@@ -17,7 -17,8 +17,7 @@@ # Automake should not assume that make files are called Makefile. # Report from Braden McDaniel. - . ./defs || exit 1 -required=GNUmake + . test-init.sh cat >> configure.ac << 'END' AC_CONFIG_FILES([sub/GNUmakefile]) diff --cc t/interp3.sh index b0ed1c7f0,4fb227ff8..0e5670d3f --- a/t/interp3.sh +++ b/t/interp3.sh @@@ -14,14 -14,10 +14,14 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Make sure '../foo/foo.cpp' generates a rule. -# Report from Dave Brolley. +# Variable interpolation should work even when GNU make functions are +# involved. This is unfortunately not the case currently, due to +# historical and hard-to-lift limitations (this is also documented in +# the manual, using an example that is a stripped-down version of this +# test case). +required=cc - . ./defs || exit 1 + . test-init.sh cat >> configure.ac << 'END' AC_PROG_CC diff --cc t/lex-line.sh index fbc05a578,4a51c1edb..299996c80 --- a/t/lex-line.sh +++ b/t/lex-line.sh @@@ -20,9 -20,10 +20,9 @@@ # See also sister test 'yacc-line.sh'. required='cc lex' - . ./defs || exit 1 + . test-init.sh cat >> configure.ac << 'END' -AC_CONFIG_FILES([sub/Makefile]) AC_PROG_CC AM_PROG_CC_C_O AC_PROG_LEX diff --cc t/lex-nodist.sh index 19e5968a6,e318c3ee2..8114c24b5 --- a/t/lex-nodist.sh +++ b/t/lex-nodist.sh @@@ -15,11 -15,13 +15,11 @@@ # along with this program. If not, see . # Checks for .c files derived from non-distributed .l sources. -# The test 'lex-pr204.sh' does similar check with AM_MAINTAINER_MODE -# enabled. -# The tests 'yacc-nodist.sh' and 'yacc-pr204.sh' does similar checks -# for yacc-generated .c and .h files. +# The test 'yacc-nodist.sh' does similar checks for yacc-generated +# .c and .h files. required='cc lex' - . ./defs || exit 1 + . test-init.sh cat >> configure.ac << 'END' AC_PROG_CC diff --cc t/lex-subobj-nodep.sh index 526e01b64,2d6405160..d80be7950 --- a/t/lex-subobj-nodep.sh +++ b/t/lex-subobj-nodep.sh @@@ -14,11 -14,11 +14,11 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Ensure subdirs for subdir scanners are generated when subdir-objects -# are used, even when dependency tracking is disabled. +# Ensure subdirs for subdir scanners are generated, even when dependency +# tracking is disabled. required='cc lex' - . ./defs || exit 1 + . test-init.sh cat >>configure.ac <<\END AC_PROG_CC diff --cc t/libobj20b.sh index fce4ab342,b42b8c901..8175a08c3 --- a/t/libobj20b.sh +++ b/t/libobj20b.sh @@@ -15,9 -15,9 +15,9 @@@ # along with this program. If not, see . # Test error reporting for AC_CONFIG_LIBOBJ_DIR. -# See also sister tests 'libobj20a.sh' and 'libobj20c.sh'. +# See also sister test 'libobj20c.sh'. - . ./defs || exit 1 + . test-init.sh cat >> configure.ac << 'END' AC_CONFIG_LIBOBJ_DIR([libobj-dir]) diff --cc t/libobj20c.sh index 533f195a1,295eeacd0..e2e7c2b7f --- a/t/libobj20c.sh +++ b/t/libobj20c.sh @@@ -15,9 -15,9 +15,9 @@@ # along with this program. If not, see . # Test error reporting for AC_CONFIG_LIBOBJ_DIR. -# See also sister tests 'libobj20a.sh' and 'libobj20b.sh'. +# See also sister test 'libobj20b.sh'. - . ./defs || exit 1 + . test-init.sh cat >> configure.ac << 'END' AC_CONFIG_LIBOBJ_DIR([libobj-dir]) diff --cc t/libtoo10.sh index 3fd8444cd,968bcb918..f56c8074c --- a/t/libtoo10.sh +++ b/t/libtoo10.sh @@@ -16,13 -16,9 +16,13 @@@ # Make sure .libs directories are removed for _PROGRAMS. # Report from Guillermo Ontañón. +# Also make sure the 'so_locations' files generated by some linkers +# (OSF, IRIX) are removed. +# And also make sure the generated 'libtool' script as well as the +# *.lo files are removed when they should. required='cc libtoolize' - . ./defs || exit 1 + . test-init.sh cat >> configure.ac << 'END' AM_PROG_AR diff --cc t/lisp8.sh index cc8a315b7,7348e4147..e64b7694b --- a/t/lisp8.sh +++ b/t/lisp8.sh @@@ -16,8 -16,8 +16,8 @@@ # Check the recover rule of lisp_LISP with parallel make. -required='GNUmake emacs' +required=emacs - . ./defs || exit 1 + . test-init.sh cat > Makefile.am << 'EOF' dist_lisp_LISP = am-one.el am-two.el am-three.el diff --cc t/location.sh index d8921c816,0ff7090bb..bf2399a16 --- a/t/location.sh +++ b/t/location.sh @@@ -16,9 -16,10 +16,9 @@@ # Test for locations in error messages. - . ./defs || exit 1 + . test-init.sh cat >> configure.ac << 'END' -AM_CONDITIONAL([COND1], [true]) AM_CONDITIONAL([COND2], [true]) AC_PROG_CC AM_PROG_AR diff --cc t/longline.sh index 25acc675f,b262f45fe..5b2a4ead1 --- a/t/longline.sh +++ b/t/longline.sh @@@ -14,19 -14,16 +14,19 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Long lines of += should be wrapped. +# Long lines of = and += should be wrapped. # Report from Simon Josefsson. - . ./defs || exit 1 + . test-init.sh -(echo DUMMY = some_long_filename_1; -for i in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; -do - echo DUMMY += some_long_filename_$i -done) > Makefile.am +i=0 +while test $i -lt 30; do + echo some_very_very_long_variable_content_$i + i=$(($i + 1)) +done > t + +{ echo "DUMMY =" && sed 's/^/DUMMY +=/' t; } > Makefile.am +{ echo "ZARDOZ =" && cat t; } | tr '\012\015' ' ' >> Makefile.am $ACLOCAL $AUTOMAKE diff --cc t/make-dryrun.tap index 487681be6,adf2f0441..099329840 --- a/t/make-dryrun.tap +++ b/t/make-dryrun.tap @@@ -14,9 -14,9 +14,9 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Check that $(am__make_dryrun) works as expected. +# Check that $(am.make.dry-run) works as expected. - . ./defs || exit 1 + . test-init.sh plan_ 14 diff --cc t/makej.sh index 3b236bf2f,e8d1ea57a..29c6a2200 --- a/t/makej.sh +++ b/t/makej.sh @@@ -21,7 -21,8 +21,7 @@@ # depend on the time at which autoconf and automake update the cache # via autom4te. - . ./defs || exit 1 -required=GNUmake + . test-init.sh cat >configure.ac <>configure.ac <<'END' AC_OUTPUT diff --cc t/maken.sh index e4254e532,5087b9259..40575088a --- a/t/maken.sh +++ b/t/maken.sh @@@ -14,12 -14,12 +14,12 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Ensure that 'make -n dist' and 'make -n distcheck' do not change files +# Ensure that "make -n dist" and "make -n distcheck" do not change files # on disk, due to GNU make executing rules containing '$(MAKE)'. -# Also, ensure that 'make -n dist' and 'make -n distcheck' show what -# would happen, at least when using GNU make. +# Also, ensure that "make -n dist" and "make -n distcheck" show what +# would happen. - . ./defs || exit 1 + . test-init.sh mkdir sub diff --cc t/maken3.sh index 5dbe7d23a,dbbdb4afa..683f3d4f9 --- a/t/maken3.sh +++ b/t/maken3.sh @@@ -23,8 -25,23 +23,8 @@@ # as well as tags. # For gen-testsuite-part: ==> try-with-serial-tests <== - . ./defs || exit 1 + . test-init.sh -# Does $MAKE support the '.MAKE' special target? -have_dotmake=false -if using_gmake; then - have_dotmake=: # GNU make must support it. -else - unindent > mk.tmp << 'END' - targ.tmp: - : > $@ - .MAKE: targ.tmp -END - if $MAKE -n -f mk.tmp targ.tmp && test -f targ.tmp; then - have_dotmake=: - fi -fi - mkdir sub sub2 cat >> configure.ac << 'END' diff --cc t/man6.sh index c2f21a9b7,d854732b2..9d96dcdee --- a/t/man6.sh +++ b/t/man6.sh @@@ -18,8 -18,12 +18,8 @@@ # even if the 'missing' script is involved. required=help2man - . ./defs || exit 1 + . test-init.sh -# Avoid a spurious failure due to a known FreeBSD make incompatibility. -useless_vpath_rebuild \ - && skip_ "VPATH useless rebuild detected (see bug#7884)" - cat > Makefile.am << 'END' dist_man_MANS = $(srcdir)/foobar.1 bazquux.1 zardoz.1 dist_bin_SCRIPTS = foobar bazquux zardoz diff --cc t/man8.sh index 597093f94,7396006ec..f6ad408b6 --- a/t/man8.sh +++ b/t/man8.sh @@@ -16,8 -16,12 +16,8 @@@ # Check for a bug in distcheck w.r.t. generated manpages. - . ./defs || exit 1 + . test-init.sh -# Avoid a spurious failure due to a known FreeBSD make incompatibility. -useless_vpath_rebuild \ - && skip_ "VPATH useless rebuild detected (see bug#7884)" - cat > Makefile.am << 'END' dist_man_MANS = foo.1 foo.1: diff --cc t/mkinst3.sh index 880d417b3,02dca5e74..f34afd3e8 --- a/t/mkinst3.sh +++ b/t/mkinst3.sh @@@ -14,10 -14,10 +14,10 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Test mkinstalldirs with spaces in directory names. +# Test "install-sh -d" with spaces in directory names. am_create_testdir=empty - . ./defs || exit 1 + . test-init.sh cwd=$(pwd) || fatal_ "getting current working directory" diff --cc t/nostdinc.sh index 2ec2b82da,93761d55a..8ebb4e8ff --- a/t/nostdinc.sh +++ b/t/nostdinc.sh @@@ -16,8 -16,12 +16,8 @@@ # 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. - +required=cc - . ./defs || exit 1 + . test-init.sh cat >> configure.ac << 'END' AC_PROG_CC diff --cc t/objdir.sh index 5d2a599b8,7b77a906b..12aff49c8 --- a/t/objdir.sh +++ b/t/objdir.sh @@@ -14,20 -14,14 +14,20 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Naming a subdirectory 'obj/' is a bad idea. Automake should say so. +# A directory named 'obj' could create problems with BSD make, but +# shouldn't with GNU make; so check that +# - the old portability warning diagnosing it is gone, and +# - such a directory truly causes no problems with GNU make. +am_create_testdir=empty - . ./defs || exit 1 + . test-init.sh -mkdir obj - -cat >>configure.ac << 'END' -AC_CONFIG_FILES([obj/Makefile]) +cat > configure.ac <. -# Test to make sure '.txi' extension works. +# Automake-NG should recognize the (no-op) 'ng' option. - . ./defs || exit 1 + . test-init.sh -cat > Makefile.am << 'END' -info_TEXINFOS = foo.txi +cat > configure.ac < foo.txi -: > texinfo.tex +echo AUTOMAKE_OPTIONS = ng > Makefile.am $ACLOCAL $AUTOMAKE diff --cc t/parallel-tests-basics.sh index 42940c32a,3022e2282..326d67397 --- a/t/parallel-tests-basics.sh +++ b/t/parallel-tests-basics.sh @@@ -19,10 -19,11 +19,10 @@@ # - log files, and what goes in 'test-suite.log' # - make clean # - dependencies between tests -# - TESTS redefinition at runtime -# - TEST_LOGS redefinition at runtime -# - RECHECK_LOGS redefinition at runtime +# - TESTS redefinition at runtime (with and without test suffixes) +# - AM_LAZY_CHECK - . ./defs || exit 1 + . test-init.sh cat >> configure.ac << 'END' AC_OUTPUT diff --cc t/parallel-tests-concurrency-2.sh index f7aac36a5,bb38d509c..2d153936a --- a/t/parallel-tests-concurrency-2.sh +++ b/t/parallel-tests-concurrency-2.sh @@@ -20,8 -20,8 +20,8 @@@ # Actually, this test doesn't ensure that things happen concurrently. # It merely serves as demonstration. :-) -required='cc native GNUmake' +required='cc native' - . ./defs || exit 1 + . test-init.sh cat >> configure.ac << 'END' AC_PROG_CC diff --cc t/parallel-tests-empty.sh index bbcbf871f,a367038ca..1a8ec0229 --- a/t/parallel-tests-empty.sh +++ b/t/parallel-tests-empty.sh @@@ -14,12 -14,13 +14,12 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Check parallel-tests features: -# - empty TESTS -# BSD make will expand '$(TESTS:=.log)' to '.log' unless overridden. -# See 'parallel-tests-trailing-whitespace.sh' for a similar issue. +# Check parallel-tests features: empty TESTS - . ./defs || exit 1 + . test-init.sh + cat >> configure.ac << 'END' +AC_CONFIG_FILES([sub1/Makefile sub2/Makefile]) AC_OUTPUT END diff --cc t/parallel-tests-generated-and-distributed.sh index 71d844e80,ff6c2f50b..3f4d482b6 --- a/t/parallel-tests-generated-and-distributed.sh +++ b/t/parallel-tests-generated-and-distributed.sh @@@ -14,9 -14,17 +14,9 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Check parallel-tests features: -# - generated distributed tests. -# - listing $(srcdir)/ or $(top_srcdir)/ in TESTS doesn't work ATM, -# and is thus diagnosed. - -# TODO: this test should also ensure that the 'make' implementation -# properly adheres to rules in all cases. See the Autoconf -# manual for the ugliness in this area, when VPATH comes into -# play. :-/ +# Check parallel-tests features: generated distributed tests. - . ./defs || exit 1 + . test-init.sh cat >> configure.ac << 'END' AC_OUTPUT diff --cc t/parallel-tests-logvars-example.sh index 50bdba2f1,1c0d44d86..6b159a7c8 --- a/t/parallel-tests-logvars-example.sh +++ b/t/parallel-tests-logvars-example.sh @@@ -15,10 -15,10 +15,10 @@@ # along with this program. If not, see . # Test the example of usage of generic and extension-specific -# LOG_COMPILER and LOG_FLAGS given in the manual. +# LOG_COMPILER, LOG_FLAGS and LOG_DEPENDNECIES given in the manual. required=python - . ./defs || exit 1 + . test-init.sh cat >> configure.ac <. -# Test to make sure that mdate-sh is added to the right directory. -# Report from Kevin Dalley. +# The parallel-tests harness do not cause the same test to be +# uselessly run multiple times. - . ./defs || exit 1 + . test-init.sh -cat >> configure.ac << 'END' -AC_CONFIG_FILES([sub/Makefile]) -END - -cat > Makefile.am << 'END' -SUBDIRS = sub -END +echo AC_OUTPUT >> configure.ac +echo TESTS = foo.test > Makefile.am -mkdir sub - -cat > sub/Makefile.am << 'END' -info_TEXINFOS = textutils.texi -END - -cat > sub/textutils.texi << 'END' -@include version.texi -@setfilename textutils.info +cat > foo.test <<'END' +#! /bin/sh +ls -l && mkdir bar END +chmod a+x foo.test $ACLOCAL +$AUTOCONF $AUTOMAKE -a -ls -l sub -test -f sub/mdate-sh + +./configure + +$MAKE -j1 check || { cat test-suite.log; exit 1; } +rmdir bar +$MAKE -j2 check || { cat test-suite.log; exit 1; } +rmdir bar +$MAKE -j4 check || { cat test-suite.log; exit 1; } : diff --cc t/parallel-tests-srcdir-in-test-name.sh index 72dc491b5,751ddb020..b9e91266f --- a/t/parallel-tests-srcdir-in-test-name.sh +++ b/t/parallel-tests-srcdir-in-test-name.sh @@@ -14,43 -14,34 +14,43 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Check that ':test-results:' directives in test scripts' output doesn't -# originate spurious results in the testsuite summary. +# Check parallel-tests features: listing $(srcdir)/ in TESTS works. - . ./defs || exit 1 + . test-init.sh -cat >> configure.ac << 'END' -AC_OUTPUT -END +echo AC_OUTPUT >> configure.ac cat > Makefile.am << 'END' -TESTS = foo.test bar.test +TESTS = \ + $(srcdir)/foo \ + @srcdir@/foo2 \ + @srcdir@/bar.test \ + ${srcdir}/sub/baz.test \ + built.test + +XFAIL_TESTS = $(srcdir)/bar.test foo2 + +built.test: + (echo '#!/bin/sh' && echo 'exit 77') >$@-t + chmod a-w,a+x $@-t && mv -f $@-t $@ END -cat > foo.test <<'END' -#! /bin/sh -echo :test-result:XFAIL -echo :test-result: SKIP -echo :test-result:ERROR +cat > foo <<'END' +#!/bin/sh exit 0 END -cat > bar.test <<'END' -#! /bin/sh -echo :test-result: ERROR -echo :test-result:FAIL -echo :test-result: XPASS -exit 0 +chmod a+x foo + +cat > foo2 <<'END' +#!/bin/sh +exit 1 END -chmod a+x foo.test bar.test +chmod a+x foo2 + +cp foo2 bar.test + +mkdir sub +cp foo sub/baz.test $ACLOCAL $AUTOCONF diff --cc t/pattern-rules.sh index 8e96d592a,ddf37d090..da9bdbeeb --- a/t/pattern-rules.sh +++ b/t/pattern-rules.sh @@@ -14,46 -14,24 +14,46 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Check a documented limitation of the Automake's Makefile parser -# w.r.t. POSIX variable substitutions used in the name of targets. -# See Section "General Operation" in the Automake manual. -# If you cause some parts of this test to fail, chances are that you've -# improved the Automake parser ;-) -# See: -# or: +# Automake do not complain about nor messes up pattern rules. - . ./defs || exit 1 + . test-init.sh +echo AC_OUTPUT >> configure.ac + cat > Makefile.am <<'END' -$(FOO:=x): bar +foo/%.out: bar/%.in + test -d $(dir $@) || $(MKDIR_P) $(dir $@) + cp $< $@ +%.sh: %/z + cp $< $@ +%: + echo True > $@ +noinst_DATA = foo/one.out +noinst_SCRIPTS = two.sh mu.py END +mkdir bar two +echo "123456789" > bar/one.in +echo "#!/bin/sh" > two/z + $ACLOCAL -AUTOMAKE_fails +$AUTOCONF +$AUTOMAKE -grep 'bad characters.*variable name.*\$(FOO' stderr -grep ':=.*assignments.*not portable' stderr +for vpath in : false; do + if $vpath; then + mkdir build + cd build + srcdir=.. + else + srcdir=. + fi + $srcdir/configure + $MAKE + diff $srcdir/bar/one.in ./foo/one.out + diff $srcdir/two/z ./two.sh + test "$(cat mu.py)" = True + cd $srcdir +done : diff --cc t/pr9.sh index 15e8b4b97,7d75cc4bc..5db775f93 --- a/t/pr9.sh +++ b/t/pr9.sh @@@ -20,10 -20,10 +20,10 @@@ # == Report == # When AC_CONFIG_AUX_DIR is set (in my case to 'support'), make dist # no longer automatically includes config.guess, config.sub, install-sh, -# ltconfig, ltmain.sh, mdate-sh, missing, and mkinstalldirs. In fact, -# the entire 'support/' directory is omitted. +# ltconfig, ltmain.sh, mdate-sh, and missing. In fact, the entire +# 'support/' directory is omitted. - . ./defs || exit 1 + . test-init.sh cat > configure.ac << END AC_INIT([$me], [1.0]) diff --cc t/recurs-user-phony.sh index 93ee973e2,274f441c0..c6e42a2ef --- a/t/recurs-user-phony.sh +++ b/t/recurs-user-phony.sh @@@ -17,7 -17,10 +17,7 @@@ # Check that user-defined recursive targets and their associate # '-local', '-am' and '-recursive' targets are declared as phony. - . ./defs || exit 1 -# Require GNU make, because some vendo makes (e.g., Solaris) doesn't -# truly respect .PHONY. + required=GNUmake -. test-init.sh cat >> configure.ac <<'END' AC_CONFIG_FILES([sub/Makefile]) diff --cc t/recurs-user-wrap.sh index c2e70b4a8,15a210cb2..59042a664 --- a/t/recurs-user-wrap.sh +++ b/t/recurs-user-wrap.sh @@@ -17,7 -17,8 +17,7 @@@ # Check that rules generated by user recursion are apt to be wrapped # by other makefiles. - . ./defs || exit 1 -required=GNUmake + . test-init.sh cat >> configure.ac << 'END' AM_EXTRA_RECURSIVE_TARGETS([extra]) diff --cc t/relativize.tap index a9644af05,6d4693441..50cc98b93 --- a/t/relativize.tap +++ b/t/relativize.tap @@@ -14,10 -14,10 +14,10 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Test Automake-provided internal make macro $(am__relativize). +# Test Automake-provided internal make macro $(am.dist.relativize-path). am_create_testdir=empty - . ./defs || exit 1 + . test-init.sh plan_ later diff --cc t/remake-after-makefile-am.sh index e304b6ea2,2161790cf..885cacb3d --- a/t/remake-after-makefile-am.sh +++ b/t/remake-after-makefile-am.sh @@@ -17,8 -17,14 +17,8 @@@ # Test remake rules when Makefile.am or its prerequisites change. # Keep in sync with the other sister tests 'remake-after-*.sh'. - . ./defs || exit 1 + . test-init.sh -if using_gmake; then - remake_() { $MAKE nil; } -else - remake_() { $MAKE Makefile && $MAKE foo.sh; } -fi - magic1=::MagicStringOne:: magic2=__MagicStringTwo__ diff --cc t/remake-all-1.sh index a6ec8e2ad,29cefd476..3f21dd919 --- a/t/remake-all-1.sh +++ b/t/remake-all-1.sh @@@ -15,8 -15,9 +15,8 @@@ # along with this program. If not, see . # Check that the "all" target triggers rebuilt of outdated Makefiles. -# See also sister test 'remake-all-2.sh'. - . ./defs || exit 1 + . test-init.sh mkfile=Makefile diff --cc t/remake-subdir-gnu.sh index b216b0eef,a00ae5758..eb2c4ada3 --- a/t/remake-subdir-gnu.sh +++ b/t/remake-subdir-gnu.sh @@@ -20,7 -20,8 +20,7 @@@ # See also the other similar tests 'remake-subdir*.sh', and the # related test 'aclocal5.sh' - . ./defs || exit 1 -required=GNUmake + . test-init.sh magic1='::MagicString::One::' magic2='__MagicString__Two__' diff --cc t/remake-subdir.sh index 9c7e0f4ae,a8014cf8f..9e90fcbf9 --- a/t/remake-subdir.sh +++ b/t/remake-subdir.sh @@@ -19,8 -19,14 +19,8 @@@ # See also the other similar tests 'remake-subdir*.sh', and the # related test 'aclocal5.sh'. - . ./defs || exit 1 + . test-init.sh -if using_gmake; then - remake=$MAKE -else - remake="$MAKE Makefile" -fi - magic1='::MagicString::One::' magic2='__MagicString__Two__' diff --cc t/repeated-options.sh index 489c31344,83253d3cc..6da754ab2 --- a/t/repeated-options.sh +++ b/t/repeated-options.sh @@@ -17,7 -17,8 +17,7 @@@ # Check that automake does not complain on repeated options, nor # generate broken or incorrect makefiles. - . ./defs || exit 1 -required='cc bzip2' + . test-init.sh cat >configure.ac < one/configure.ac < one/Makefile.am - -cat > two/configure.ac < two/bMakefile.am < Makefile.am << 'END' AUTOMAKE_OPTIONS = serial-tests +TESTS = foo.test bar.test END -cd one -touch missing install-sh $ACLOCAL $AUTOMAKE -grep TEST Makefile.in # For debugging. -hasnt_parallel_tests Makefile.in -test ! -e test-driver -cd .. - -cd two -mkdir config -$ACLOCAL -$AUTOMAKE --add-missing -grep TEST [ab]Makefile.in # For debugging. -has_parallel_tests aMakefile.in -hasnt_parallel_tests bMakefile.in -mv aMakefile.in aMakefile.sav -mv bMakefile.in bMakefile.sav +grep '^include .*/am-ng/serial-tests\.mk$' Makefile.in +$FGREP 'parallel-tests.mk' Makefile.in && exit 1 +test -f am-ng/serial-tests.mk +test ! -e am-ng/parallel-tests.mk test ! -e test-driver -test -f config/test-driver -$AUTOMAKE -diff aMakefile.sav aMakefile.in -diff bMakefile.sav bMakefile.in -cd .. : diff --cc t/silent-lex.sh index 5b98a1bb6,6cc04308e..4c0b09484 --- a/t/silent-lex.sh +++ b/t/silent-lex.sh @@@ -17,8 -17,10 +17,8 @@@ # Check silent-rules mode for Lex. required='cc lex' - . ./defs || exit 1 + . test-init.sh -mkdir sub - cat >>configure.ac <<'EOF' AM_PROG_CC_C_O AC_PROG_LEX diff --cc t/silent-yacc.sh index 6330fc7ef,b54bfe2d7..4d7eb8350 --- a/t/silent-yacc.sh +++ b/t/silent-yacc.sh @@@ -18,8 -18,10 +18,8 @@@ # Keep this in sync with sister test 'silent-yacc-gcc.sh'. required='cc yacc' - . ./defs || exit 1 + . test-init.sh -mkdir sub - cat >>configure.ac <<'EOF' AM_PROG_CC_C_O AC_PROG_YACC diff --cc t/silent7.sh index d34e8d198,42e5a83e5..ee56ce337 --- a/t/silent7.sh +++ b/t/silent7.sh @@@ -15,9 -15,9 +15,9 @@@ # along with this program. If not, see . # Check user extensibility of silent-rules mode. -# Aslo check that silent rules are disabled by default. +# Also check that silent rules are disabled by default. - . ./defs || exit 1 + . test-init.sh echo AC_OUTPUT >> configure.ac diff --cc t/spell.sh index 58202af4b,3bed9b186..23b0b330b --- a/t/spell.sh +++ b/t/spell.sh @@@ -16,14 -16,8 +16,14 @@@ # Test to make sure misspellings in _SOURCES variables cause failure. +required=cc - . ./defs || exit 1 + . test-init.sh +cat >> configure.ac << 'END' +AC_PROG_CC +AC_OUTPUT +END + cat > Makefile.am << 'END' bin_PROGRAMS = zardoz foo zardoz_SOURCES = x.c diff --cc t/spell2.sh index 839e363d5,98550afe1..f21f0c6f4 --- a/t/spell2.sh +++ b/t/spell2.sh @@@ -14,15 -14,11 +14,15 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Test to make sure misspellings in _SOURCES variables cause failure. +# Test to make sure misspellings in _LDADD variable cause failure. +required=cc - . ./defs || exit 1 + . test-init.sh -echo AC_PROG_CC >> configure.ac +cat >> configure.ac << 'END' +AC_PROG_CC +AC_OUTPUT +END cat > Makefile.am << 'END' bin_PROGRAMS = zardoz diff --cc t/spy-foreach.sh index e71bd8124,7973d92cc..05141b07e --- a/t/spy-foreach.sh +++ b/t/spy-foreach.sh @@@ -14,26 -14,19 +14,26 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Make sure that our macro 'AM_ENABLE_MULTILIB' adds proper text to -# the configure help screen. +# Verify that iterating variable used in a $(foreach ...) builtin is +# only temporary, and restored to its previous variable if it was already +# set. +am_create_testdir=empty - . ./defs || exit 1 + . test-init.sh -cat > configure.ac < Makefile <<'END' +$(foreach x,1 2,$(warning foo-$(x))$(eval y:=$$(x))) +$(foreach u,oops ko,$(warning bar-$(u))$(eval v=$(u))) +test: + test .'$(x)' = . + test .'$(origin x)' = .'undefined' + test .'$(y)' = .2 + test .'$(v)' = .ko + test .'$(u)' = .ok + test .'$(origin u)' = .'command line' END -cat "$am_top_srcdir"/contrib/multilib/multi.m4 > aclocal.m4 -$AUTOCONF - -grep_configure_help --enable-multilib ' many library versions \(default\)' +x= y= u= v=; unset x y u v +$MAKE test u=ok : diff --cc t/spy-phony.sh index 105a44a9f,6f3b1ee00..1bd3c10fe --- a/t/spy-phony.sh +++ b/t/spy-phony.sh @@@ -14,44 -14,35 +14,44 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Check that the AM_PROG_MKDIR_P macro is deprecated. It will be -# be removed in the next major Automake release. +# Check that the '.PHONY' semantics we expect truly hold. +am_create_testdir=empty - . ./defs || exit 1 + . test-init.sh -echo AM_PROG_MKDIR_P >> configure.ac -: > Makefile.am - -grep_err () -{ - loc='^configure.ac:4:' - grep "$loc.*AM_PROG_MKDIR_P.*deprecated" stderr - grep "$loc.* use .*AC_PROG_MKDIR_P" stderr - grep "$loc.* use '\$(MKDIR_P)' instead of '\$(mkdir_p)'.*Makefile" stderr -} - -$ACLOCAL - -$AUTOCONF -Werror -Wobsolete 2>stderr && { cat stderr >&2; exit 1; } -cat stderr >&2 -grep_err - -$AUTOCONF -Werror -Wno-obsolete - -#AUTOMAKE_fails -#grep_err -AUTOMAKE_fails --verbose -Wnone -Wobsolete -grep_err - -$AUTOMAKE -Wno-obsolete +cat > Makefile <<'END' +.PHONY: pdir pfile +pdir rdir: + echo foo > $@/foo +pfile rfile: + echo bar >$@ +.PHONY: other +other: + echo baz >> dummy +indirect: other + echo run > $@ +END + +: > rfile +mkdir rdir +$MAKE rdir rfile +test ! -s rfile +test ! -f rdir/foo + +: > pfile +mkdir pdir +$MAKE pdir pfile +test "$(cat pfile)" = bar +test "$(cat pdir/foo)" = foo + +$MAKE other +test "$(cat dummy)" = baz +$MAKE other +test "$(cat dummy)" = "baz${nl}baz" + +echo not run > indirect +$MAKE indirect +test "$(cat indirect)" = run +test "$(cat dummy)" = "baz${nl}baz${nl}baz" : diff --cc t/spy-wildcard.sh index 9a8e47daf,dd1adaa43..612fde496 --- a/t/spy-wildcard.sh +++ b/t/spy-wildcard.sh @@@ -14,23 -14,31 +14,23 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Test that := definitions work as expected at make time. +# Check that the behaviour of the $(wildcard) builtin in corner cases +# matches the assumptions done in our recipes. - . ./defs || exit 1 -required=GNUmake + . test-init.sh -cat >> configure.ac << 'END' -AC_OUTPUT -END +mkdir dir +echo dummy > file -cat > Makefile.am << 'END' -BAR := $(FOO) -BAZ = $(FOO) -FOO := foo +cat > Makefile <<'END' .PHONY: test test: - test x'$(FOO)' = x'foo' - test x'$(BAZ)' = x'foo' - test x'$(BAR)' = x + test x'$(wildcard dir)' = x'dir' + test x'$(wildcard file)' = x'file' + test x'$(wildcard dir/)' = x'dir/' + test x'$(wildcard file/.)' = x'' END -$ACLOCAL -$AUTOCONF -$AUTOMAKE -Wno-portability - -./configure $MAKE test : diff --cc t/stdinc-no-repeated.sh index afeb1fd3c,d6f7caf5c..6fe775bfb --- a/t/stdinc-no-repeated.sh +++ b/t/stdinc-no-repeated.sh @@@ -14,14 -14,12 +14,14 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Test to make sure .info-less @setfilename works. +# Check that automake rules do not use repeated "-I $(srcdir)" in the +# compiler invocation. -required='makeinfo tex texi2dvi' +required=cc - . ./defs || exit 1 + . test-init.sh cat >> configure.ac << 'END' +AC_PROG_CC AC_OUTPUT END diff --cc t/subdir.sh index fb1e2469c,e8719997d..c33de211f --- a/t/subdir.sh +++ b/t/subdir.sh @@@ -14,9 -14,10 +14,9 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Test to make sure install-sh and mkinstalldirs correctly found in -# subdirs. +# Test to make sure install-sh is correctly found in subdirs. - . ./defs || exit 1 + . test-init.sh mkdir zot diff --cc t/subobj-cxx-grep.sh index b1f6980b6,d0b05fe3b..ac18bc270 --- a/t/subobj-cxx-grep.sh +++ b/t/subobj-cxx-grep.sh @@@ -14,14 -14,16 +14,14 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Test of subdir objects with C++. +# Grepping checks on the use of subdir objects with C++. +# See relate test 't/subobj-cxx-grep.sh' for semantic checks. - . ./defs || exit 1 + . test-init.sh -cat >> configure.ac << 'END' -AC_PROG_CXX -END +echo AC_PROG_CXX >> configure.ac cat > Makefile.am << 'END' -AUTOMAKE_OPTIONS = subdir-objects bin_PROGRAMS = wish wish_SOURCES = generic/a.cc generic/b.cxx END diff --cc t/subobj10.sh index 55776a722,68f0e32b1..880b659ef --- a/t/subobj10.sh +++ b/t/subobj10.sh @@@ -14,12 -14,15 +14,12 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# PR 492: Test asm subdir-objects. +# PR 492: Test asm subdir objects. required=gcc - . ./defs || exit 1 + . test-init.sh -cat > configure.ac << END -AC_INIT([$me], [1.0]) -AM_INIT_AUTOMAKE([subdir-objects]) - +cat >> configure.ac << 'END' AM_PROG_AS AM_PROG_AR AC_PROG_RANLIB diff --cc t/subobj11a.sh index 615ed6300,4bd886303..106d8eb01 --- a/t/subobj11a.sh +++ b/t/subobj11a.sh @@@ -14,24 -14,20 +14,24 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Test that automake works around a bug of Solaris Make. The bug is the -# following. If we have a Makefile containg a file inclusion like this: +# If we have a Makefile containing a file inclusion like this: +# # include .//foo.mk -# Solaris make fails with a message like: +# +# Solaris 10 make fails with a message like: +# # make: ... can't find '/foo.mk': No such file or directory # make: fatal error ... read of include file '/foo.mk' failed -# (even if the file 'foo.mk' exists). The error disappear by collapsing -# the repeated slash '/' characters into a single one. # -# See also sister "grepping" test 'subobj11b.sh', and related test -# 'subobj11c.sh'. +# (even if the file 'foo.mk' exists). Our dependency tracking support +# code used to generate include directives like that sometimes, thus +# causing spurious failures. +# +# GNU make shouldn't suffer from that Solaris make bug, but we check +# the problematic setup anyway -- better safe than sorry. required=cc - . ./defs || exit 1 + . test-init.sh cat >> configure.ac << 'END' AC_PROG_CC diff --cc t/subobj8.sh index cd25f6692,fe0d0c888..ef0f0d60a --- a/t/subobj8.sh +++ b/t/subobj8.sh @@@ -14,10 -14,9 +14,10 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Make sure 'compile' is included when subdir-objects is used in a subdir. +# Make sure 'compile' is included when subdir objects are used in a +# subdir. - . ./defs || exit 1 + . test-init.sh cat > configure.ac << END AC_INIT([$me], [1.0]) diff --cc t/subobj9.sh index 4b3c4d5fb,69675760b..e568c2095 --- a/t/subobj9.sh +++ b/t/subobj9.sh @@@ -23,9 -23,11 +23,9 @@@ # forgets '.../.o'. required='c++ libtoolize' - . ./defs || exit 1 + . test-init.sh -cat > configure.ac << END -AC_INIT([$me], [1.0]) -AM_INIT_AUTOMAKE([subdir-objects]) +cat >> configure.ac << END AC_PROG_CXX AM_PROG_AR AM_PROG_LIBTOOL diff --cc t/subpkg-yacc.sh index fe170ef63,f05396f74..6cb248512 --- a/t/subpkg-yacc.sh +++ b/t/subpkg-yacc.sh @@@ -18,13 -18,10 +18,13 @@@ # properly, when a subpackage is involved. required='cc yacc' - . ./defs || exit 1 + . test-init.sh -cat >>configure.ac <<'END' +cat > configure.ac <<'END' +AC_INIT([suya], [0.5a], [automake-ng@gnu.org]) +AM_INIT_AUTOMAKE([foreign -Wall]) AC_PROG_CC +AC_CONFIG_FILES([GNUmakefile]) AC_CONFIG_SUBDIRS([lib]) AC_OUTPUT END diff --cc t/suffix-chain.sh index 7ac4997f6,20656db65..91aaea6f2 --- a/t/suffix-chain.sh +++ b/t/suffix-chain.sh @@@ -19,8 -19,10 +19,8 @@@ # See automake bug#7824 and bug#7670. required=cc - . ./defs || exit 1 + . test-init.sh -plan_ 8 - cat >> configure.ac <<'END' AC_PROG_CC AC_OUTPUT diff --cc t/suffix-custom-subobj-and-specflg.sh index 83e677dd3,15aa56aa9..0d3684bc9 --- a/t/suffix-custom-subobj-and-specflg.sh +++ b/t/suffix-custom-subobj-and-specflg.sh @@@ -14,11 -14,12 +14,11 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Tests that Automake understands suffix rules with renamed objects -# and subdir objects. -# Reported by Florian Briegel. +# Tests that Automake understands suffix-based pattern rules with +# renamed objects and subdir objects. Reported by Florian Briegel. required=cc - . ./defs || exit 1 + . test-init.sh cat >>configure.ac <. -# Tests that Automake understands suffix rules with subdir objects. -# Reported by John Ratliff. +# Tests that pattern rules with subdir objects are understood. +# Originally reported by John Ratliff against suffix rules. required=cc - . ./defs || exit 1 + . test-init.sh cat >>configure.ac <. # Test to make sure that '.o' and '.obj' are handled like '.$(OBJEXT)'. -# See also related "grepping" test 'suffix6.sh'. - . ./defs || exit 1 + . test-init.sh cat >> configure.ac << 'END' # $(LINK) is not defined automatically by Automake, since the *_SOURCES diff --cc t/suffix-rules-old-fashioned.sh index c0dd3d5dc,df25abb5b..891f301eb --- a/t/suffix-rules-old-fashioned.sh +++ b/t/suffix-rules-old-fashioned.sh @@@ -14,11 -14,16 +14,11 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Make sure libtool clean targets exist. -# Report from Eric Magnien. +# Automake-NG still accepts old-fashioned suffix rules. - . ./defs || exit 1 -required=libtoolize + . test-init.sh cat >> configure.ac << 'END' -AC_PROG_CC -AM_PROG_AR -AC_PROG_LIBTOOL AC_CONFIG_FILES([sub/Makefile]) AC_OUTPUT END diff --cc t/suffix10.sh index 6f95391c9,1f83590eb..7e316aea7 --- a/t/suffix10.sh +++ b/t/suffix10.sh @@@ -19,8 -18,10 +19,8 @@@ # (related to PR/37) required='cc libtoolize yacc' - . ./defs || exit 1 + . test-init.sh -plan_ 7 - cat >>configure.ac <. -# Make sure proper suffix rules for C compilation are produced, +# Make sure proper pattern rules for C compilation are produced, # and only once, even for libtool libraries. # See also related test 'suffix.sh'. -required=libtoolize - . ./defs || exit 1 + . test-init.sh cat >> configure.ac << 'END' AC_PROG_CC diff --cc t/suffix8.sh index 30bb6e4c2,f61a6b094..2cd07c6e4 --- a/t/suffix8.sh +++ b/t/suffix8.sh @@@ -19,8 -19,10 +19,8 @@@ # From PR/37. required='cc libtoolize' - . ./defs || exit 1 + . test-init.sh -plan_ 10 - cat >>configure.ac <<'END' AM_PROG_AR AM_PROG_LIBTOOL diff --cc t/tags-id.sh index 9032125fc,deeea16be..22d9b6132 --- a/t/tags-id.sh +++ b/t/tags-id.sh @@@ -17,22 -17,10 +17,22 @@@ # Test for bug reported by Harlan Stenn: the tags target doesn't work # when there are only headers in a directory. +required=mkid - . ./defs || exit 1 + . test-init.sh +echo AC_OUTPUT >> configure.ac + cat > Makefile.am << 'END' noinst_HEADERS = iguana.h +test-id: ID + test -f $(srcdir)/iguana.h + test -f ID +check-local: test-id +END + +cat > iguana.h << 'END' +#define FOO "bar" +int zap (int x, char y); END $ACLOCAL diff --cc t/tap-common-setup.sh index 32a474a4f,63af43caf..b6e722873 --- a/t/tap-common-setup.sh +++ b/t/tap-common-setup.sh @@@ -16,9 -16,11 +16,9 @@@ # Auxiliary test to set up common data used by many tests on TAP support. - . ./defs || exit 1 + . test-init.sh -cat >> configure.ac << END -AC_OUTPUT -END +echo AC_OUTPUT >> configure.ac cat > Makefile.am << 'END' TEST_LOG_DRIVER = $(srcdir)/tap-driver diff --cc t/tap-deps.sh index 472ae3d4f,535c58d48..ad761275b --- a/t/tap-deps.sh +++ b/t/tap-deps.sh @@@ -17,10 -17,10 +17,10 @@@ # Basic TAP test protocol support: # - dependencies between test scripts - . ./defs || exit 1 + . test-init.sh cat > Makefile.am << 'END' -# The tests are *deliberately* listed in inversed order here. +# The tests are *deliberately* listed in inverted order here. TESTS = c.test b.test a.test b.log: a.log c.log: b.log diff --cc t/tap-lazy-check.sh index 7d3e93ac5,69c0fe2ea..c16567907 --- a/t/tap-lazy-check.sh +++ b/t/tap-lazy-check.sh @@@ -14,9 -14,10 +14,9 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# TAP support: -# - RECHECK_LOGS +# TAP support: AM_LAZY_CHECK - . ./defs || exit 1 + . test-init.sh cat > Makefile.am << 'END' TEST_LOG_COMPILER = cat diff --cc t/test-driver-custom-multitest-recheck2.sh index d8de857dd,b87d035a1..6d60cc417 --- a/t/test-driver-custom-multitest-recheck2.sh +++ b/t/test-driver-custom-multitest-recheck2.sh @@@ -16,10 -16,12 +16,10 @@@ # Custom test drivers: try the "recheck" functionality with test protocols # that allow multiple testcases in a single test script. In particular, -# check that this still works when we override $(TESTS) and $(TEST_LOGS) -# at make runtime. -# See also related tests 'test-driver-custom-multitest-recheck.sh' and -# 'parallel-tests-recheck-override.sh'. +# check that this still works when we override $(TESTS) at make runtime. +# See also related tests 'test-driver-custom-multitest-recheck.sh'. - . ./defs || exit 1 + . test-init.sh cp "$am_testauxdir"/trivial-test-driver . \ || fatal_ "failed to fetch auxiliary script trivial-test-driver" diff --cc t/test-extensions-cond.sh index 73f617b70,3cc7d85ff..fdfbb974d --- a/t/test-extensions-cond.sh +++ b/t/test-extensions-cond.sh @@@ -14,24 -14,22 +14,24 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Expose bug in conditional definition of TEST_EXTENSIONS. +# Conditional definition of TEST_EXTENSIONS is supported. - . ./defs || exit 1 + . test-init.sh cat >> configure.ac << 'END' -AM_CONDITIONAL([COND], [:]) -AM_CONDITIONAL([COND2], [:]) +AC_CONFIG_FILES([sub/Makefile]) +AM_CONDITIONAL([COND1], [test x"$cond1" = x"yes"]) +AM_CONDITIONAL([COND2], [test x"$cond2" = x"yes"]) +AC_OUTPUT END -$ACLOCAL +mkdir sub -cat > 1.am << 'END' -TESTS = -if COND -## lineno 4 -TEST_EXTENSIONS = .foo +cat > Makefile.am << 'END' +SUBDIRS = sub +TESTS = foo.sh bar.test +if COND1 +TEST_EXTENSIONS = .sh endif END diff --cc t/test-extensions-invalid.sh index ebc3c75ea,3dc417a87..014589900 --- a/t/test-extensions-invalid.sh +++ b/t/test-extensions-invalid.sh @@@ -14,32 -14,31 +14,32 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Check that 'acconfig.h' is automatically distributed if it exists -# (at automake runtime). -# Related to automake bug#7819. +# Make sure that invalid entries in TEST_EXTENSIONS are diagnosed at +# make runtime. See automake bug#9400. - . ./defs || exit 1 + . test-init.sh -cat >> configure.ac <> configure.ac -cat > Makefile.am <<'END' -.PHONY: test -test: distdir - ls -l $(distdir) - echo ' ' $(DIST_COMMON) ' ' | grep '[ /]acconfig\.h ' - test -f $(distdir)/acconfig.h +cat > Makefile.am << 'END' +TESTS = +TEST_EXTENSIONS = mu x1 .foo _ x2 END -: > acconfig.h - $ACLOCAL -$AUTOMAKE $AUTOCONF +$AUTOMAKE -a ./configure -$MAKE test + +$MAKE 2>stderr && { cat stderr >&2; exit 1; } +cat stderr >&2 +for suf in mu x1 _ x2; do + $FGREP "invalid test extension: '$suf'" stderr +done + +# Verify that we don't report valid suffixes, even if intermixed +# with invalid ones. +grep 'invalid.*extension.*foo' stderr && exit 1 : diff --cc t/test-missing.sh index fb7974c4e,f8302487d..9d86e19aa --- a/t/test-missing.sh +++ b/t/test-missing.sh @@@ -14,9 -14,11 +14,9 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# parallel-tests: -# - non-existent scripts listed in TESTS get diagnosed -# See also related test 'test-missing2.sh'. +# parallel-tests: non-existent scripts listed in TESTS get diagnosed. - . ./defs || exit 1 + . test-init.sh cat >> configure.ac << 'END' AC_OUTPUT diff --cc t/test-trs-recover-parallel.sh index bc8b51de2,835d53ed8..24e2bd1cc --- a/t/test-trs-recover-parallel.sh +++ b/t/test-trs-recover-parallel.sh @@@ -14,46 -14,43 +14,46 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Check that 'acconfig.h' is *not* automatically distributed when -# placed in a subdirectory. -# Related to automake bug#7819. +# Check parallel harness features: +# - recovery from deleted '.log' and '.trs' files, with parallel make - . ./defs || exit 1 + . test-init.sh -cat >> configure.ac < Makefile.am <<'END' -SUBDIRS = sub -sub/acconfig.h: - echo target $@ should not be built >&2; exit 1 -check-local: distdir - ls -l $(distdir)/sub - test ! -f $(distdir)/sub/acconfig.h -END +echo AC_OUTPUT >> configure.ac +echo TESTS = > Makefile.am -mkdir sub +for i in $all; do + echo TESTS += $i.test >> Makefile.am + (echo "#!/bin/sh" && echo "mkdir $i.d") > $i.test + chmod a+x $i.test +done -cat > sub/Makefile.am <<'END' -acconfig.h: - echo target $@ should not be built >&2; exit 1 -check-local: - echo $(DISTFILES) | grep 'acconfig\.h' && exit 1; : - echo $(DIST_COMMON) | grep 'acconfig\.h' && exit 1; : -END - -: > sub/acconfig.h +ls -l # For debugging. $ACLOCAL -$AUTOMAKE $AUTOCONF +$AUTOMAKE -a ./configure + +: Create the required log files. $MAKE check +for n in 1 2 5 7 12; do + for suf in log trs; do + rmdir *.d + rm -f *.$suf + $MAKE -j$n check + for f in $all; do + test -f $f.log + test -f $f.trs + done + done +done + : diff --cc t/testsuite-summary-count-many.sh index 55b2eb42e,866b92251..1519c2831 --- a/t/testsuite-summary-count-many.sh +++ b/t/testsuite-summary-count-many.sh @@@ -19,10 -19,8 +19,10 @@@ # Incidentally, this test also checks that the testsuite summary doesn't # give any bug-report address if it's not defined. - . ./defs || exit 1 + . test-init.sh +expensive_ + for s in trivial-test-driver extract-testsuite-summary.pl; do cp "$am_testauxdir/$s" . || fatal_ "failed to fetch auxiliary script $s" done diff --cc t/txinfo-unrecognized-extension-2.sh index ac52e4ad1,c7ea3120b..abede4aea --- a/t/txinfo-unrecognized-extension-2.sh +++ b/t/txinfo-unrecognized-extension-2.sh @@@ -14,19 -14,24 +14,19 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Make sure backslash-newline-hash combinations are diagnosed as -# comments following a trailing backslash, even when the combination -# follows a variable assignment that is preceded by a comment. +# Test that automake complains properly when texinfo input files +# specify output info files with an invalid extension. - . ./defs || exit 1 + . test-init.sh cat > Makefile.am << 'END' -# initial comment -variable = value-before-comment \ -# - -# comment -SUBDIRS = foo \ -# bar - +info_TEXINFOS = foo.texi bar.texi baz.texi END -mkdir foo +echo '@setfilename foo.inf' > foo.texi +echo '@setfilename bar' > bar.texi +echo '@setfilename baz.texi' > baz.texi +: > texinfo.tex $ACLOCAL AUTOMAKE_fails diff --cc t/vala-headers.sh index 1c23cf86f,79a7b27c8..11c0d1021 --- a/t/vala-headers.sh +++ b/t/vala-headers.sh @@@ -16,8 -16,8 +16,8 @@@ # Test to make sure compiling Vala code really works with recursive make. -required="pkg-config valac gcc GNUmake" +required="pkg-config valac gcc" - . ./defs || exit 1 + . test-init.sh cat >> configure.ac << 'END' AC_PROG_CC diff --cc t/vala-libs.sh index 0eab4feb0,c38740f99..4469eb8de --- a/t/vala-libs.sh +++ b/t/vala-libs.sh @@@ -17,8 -17,8 +17,8 @@@ # Building libraries (libtool and static) from Vala sources. # And use of vapi files to call C code from Vala. -required="valac cc pkg-config libtoolize GNUmake" +required="valac cc pkg-config libtoolize" - . ./defs || exit 1 + . test-init.sh cat >> configure.ac << 'END' AC_PROG_CC diff --cc t/vala-mix.sh index e16c02cd2,5e2e7ce28..274d50678 --- a/t/vala-mix.sh +++ b/t/vala-mix.sh @@@ -16,8 -16,8 +16,8 @@@ # Vala sources and C sources in the same program. Functional test. -required='valac cc GNUmake' +required='valac cc' - . ./defs || exit 1 + . test-init.sh cat >> configure.ac <<'END' AC_PROG_CC diff --cc t/vala-mix2.sh index 7a2d32449,9b2402dec..753a5d144 --- a/t/vala-mix2.sh +++ b/t/vala-mix2.sh @@@ -17,8 -17,8 +17,8 @@@ # Vala sources, C and C++ sources and C and C++ headers in the same # program. Functional test. See automake bug#10894. -required='valac cc c++ GNUmake' +required='valac cc c++' - . ./defs || exit 1 + . test-init.sh cat >> configure.ac <<'END' AC_PROG_CC diff --cc t/vala-parallel.sh index 347913540,c71420ad7..19b5570a3 --- a/t/vala-parallel.sh +++ b/t/vala-parallel.sh @@@ -16,8 -16,8 +16,8 @@@ # Vala support with parallel make. -required='valac cc GNUmake' +required='valac cc' - . ./defs || exit 1 + . test-init.sh cat >> configure.ac <<'END' AC_PROG_CC diff --cc t/vala-vapi.sh index eea61609f,f006832a9..66d033ed7 --- a/t/vala-vapi.sh +++ b/t/vala-vapi.sh @@@ -16,8 -16,8 +16,8 @@@ # Test and that vapi files are correctly handled by Vala support. -required='valac cc GNUmake' +required='valac cc' - . ./defs || exit 1 + . test-init.sh cat >> configure.ac <<'END' AC_PROG_CC diff --cc t/vala-vpath.sh index 53b13585c,7428b9765..ad5acf680 --- a/t/vala-vpath.sh +++ b/t/vala-vpath.sh @@@ -17,8 -17,8 +17,8 @@@ # Test to make sure vala support handles from-scratch VPATH builds. # See automake bug#8753. -required="cc valac GNUmake" +required="cc valac" - . ./defs || exit 1 + . test-init.sh cat >> configure.ac << 'END' AC_CONFIG_SRCDIR([hello.vala]) diff --cc t/vala2.sh index a392a7a4e,2543c78e9..9103a3fbd --- a/t/vala2.sh +++ b/t/vala2.sh @@@ -16,8 -16,8 +16,8 @@@ # Test to make sure compiling Vala code really works with recursive make. -required="pkg-config valac gcc GNUmake" +required="pkg-config valac gcc" - . ./defs || exit 1 + . test-init.sh mkdir src diff --cc t/vala3.sh index ccce705fc,96135d34e..b3712e9e1 --- a/t/vala3.sh +++ b/t/vala3.sh @@@ -16,8 -16,8 +16,8 @@@ # Test to make sure compiling Vala code really works with non-recursive make. -required="pkg-config valac gcc GNUmake" +required="pkg-config valac gcc" - . ./defs || exit 1 + . test-init.sh mkdir src diff --cc t/vala5.sh index 7f5fba231,9cd57f8d1..94ae7aa01 --- a/t/vala5.sh +++ b/t/vala5.sh @@@ -16,8 -16,8 +16,8 @@@ # Test per-target flags. -required="pkg-config valac gcc GNUmake" +required="pkg-config valac gcc" - . ./defs || exit 1 + . test-init.sh mkdir src diff --cc t/vars-assign.sh index 36d3dc736,4878b50ab..700640089 --- a/t/vars-assign.sh +++ b/t/vars-assign.sh @@@ -14,35 -14,33 +14,35 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Check for _AM_OUTPUT_DEPENDENCY_COMMANDS grouping bug, -# reported by Markus Duft. +# Automake do not complain about nor messes up GNU make specific +# variable assignments (":=" and "?="). - . ./defs || exit 1 + . test-init.sh -cat >>configure.ac << END -AC_PROG_CC -AC_OUTPUT -END +echo AC_OUTPUT >> configure.ac -cat > Makefile.am << END -bin_PROGRAMS = foo -foo_SOURCES = foo.c foo.h -END +unset PREFOO FOO BAR BAZ XFOO XBAZ || : + +cat > Makefile.am <<'END' +PREFOO = bar +FOO := foo$(PREFOO)$(XFOO) +XFOO = fail +BAR ?= barbar -cat >foo.c << END -#include "foo.h" +.PHONY: test1 test2 +test1: + test $(FOO) = foobar + test $(BAR) = barbar +test2: + test $(FOO) = foobar + test $(BAR) = rabrab END -: >foo.h $ACLOCAL -$AUTOMAKE $AUTOCONF -./configure --disable-dependency-tracking 2>stderr || { - stat=$?; cat stderr >&2; exit $stat; -} -cat stderr >&2 -grep shift stderr && exit 1 +$AUTOMAKE +./configure +$MAKE test1 +PREFOO=notseen FOO=notseen BAR=rabrab $MAKE test2 : diff --cc t/vartar.sh index 91d8fb9b0,384538a46..590c9d900 --- a/t/vartar.sh +++ b/t/vartar.sh @@@ -16,12 -16,12 +16,12 @@@ # Targets and macros are two different name spaces. - . ./defs || exit 1 + . test-init.sh cat > Makefile.am << 'END' -install = install -install: - $(install) install +xinstall = xinstall +xinstall: + $(xinstall) xinstall END $ACLOCAL diff --cc t/vartypos.sh index 79271633f,e8da7e74c..68f18dbb7 --- a/t/vartypos.sh +++ b/t/vartypos.sh @@@ -16,16 -16,9 +16,16 @@@ # Make sure we warn about possible variable typos when we should. - . ./defs || exit 1 + . test-init.sh -cat >>configure.ac <<'END' +: > ltmain.sh + +cat >> configure.ac <<'END' +m4_define([AC_PROG_RANLIB], [AC_SUBST([RANLIB], [who-cares])]) +m4_define([AM_PROG_AR], [AC_SUBST([AR], [who-cares])]) +m4_define([LT_INIT], [AC_SUBST([LIBTOOL], [who-cares])]) +LT_INIT +AM_PROG_AR AC_PROG_RANLIB AC_OUTPUT END diff --cc t/vpath.sh index 20908104e,a67af17d8..33f6f0aad --- a/t/vpath.sh +++ b/t/vpath.sh @@@ -17,14 -17,10 +17,14 @@@ # Test to make sure VPATH can be overridden. # Report from Anthony Green. - . ./defs || exit 1 + . test-init.sh +echo AC_OUTPUT >> configure.ac + cat > Makefile.am << 'END' VPATH = zardoz +%.bar: %.foo + cp $< $@ END $ACLOCAL diff --cc t/warnopts.sh index c3be61798,65165b731..a368f23c5 --- a/t/warnopts.sh +++ b/t/warnopts.sh @@@ -16,12 -16,10 +16,12 @@@ # Make sure that we can enable or disable warnings on a per-file basis. - . ./defs || exit 1 + . test-init.sh -cat >>configure.ac <> configure.ac << 'END' +AC_PROG_CC AC_CONFIG_FILES([sub/Makefile]) +AM_CONDITIONAL([COND_FALSE], [false]) AC_OUTPUT END diff --cc t/werror.sh index d6c6587c1,57f6d648b..1475e444c --- a/t/werror.sh +++ b/t/werror.sh @@@ -16,19 -16,11 +16,19 @@@ # Test to make sure -Werror and --add-missing work together. +am_create_testdir=empty - . ./defs || exit 1 + . test-init.sh -: > Makefile.am - -rm -f install-sh depcomp missing mkinstalldirs +cat > configure.ac < Makefile.am +test ! -f install-sh # Sanity check. $ACLOCAL $AUTOMAKE -Werror --add-missing +test -f install-sh # Sanity check. + +: diff --cc t/werror2.sh index 8b42833ad,b1feeff21..b56448d70 --- a/t/werror2.sh +++ b/t/werror2.sh @@@ -19,9 -19,9 +19,9 @@@ # succeed if make is run a second time immediately afterwards. # Report from Harlan Stenn. - . ./defs || exit 1 + . test-init.sh -echo AC_OUTPUT>>configure.ac +echo AC_OUTPUT >> configure.ac : > Makefile.am diff --cc t/yacc-depend2.sh index 281dcd276,f20604dee..af5196a70 --- a/t/yacc-depend2.sh +++ b/t/yacc-depend2.sh @@@ -15,10 -15,11 +15,10 @@@ # along with this program. If not, see . # Make sure depcomp does not needlessly update headers and objects -# for yacc rules. This test still fails with FreeBSD make (but passes -# with NetBSD make). +# for yacc rules. required='cc yacc' - . ./defs || exit 1 + . test-init.sh cat >> configure.ac << 'END' AC_PROG_CC diff --cc t/yacc-dist-nobuild-subdir.sh index 94919aa40,f6064e7d4..3b34065f9 --- a/t/yacc-dist-nobuild-subdir.sh +++ b/t/yacc-dist-nobuild-subdir.sh @@@ -15,11 -15,16 +15,11 @@@ # along with this program. If not, see . # Check that VPATH builds and "make distcheck" works with packages -# using yacc and the automake 'subdir-objects' option. -# Exposes automake bug#8485. +# using yacc sources in a subdir option. Exposes automake bug#8485. required='cc yacc' - . ./defs || exit 1 + . test-init.sh -# This test is bounded to fail for any implementation that -# triggers automake bug#7884. -useless_vpath_rebuild && skip_ "would trip on automake bug#7884" - cat >> configure.ac << 'END' AC_PROG_CC AM_PROG_CC_C_O diff --cc t/yacc-line.sh index f7626b0a9,1b2b4848e..7f01d7686 --- a/t/yacc-line.sh +++ b/t/yacc-line.sh @@@ -19,9 -20,10 +19,9 @@@ # See also sister test 'lex-line.sh'. required='cc yacc' - . ./defs || exit 1 + . test-init.sh cat >> configure.ac << 'END' -AC_CONFIG_FILES([sub/Makefile]) AC_PROG_CC AM_PROG_CC_C_O AC_PROG_YACC diff --cc t/yacc-nodist.sh index 1be007c18,78191d9b1..8ccf7b80d --- a/t/yacc-nodist.sh +++ b/t/yacc-nodist.sh @@@ -15,10 -15,13 +15,10 @@@ # along with this program. If not, see . # Checks for .c and .h files derived from non-distributed yacc sources. -# The test 'yacc-pr204.sh' does similar check with AM_MAINTAINER_MODE -# enabled. -# The tests 'lex-nodist.sh' and 'lex-pr204.sh' does similar checks -# for lex-generated .c files. +# The test 'lex-sh.test' does similar checks for lex-generated '.c' required='cc yacc' - . ./defs || exit 1 + . test-init.sh cat >> configure.ac << 'END' AC_PROG_CC