summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2011-06-02 11:22:32 +0200
committerStefano Lattarini <stefano.lattarini@gmail.com>2011-06-02 11:22:32 +0200
commit5e62b9623217fd5c23934c7d62b0f02ee6829c70 (patch)
tree690721cdaf1a4326ef3bcc5b62c07ddc3299923d
parent1f703d92432c1f6a9014d7f632e06493d4768e22 (diff)
downloadautomake-5e62b9623217fd5c23934c7d62b0f02ee6829c70.tar.gz
tests: don't require GNU make where it's not strictly needed
* tests/autohdr3.test: Rewrite to be stricter when make is GNU make. Drop the requirement of GNU make. * tests/aclocal5.test: Drop GNU make requirement, it's not truly needed. Add reference to similar tests `remake-subdir*.test'. * remake-subdir-gnu.test, remake-subdir-from-subdir.test, remake-subdir.test, remake-subdir2.test: Add reference to each other, and to related test `aclocal5.test'. * tests/aclocal6.test: Drop GNU make requirement, it's not truly needed. * tests/confh6.test: Likewise. * tests/lex3.test: Likewise. * tests/remake11.test: Likewise. * tests/subdir5.test: Likewise. * tests/subdir8.test: Likewise. * tests/werror2.test: Likewise. * tests/conff.test: Likewise, and ensure verbose printing of captured make output. * tests/lex5.test: Tweak so that GNU make is no more required. * tests/version7.test: Likewise. * tests/maken2.test: Add explicative comment for why this test required GNU make. * tests/maken4.test: Let it run also with BSD makes supporting the `.MAKE' special target. * tests/output6.test: Use proper m4 quoting in configure.in. Expand make macros with one-character name using `$(x)', not `$x', for portability. Move checks in the makefiles, rather than relying on grepping the output from make. Drop the now unneeded GNU make requirement.
-rw-r--r--ChangeLog32
-rwxr-xr-xtests/aclocal5.test7
-rwxr-xr-xtests/aclocal6.test1
-rwxr-xr-xtests/autohdr3.test20
-rwxr-xr-xtests/conff.test13
-rwxr-xr-xtests/confh6.test1
-rwxr-xr-xtests/lex3.test2
-rwxr-xr-xtests/lex5.test3
-rwxr-xr-xtests/maken2.test5
-rwxr-xr-xtests/maken4.test17
-rwxr-xr-xtests/output6.test18
-rwxr-xr-xtests/remake-subdir-from-subdir.test4
-rwxr-xr-xtests/remake-subdir-gnu.test2
-rwxr-xr-xtests/remake-subdir.test2
-rwxr-xr-xtests/remake-subdir2.test2
-rwxr-xr-xtests/remake11.test1
-rwxr-xr-xtests/subdir5.test8
-rwxr-xr-xtests/subdir8.test8
-rwxr-xr-xtests/version7.test3
-rwxr-xr-xtests/werror2.test3
20 files changed, 103 insertions, 49 deletions
diff --git a/ChangeLog b/ChangeLog
index 385c3cc3d..04df5264e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,35 @@
+2011-06-02 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests: don't require GNU make where it's not strictly needed
+ * tests/autohdr3.test: Rewrite to be stricter when make is GNU
+ make. Drop the requirement of GNU make.
+ * tests/aclocal5.test: Drop GNU make requirement, it's not truly
+ needed. Add reference to similar tests `remake-subdir*.test'.
+ * remake-subdir-gnu.test, remake-subdir-from-subdir.test,
+ remake-subdir.test, remake-subdir2.test: Add reference to
+ each other, and to related test `aclocal5.test'.
+ * tests/aclocal6.test: Drop GNU make requirement, it's not
+ truly needed.
+ * tests/confh6.test: Likewise.
+ * tests/lex3.test: Likewise.
+ * tests/remake11.test: Likewise.
+ * tests/subdir5.test: Likewise.
+ * tests/subdir8.test: Likewise.
+ * tests/werror2.test: Likewise.
+ * tests/conff.test: Likewise, and ensure verbose printing of
+ captured make output.
+ * tests/lex5.test: Tweak so that GNU make is no more required.
+ * tests/version7.test: Likewise.
+ * tests/maken2.test: Add explicative comment for why this test
+ requires GNU make.
+ * tests/maken4.test: Let it run also with BSD makes supporting
+ the `.MAKE' special target.
+ * tests/output6.test: Use proper m4 quoting in configure.in.
+ Expand make macros with one-character name using `$(x)', not
+ `$x', for portability. Move checks in the makefiles, rather
+ than relying on grepping the output from make. Drop the now
+ unneeded GNU make requirement.
+
2011-05-29 Stefano Lattarini <stefano.lattarini@gmail.com>
remake: behave better with non-GNU make in subdirectories
diff --git a/tests/aclocal5.test b/tests/aclocal5.test
index 0f87e0001..ab06607a8 100755
--- a/tests/aclocal5.test
+++ b/tests/aclocal5.test
@@ -14,12 +14,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Test to make sure that aclocal.m4's dependencies are honored
-# in sub-directories.
+# Test to make sure that aclocal.m4's dependencies are honored in
+# sub-directories. See also related tests `remake-subdir*.test'.
-# This test assumes that the `make' utility is able to start
-# over and reload Makefiles which have been remade (a non-POSIX feature).
-required='GNUmake'
. ./defs || Exit 1
cat >> configure.in << 'END'
diff --git a/tests/aclocal6.test b/tests/aclocal6.test
index 905608c39..c631e64c3 100755
--- a/tests/aclocal6.test
+++ b/tests/aclocal6.test
@@ -17,7 +17,6 @@
# Make sure aclocal.m4 is rebuilt whenever a configure
# dependency changes. Test for acinclude.m4 and VPATH too.
-required='GNUmake'
. ./defs || Exit 1
cat >> configure.in << 'END'
diff --git a/tests/autohdr3.test b/tests/autohdr3.test
index b75506bfd..85688da1a 100755
--- a/tests/autohdr3.test
+++ b/tests/autohdr3.test
@@ -16,7 +16,6 @@
# Check rebuild rules for autoheader.
-required=GNUmake
. ./defs || Exit 1
cat >>configure.in <<EOF
@@ -25,9 +24,18 @@ AC_CONFIG_HEADERS([config.h:config.hin])
AC_OUTPUT
EOF
-: > Makefile.am
: > foo.m4
+cat > Makefile.am <<'END'
+.PHONY: test
+check-local: test
+test:
+ cat $(srcdir)/config.hin ;: For debugging.
+ cat config.h ;: Likewise.
+ grep '#.*GREPME' $(srcdir)/config.hin
+ grep '#.*define.*GREPME' config.h
+END
+
$ACLOCAL
$AUTOCONF
$AUTOHEADER
@@ -39,8 +47,8 @@ $MAKE
$sleep
echo 'AC_DEFINE([GREPME], 1, [Doc for GREPME])' > foo.m4
-$MAKE
-grep GREPME config.hin
-grep GREPME config.h
-
+using_gmake || $MAKE
+$MAKE test
$MAKE distcheck
+
+:
diff --git a/tests/conff.test b/tests/conff.test
index 1565271e2..2f0214a2e 100755
--- a/tests/conff.test
+++ b/tests/conff.test
@@ -17,7 +17,6 @@
# Make sure rebuild rules work even when AC_CONFIG_FILES uses colons.
# Report from Alexander Turbov.
-required=GNUmake
. ./defs || Exit 1
cat >> configure.in << 'END'
@@ -48,10 +47,10 @@ $AUTOMAKE
$MAKE
cd bar
-$MAKE top-rule >stdout
+$MAKE top-rule >stdout || { cat stdout; Exit 1; }
cat stdout
grep 'top rule' stdout
-$MAKE bot-rule >stdout
+$MAKE bot-rule >stdout || { cat stdout; Exit 1; }
cat stdout
grep 'bot rule' stdout
cd ..
@@ -65,10 +64,10 @@ END
$MAKE
cd bar
-$MAKE top-rule >stdout
+$MAKE top-rule >stdout || { cat stdout; Exit 1; }
cat stdout
grep 'top2 rule' stdout
-$MAKE bot-rule >stdout
+$MAKE bot-rule >stdout || { cat stdout; Exit 1; }
cat stdout
grep 'bot rule' stdout
cd ..
@@ -82,10 +81,10 @@ END
$MAKE
cd bar
-$MAKE top-rule >stdout
+$MAKE top-rule >stdout || { cat stdout; Exit 1; }
cat stdout
grep 'top2 rule' stdout
-$MAKE bot-rule >stdout
+$MAKE bot-rule >stdout || { cat stdout; Exit 1; }
cat stdout
grep 'bot2 rule' stdout
cd ..
diff --git a/tests/confh6.test b/tests/confh6.test
index c00190fb6..c03880b07 100755
--- a/tests/confh6.test
+++ b/tests/confh6.test
@@ -19,7 +19,6 @@
# idea is that if config.h is in a subdir, and there is no Makefile in
# that subdir, then we want to build config.h as the top level.
-required=GNUmake
. ./defs || Exit 1
cat >> configure.in << 'END'
diff --git a/tests/lex3.test b/tests/lex3.test
index ae79796b4..dca98ba47 100755
--- a/tests/lex3.test
+++ b/tests/lex3.test
@@ -19,7 +19,7 @@
# Test associated with PR 19.
# From Matthew D. Langston.
-required='cc flex GNUmake'
+required='cc flex'
. ./defs || Exit 1
cat >> configure.in << 'END'
diff --git a/tests/lex5.test b/tests/lex5.test
index ee4306fb8..932a37421 100755
--- a/tests/lex5.test
+++ b/tests/lex5.test
@@ -17,7 +17,7 @@
# Test for subdir lexers.
-required='cc GNUmake flex'
+required='cc flex'
. ./defs || Exit 1
cat >> configure.in << 'END'
@@ -85,6 +85,7 @@ $AUTOMAKE -a --no-force
test -f ./ylwrap
cd sub
+using_gmake || $MAKE Makefile
$MAKE foo/foo2.o
test -f foo/foo2.c
test -f foo/foo2.o
diff --git a/tests/maken2.test b/tests/maken2.test
index eb330a23f..a6625e2d0 100755
--- a/tests/maken2.test
+++ b/tests/maken2.test
@@ -14,8 +14,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Ensure that `make -n dist' and `make -n distcheck' show what would happen.
-# This currently works for GNU make only.
+# Ensure that `make -n dist' and `make -n distcheck' show what would
+# happen. This currently works for GNU make, but might fail with other
+# make implementations (e.g., FreeBSD's or NetBSD's).
# Please keep this test in sync with sister test maken.test.
diff --git a/tests/maken4.test b/tests/maken4.test
index 5c2194371..bef1389fc 100755
--- a/tests/maken4.test
+++ b/tests/maken4.test
@@ -23,9 +23,24 @@
# Please keep this test in sync with sister test maken3.test.
-required=GNUmake
. ./defs || Exit 1
+if using_gmake; then
+ : Good, make is GNU make.
+else
+ unindent > mk.tmp << 'END'
+ targ.tmp:
+ : > $@
+ .MAKE: targ.tmp
+END
+ if $MAKE -n -f mk.tmp targ.tmp && test -f targ.tmp; then
+ : Good, make supports the '.MAKE' special target.
+ else
+ skip_ "GNU or BSD make required"
+ fi
+ rm -f *.tmp
+fi
+
mkdir sub sub2
cat >> configure.in << 'END'
diff --git a/tests/output6.test b/tests/output6.test
index 483de80e6..e28391933 100755
--- a/tests/output6.test
+++ b/tests/output6.test
@@ -16,13 +16,12 @@
# Check for support for colon separated input files in AC_CONFIG_FILES
-required=GNUmake
. ./defs || Exit 1
cat > configure.in << END
AC_INIT([$me], [1.0])
AM_INIT_AUTOMAKE
-AC_CONFIG_FILES(foo:a.in:b.in:c.in:d.in)
+AC_CONFIG_FILES([foo:a.in:b.in:c.in:d.in])
AC_OUTPUT
END
@@ -43,8 +42,11 @@ cat >c.am <<'EOF'
c = C
d = C
-print:
- @echo $a$b$c$d
+.PHONY: test1 test2
+test1:
+ test $(a)$(b)$(c)$(d) = ABCD
+test2:
+ test $(a)$(b)$(c)$(d) = GFCD
EOF
echo 'd = D' > d.in
@@ -54,7 +56,7 @@ $ACLOCAL
$AUTOCONF
$AUTOMAKE
./configure
-$MAKE -f foo print | grep 'ABCD'
+$MAKE -f foo test1
$sleep
cat >b.in <<'EOF'
@@ -64,5 +66,7 @@ c = F
d = F
EOF
-# This involves the rebuild rule, hence it requires GNUmake
-$MAKE -f foo print | grep 'GFCD'
+using_gmake || $MAKE -f foo
+$MAKE -f foo test2
+
+:
diff --git a/tests/remake-subdir-from-subdir.test b/tests/remake-subdir-from-subdir.test
index 1e369f8a2..f84455035 100755
--- a/tests/remake-subdir-from-subdir.test
+++ b/tests/remake-subdir-from-subdir.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2009 Free Software Foundation, Inc.
+# Copyright (C) 2009, 2011 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -16,6 +16,8 @@
# Check that remake rules works for adding a new subdirectory from a
# pre-existing subdirectory.
+# See also the other similar tests `remake-subdir*.test', and the
+# related test `aclocal5.test'.
. ./defs || Exit 1
diff --git a/tests/remake-subdir-gnu.test b/tests/remake-subdir-gnu.test
index cc683f3ae..7865c20d5 100755
--- a/tests/remake-subdir-gnu.test
+++ b/tests/remake-subdir-gnu.test
@@ -17,6 +17,8 @@
# Check that remake rules works from subdirectories, even using
# `GNUmakefile' as makefiles name. This obviously requires GNU
# make.
+# See also the other similar tests `remake-subdir*.test', and the
+# related test `aclocal5.test'
required=GNUmake
. ./defs || Exit 1
diff --git a/tests/remake-subdir.test b/tests/remake-subdir.test
index 5bbc3452b..3ccfee5c4 100755
--- a/tests/remake-subdir.test
+++ b/tests/remake-subdir.test
@@ -16,6 +16,8 @@
# Check that remake rules works from subdirectories, even with non-GNU
# make implementations.
+# See also the other similar tests `remake-subdir*.test', and the
+# related test `aclocal5.test'
. ./defs || Exit 1
diff --git a/tests/remake-subdir2.test b/tests/remake-subdir2.test
index 09d1a36b9..dcf306eb8 100755
--- a/tests/remake-subdir2.test
+++ b/tests/remake-subdir2.test
@@ -16,6 +16,8 @@
# Check that remake rules works from subdirectories, even when makefiles
# are not named "Makefile".
+# See also the other similar tests `remake-subdir*.test', and the
+# related test `aclocal5.test'
. ./defs || Exit 1
diff --git a/tests/remake11.test b/tests/remake11.test
index bfd682e99..493fcf319 100755
--- a/tests/remake11.test
+++ b/tests/remake11.test
@@ -19,7 +19,6 @@
# rules don't break in obvious ways in a slightly "heavier than usual"
# setup.
-required=GNUmake
. ./defs || Exit 1
ocwd=`pwd` || Exit 1
diff --git a/tests/subdir5.test b/tests/subdir5.test
index 42c9ad6dc..f9865b618 100755
--- a/tests/subdir5.test
+++ b/tests/subdir5.test
@@ -16,14 +16,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Test to make sure that adding a new directory works.
-# This test runs `make' from the top-level directory, subdir8.test
-# do it from a subdirectory.
+# This test runs `make' from the top-level directory, the sister test
+# `subdir8.test' do it from a subdirectory.
# PR automake/46
-# This test assumes that the `make' utility is able to start
-# over and reload Makefiles which have been remade (a non-POSIX feature).
-# See also the related test subdir8.test.
-required=GNUmake
. ./defs || Exit 1
cat >> configure.in << 'END'
diff --git a/tests/subdir8.test b/tests/subdir8.test
index dc13c2b55..502c9e400 100755
--- a/tests/subdir8.test
+++ b/tests/subdir8.test
@@ -16,14 +16,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Test to make sure that adding a new directory works, even from
-# subdirectories. (subdir5.test makes sure it works when make
-# is run from the top-level directory.)
+# subdirectories. The sister test `subdir5.test' makes sure it works
+# when make is run from the top-level directory.
# PR automake/46
-# This test assumes that the `make' utility is able to start
-# over and reload Makefiles which have been remade (a non-POSIX feature).
-# See also the related test subdir5.test.
-required=GNUmake
. ./defs || Exit 1
cat >> configure.in << 'END'
diff --git a/tests/version7.test b/tests/version7.test
index 2385b07a9..fe5dd026b 100755
--- a/tests/version7.test
+++ b/tests/version7.test
@@ -19,7 +19,7 @@
# is to make sure Makefile.ins get rebuilt when a m4_included file
# changes -- we don't support this feature on non-GNU Makes).
-required='makeinfo tex texi2dvi GNUmake'
+required='makeinfo tex texi2dvi'
. ./defs || Exit 1
cat >configure.in <<END
@@ -59,6 +59,7 @@ grep '2\.718' version.texi
$sleep
echo 'm4_define([THE_VERSION], [3.141])' > version.m4
+using_gmake || $MAKE Makefile
$MAKE distcheck
./configure --version | grep '3\.141'
grep '3\.141' version.texi
diff --git a/tests/werror2.test b/tests/werror2.test
index c3c46a560..bb5851e76 100755
--- a/tests/werror2.test
+++ b/tests/werror2.test
@@ -19,7 +19,6 @@
# succeed if make is run a second time immediately afterwards.
# Report from Harlan Stenn.
-required=GNUmake
. ./defs || Exit 1
echo AC_OUTPUT>>configure.in
@@ -42,8 +41,8 @@ INCLUDES = -Ifoo
foo_SOURCES = unused
END
+# This repetition is deliberate; see heading comments.
$MAKE && Exit 1
-
$MAKE && Exit 1
: