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