about summary refs log tree commit homepage
path: root/t/GNUmakefile
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-10-24 17:10:49 -0700
committerEric Wong <normalperson@yhbt.net>2009-10-24 17:10:49 -0700
commite77369a6bde35a4e8925d450aac85f328f87d208 (patch)
treee43c5b68ac26ee625a372a710a2e302711fa59f1 /t/GNUmakefile
parent60ff6aaee097ff1f3ddca34ab53da9b077997dde (diff)
downloadrainbows-e77369a6bde35a4e8925d450aac85f328f87d208.tar.gz
Everything passes, and "set -e" prevents us from
making any stupid mistakes...
Diffstat (limited to 't/GNUmakefile')
-rw-r--r--t/GNUmakefile31
1 files changed, 8 insertions, 23 deletions
diff --git a/t/GNUmakefile b/t/GNUmakefile
index e4e4f5a..24ce750 100644
--- a/t/GNUmakefile
+++ b/t/GNUmakefile
@@ -2,7 +2,7 @@
 
 all::
 
-RUBY = ruby
+RUBY = $(ruby)
 rainbows_lib := $(shell cd ../lib && pwd)
 -include ../local.mk
 ifeq ($(RUBY_VERSION),)
@@ -22,34 +22,19 @@ all:: $(T)
 
 # can't rely on "set -o pipefail" since we don't require bash or ksh93 :<
 t_pfx = trash/$@-$(RUBY_VERSION)
-t_code = $(t_pfx).code
-t_log = $(t_pfx).log
+TEST_OPTS =
 # TRACER = strace -f -o $(t_pfx).strace -s 100000
 # TRACER = /usr/bin/time -o $(t_pfx).time
-t_run = $(TRACER) $(SHELL) $(SH_TEST_OPTS) $@
+run_test = $(TRACER) $(SHELL) $(SH_TEST_OPTS) $@ $(TEST_OPTS)
 
-# prefix stdout messages with ':', and stderr messages with '!'
-t_wrap = ( ( ( echo 42 > $(t_code); \
-  $(t_run); \
-  echo $$? > $(t_code) ) \
-  | sed 's/^/$(pfx):/' 1>&3 ) 2>&1 \
-  | sed 's/^/$(pfx)!/' 1>&2 ) 3>&1
-
-ifndef V
-  quiet_pre = @echo '* $@';
-  quiet_post = > $(t_log) 2>&1; exit $$(cat $(t_code))
-  pfx =
-else
+ifdef V
   ifeq ($(V),2)
-    SH_TEST_OPTS += -x
+    TEST_OPTS += --trace
+  else
+    TEST_OPTS += --verbose
   endif
-  quiet_pre = @echo '* $@';
-  quiet_post = 2>&1 | ./bin/utee $(t_log); exit $$(cat $(t_code))
-  pfx = $@
 endif
 
-run_test = $(quiet_pre) ( $(t_wrap) ) $(quiet_post)
-
 test-bin-$(RUBY_VERSION)/rainbows: ruby_bin = $(shell which $(RUBY))
 test-bin-$(RUBY_VERSION)/rainbows: ../bin/rainbows
         mkdir -p $(@D)
@@ -68,7 +53,7 @@ $(T): trash/.gitignore
 $(T): export RUBY := $(RUBY)
 $(T): export PATH := $(CURDIR)/test-bin-$(RUBY_VERSION):$(PATH)
 $(T): test-bin-$(RUBY_VERSION)/rainbows
-        $(run_test)
+        @$(run_test)
 
 trash/.gitignore:
         mkdir -p $(@D)