# Check that AUTOMAKE_OPTIONS support variable expansion.
- . ./defs || exit 1
+am_create_testdir=empty
+ . test-init.sh
# We want complete control over automake options.
AUTOMAKE=$am_original_AUTOMAKE
# 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 '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 <<END
AC_CONFIG_FILES([sub/Makefile])
# For more background, see:
# <http://lists.gnu.org/archive/html/help-smalltalk/2012-08/msg00027.html>
# <http://lists.gnu.org/archive/html/automake-patches/2012-08/msg00052.html>
-# Backported to improve coverage of mainline Automake.
- . ./defs || exit 1
-required=GNUmake
+ . test-init.sh
echo AC_OUTPUT >> configure.ac
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# 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 <<EOF
+AC_CONFIG_FILES([src/Makefile])
AC_PROG_CC
AC_OUTPUT
EOF
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# 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
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# 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
# 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])
# > 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<DIR>' 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
:
# 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
# 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
# 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 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
:
# Test to make sure that if an auxfile (here depcomp) is required
# by a subdir Makefile.am, it is distributed by that Makefile.am.
- . ./defs || exit 1
+required=cc
+ . test-init.sh
cat >> configure.ac << 'END'
AC_CONFIG_FILES([subdir/Makefile])
# 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
# 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])
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Test to make sure 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
# 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
# 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"])
# 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
# 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
# $srcdir != $builddir, if properly declared.
# Suggested by observations from Braden McDaniel.
- . ./defs || exit 1
-required=GNUmake
+ . test-init.sh
echo AC_OUTPUT >> configure.ac
# 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
# Cf. 'fort1.sh' and 'link_f90_only.sh'.
- . ./defs || exit 1
+required=gfortran # Required only in order to run ./configure.
+ . test-init.sh
mkdir sub
# Test of compiled java.
- . ./defs || exit 1
+required='gcc gcj'
+ . 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'
# 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 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 <<END
-AC_INIT([$me], [1.0])
-AM_INIT_AUTOMAKE
-AC_PROG_CC
-AC_CONFIG_FILES([myMakefile])
+cat >> 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
# 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 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
:
# Check gettext support.
required='gettext'
- . ./defs || exit 1
+ . test-init.sh
-cat >>configure.ac <<END
+cat >> configure.ac << 'END'
AM_GNU_GETTEXT
-AM_GNU_GETTEXT_VERSION([0.14.3])
AC_OUTPUT
END
# 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])
# 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 '../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).
- . ./defs || exit 1
+required=cc
+ . test-init.sh
cat >> configure.ac << 'END'
AC_PROG_CC
# 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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# 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
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# 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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# 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])
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# 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])
# 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
# 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
# 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
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# 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
# 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 $(am__make_dryrun) works as expected.
+# Check that $(am.make.dry-run) works as expected.
- . ./defs || exit 1
+ . test-init.sh
plan_ 14
# 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 <<END
m4_include([version.m4])
# Test to make sure known BSD 'make -jN' issues are fixed:
# without -B, it may reuse the same shell for separate commands in a
# rule, which can lead to interesting results.
+# Problems like this shouldn't happen with GNU make, but we keep the
+# test anyway for the moment, for extra safety.
- . ./defs || exit 1
+ . test-init.sh
cat >>configure.ac <<'END'
AC_OUTPUT
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# 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
# 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'
# 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
# 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:
# 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 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"
# 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
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# 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.
- . ./defs || exit 1
+am_create_testdir=empty
+ . test-init.sh
-mkdir obj
-
-cat >>configure.ac << 'END'
-AC_CONFIG_FILES([obj/Makefile])
+cat > configure.ac <<END
+AC_INIT([$me], [1.0])
+AC_CONFIG_AUX_DIR([obj])
+AM_INIT_AUTOMAKE
+AC_REQUIRE_AUX_FILE([Makefile])
+AC_CONFIG_FILES([Makefile])
AC_OUTPUT
END
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Test to make sure '.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 <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE([ng])
+AC_CONFIG_FILES([Makefile])
END
-echo '@setfilename foo.info' > foo.txi
-: > texinfo.tex
+echo AUTOMAKE_OPTIONS = ng > Makefile.am
$ACLOCAL
$AUTOMAKE
# - 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
# 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
# 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:
-# - 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
# 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:
-# - 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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# 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 <<END
AC_SUBST([PERL], ['$PERL'])
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Test to make sure 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; }
:
# 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 ':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
# 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 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: <http://lists.gnu.org/archive/html/automake/2010-08/msg00074.html>
-# or: <http://thread.gmane.org/gmane.comp.sysutils.automake.general/11943/focus=11962>
+# 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
:
# == 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])
# 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])
# 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])
# 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 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
# 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__
# 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.sh'.
- . ./defs || exit 1
+ . test-init.sh
mkfile=Makefile
# 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__'
# 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__'
# 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 <<END
AC_INIT([$me], [1.0])
# Option 'serial-tests'.
- . ./defs || exit 1
-am_create_testdir=empty
+ . test-init.sh
-hasnt_parallel_tests ()
-{
- $EGREP 'TEST_SUITE_LOG|TEST_LOGS|\.log.*:' $1 && exit 1
- grep 'recheck.*:' $1 && exit 1
- grep '^check-TESTS: \$(TESTS)$' $1
-}
-
-has_parallel_tests ()
-{
- $EGREP '(^| )check-TESTS.*:' $1
- $EGREP '(^| )recheck.*:' $1
- grep '^\$(TEST_SUITE_LOG): \$(TEST_LOGS)$' $1
- grep '^\.test\.log:$' $1
-}
-
-mkdir one two
-
-cat > one/configure.ac <<END
-AC_INIT([$me], [1.0])
-AM_INIT_AUTOMAKE([serial-tests])
-AC_CONFIG_FILES([Makefile])
-END
-
-echo 'TESTS = foo.test bar.test' > one/Makefile.am
-
-cat > two/configure.ac <<END
-AC_INIT([$me], [2.0])
-AC_CONFIG_AUX_DIR([config])
-AM_INIT_AUTOMAKE([parallel-tests])
-AC_CONFIG_FILES([aMakefile bMakefile])
-END
-
-cp one/Makefile.am two/aMakefile.am
-cat - one/Makefile.am > two/bMakefile.am <<END
+cat > 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 ..
:
# 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
# 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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# 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
# Test to make sure misspellings in _SOURCES variables cause failure.
- . ./defs || exit 1
+required=cc
+ . 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
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Test to make sure misspellings in _SOURCES variables cause failure.
+# Test to make sure misspellings in _LDADD variable cause failure.
- . ./defs || exit 1
+required=cc
+ . 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
# 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 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.
- . ./defs || exit 1
+am_create_testdir=empty
+ . test-init.sh
-cat > configure.ac <<END
-AC_INIT([$me], [1.0])
-AM_ENABLE_MULTILIB
+cat > 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
:
# 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 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.
- . ./defs || exit 1
+am_create_testdir=empty
+ . 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"
:
# 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 := 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
:
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Test to make sure .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
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Test to make sure 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
# 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++.
+# 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
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# 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
# 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 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
# 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 '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])
# forgets '.../<file>.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
# 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
# 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
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# 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 <<EOF
AC_PROG_CC
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# 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 <<EOF
AC_PROG_CC
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# 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
# 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 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
# (related to PR/37)
required='cc libtoolize yacc'
- . ./defs || exit 1
+ . test-init.sh
-plan_ 7
-
cat >>configure.ac <<EOF
AC_PROG_CC
AC_PROG_YACC
# 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 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
# From PR/37.
required='cc libtoolize'
- . ./defs || exit 1
+ . test-init.sh
-plan_ 10
-
cat >>configure.ac <<'END'
AM_PROG_AR
AM_PROG_LIBTOOL
# Test for bug reported by Harlan Stenn: the tags target doesn't work
# when there are only headers in a directory.
- . ./defs || exit 1
+required=mkid
+ . 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
# 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
# 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
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# TAP support:
-# - RECHECK_LOGS
+# TAP support: AM_LAZY_CHECK
- . ./defs || exit 1
+ . test-init.sh
cat > Makefile.am << 'END'
TEST_LOG_COMPILER = cat
# 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"
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# 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
# 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 '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 <<END
-AC_OUTPUT
-END
+echo AC_OUTPUT >> 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
:
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# 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
# 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 '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 <<END
-AC_CONFIG_FILES([sub/Makefile])
-AC_OUTPUT
-END
+all= log= trs=
+for i in 1 2 3 4 5 6 7 8 9 10 11 12; do
+ all="$all $i" log="$log $i" trs="$trs $i"
+done
-cat > 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
+
:
# 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
# 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 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
# 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
# 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
# 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
# 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
# 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
# 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
# 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])
# 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
# 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
# Test per-target flags.
-required="pkg-config valac gcc GNUmake"
+required="pkg-config valac gcc"
- . ./defs || exit 1
+ . test-init.sh
mkdir src
# 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 _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
:
# 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
# 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
# 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
# Make sure that we can enable or disable warnings on a per-file basis.
- . ./defs || exit 1
+ . test-init.sh
-cat >>configure.ac <<END
+cat >> configure.ac << 'END'
+AC_PROG_CC
AC_CONFIG_FILES([sub/Makefile])
+AM_CONDITIONAL([COND_FALSE], [false])
AC_OUTPUT
END
# Test to make sure -Werror and --add-missing work together.
- . ./defs || exit 1
+am_create_testdir=empty
+ . test-init.sh
-: > Makefile.am
-
-rm -f install-sh depcomp missing mkinstalldirs
+cat > configure.ac <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile])
+END
+: > Makefile.am
+test ! -f install-sh # Sanity check.
$ACLOCAL
$AUTOMAKE -Werror --add-missing
+test -f install-sh # Sanity check.
+
+:
# 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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# 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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# 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
# 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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# 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