automake-ng
[Top][All Lists]
Advanced

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

[Automake-ng] [PATCH 3/5] [ng] tests: just assume make can chain suffix


From: Stefano Lattarini
Subject: [Automake-ng] [PATCH 3/5] [ng] tests: just assume make can chain suffix rules automatically
Date: Sat, 17 Dec 2011 11:51:35 +0100

* Makefile.am (sc_tests_make_can_chain_suffix_rules): New
maintainer-check.
(syntax_check_rules): Add it.
* tests/defs (make_can_chain_suffix_rules): Remove this function.
* tests/suffix-chain.tap: Remove `make_can_chain_suffix_rules'
usages, and, where possible, simplify code and logic by assuming
that $MAKE can always chain suffix rules automatically.
* tests/suffix3.tap: Likewise.
* tests/suffix8.tap: Likewise.
* tests/suffix10.tap: Likewise.
* tests/suffix11.tap: Likewise.
---
 ChangeLog              |   15 +++++++++++++++
 Makefile.am            |   15 +++++++++++++++
 Makefile.in            |   13 +++++++++++++
 tests/defs             |   11 -----------
 tests/suffix-chain.tap |   24 +++++++++---------------
 tests/suffix10.tap     |    5 +----
 tests/suffix11.tap     |   16 +++++-----------
 tests/suffix3.tap      |    9 ++-------
 tests/suffix8.tap      |    9 ++-------
 9 files changed, 62 insertions(+), 55 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6a35067..5770dd6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,20 @@
 2011-12-15  Stefano Lattarini  <address@hidden>
 
+       [ng] tests: just assume make can chain suffix rules automatically
+       * Makefile.am (sc_tests_make_can_chain_suffix_rules): New
+       maintainer-check.
+       (syntax_check_rules): Add it.
+       * tests/defs (make_can_chain_suffix_rules): Remove this function.
+       * tests/suffix-chain.tap: Remove `make_can_chain_suffix_rules'
+       usages, and, where possible, simplify code and logic by assuming
+       that $MAKE can always chain suffix rules automatically.
+       * tests/suffix3.tap: Likewise.
+       * tests/suffix8.tap: Likewise.
+       * tests/suffix10.tap: Likewise.
+       * tests/suffix11.tap: Likewise.
+
+2011-12-15  Stefano Lattarini  <address@hidden>
+
        [ng] tests: no need explicitly check whether $MAKE is GNU make
        Automake-NG assumes the use of GNU make unconditionally, so test
        cases should never check explicitly whether the make program
diff --git a/Makefile.am b/Makefile.am
index 6402850..5527483 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -190,6 +190,7 @@ sc_perl_local \
 sc_AMDEP_TRUE_in_automake_in \
 sc_tests_no_gmake_requirement \
 sc_tests_no_gmake_checking \
+sc_tests_make_can_chain_suffix_rules \
 sc_tests_make_without_am_makeflags \
 sc_tests_obsolete_variables \
 sc_tests_plain_make \
@@ -462,6 +463,20 @@ sc_tests_no_gmake_checking:
          exit 1; \
        fi
 
+## GNU make can obviously chain suffix rules, so don't try to check
+## whether this is the case.
+sc_tests_make_can_chain_suffix_rules:
+       @if grep 'chain_suffix_rule' \
+          $(srcdir)/tests/*.test \
+          $(srcdir)/tests/*.tap \
+          $(builddir)/tests/*.test \
+          $(builddir)/tests/*.tap \
+        ; then \
+         echo 'GNU make can implicitly chain suffix rules; tests' \
+              'should just assume that without checking.' 1>&2; \
+         exit 1; \
+       fi
+
 ## Tests should never call make directly.
 sc_tests_make_without_am_makeflags:
        @if grep '^[^#].*(MAKE) ' $(srcdir)/lib/am/*.am $(srcdir)/automake.in |\
diff --git a/Makefile.in b/Makefile.in
index b815d2a..9c932dd 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -330,6 +330,7 @@ sc_perl_local \
 sc_AMDEP_TRUE_in_automake_in \
 sc_tests_no_gmake_requirement \
 sc_tests_no_gmake_checking \
+sc_tests_make_can_chain_suffix_rules \
 sc_tests_make_without_am_makeflags \
 sc_tests_obsolete_variables \
 sc_tests_plain_make \
@@ -1231,6 +1232,18 @@ sc_tests_no_gmake_checking:
          exit 1; \
        fi
 
+sc_tests_make_can_chain_suffix_rules:
+       @if grep 'chain_suffix_rule' \
+          $(srcdir)/tests/*.test \
+          $(srcdir)/tests/*.tap \
+          $(builddir)/tests/*.test \
+          $(builddir)/tests/*.tap \
+        ; then \
+         echo 'GNU make can implicitly chain suffix rules; tests' \
+              'should just assume that without checking.' 1>&2; \
+         exit 1; \
+       fi
+
 sc_tests_make_without_am_makeflags:
        @if grep '^[^#].*(MAKE) ' $(srcdir)/lib/am/*.am $(srcdir)/automake.in |\
                grep -v 'AM_MAKEFLAGS'; then \
diff --git a/tests/defs b/tests/defs
index da80c0d..c333bcf 100644
--- a/tests/defs
+++ b/tests/defs
@@ -377,17 +377,6 @@ grep_configure_help ()
   $EGREP "$2" am--our-help || Exit 1
 }
 
-# make_can_chain_suffix_rules
-# ---------------------------
-# Return 0 if $MAKE is a make implementation that can chain suffix rules
-# automatically, return 1 otherwise.  Caches the result for speed reasons.
-# FIXME: this is useless now; GNU make can always chain suffix rules
-# automatically.
-make_can_chain_suffix_rules ()
-{
-  return 0
-}
-
 # seq_ - print a sequence of numbers
 # ----------------------------------
 # This function simulates GNU seq(1) portably.  Valid usages:
diff --git a/tests/suffix-chain.tap b/tests/suffix-chain.tap
index 680d3f0..90ebd2a 100755
--- a/tests/suffix-chain.tap
+++ b/tests/suffix-chain.tap
@@ -14,8 +14,8 @@
 # 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 Automake can emit code that work round the inability of
-# some make implementations to automatically chain suffix rules.
+# Check that Automake can take advantage of GNU make ability to
+# automatically chain suffix rules.
 # See automake bug#7824 and bug#7670.
 
 required=cc
@@ -40,20 +40,14 @@ END
 
 echo 'return 0;' > foo.c1
 
-command_ok_ "aclocal"   $ACLOCAL
-command_ok_ "automake"  $AUTOMAKE
-command_ok_ "autoconf"  $AUTOCONF
-command_ok_ "configure" ./configure
+command_ok_ "aclocal"        $ACLOCAL
+command_ok_ "automake"       $AUTOMAKE
+command_ok_ "autoconf"       $AUTOCONF
+command_ok_ "configure"      ./configure
+command_ok_ "make all"       $MAKE all
+command_ok_ "make distcheck" $MAKE distcheck
+command_ok_ "clean"          $MAKE clean
 
-directive=''; make_can_chain_suffix_rules || directive=TODO
-
-for target in all distcheck; do
-  command_ok_ "make $target" \
-              -D "$directive" -r "suffix rules not chained" \
-              $MAKE $target
-done
-
-command_ok_ "clean" $MAKE clean
 # Sanity check.
 cat >> Makefile <<'END'
 foo.c: foo.c0
diff --git a/tests/suffix10.tap b/tests/suffix10.tap
index 2d66f3b..65f77ae 100755
--- a/tests/suffix10.tap
+++ b/tests/suffix10.tap
@@ -63,9 +63,6 @@ command_ok_ "autoconf"   $AUTOCONF
 command_ok_ "automake"   $AUTOMAKE --add-missing
 command_ok_ "configure"  ./configure
 command_ok_ "make test"  $MAKE test
-
-directive=''; make_can_chain_suffix_rules || directive=TODO
-command_ok_ "make all" -D "$directive" -r "suffix rules not chained" \
-            $MAKE all
+command_ok_ "make all"   $MAKE all
 
 :
diff --git a/tests/suffix11.tap b/tests/suffix11.tap
index e740f6c..9843e73 100755
--- a/tests/suffix11.tap
+++ b/tests/suffix11.tap
@@ -67,16 +67,10 @@ command_ok_ "warn about unportable make usage" \
 # But this should work anyway.
 command_ok_ "automake" $AUTOMAKE -a -Wno-portability
 
-command_ok_ "configure"  ./configure
-command_ok_ "make test-fake" env OBJEXT=foo $MAKE -e test-fake
-command_ok_ "make test-real" $MAKE test-real
-
-directive=''; make_can_chain_suffix_rules || directive=TODO
-
-for target in '' distcheck; do
-  command_ok_ "make $target" \
-              -D "$directive" -r "suffix rules not chained" \
-              $MAKE $target
-done
+command_ok_ "configure"       ./configure
+command_ok_ "make test-fake"  env OBJEXT=foo $MAKE -e test-fake
+command_ok_ "make test-real"  $MAKE test-real
+command_ok_ "make"            $MAKE
+command_ok_ "make distcheck"  $MAKE distcheck
 
 :
diff --git a/tests/suffix3.tap b/tests/suffix3.tap
index f1596ce..c5f1300 100755
--- a/tests/suffix3.tap
+++ b/tests/suffix3.tap
@@ -65,13 +65,8 @@ INTEGER main (void)
 }
 END
 
-directive=''; make_can_chain_suffix_rules || directive=TODO
-
-for target in all distcheck; do
-  command_ok_ "make $target"  \
-              -D "$directive" -r "suffix rules not chained" \
-              $MAKE $target
-done
+command_ok_ "make all" $MAKE all
+command_ok_ "make distcheck"  $MAKE distcheck
 
 # FIXME: should we check that intermediate file `foo.cc' has
 # been removed?  Or is this requiring too much from the make
diff --git a/tests/suffix8.tap b/tests/suffix8.tap
index 8a819a9..34f549e 100755
--- a/tests/suffix8.tap
+++ b/tests/suffix8.tap
@@ -79,14 +79,9 @@ command_ok_ "autoconf"   $AUTOCONF
 command_ok_ "automake"   $AUTOMAKE -a
 command_ok_ "configure"  ./configure
 command_ok_ "make test0" env OBJEXT=foo $MAKE -e test0
-command_ok_ "make test1" $MAKE test1
 
-directive=''; make_can_chain_suffix_rules || directive=TODO
-
-for target in test2 all distcheck; do
-  command_ok_ "make $target"  \
-              -D "$directive" -r "suffix rules not chained" \
-              $MAKE $target
+for target in test1 test2 all distcheck; do
+  command_ok_ "make $target" $MAKE $target
 done
 
 :
-- 
1.7.2.3




reply via email to

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