From d7b3fb8053315c2ecf4d66199b028df5070e1ab8 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 29 Jun 2009 02:39:04 -0700 Subject: GNUmakefile: more stringent error checking in tests --- GNUmakefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 1145143..6291f93 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -70,17 +70,18 @@ $(slow_tests): $(test_prefix)/.stamp @$(MAKE) $(shell $(awk_slow) $@) TEST_OPTS = -v -TEST_OPTS = -v +check_test = grep '0 failures, 0 errors' $(t) >/dev/null ifndef V quiet_pre = @echo '* $(arg)$(extra)'; - quiet_post = >$(t) 2>&1 + quiet_post = >$(t) 2>&1 && $(check_test) else # we can't rely on -o pipefail outside of bash 3+, # so we use a stamp file to indicate success and # have rm fail if the stamp didn't get created stamp = $@$(log_suffix).ok quiet_pre = @echo $(ruby) $(arg) $(TEST_OPTS); ! test -f $(stamp) && ( - quiet_post = && > $(stamp) )>&2 | tee $(t); rm $(stamp) 2>/dev/null + quiet_post = && > $(stamp) )2>&1 | tee $(t); \ + rm $(stamp) 2>/dev/null && $(check_test) endif run_test = $(quiet_pre) setsid $(ruby) -w $(arg) $(TEST_OPTS) $(quiet_post) || \ (sed "s,^,$(extra): ," >&2 < $(t); exit 1) -- cgit v1.2.3-24-ge0c7