about summary refs log tree commit homepage
path: root/GNUmakefile
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-02-03 12:04:45 -0800
committerEric Wong <normalperson@yhbt.net>2009-02-09 19:50:33 -0800
commit72a2aa7ca6e4ed1dab8448b93be31a35748ff881 (patch)
tree5835901566ef2a10d7ee4c76fe4f82d3852684e1 /GNUmakefile
parent9f9a9d488ed32a2891dc3dd7d50a17a16357042d (diff)
downloadunicorn-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--GNUmakefile19
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)