about summary refs log tree commit homepage
path: root/GNUmakefile
diff options
context:
space:
mode:
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)