From 61873d53fea7a1a341bb7234d8428d5aba9ebf3b Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Wed, 10 Aug 2011 16:03:35 +0200 Subject: [PATCH] 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. --- ChangeLog | 9 +++++++++ tests/parallel-tests-fork-bomb.test | 20 +++++++++++--------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0c5c5e7ae..76e1b3dd2 100644 --- 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 + + 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 test defs: yet more environment cleanup diff --git a/tests/parallel-tests-fork-bomb.test b/tests/parallel-tests-fork-bomb.test index 6a385d652..7b616c1bb 100755 --- a/tests/parallel-tests-fork-bomb.test +++ b/tests/parallel-tests-fork-bomb.test @@ -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 -- 2.47.2