1 # use GNU Make to run tests in parallel, and without depending on Rubygems
4 ifeq ($(DLEXT
),) # "so" for Linux
5 DLEXT
:= $(shell ruby
-rrbconfig
-e
'puts Config::CONFIG["DLEXT"]')
8 slow_tests
:= test/unit
/test_server.rb
9 awk_slow
:= awk
'/def test_/{print FILENAME"--"$$2".n"}'
10 T
:= $(filter-out $(slow_tests
),$(wildcard test/unit
/test*.rb
))
11 T_n
:= $(shell $(awk_slow
) $(slow_tests
))
12 t_log
:= $(subst .rb
,.log
,$(T
)) $(subst .n
,.log
,$(T_n
))
14 @cat
$(t_log
) | ruby
test/aggregate.rb
18 @
$(MAKE
) $(shell $(awk_slow
) $@
)
19 %.n
: arg
= $(subst .n
,,$(subst --, -n
,$@
))
20 %.n
: name
= $(subst .n
,,$(subst --, ,$@
))
21 %.n
: t
= $(subst .n
,.log
,$@
)
22 %.n
: lib
/http11.
$(DLEXT
)
23 @echo
'**** $(name) ****'; ruby
-I lib
$(arg
) $(TEST_OPTS
) >$(t
)+ 2>&1
26 $(T
): t
= $(subst .rb
,.log
,$@
)
27 $(T
): lib
/http11.
$(DLEXT
)
28 @echo
'**** $@ ****'; ruby
-I lib
$@
$(TEST_OPTS
) > $(t
)+ 2>&1
31 http11_deps
:= $(addprefix ext
/http11
/, \
32 ext_help.h http11.c http11_parser.c http11_parser.h \
33 http11_parser.rl http11_parser_common.rl \
35 ext
/http11
/http11_parser.c
: ext
/http11
/http11_parser.rl
36 cd
$(@D
) && ragel
$(<F
) -C
-G2
-o
$(@F
)
37 ext
/http11
/Makefile
: ext
/http11
/extconf.rb
38 cd
$(@D
) && ruby
$(<F
)
39 ext
/http11
/http11.
$(DLEXT
): $(http11_deps
)
41 lib
/http11.
$(DLEXT
): ext
/http11
/http11.
$(DLEXT
)
46 -$(MAKE
) -C ext
/http11
clean
47 $(RM
) ext
/http11
/Makefile lib
/http11.
$(DLEXT
)
51 cmp
$@
+ $@ || mv
$@
+ $@
54 .PHONY
: $(T
) $(slow_tests
) Manifest