about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-04-05 21:34:24 -0700
committerEric Wong <normalperson@yhbt.net>2009-04-05 21:34:24 -0700
commit0d20fd3eda124861857d7f48be0c16af0b10d2ad (patch)
tree8c5724072a51985b424cff34d0528920e6cf4ed4
parentcada8cddb16fd0117cffdbf9d4624807af4af797 (diff)
downloadunicorn-0d20fd3eda124861857d7f48be0c16af0b10d2ad.tar.gz
As usual, spit out all the test output if something fails.  But
allow people who like to see things scroll by see things scroll
by.  Quiet down the Rails tests by default, too.
-rw-r--r--GNUmakefile16
1 files changed, 13 insertions, 3 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 6ccf997..5ef370d 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -66,8 +66,19 @@ $(slow_tests):
         @$(MAKE) $(shell $(awk_slow) $@)
 
 TEST_OPTS = -v
-run_test = @echo '* $(arg)$(extra)'; \
-  setsid $(ruby) $(arg) $(TEST_OPTS) >$(t) 2>&1 || \
+TEST_OPTS = -v
+ifndef V
+       quiet_pre = @echo '* $(arg)$(extra)';
+       quiet_post = >$(t) 2>&1
+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
+endif
+run_test = $(quiet_pre) setsid $(ruby) $(arg) $(TEST_OPTS) $(quiet_post) || \
   (sed "s,^,$(extra): ," >&2 < $(t); exit 1)
 
 %.n: arg = $(subst .n,,$(subst --, -n ,$@))
@@ -134,6 +145,5 @@ $(T_r).%.r: export UNICORN_RAILS_TEST_VERSION = $(rv)
 $(T_r).%.r: export RAILS_GIT_REPO = $(CURDIR)/$(rails_git)
 $(T_r).%.r: $(test_prefix)/.stamp $(rails_git)/info/cloned-stamp
         $(run_test)
-        @sed 's,^,$(rv): ,' < $(t)
 
 .PHONY: doc $(T) $(slow_tests) Manifest