]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] check: avoid extra recursive make invocations
authorStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 30 Jul 2012 10:01:52 +0000 (12:01 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 30 Jul 2012 15:05:53 +0000 (17:05 +0200)
After this change, "make check" will not cause any recursive make
invocation by default (unless there are $(SUBDIRS) to descend into, of
course).  One little price to pay is that the targets 'check-TESTS',
'check-DEJAGNU' and 'check-local' will always be defined (being dummy
by default).  The other one is that the old semantics are not 100%
preserved, so corner cases that worked in mainline Automake might not
work anymore out-of-the-box with Automake-NG, thus requiring the user
to make his dependency declarations more complete or precises.
We believe these prices are well worth paying.

* lib/am/check-target.am: Rewrite 'check-am' handling to avoid the
extra make recursion(s).  A side effect of this is that the transform
'%CHECK-DEPS%' is no more needed.  Accordingly ...
* automake.in (@check_tests): ... drop definition and updating of this
variable throughout, and ...
(handle_all_and_check): ... the definition of the '%CHECK-TESTS%'
transform when processing the 'check-target.am' file.
* t/local-targets.sh: Adjust to avoid spurious failures.
* t/checkall.sh: Remove, it's quite obsolete (and has just started
to spuriously fail).

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
automake.in
lib/am/check-target.am
t/checkall.sh [deleted file]
t/local-targets.sh

index f7055c57ed65c0aa7c32a4a207b938e02b3f9111..698549fa716f4e4348af4c77f310f8799e4c4461 100644 (file)
@@ -528,7 +528,6 @@ my @include_stack;
 # List of dependencies for the obvious targets.
 my @all;
 my @check;
-my @check_tests;
 
 # Keys in this hash table are files and directories to delete.  The
 # associated value tells when this should happen (MOSTLY_CLEAN,
@@ -647,7 +646,6 @@ sub initialize_per_input ()
 
     @all = ();
     @check = ();
-    @check_tests = ();
 
     %clean_files = ();
     %clean_dirs = ();
@@ -3905,8 +3903,7 @@ sub handle_all_and_check ()
                    'ALL-DEPS' => "@all",
                    'LOCAL-HEADERS' => "@local_headers");
 
-  almost_verbatim ('check-target',
-                   'CHECK-TESTS' => "@check_tests");
+  almost_verbatim ('check-target');
 }
 
 # Generate helper targets for user recursion, where needed.
@@ -4078,7 +4075,6 @@ sub handle_factored_dependencies
 # ------------------------
 sub handle_tests_dejagnu
 {
-    push (@check_tests, 'check-DEJAGNU');
     $output_rules .= file_contents ('dejagnu', new Automake::Location);
 }
 
@@ -4100,7 +4096,6 @@ sub handle_tests
 
   if (var ('TESTS'))
     {
-      push (@check_tests, 'check-TESTS');
       almost_verbatim ('color-tests');
       if (option 'serial-tests')
         {
index dba23d1464a256464b58d65095acdbc999f31621..29d73acc37544b179af4850448086285cb481f82 100644 (file)
@@ -25,8 +25,9 @@ endif
 # ensure all the primary targets are built; then it must build the
 # local check dependencies, and finally run the actual tests (as given
 # by $(TESTS), by DejaGNU, and by the 'check-local' target).
-check-am: all-am
-       $(if $(am.test-suite.deps),$(MAKE) $(am.test-suite.deps),@:)
-       $(MAKE) %CHECK-TESTS% check-local
+am.test-suite.check-targets = check-DEJAGNU check-TESTS check-local
+.PHONY: $(am.test-suite.check-targets)
+check-am: $(am.test-suite.check-targets)
+$(am.test-suite.check-targets): all-am $(am.test-suite.deps)
 
 check: $(if $(SUBDIRS),check-recursive,check-am)
diff --git a/t/checkall.sh b/t/checkall.sh
deleted file mode 100755 (executable)
index 4320574..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-# Copyright (C) 1996-2012 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# 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 for bug where check target doesn't depend on all.
-
-. ./defs || exit 1
-
-cat > Makefile.am << 'END'
-bin_SCRIPTS = derived
-check-local:
-       true
-END
-
-$ACLOCAL
-$AUTOMAKE
-
-grep '^check-am:.*all-am' Makefile.in
-grep 'MAKE.*check-local' Makefile.in
index d15bc809a0ccf872eb7e073b675cbe53dc1a2bf0..d7db7d4935fddd4048ff98182a1803e1b2d5329d 100755 (executable)
@@ -28,17 +28,19 @@ END
 
 cat > Makefile.am <<'END'
 @SafeInclude@ ./inc.mk
-$(foreach x,all check installdirs,$(eval $(x)-local:: ; : > main-$(x)))
+$(foreach x,all check installdirs,$(eval $(x)-local: ; : > main-$(x)))
 END
 
 cat > inc.mk << 'END'
-all-local check-local installdirs-local:: %-local:
+all-local check-local installdirs-local: %-local: %-incl
+all-incl check-incl installdirs-incl: %-incl:
        : > incl-$*
 END
 
 cat > GNUmakefile << 'END'
 include ./Makefile
-all-local check-local installdirs-local:: %-local:
+all-local check-local installdirs-local: %-local: %-wrap
+all-wrap check-wrap installdirs-wrap: %-wrap:
        : > wrap-$*
 END