summaryrefslogtreecommitdiff
path: root/make/test.make
diff options
context:
space:
mode:
authorJan Huwald <jh@sotun.de>2012-05-07 20:01:51 (GMT)
committerJan Huwald <jh@sotun.de>2012-05-07 20:01:51 (GMT)
commit420d2ef464d4a741028e132e662d5626806a41f5 (patch)
tree1aca6eb512e4ed0fb5f3c10c528cb998b6ffd695 /make/test.make
Initial commitHEADmaster
Diffstat (limited to 'make/test.make')
-rw-r--r--make/test.make27
1 files changed, 27 insertions, 0 deletions
diff --git a/make/test.make b/make/test.make
new file mode 100644
index 0000000..e57180c
--- /dev/null
+++ b/make/test.make
@@ -0,0 +1,27 @@
+.PHONY: test speedtest alltest
+test: $(TEST) exec
+
+# targets with long runtime
+speedtest: $(SPEEDTEST)
+alltest: test speedtest
+
+test_%: tmp/.passed.test_%
+ @echo "=== $@ passed ==="
+
+tmp/%/.test.init_dir:
+ @mkdir -p $(shell dirname $@)
+ @rm $(shell dirname $@)/{*,.test*} 2>/dev/null || true
+ @date > $@
+
+.SECONDEXPANSION:
+tmp/.passed.test_%: DIR=tmp/$(shell basename $<)
+tmp/.passed.test_%: bin/test_% tmp/test_%/.test.init_dir
+ @echo "running $(DIR)"
+ @(cd "$(DIR)" && ../../$<) || (if [ -z "$$KEEPTEST" ]; then rm -r "$(DIR)"; fi; false)
+ @rm -r "$(DIR)"
+ @date > $@
+
+# TODO: bootstrap has to wait for dir creation (yes, this is a race
+# cond right now - good luck)
+tmp/.passed.test_sim_loop: tmp/test_sim_loop/.bootstrap
+tmp/.passed.test_filter: tmp/test_filter/.topology
contact: Jan Huwald // Impressum