]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
coverage: possible infinite recursion in the test harness
authorStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 10 Aug 2011 14:03:35 +0000 (16:03 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 11 Aug 2011 09:33:22 +0000 (11:33 +0200)
Motivated by a regression in the 'test-protocols' branch.

* tests/parallel-tests-fork-bomb.test: New test, checking that
if $(TEST_SUITE_LOG) is in $(TEST_LOGS), we obtain a diagnosed
error rather than a make hang or a fork bomb.
* tests/Makefile.am (TESTS): Update.

ChangeLog
tests/parallel-tests-fork-bomb.test

index 0c5c5e7ae2fba6ce07136988666e682b91b3658c..76e1b3dd2062d59c10b105d3d58250478d3a46f2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,15 @@
        error rather than a make hang or a fork bomb.
        * tests/Makefile.am (TESTS): Update.
 
+2011-08-09  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       coverage: possible infinite recursion in the test harness
+       Motivated by a regression in the 'test-protocols' branch.
+       * tests/parallel-tests-fork-bomb.test: New test, checking that
+       if $(TEST_SUITE_LOG) is in $(TEST_LOGS), we obtain a diagnosed
+       error rather than a make hang or a fork bomb.
+       * tests/Makefile.am (TESTS): Update.
+
 2011-08-09  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        test defs: yet more environment cleanup
index 6a385d652341bfacc18641c8b969fefcd1e822af..7b616c1bb7c023d5c5bfa550e201feadc3bf4ac2 100755 (executable)
@@ -100,11 +100,18 @@ do_check ()
   cat output
   $FGREP '::OOPS::' output && Exit 1 # Possible infinite recursion.
   # Check that at least we don't create a botched global log file.
-# FIXME: GNU make currently creates it!
-#  test ! -f "$log"
+  test ! -f "$log"
+  if using_gmake; then
+    grep "[Cc]ircular.*dependency" output | $FGREP "$log"
+    test $st -gt 0
+  else
     # Look for possible error messages about circular dependencies from
     # either make or our own recipes.  At least one such a message must
-    # be present.
+    # be present.  OTOH, some make implementations (e.g., NetBSD's), while
+    # smartly detecting the circular dependency early and diagnosing it,
+    # still exit with a successful exit status (yikes!).  So don't check
+    # the exit status of non-GNU make, to avoid spurious failures.
+    # this case.
     err_seen=no
     for err_rx in \
       'circular.* depend' \
@@ -118,12 +125,7 @@ do_check ()
       break
     done
     test $err_seen = yes || Exit 1
-    # Some make implementations (e.g., NetBSD's), while smartly detecting
-    # the circular dependency early and diagnosing it, still exit with a
-    # successful exit status (yikes!).  Relax our checks not to fail in
-    # this case.
-    using_gmake && { test $st -gt 0 || Exit 1; }
-    :
+  fi
 }
 
 : > test-suite.test