]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tests: don't require GNU make where it's not strictly needed
authorStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 2 Jun 2011 09:22:32 +0000 (11:22 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 2 Jun 2011 09:22:32 +0000 (11:22 +0200)
* 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.

20 files changed:
ChangeLog
tests/aclocal5.test
tests/aclocal6.test
tests/autohdr3.test
tests/conff.test
tests/confh6.test
tests/lex3.test
tests/lex5.test
tests/maken2.test
tests/maken4.test
tests/output6.test
tests/remake-subdir-from-subdir.test
tests/remake-subdir-gnu.test
tests/remake-subdir.test
tests/remake-subdir2.test
tests/remake11.test
tests/subdir5.test
tests/subdir8.test
tests/version7.test
tests/werror2.test

index 385c3cc3dd4490a91c5447a7bb850f99dd7160ac..04df5264ecc67dbf22689c35f37b35bd89da9a89 100644 (file)
--- 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
index 0f87e00018a5d7490facb9c28319840216b0cbc8..ab06607a8f9c534fa050ff2f8dfca602e13f7fd9 100755 (executable)
 # 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'
index 905608c39534c0192fd1bc34ee333c8f7f84e5cc..c631e64c3ce1b278230c1d04581bb9a851e5d100 100755 (executable)
@@ -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'
index b75506bfded83adc8e52a400058cdb2ffe4e2e88..85688da1a098d38d415a0f288865d520dd17aba3 100755 (executable)
@@ -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
+
+:
index 1565271e28ebae5f05f63b309bedb0f0ea701520..2f0214a2ee9695574c517b400d38a2f6c45517c1 100755 (executable)
@@ -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 ..
index c00190fb687f7106ad6f47c31a66913653d5bad5..c03880b07b860061760085ad289dd35f108fa430 100755 (executable)
@@ -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'
index ae79796b4bad7a53a46ece1f3812d17eea658554..dca98ba473a746866cdf04d6923693759b3326c4 100755 (executable)
@@ -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'
index ee4306fb851e29a2c9892445998e34048c06d785..932a37421704e9843cd78d51db7a9c1fb1fead42 100755 (executable)
@@ -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
index eb330a23f7e97def5aafa5889a6b374588d9453b..a6625e2d0306bb28ff6f41e94bce0ac5bba0deb2 100755 (executable)
@@ -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.
 
index 5c21943714b0ae491faebcff6d8e9cbb75f95f87..bef1389fc208b94baebaebc9fbe4c4ae08168741 100755 (executable)
 
 # 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'
index 483de80e6ea0c8525ad6b2ae04df28464d3c4bfe..e28391933a21be09198e1e7efd6a7088a28e8ade 100755 (executable)
 
 # 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
+
+:
index 1e369f8a2d855b200dda233b77201c80a037189d..f84455035a613bc3f8bd5eb4c95c4bdae9a441e0 100755 (executable)
@@ -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
 
index cc683f3aef8c8f62ebc70c398e8597875bb5161a..7865c20d54d8cae24bc317050413a701e3b8c139 100755 (executable)
@@ -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
index 5bbc3452bd0607b6480c166c28ffc758accab789..3ccfee5c49b3560ae1f09c5beeb9256cf1fab6ee 100755 (executable)
@@ -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
 
index 09d1a36b9c529de9f80c621abab65c8aaeb68fbe..dcf306eb8ab68b95f9fc79d7d1516f9bd22bf4db 100755 (executable)
@@ -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
 
index bfd682e991284eb6ecbeb19e3f3d8fb24eea8b5f..493fcf31921f8846c37908412e9a862eda527443 100755 (executable)
@@ -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
index 42c9ad6dc21a4b780aac7b6e8b6617b305daef02..f9865b618adf41b633909cfd956c0a43183bc667 100755 (executable)
 # 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'
index dc13c2b5583f4ba72df73e36ef68eee038a9cc55..502c9e40088320743229fd57db16b548f4e188d5 100755 (executable)
 # 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'
index 2385b07a9376cf7586fd171104360b032fea89df..fe5dd026b16040ec67a5dbb12c59c9570c7f3654 100755 (executable)
@@ -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
index c3c46a56054df0e9c4373d0aea7dc0860d9a1bcc..bb5851e7635b5f9333bac4921a7052d3685d7dee 100755 (executable)
@@ -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
 
 :