From 72a2aa7ca6e4ed1dab8448b93be31a35748ff881 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 3 Feb 2009 12:04:45 -0800 Subject: Allow running tests in parallel via gmake Some of the tests here are horrifically slow due to sleeps, allow using gmake to run these tests in parallel. My Core2 Duo runs "make -j" over 10s faster than "rake". --- GNUmakefile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 GNUmakefile (limited to 'GNUmakefile') diff --git a/GNUmakefile b/GNUmakefile new file mode 100644 index 0000000..457d30d --- /dev/null +++ b/GNUmakefile @@ -0,0 +1,19 @@ +# use GNU Make to run tests in parallel, and without depending on Rubygems +all:: test + +slow_tests := test/unit/test_server.rb +awk_slow := awk '/def test_/{print FILENAME"--"$$2".n"}' +T := $(filter-out $(slow_tests),$(wildcard test/unit/test*.rb)) +T_n := $(shell $(awk_slow) $(slow_tests)) +test: $(T) $(T_n) + +$(slow_tests): + @$(MAKE) $(shell $(awk_slow) $@) +%.n: arg = $(subst .n,,$(subst --, -n ,$@)) +%.n: name = $(subst .n,,$(subst --, ,$@)) +%.n: + @echo '**** $(name) ****'; ruby -I lib $(arg) $(TEST_OPTS) +$(T): + @echo '**** $@ ****'; ruby -I lib $@ $(TEST_OPTS) + +.PHONY: $(T) $(slow_tests) -- cgit v1.2.3-24-ge0c7