automake-commit
[Top][All Lists]
Advanced

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

[Automake-commit] [SCM] GNU Automake branch, ng/master, updated. v1.12.2


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, ng/master, updated. v1.12.2-603-g61e23e4
Date: Mon, 23 Jul 2012 14:37:01 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=61e23e47ebb7f89ff0933c9dd5a4f61bdde5b636

The branch, ng/master has been updated
       via  61e23e47ebb7f89ff0933c9dd5a4f61bdde5b636 (commit)
       via  eee3aff0d76f05e37192e3b8322bb7129a8b0746 (commit)
       via  4356f822848a78dfc96023e8848c0b999d5e8e57 (commit)
       via  43619a0fa3edc6c0c4ce3b49835d2c48c4afb862 (commit)
       via  54a47b07f8385136ed85626093cdff94dc7124fd (commit)
       via  47388dbc2c169a4f594801fdb8660ff8e31ef300 (commit)
       via  15fa9fba94f55e8aa5508d23d23413d04a2ffe79 (commit)
       via  7519d2634bdac6763ef2d57b3aff00f37c086a30 (commit)
       via  587e0c6b4f9c422b26faeecee8b35c3eb741ab8a (commit)
       via  8c9d0df20185ee48bc594a4a120daa5ea9c9aa1a (commit)
       via  72ac29f10130ef8f450f8fcb71762d56ada18d4e (commit)
       via  9761847dd0a49a14a46fa2ac09b7224e8e818147 (commit)
       via  f5164af2690681708e64422040d8bb90bdd103d1 (commit)
       via  9583827973b01540214d4830d18b1dc373d98b77 (commit)
       via  fbe978867032d47013b9e9bacf176f300e6e924d (commit)
       via  97540c57f3fbe7c2d72eb729162f8f9cbe81903d (commit)
       via  2dcf8c29a21ae95eeceff080c4d538229d9de1b8 (commit)
       via  e3f7885c0c9e686762d5dd0470dc93eb0f7aca06 (commit)
      from  96dd671b452c944dee744a1fe41203801835a321 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 61e23e47ebb7f89ff0933c9dd5a4f61bdde5b636
Merge: eee3aff 43619a0
Author: Stefano Lattarini <address@hidden>
Date:   Mon Jul 23 16:27:22 2012 +0200

    Merge branch 'master' into ng/master
    
    * master:
      tests: avoid a spurious failure with Solaris /bin/sh
      tests: fix buglet in t/missing3.sh
      self tests: avoid spurious failures on older bash
      tests: remove t/parallel-tests-many.sh (fixes spurious failure)
      typofix: in a comment in the automake script
      news: minor fixlets and reordering
    
    + Extra non-trivial edits:
    
    * t/parallel-tests-many.sh: Do not deleted; keep the correct and
    improved version from the 'ng/master' branch.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit eee3aff0d76f05e37192e3b8322bb7129a8b0746
Author: Stefano Lattarini <address@hidden>
Date:   Mon Jul 23 16:20:49 2012 +0200

    tests: relax a grepping check on configure output
    
    * t/subpkg.sh: Here: do not expect the C compiler to be simply
    named 'cc'.  This was causing spurious failures when $CC was
    overridden at configure time or though config.site.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 4356f822848a78dfc96023e8848c0b999d5e8e57
Merge: 96dd671 8c9d0df
Author: Stefano Lattarini <address@hidden>
Date:   Mon Jul 23 14:47:05 2012 +0200

    Merge branch 'ng/many-tests' into ng/master
    
    * ng/many-tests:
      [ng] check: in recipes, don't use pipe when redirection suffices
      [ng] recheck: don't exceed command line limits, even with many failed 
tests
      [ng] coverage: recheck with many failed tests
      [ng] check: refactor for less duplication and better performances
      [ng] check: use awk rather than grep+xargs to count test results
      [ng] parallel-tests: do not exceed command line length limits
      [ng] coverage: testing with lots of test scripts

commit 8c9d0df20185ee48bc594a4a120daa5ea9c9aa1a
Author: Stefano Lattarini <address@hidden>
Date:   Sun Jul 22 11:31:32 2012 +0200

    [ng] check: in recipes, don't use pipe when redirection suffices
    
    Instead of the botched idiom:
    
        while read c; do echo $c; done <file | command
    
    use the simpler and much better one:
    
        command <file
    
    Not only the latter is simpler and marginally more efficient, but is also
    better at catching possible unexpected I/O errors; while in the former,
    the exit status of the while loop (which might have revealed such errors)
    was lost in the pipeline.
    
    * lib/am/parallel-tests.am ($(TEST_SUITE_LOG), recheck): Use the better
    idiom.
    
    Co-authored-by: Akim Demaille <address@hidden>
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 72ac29f10130ef8f450f8fcb71762d56ada18d4e
Author: Stefano Lattarini <address@hidden>
Date:   Sat Jul 21 10:13:58 2012 +0200

    [ng] recheck: don't exceed command line limits, even with many failed tests
    
    Related to automake bug#7868.
    
    * lib/am/parallel-tests.sh (recheck): Arrange recursive make invocation
    to pass the list of tests to be rechecked in the make standard input
    rather than on the make command line.
    (am__test_bases): Only define if not already set, to make the new idiom
    referenced above work as expected.
    * Makefile.am (XFAIL_TESTS): Remove 't/parallel-tests-many.sh' once
    again.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 9761847dd0a49a14a46fa2ac09b7224e8e818147
Author: Stefano Lattarini <address@hidden>
Date:   Fri Jul 20 20:53:57 2012 +0200

    [ng] coverage: recheck with many failed tests
    
    * t/parallel-tests-many.sh: Extend to check that the 'recheck' target
    works even when a huge number of tests (~ 30k) have failed in the
    previous testsuite run.  Currently this doesn't work, and causes the
    test to fail, so list it ...
    * Makefile.am (XFAIL_TESTS): ... in here.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit f5164af2690681708e64422040d8bb90bdd103d1
Author: Stefano Lattarini <address@hidden>
Date:   Fri Jul 20 19:38:20 2012 +0200

    [ng] check: refactor for less duplication and better performances
    
    * lib/am/parallel-tests.am (am__count_test_results): Adjust this awk
    program to emit a shell snippet to be executed by the calling recipe ...
    ($(TEST_SUITE_LOG)): ... here.  This avoid the need to call the program
    in $(am__count_test_results) once for each valid test result.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 9583827973b01540214d4830d18b1dc373d98b77
Author: Stefano Lattarini <address@hidden>
Date:   Fri Jul 20 16:37:50 2012 +0200

    [ng] check: use awk rather than grep+xargs to count test results
    
    * lib/am/parallel-tests.am ($(TEST_SUITE_LOG)): Here, with the help
    of ...
    (am__count_test_results): ... this new internal variable.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit fbe978867032d47013b9e9bacf176f300e6e924d
Author: Stefano Lattarini <address@hidden>
Date:   Fri Jul 20 12:28:46 2012 +0200

    [ng] parallel-tests: do not exceed command line length limits
    
    Fixes automake bug#7868.
    
    Two things worth noting:
    
     + a "make recheck" issued after a huge number of tests have failed
       can still hit command-line length issues;
    
     + the check-recipes now contain (first among the Automake-generated
       recipes) a use of the 'xargs' utility.
    
    These issues will likely be tackled by later patches.
    
    * Makefile.am (XFAIL_TESTS): Remove 't/parallel-tests-many.sh'.
    * lib/am/clean.am (.am.clean-cmd.f, .am.clean-cmd.d, .am.rm-f,
    .am.rm-rf): Move their definitions ...
    * lib/am/header-vars.am: ... here, because we need to use them ...
    * lib/am/parallel-tests.am: ... here as well.
    (am.test-harness.workdir, am.setup-test-harness-workdir,
    am.test-harness.append-to-list-of-bases): New internal variables.
    Use them to avoid hitting command-line length limits ...
    ($(TEST_SUITE_LOG), recheck): ... in this rules ...
    (am__remove_if_not_lazy_check): ... and in the shell code defined
    by this internal variable.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 97540c57f3fbe7c2d72eb729162f8f9cbe81903d
Author: Stefano Lattarini <address@hidden>
Date:   Thu Jul 19 13:42:19 2012 +0200

    [ng] coverage: testing with lots of test scripts
    
    See long-standing automake bug#7868.
    
    * t/parallel-tests-many.sh: Simplify and enhance.  Among other things,
    this test now tries running ~ 30k tests.  Currently fails on several
    systems (e.g., Linux 2.6.30 on i686, Solaris 10 on i86pc).
    
    Signed-off-by: Stefano Lattarini <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 Makefile.am                    |    1 -
 NEWS                           |    6 +-
 automake.in                    |    2 +-
 lib/am/clean.am                |    6 -
 lib/am/header-vars.am          |    6 +
 lib/am/parallel-tests.am       |  148 +++++++++++++++-------
 t/missing3.sh                  |   11 ++-
 t/parallel-tests-many.sh       |  269 +++++++++++++++++++---------------------
 t/self-check-explicit-skips.sh |   11 +-
 t/subpkg.sh                    |    3 +-
 10 files changed, 257 insertions(+), 206 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 27120ef..f4783c6 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -350,7 +350,6 @@ XFAIL_TESTS = \
   t/interp3.sh \
   t/java-nobase.sh \
   t/objext-pr10128.sh \
-  t/parallel-tests-many.sh \
   t/pr8365-remake-timing.sh \
   t/remake-am-pr10111.sh \
   t/remake-m4-pr10111.sh \
diff --git a/NEWS b/NEWS
index 6c39a7d..71771cf 100644
--- a/NEWS
+++ b/NEWS
@@ -139,16 +139,16 @@ New in 1.12.3:
     giving more useful warnings than a bare "command not found" from a
     make recipe would.
 
-* M4 files:
+* Miscellaneous changes:
 
   - The '.m4' files provided by Automake does not define serial numbers
     anymore.  This should cause no difference in the behaviour of aclocal
     though.
 
-* Automake Testsuite:
-
   - Some testsuite weaknesses and spurious failures have been fixed.
 
+Bugs fixed in 1.12.3:
+
 * Long-standing bugs:
 
   - Instead of renaming only self-references of files (typically for
diff --git a/automake.in b/automake.in
index 7727fb3..2d268eb 100644
--- a/automake.in
+++ b/automake.in
@@ -5809,7 +5809,7 @@ sub transform ($$)
 # preprocess_file ($MAKEFILE, [%TRANSFORM])
 # -----------------------------------------
 # Load a $MAKEFILE, apply the %TRANSFORM, and return the result.
-# No extra parsing of post-processing is done (i.e., recognition of
+# No extra parsing or post-processing is done (i.e., recognition of
 # rules declaration or of make variables definitions).
 sub preprocess_file ($%)
 {
diff --git a/lib/am/clean.am b/lib/am/clean.am
index 2e1af82..bc043e4 100644
--- a/lib/am/clean.am
+++ b/lib/am/clean.am
@@ -14,12 +14,6 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-.am.rm-f = $(if $(strip $1),rm -f $(strip $1)$(am__newline))
-.am.rm-rf = $(if $(strip $1),rm -rf $(strip $1)$(am__newline))
-
-.am.clean-cmd.f = $(call am.xargs-map,.am.rm-f,$1)
-.am.clean-cmd.d = $(call am.xargs-map,.am.rm-rf,$1)
-
 am__mostlyclean_files += $(MOSTLYCLEANFILES)
 am__clean_files       += $(CLEANFILES)
 am__distclean_files   += $(DISTCLEANFILES)
diff --git a/lib/am/header-vars.am b/lib/am/header-vars.am
index 62d7ecd..6efad03 100644
--- a/lib/am/header-vars.am
+++ b/lib/am/header-vars.am
@@ -295,6 +295,12 @@ $(if $2,$(strip \
   )$(if $($0.counter),$(call $1,$(strip $($0.partial-args)))))
 endef
 
+.am.rm-f = $(if $(strip $1),rm -f $(strip $1)$(am__newline))
+.am.rm-rf = $(if $(strip $1),rm -rf $(strip $1)$(am__newline))
+
+.am.clean-cmd.f = $(call am.xargs-map,.am.rm-f,$1)
+.am.clean-cmd.d = $(call am.xargs-map,.am.rm-rf,$1)
+
 ## Some derived variables that have been found to be useful.
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
diff --git a/lib/am/parallel-tests.am b/lib/am/parallel-tests.am
index 61d3c8a..59276c0 100644
--- a/lib/am/parallel-tests.am
+++ b/lib/am/parallel-tests.am
@@ -115,6 +115,7 @@ $(call am.util.strip-suffixes, $(TEST_EXTENSIONS), \
 
 am__recheck_rx = ^[    ]*:recheck:[    ]*
 am__global_test_result_rx = ^[         ]*:global-test-result:[         ]*
+am__test_result_rx = ^[        ]*:test-result:[        ]*
 am__copy_in_global_log_rx = ^[         ]*:copy-in-global-log:[         ]*
 
 # A command that, given a newline-separated list of test names on the
@@ -167,6 +168,64 @@ am__list_recheck_tests = $(AWK) '{ \
 }'
 
 # A command that, given a newline-separated list of test names on the
+# standard input, output a shell code snippet setting variables that
+# count occurrences of each test result (PASS, FAIL, etc) declared in
+# the '.trs' files of that given tests.  For example, the count of
+# PASSes will be saved in the '$am_PASS' variable, the count of SKIPs
+# in the '$am_SKIP' variable, and so on.
+am__count_test_results = $(AWK) ' \
+## Don't leak open file descriptors, as this could cause serious
+## problems when there are many tests (yes, even on Linux).
+function close_current() \
+{ \
+  close ($$0 ".trs"); \
+  close ($$0 ".log"); \
+} \
+function error(msg) \
+{ \
+  print msg | "cat >&2"; \
+  exit_status = 1; \
+} \
+function input_error(file) \
+{ \
+  error("awk" ": cannot read \"" file "\""); \
+  close_current(); \
+} \
+BEGIN { exit_status = 0; } \
+{ \
+  while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+    { \
+      if (rc < 0) \
+        { \
+          input_error($$0 ".trs"); \
+          next; \
+        } \
+      if (line ~ /$(am__test_result_rx)/) \
+        { \
+          sub("$(am__test_result_rx)", "", line); \
+          sub("[:      ].*$$", "", line); \
+          counts[line]++;\
+        } \
+    }; \
+  close_current(); \
+} \
+END { \
+  if (exit_status != 0) \
+    error("fatal: making $@: I/O error reading test results"); \
+  else \
+    { \
+      global_count = 0; \
+      for (k in counts) \
+        { \
+          print "am_" k "=" counts[k]; \
+          global_count += counts[k]; \
+        } \
+     } \
+  print "am_ALL=" global_count; \
+  exit(exit_status); \
+}'
+
+# A command that, given a newline-separated list of test names on the
 # standard input, create the global log from their .trs and .log files.
 am__create_global_log = $(AWK) ' \
 ## Don't leak open file descriptors, as this could cause serious
@@ -243,8 +302,8 @@ END { \
 am__rst_title = { sed 's/.*/   &   /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
 
 # This supports runtime overriding of $(TESTS) and $(XFAIL_TESTS).
-am__test_bases = \
-  $(call am__memoize,am__test_bases,$(call am__get_test_bases,$(TESTS)))
+!am__test_bases ?= \
+!  $(call am__memoize,am__test_bases,$(call am__get_test_bases,$(TESTS)))
 am__xfail_test_bases = \
   $(call am__memoize,am__xfail_test_bases,$(call 
am__get_test_bases,$(XFAIL_TESTS)))
 
@@ -261,38 +320,40 @@ am__mostlyclean_files += $(am__test_results) 
$(am__test_logs)
 # $(TEST_LOGS) is a published interface.
 TEST_LOGS = $(am__test_logs)
 
+am.test-harness.workdir = $(am__dir)/test-harness
+
+am.test-harness.append-to-list-of-bases = \
+  @lst='$1'; for x in $$lst; do echo $$x; done \
+    >> $(am.test-harness.workdir)/bases$(am__newline)
+
+!define am.setup-test-harness-workdir
+!      @rm -rf $(am.test-harness.workdir)
+!      @$(MKDIR_P) $(am.test-harness.workdir)
+!      @touch $(am.test-harness.workdir)/bases
+!      $(call am.xargs-map,am.test-harness.append-to-list-of-bases, \
+!             $(am__test_bases))
+!      @workdir='$(am.test-harness.workdir)' \
+!        && sed 's/$$/.log/' $$workdir/bases > $$workdir/logs \
+!        && sed 's/$$/.trs/' $$workdir/bases > $$workdir/trs
+!endef
+
 $(TEST_SUITE_LOG): $(am__test_logs) $(am__test_results)
+       $(am.setup-test-harness-workdir)
        @$(am__sh_e_setup); $(am__tty_colors); \
        fatal () { echo "fatal: making $@: $$*" >&2; exit 1; }; \
-## Detect a possible circular dependency, and error out.
-       case ' $(strip $(am__test_logs)) ' in *' $(TEST_SUITE_LOG) '*) \
-         fatal "depends on itself (check TESTS content)";; \
-       esac; \
-       ws='[   ]'; \
-       count_result () \
-       { \
-         r='$(strip $(am__test_results))'; \
-         r=`grep "^$$ws*:test-result:$$ws*$${1-}" $$r </dev/null`; \
-## Catch I/O errors, and complain accordingly.
-         test $$? -le 1 || fatal "I/O error reading test results"; \
-         case $$r in \
-           "") echo 0;; \
-           * ) printf '%s\n' "$$r" | wc -l;; \
-         esac; \
-       }; \
+       workdir='$(am.test-harness.workdir)'; \
+## Detect a possible circular dependency, and error out if it's found.
+       grep '^$(TEST_SUITE_LOG:.log=)$$' $$workdir/bases \
+         && fatal "depends on itself (check TESTS content)"; \
 ## Prepare data for the test suite summary.  These do not take into account
 ## unreadable test results, but they'll be appropriately updated later if
 ## needed.
-       all=`count_result` \
-         && pass=` count_result PASS` \
-         && fail=` count_result FAIL` \
-         && skip=` count_result SKIP` \
-         && xfail=`count_result XFAIL` \
-         && xpass=`count_result XPASS` \
-         && error=`count_result ERROR` \
-         || exit 1; \
+       am_PASS=0 am_FAIL=0 am_SKIP=0 am_XPASS=0 am_XFAIL=0 am_ERROR=0; \
+       count_test_results_command=`$(am__count_test_results) <$$workdir/bases` 
\
+         && eval "$$count_test_results_command" \
+          || fatal "unknown error reading test results"; \
 ## Whether the testsuite was successful or not.
-       if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+       if test `expr $$am_FAIL + $$am_XPASS + $$am_ERROR` -eq 0; then \
          success=true; \
        else \
          success=false; \
@@ -328,13 +389,13 @@ $(TEST_SUITE_LOG): $(am__test_logs) $(am__test_results)
        create_testsuite_report () \
        { \
          opts=$$*; \
-         display_result_count $$opts "TOTAL:" $$all   "$$brg"; \
-         display_result_count $$opts "PASS: " $$pass  "$$grn"; \
-         display_result_count $$opts "SKIP: " $$skip  "$$blu"; \
-         display_result_count $$opts "XFAIL:" $$xfail "$$lgn"; \
-         display_result_count $$opts "FAIL: " $$fail  "$$red"; \
-         display_result_count $$opts "XPASS:" $$xpass "$$red"; \
-         display_result_count $$opts "ERROR:" $$error "$$mgn"; \
+         display_result_count $$opts "TOTAL:" $$am_ALL   "$$brg"; \
+         display_result_count $$opts "PASS: " $$am_PASS  "$$grn"; \
+         display_result_count $$opts "SKIP: " $$am_SKIP  "$$blu"; \
+         display_result_count $$opts "XFAIL:" $$am_XFAIL "$$lgn"; \
+         display_result_count $$opts "FAIL: " $$am_FAIL  "$$red"; \
+         display_result_count $$opts "XPASS:" $$am_XPASS "$$red"; \
+         display_result_count $$opts "ERROR:" $$am_ERROR "$$mgn"; \
        }; \
 ## Write "global" testsuite log.
        if {                                                            \
@@ -345,9 +406,7 @@ $(TEST_SUITE_LOG): $(am__test_logs) $(am__test_results)
          echo;                                                         \
          echo ".. contents:: :depth: 2";                               \
          echo;                                                         \
-         bases='$(am__test_bases)';                                    \
-         for b in $$bases; do echo $$b; done                           \
-           | $(am__create_global_log);                                 \
+         $(am__create_global_log) <$$workdir/bases;                    \
        } >$(TEST_SUITE_LOG).tmp; then                                  \
          mv -f $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG);                \
        else                                                            \
@@ -386,9 +445,7 @@ am__mostlyclean_files += $(TEST_SUITE_LOG)
 ## ------------------------------------------ ##
 
 am__remove_if_not_lazy_check = \
-## Expand the given list only once, to avoid exceeding line length limits.
-  $(if $(filter yes,$(AM_LAZY_CHECK)),, \
-       list='$(strip $(1))'; test -z "$$list" || rm -f $$list)
+  $(if $(filter yes,$(AM_LAZY_CHECK)),,$(call .am.clean-cmd.f,$1))
 
 check-TESTS:
        @$(call am__remove_if_not_lazy_check,$(am__test_results))
@@ -407,17 +464,20 @@ check-TESTS:
 ## Recheck must depend on $(check_SCRIPTS), $(check_PROGRAMS), etc.
 ## It must also depend on the 'all' target.  See automake bug#11252.
 recheck: all %CHECK_DEPS%
+       +$(am.setup-test-harness-workdir)
 ## See comments above in the check-TESTS recipe for why remove
 ## $(TEST_SUITE_LOG) here.
        @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
-       @bases='$(am__test_bases)'; \
 ## If running a "make recheck", we must only consider tests that had an
 ## unexpected outcome (FAIL or XPASS) in the earlier run.
-       bases=`for i in $$bases; do echo $$i; done \
-                | $(am__list_recheck_tests)` || exit 1; \
+       @bases=`$(am__list_recheck_tests) \
+                 <$(am.test-harness.workdir)/bases` || exit 1; \
 ## Remove newlines and normalize whitespace.
        bases=`echo $$bases`; \
-       $(MAKE) $(TEST_SUITE_LOG) .am/doing-recheck=yes am__test_bases="$$bases"
+## Re-run the relevant tests, without hitting command-line length limits.
+       echo am__test_bases="$$bases" | \
+         $(MAKE) -f- -f$(firstword $(MAKEFILE_LIST)) \
+                 $(TEST_SUITE_LOG) .am/doing-recheck=yes
 .PHONY: recheck
 
 ## One tricky requirement of the "recheck" target is that, in case (say)
diff --git a/t/missing3.sh b/t/missing3.sh
index 3a9ba01..b2cacf9 100755
--- a/t/missing3.sh
+++ b/t/missing3.sh
@@ -31,10 +31,17 @@ run_cmd ()
   return $st
 }
 
-./missing b7cb8259 --version && exit 1
+run_cmd ./missing b7cb8259 --version && exit 1
 grep WARNING stderr && exit 1
 run_cmd ./missing b7cb8259 --grep && exit 1
-grep 'WARNING:.*missing on your system' stderr
+
+if test x"$am_test_prefer_config_shell" != x"yes"; then
+  # The /bin/sh from Solaris 10 is a spectacular failure.  After a failure
+  # due to a "command not found", it sets '$?' to '1'.
+  if (st=0; /bin/sh -c 'no--such--command' || st=$?; test $st -eq 127); then
+    grep 'WARNING:.*missing on your system' stderr
+  fi
+fi
 
 # missing itself it known to exist :)
 
diff --git a/t/parallel-tests-many.sh b/t/parallel-tests-many.sh
index 0b4fef2..bd107e2 100755
--- a/t/parallel-tests-many.sh
+++ b/t/parallel-tests-many.sh
@@ -16,175 +16,162 @@
 
 # Check that the parallel testsuite harness does not hit errors due
 # to an exceeded command line length when there are many tests.
-# For automake bug#7868.  This test is currently expected to fail.
+# For automake bug#7868.
 
 . ./defs || exit 1
 
-cat >> configure.ac << 'END'
-AC_OUTPUT
-END
+echo AC_OUTPUT >> configure.ac
 
-cat > Makefile.am <<'END'
-# Sanity check that the $(TESTS) is going to exceed the system
-# command line length.
-# Extra quoting and indirections below are required to ensure the
-# various make implementations (e.g, GNU make or Sun Distributed Make)
-# will truly spawn a shell to execute this command, instead of relying
-# on optimizations that might mask the "Argument list too long" error
-# we expect.
-this-will-fail:
-       @":" && ":" $(TEST_LOGS)
-TEST_LOG_COMPILER = true
-include list-of-tests.am
-# So that we won't have to create a ton of dummy test cases.
-$(TESTS):
+cat > Makefile.am << 'END'
+TEST_EXTENSIONS = .test .sh
+LOG_COMPILER = true
+TEST_LOG_COMPILER = $(LOG_COMPILER)
+SH_LOG_COMPILER = $(LOG_COMPILER)
+EXTRA_DIST = $(TESTS)
 END
 
-# The real instance will be dynamically created later.
-echo TESTS = foo.test > list-of-tests.am
-
-$ACLOCAL && $AUTOCONF && $AUTOMAKE -a \
-  || framework_failure_ "unexpected autotools failure"
-./configure \
-  || framework_failure_ "unexpected configure failure"
-
-# We want to hit the system command-line length limit without hitting
-# the filename length limit or the PATHMAX limit; so we use longish
-# (but not too long) names for the testcase, and place them in a nested
-# (but not too deeply) directory.
-# We also prefer to use the minimal(ish) number of test cases that can
-# make us hit the command-line length limit, since the more the test
-# cases are, the more time "automake" and "make check" will take to run
-# (especially on Cygwin and MinGW/MSYS).
-
-tname="wow-this-is-a-very-long-name-for-a-simple-dummy-test-case"
-dname="and-this-too-is-a-very-long-name-for-a-dummy-directory"
-
-deepdir=.
-depth=0
-for i in 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 29 21 22 23 24; do
-  new_deepdir=$deepdir/$dname.d$i
-  mkdir $new_deepdir || break
-  tmpfile=$new_deepdir/$tname-some-more-chars-for-good-measure
-  if touch $tmpfile; then
-    rm -f $tmpfile || exit 99
-  else
-    rmdir $new_deepdir || exit 99
-  fi
-  deepdir=$new_deepdir
-  unset tmpfile new_deepdir
-  depth=$i
-done
-
-cat <<END
-*********************************************************************
-Our tests will be in the following directory (depth = $depth)
-*********************************************************************
-$deepdir
-*********************************************************************
-END
+tst='a-test-script-with-a-long-name'
+dir1='a-directory-with-a-long-name'
+dir2='another-long-named-directory'
 
-setup_data ()
+list_logs ()
 {
-  # Use perl, not awk, to avoid errors like "awk: string too long"
-  # (seen e.g. with Solaris 10 /usr/bin/awk).
-  count=$count deepdir=$deepdir tname=$tname $PERL -e '
-    use warnings FATAL => "all";
-    use strict;
-    print "TESTS = \\\n";
-    my $i = 0;
-    while (++$i)
-      {
-        print "  $ENV{deepdir}/$ENV{tname}-$i.test";
-        if ($i >= $ENV{count})
-          {
-            print "\n";
-            last;
-          }
-        else
-          {
-            print " \\\n";
-          }
-      }
-  ' > list-of-tests.am || exit 99
-  sed 20q list-of-tests.am || exit 99 # For debugging.
-  $AUTOMAKE Makefile \
-    || framework_failure_ "unexpected automake failure"
-  ./config.status Makefile \
-    || framework_failure_ "unexpected config.status failure"
+  find . -name '*.log' | $EGREP -v '^\./(config|test-suite)\.log$'
 }
 
-for count in 1 2 4 8 12 16 20 24 28 32 48 64 96 128 E_HUGE; do
-  test $count = E_HUGE && break
-  count=$(($count * 100))
-  setup_data
-  if $MAKE this-will-fail; then
-    continue
-  else
-    # We have managed to find a number of test cases large enough to
-    # hit the system command-line limits; we can stop.  But first, for
-    # good measure, increase the number of tests of some 20%, to be
-    # "even more sure" of really tickling command line length limits.
-    count=$(($count * 12))
-    count=$(($count / 10))
-    setup_data
-    break
-  fi
-done
-
-if test $count = E_HUGE; then
-  framework_failure_ "system has a too-high limit on command line length"
-else
-  cat <<END
-*********************************************************************
-               Number of tests we will use: $count
-*********************************************************************
-END
-fi
-
-$MAKE check TESTS=$deepdir/$tname-1.test \
-  && test -f $deepdir/$tname-1.log \
-  || framework_failure_ "\"make check\" with one single tests"
-
-rm -f $deepdir/* || exit 99
+# Number of test scripts will be 3 * $count.
+count=10000
+
+i=1
+while test $i -le $count; do
+  files="
+    $tst-$i.test
+    $dir1-$i/foo.sh
+    $dir2-$i/$tst-$i
+  "
+  mkdir $dir1-$i $dir2-$i
+  for f in $files; do
+    : > $f
+    echo $f
+  done
+  i=$(($i + 1))
+  # Disable shell traces after the first iteration, to avoid
+  # polluting the test logs.
+  set +x
+done > t
+set -x # Re-enable shell traces.
+echo 'TESTS = \'   >> Makefile.am
+sed '$!s/$/ \\/' t >> Makefile.am
+rm -f t
+
+whole_count=$(($count * 3))
+
+test $(wc -l <Makefile.am) -eq $((6 + $whole_count)) \
+  || fatal_ "populating 'TESTS'"
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+./configure
 
 $MAKE check > stdout || { cat stdout; exit 1; }
 cat stdout
 
-grep "^# TOTAL: $count$" stdout
-grep "^# PASS:  $count$" stdout
+grep "^# TOTAL: $whole_count$" stdout
+grep "^# PASS:  $whole_count$" stdout
+
+# Only check head, tail, and a random sample.
 
-grep "^PASS: .*$tname-[0-9][0-9]*\.test" stdout > grp
-ls -1 $deepdir | grep '\.log$' > lst
+test -f $tst-1.log
+test -f $dir1-1/foo.log
+test -f $dir2-1/$tst-1.log
+
+test -f $tst-$count.log
+test -f $dir1-$count/foo.log
+test -f $dir2-$count/$tst-$count.log
+
+test -f $tst-163.log
+grep "^PASS: $tst-163\.test$" stdout
+test -f $dir1-7645/foo.log
+grep "^PASS: $dir1-7645/foo.sh$" stdout
+test -f $dir2-4077/$tst-4077.log
+grep "^PASS: $dir2-4077/$tst-4077$" stdout
+
+grep "^PASS: " stdout > grp
+list_logs > lst
 
 sed 20q lst # For debugging.
 sed 20q grp # Likewise.
 
-test $(cat <grp | wc -l) -eq $count
-test $(cat <lst | wc -l) -eq $count
+test $(wc -l <grp) -eq $whole_count
+test $(wc -l <lst) -eq $whole_count
+
+check_three_reruns ()
+{
+  grep "^PASS: $tst-1\.test$" stdout
+  grep "^PASS: $dir1-1/foo\.sh$" stdout
+  grep "^PASS: $dir2-1/$tst-1$" stdout
+  test $(LC_ALL=C grep -c "^[A-Z][A-Z]*:" stdout) -eq 3
+}
+
+$sleep
+touch $tst-1.test $dir1-1/foo.sh $dir2-1/$tst-1
+$MAKE check AM_LAZY_CHECK=yes > stdout || { cat stdout; exit 1; }
+cat stdout
+check_three_reruns
+grep "^# TOTAL: $whole_count$" stdout
+grep "^# PASS:  $whole_count$" stdout
 
-# We need to simulate a failure of two tests.
+# We need to simulate the failure of few tests.
 st=0
-env TESTS="$deepdir/$tname-1.test $deepdir/$tname-2.test" \
-    $MAKE check TEST_LOG_COMPILER=false > stdout && st=1
+$MAKE check TESTS="$tst-1.test $dir1-1/foo.sh $dir2-1/$tst-1" \
+            LOG_COMPILER=false > stdout && st=1
 cat stdout
-test $(grep -c '^FAIL:' stdout) -eq 2 || st=1
-test $st -eq 0 || fatal_ "couldn't simulate failure of two tests"
+test $(grep -c '^FAIL:' stdout) -eq 3 || st=1
+test $st -eq 0 || fatal_ "couldn't simulate failure of 3 tests"
 unset st
 
 $MAKE recheck > stdout || { cat stdout; exit 1; }
 cat stdout
-grep "^PASS: .*$tname-1\.test" stdout
-grep "^PASS: .*$tname-2\.test" stdout
-test $(LC_ALL=C grep -c "^[A-Z][A-Z]*:" stdout) -eq 2
-grep "^# TOTAL: 2$" stdout
-grep "^# PASS:  2$" stdout
-
-# "make clean" might ignore some failures, so we prefer to also grep its
-# output to ensure that no "Argument list too long" error was encountered.
+check_three_reruns
+grep "^# TOTAL: 3$" stdout
+grep "^# PASS:  3$" stdout
+
+# We need to simulate the failure of a lot of tests.
+$MAKE check LOG_COMPILER=false > stdout && { cat stdout; exit 1; }
+cat stdout
+
+grep '^PASS:' stdout && exit 1
+# A random sample.
+grep "^FAIL: $tst-363\.test$" stdout
+grep "^FAIL: $dir1-9123/foo.sh$" stdout
+grep "^FAIL: $dir2-3609/$tst-3609$" stdout
+
+grep "^FAIL: " stdout > grp
+sed 20q grp # For debugging.
+test $(wc -l <grp) -eq $whole_count
+
+$MAKE recheck > stdout || { cat stdout; exit 1; }
+cat stdout
+
+grep '^FAIL:' stdout && exit 1
+# A random sample.
+grep "^PASS: $tst-363\.test$" stdout
+grep "^PASS: $dir1-9123/foo.sh$" stdout
+grep "^PASS: $dir2-3609/$tst-3609$" stdout
+
+grep "^PASS: " stdout > grp
+sed 20q grp # For debugging.
+test $(wc -l <grp) -eq $whole_count
+grep "^# TOTAL: $whole_count$" stdout
+grep "^# PASS:  $whole_count$" stdout
+
+# "make clean" might ignore some failures (either on purpose or spuriously),
+# so we prefer to also grep its output to ensure that no "Argument list too
+# long" error was encountered.
 $MAKE clean >output 2>&1 || { cat output; exit 1; }
 cat output
 grep -i 'list.* too long' output && exit 1
-ls $deepdir | grep '\.log$' && exit 1
+list_logs | grep . && exit 1
 
 :
diff --git a/t/self-check-explicit-skips.sh b/t/self-check-explicit-skips.sh
index 24687a8..97f5288 100755
--- a/t/self-check-explicit-skips.sh
+++ b/t/self-check-explicit-skips.sh
@@ -36,22 +36,19 @@ run_dummy_test ()
   " dummy.sh
 }
 
-run_dummy_test '(exit 77); exit 77'
+run_dummy_test 'exit 77'
 test $? -eq 77 || exit 1
 
 run_dummy_test 'sh -c "exit 77"' am_explicit_skips=no
 test $? -eq 77 || exit 1
 
-run_dummy_test '(exit 77); exit 77' am_explicit_skips=yes
+run_dummy_test '$PERL -e "exit 77"; true' am_explicit_skips=yes
 test $? -eq 78 || exit 1
 
-run_dummy_test 'sh -c "exit 77"' am_explicit_skips=y
+run_dummy_test 'sh -c "exit 77"; exit 0' am_explicit_skips=y
 test $? -eq 78 || exit 1
 
-run_dummy_test 'exit 77' am_explicit_skips=yes
-test $? -eq 77 || exit 1
-
-run_dummy_test 'skip_ "foo"' am_explicit_skips=y
+run_dummy_test 'skip_ "foo"; :' am_explicit_skips=y
 test $? -eq 77 || exit 1
 
 :
diff --git a/t/subpkg.sh b/t/subpkg.sh
index 0548f98..9b9f7eb 100755
--- a/t/subpkg.sh
+++ b/t/subpkg.sh
@@ -107,7 +107,8 @@ cd ..
 
 ./configure >stdout || { cat stdout; exit 1; }
 cat stdout
-grep '^checking whether cc understands -c and -o together' stdout
+# Don't pretend to know the name or path of the C compiler.
+grep '^checking whether .* understands -c and -o together' stdout
 
 $MAKE
 $MAKE distcheck


hooks/post-receive
-- 
GNU Automake



reply via email to

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