chiark / gitweb /
Test suite: Use make for parallel execution
[dgit.git] / tests / Makefile
diff --git a/tests/Makefile b/tests/Makefile
new file mode 100644 (file)
index 0000000..011bd3c
--- /dev/null
@@ -0,0 +1,14 @@
+# usage: tests/using-intree make -f tests/Makefile
+# (optionally setting TESTSCRIPTS='tests/tests/foo tests/tests/bar')
+
+TESTSCRIPTS ?= $(shell run-parts --list tests/tests)
+TESTNAMES := $(notdir $(TESTSCRIPTS))
+
+all: $(foreach t,$(TESTNAMES),tests/tmp/$t.ok)
+       @echo "ALL PASSED"
+
+tests/tmp:
+       mkdir -p $@
+
+tests/tmp/%.ok: tests/tmp
+       tests/tests/$* >tests/tmp/$*.log 2>&1