1 # we can run tests in parallel with GNU make
4 pid
:= $(shell echo
$$PPID)
9 ifeq ($(RUBY_VERSION
),)
10 RUBY_VERSION
:= $(shell $(RUBY
) -e
'puts RUBY_VERSION')
13 ifeq ($(RUBY_VERSION
),)
14 $(error unable to detect RUBY_VERSION
)
17 T
= $(wildcard t
[0-9][0-9][0-9][0-9]-*.sh
)
21 # can't rely on "set -o pipefail" since we don't require bash or ksh93 :<
22 t_pfx
= trash
/$@
-$(RUBY_VERSION
)
24 # TRACER = strace -f -o $(t_pfx).strace -s 100000
25 # TRACER = /usr/bin/time -o $(t_pfx).time
31 TEST_OPTS
+= --verbose
36 dd if
=/dev
/urandom bs
=1M count
=30 of
=$@.
$(pid
)
41 dependencies
:= socat curl
42 deps
:= $(addprefix .dep
+,$(dependencies
))
43 $(deps
): dep_bin
= $(lastword
$(subst +, ,$@
))
45 @which
$(dep_bin
) > $@.
$(pid
) 2>/dev
/null ||
:
46 @
test -s
$@.
$(pid
) || \
47 { echo
>&2 "E '$(dep_bin)' not found in PATH=$(PATH)"; exit
1; }
51 test_prefix
:= $(CURDIR
)/..
/test/install-
$(RUBY_VERSION
)
52 $(test_prefix
)/.stamp
:
53 $(MAKE
) -C .. test-install
55 $(T
): export RUBY
:= $(RUBY
)
56 $(T
): export RAKE
:= $(RAKE
)
57 $(T
): export PATH
:= $(test_prefix
)/bin
:$(PATH
)
58 $(T
): export RUBYLIB
:= $(test_prefix
)/lib
:$(RUBYLIB
)
59 $(T
): dep
$(test_prefix
)/.stamp trash
/.gitignore
60 $(TRACER
) $(SHELL
) $(SH_TEST_OPTS
) $@
$(TEST_OPTS
)