diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-02-03 12:04:45 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-02-09 19:50:33 -0800 |
commit | 72a2aa7ca6e4ed1dab8448b93be31a35748ff881 (patch) | |
tree | 5835901566ef2a10d7ee4c76fe4f82d3852684e1 /GNUmakefile | |
parent | 9f9a9d488ed32a2891dc3dd7d50a17a16357042d (diff) | |
download | unicorn-72a2aa7ca6e4ed1dab8448b93be31a35748ff881.tar.gz |
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".
Diffstat (limited to 'GNUmakefile')
-rw-r--r-- | GNUmakefile | 19 |
1 files changed, 19 insertions, 0 deletions
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) |