1 # we can run tests in parallel with GNU make
6 rainbows_lib
:= $(shell cd ..
/lib
&& pwd
)
8 ifeq ($(RUBY_VERSION
),)
9 RUBY_VERSION
:= $(shell $(RUBY
) -e
'puts RUBY_VERSION')
13 RUBYLIB
:= $(rainbows_lib
)
15 RUBYLIB
:= $(rainbows_lib
):$(RUBYLIB
)
17 export RUBYLIB RUBY_VERSION
19 T
= $(wildcard t
[0-9][0-9][0-9][0-9]-*.sh
)
23 # can't rely on "set -o pipefail" since we don't require bash or ksh93 :<
24 t_pfx
= trash
/$@
-$(RUBY_VERSION
)
26 # TRACER = strace -f -o $(t_pfx).strace -s 100000
27 # TRACER = /usr/bin/time -o $(t_pfx).time
28 run_test
= $(TRACER
) $(SHELL
) $(SH_TEST_OPTS
) $@
$(TEST_OPTS
)
34 TEST_OPTS
+= --verbose
38 test-bin-
$(RUBY_VERSION
)/rainbows
: ruby_bin
= $(shell which
$(RUBY
))
39 test-bin-
$(RUBY_VERSION
)/rainbows
: ..
/bin
/rainbows
42 $(RUBY
) -i
-p
-e
'$$_.gsub!(%r{^#!.*$$},"#!$(ruby_bin)")' $@
+
45 req_random_blob
:= $(wildcard t?
1??
-*.sh
)
47 dd if
=/dev
/urandom bs
=1M count
=10 of
=$@
+
50 $(req_random_blob
): random_blob
52 $(T
): trash
/.gitignore
53 $(T
): export RUBY
:= $(RUBY
)
54 $(T
): export PATH
:= $(CURDIR
)/test-bin-
$(RUBY_VERSION
):$(PATH
)
55 $(T
): test-bin-
$(RUBY_VERSION
)/rainbows
63 $(RM
) -r trash
/*.log trash
/*.code test-bin-
$(RUBY_VERSION
)