1 # use GNU Make to run tests in parallel, and without depending on Rubygems
4 T
:= $(wildcard test/test*.rb
)
5 TO
:= $(subst .rb
,.log
,$(T
))
8 @cat
$(TO
) | ruby
test/aggregate.rb
11 $(RM
) $(TO
) $(addsuffix +,$(TO
))
15 quiet_pre
= @echo
'* $@';
16 quiet_post
= >$(t
) 2>&1
18 # we can't rely on -o pipefail outside of bash 3+,
19 # so we use a stamp file to indicate success and
20 # have rm fail if the stamp didn't get created
21 stamp
= $@
$(log_suffix
).ok
22 quiet_pre
= @echo
$(ruby
) $@
$(TEST_OPTS
); ! test -f
$(stamp
) && (
23 quiet_post
= && > $(stamp
) )>&2 | tee
$(t
); rm $(stamp
) 2>/dev
/null
26 run_test
= $(quiet_pre
) setsid
$(ruby
) -w
$@
$(TEST_OPTS
) $(quiet_post
) || \
27 (sed
"s,^,$(extra): ," >&2 < $(t
); exit
1)
29 $(T
): t
= $(subst .rb
,.log
,$@
)
30 $(T
): export RUBYLIB
:= $(CURDIR
)/lib
:$(RUBYLIB
)
34 # using make instead of rake since Rakefile takes too long to load
35 manifest
: Manifest.txt
38 cmp
$@
+ $@ || mv
$@
+ $@
42 git diff
--exit-code HEAD^
0
47 libs
:= $(wildcard lib
/*.rb lib
/*/*.rb
)
54 .PHONY
: $(T
) Manifest.txt