summaryrefslogtreecommitdiff
path: root/defs
diff options
context:
space:
mode:
Diffstat (limited to 'defs')
-rw-r--r--defs/gmake.mk17
1 files changed, 17 insertions, 0 deletions
diff --git a/defs/gmake.mk b/defs/gmake.mk
new file mode 100644
index 0000000..67dce0b
--- /dev/null
+++ b/defs/gmake.mk
@@ -0,0 +1,17 @@
+TEST_TARGETS := $(filter check test check% test% btest%,$(MAKECMDGOALS))
+TEST_TARGETS += $(subst check,test-all,$(patsubst check-%,test-%,$(TEST_TARGETS)))
+TEST_TARGETS := $(patsubst test-%,yes-test-%,$(patsubst btest-%,yes-btest-%,$(TEST_TARGETS)))
+TEST_DEPENDS := $(if $(TEST_TARGETS),$(filter all main exts,$(MAKECMDGOALS)))
+TEST_DEPENDS += $(TEST_DEPENDS) $(if $(filter check%,$(MAKECMDGOALS)),main)
+
+ifneq ($(filter check% test,$(MAKECMDGOALS)),)
+yes-test-knownbug: $(TEST_DEPENDS) yes-btest-ruby
+yes-btest-ruby: $(TEST_DEPENDS) yes-test-sample
+yes-test-sample: $(TEST_DEPENDS)
+endif
+ifneq ($(filter check%,$(MAKECMDGOALS)) $(filter test-all,$(TEST_TARGETS)),)
+yes-test-all yes-test-ruby: $(filter-out %test-all %test-ruby check%,$(TEST_TARGETS)) \
+ yes-test-knownbug
+endif
+
+$(TEST_TARGETS): $(TEST_DEPENDS)