parallel-tests: avoid command-line length limit issue.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Tue, 7 Sep 2010 02:38:08 +0000 (04:38 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Tue, 7 Sep 2010 02:52:42 +0000 (04:52 +0200)
* automake.in (handle_tests): New argument $makefile, new
substitution %MAKEFILE%.
(generate_makefile): Adjust.
* lib/am/check.am [%?PARALLEL_TESTS%] (check-TESTS): Pass
sanitized TEST_LOGS value as makefile snippet on standard
input to $(MAKE), to avoid exceeding the command line limit on
w32 (MSYS).
* NEWS: Update.
Report by Bob Friesenhahn.

ChangeLog
NEWS
automake.in
lib/Automake/tests/Makefile.in
lib/am/check.am
tests/Makefile.in

index 3c682a8..01ee527 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2010-09-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       parallel-tests: avoid command-line length limit issue.
+       * automake.in (handle_tests): New argument $makefile, new
+       substitution %MAKEFILE%.
+       (generate_makefile): Adjust.
+       * lib/am/check.am [%?PARALLEL_TESTS%] (check-TESTS): Pass
+       sanitized TEST_LOGS value as makefile snippet on standard
+       input to $(MAKE), to avoid exceeding the command line limit on
+       w32 (MSYS).
+       * NEWS: Update.
+       Report by Bob Friesenhahn.
+
        Posix 2008 requires make to set errexit.
        * lib/am/check.am: Update comment.
 
diff --git a/NEWS b/NEWS
index b3d4131..3a0ca06 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,9 @@ Bugs fixed in 1.11.0a:
   - The AM_COND_IF macro also works if the shell expression for the conditional
     is no longer valid for the condition.
 
+  - The `parallel-tests' driver works around a problem with command-line
+    length limits with `make check' on w32 (MSYS).
+
 * Long standing bugs:
 
   - On Darwin 9, `pythondir' and `pyexecdir' pointed below `/Library/Python'
index 381202b..fa098bb 100755 (executable)
@@ -4908,9 +4908,13 @@ sub handle_tests_dejagnu
 }
 
 
+# handle_tests ($MAKEFILE)
+# ------------------------
 # Handle TESTS variable and other checks.
-sub handle_tests
+sub handle_tests ($)
 {
+  my ($makefile) = @_;
+
   if (option 'dejagnu')
     {
       &handle_tests_dejagnu;
@@ -4929,7 +4933,8 @@ sub handle_tests
       push (@check_tests, 'check-TESTS');
       $output_rules .= &file_contents ('check', new Automake::Location,
                                       COLOR => !! option 'color-tests',
-                                      PARALLEL_TESTS => !! option 'parallel-tests');
+                                      PARALLEL_TESTS => !! option 'parallel-tests',
+                                      MAKEFILE => basename $makefile);
 
       # Tests that are known programs should have $(EXEEXT) appended.
       # For matching purposes, we need to adjust XFAIL_TESTS as well.
@@ -8211,7 +8216,7 @@ sub generate_makefile ($$)
   handle_tags;
   handle_minor_options;
   # Must come after handle_programs so that %known_programs is up-to-date.
-  handle_tests;
+  handle_tests ($makefile);
 
   # This must come after most other rules.
   handle_dist;
index 09d3a63..567802b 100644 (file)
@@ -404,10 +404,10 @@ check-TESTS:
        @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
        @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
        @list='$(TEST_LOGS)';                                           \
-       list=`for f in $$list; do                                       \
-         test .log = $$f || echo $$f;                                  \
-       done | tr '\012\015' '  '`;                                     \
-       $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$list"
+       { echo "TEST_LOGS = \\";                                        \
+         for f in $$list; do test .log = $$f || echo "$$f \\"; done;   \
+       } | sed '$$s/\\$$//'                                            \
+         | $(MAKE) -f Makefile -f - $(AM_MAKEFLAGS) $(TEST_SUITE_LOG)
 
 .log.html:
        @list='$(RST2HTML) $$RST2HTML rst2html rst2html.py';            \
index c612b22..b79201f 100644 (file)
@@ -236,10 +236,10 @@ check-TESTS:
 ## we rely on .PHONY to work portably.
        @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
        @list='$(TEST_LOGS)';                                           \
-       list=`for f in $$list; do                                       \
-         test .log = $$f || echo $$f;                                  \
-       done | tr '\012\015' '  '`;                                     \
-       $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$list"
+       { echo "TEST_LOGS = \\";                                        \
+         for f in $$list; do test .log = $$f || echo "$$f \\"; done;   \
+       } | sed '$$s/\\$$//'                                            \
+         | $(MAKE) -f %MAKEFILE% -f - $(AM_MAKEFLAGS) $(TEST_SUITE_LOG)
 
 AM_RECURSIVE_TARGETS += check
 
index 575a5d7..563c9e6 100644 (file)
@@ -1181,10 +1181,10 @@ check-TESTS:
        @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
        @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
        @list='$(TEST_LOGS)';                                           \
-       list=`for f in $$list; do                                       \
-         test .log = $$f || echo $$f;                                  \
-       done | tr '\012\015' '  '`;                                     \
-       $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$list"
+       { echo "TEST_LOGS = \\";                                        \
+         for f in $$list; do test .log = $$f || echo "$$f \\"; done;   \
+       } | sed '$$s/\\$$//'                                            \
+         | $(MAKE) -f Makefile -f - $(AM_MAKEFLAGS) $(TEST_SUITE_LOG)
 
 .log.html:
        @list='$(RST2HTML) $$RST2HTML rst2html rst2html.py';            \