automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[FYI] {testsuite-work} tests: don't require GNU make where it's not stri


From: Stefano Lattarini
Subject: [FYI] {testsuite-work} tests: don't require GNU make where it's not strictly needed
Date: Thu, 2 Jun 2011 11:24:51 +0200
User-agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )

* 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.
---
 ChangeLog                            |   32 ++++++++++++++++++++++++++++++++
 tests/aclocal5.test                  |    7 ++-----
 tests/aclocal6.test                  |    1 -
 tests/autohdr3.test                  |   20 ++++++++++++++------
 tests/conff.test                     |   13 ++++++-------
 tests/confh6.test                    |    1 -
 tests/lex3.test                      |    2 +-
 tests/lex5.test                      |    3 ++-
 tests/maken2.test                    |    5 +++--
 tests/maken4.test                    |   17 ++++++++++++++++-
 tests/output6.test                   |   18 +++++++++++-------
 tests/remake-subdir-from-subdir.test |    4 +++-
 tests/remake-subdir-gnu.test         |    2 ++
 tests/remake-subdir.test             |    2 ++
 tests/remake-subdir2.test            |    2 ++
 tests/remake11.test                  |    1 -
 tests/subdir5.test                   |    8 ++------
 tests/subdir8.test                   |    8 ++------
 tests/version7.test                  |    3 ++-
 tests/werror2.test                   |    3 +--
 20 files changed, 103 insertions(+), 49 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 385c3cc..04df526 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,35 @@
+2011-06-02  Stefano Lattarini  <address@hidden>
+
+       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  <address@hidden>
 
        remake: behave better with non-GNU make in subdirectories
diff --git a/tests/aclocal5.test b/tests/aclocal5.test
index 0f87e00..ab06607 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 905608c..c631e64 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 b75506b..85688da 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 1565271..2f0214a 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 c00190f..c03880b 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 ae79796..dca98ba 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 ee4306f..932a374 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 eb330a2..a6625e2 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 5c21943..bef1389 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 483de80..e283919 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 1e369f8..f844550 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 cc683f3..7865c20 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 5bbc345..3ccfee5 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 09d1a36..dcf306e 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 bfd682e..493fcf3 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 42c9ad6..f9865b6 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 dc13c2b..502c9e4 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 2385b07..fe5dd02 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 c3c46a5..bb5851e 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
 
 :
-- 
1.7.2.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]