diff options
Diffstat (limited to 't/GNUmakefile')
-rw-r--r-- | t/GNUmakefile | 31 |
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) |