make-rules/setup.py.mk
changeset 247 c57f32335aee
parent 181 87e11e685b1f
child 706 6e61f0012046
--- a/make-rules/setup.py.mk	Wed May 18 20:49:57 2011 -0700
+++ b/make-rules/setup.py.mk	Thu May 19 09:15:54 2011 -0700
@@ -60,5 +60,21 @@
 	$(COMPONENT_POST_INSTALL_ACTION)
 	$(TOUCH) [email protected]
 
+COMPONENT_TEST_DEP =	$(BUILD_DIR)/%/.installed
+COMPONENT_TEST_DIR =	$(COMPONENT_SRC)/test
+COMPONENT_TEST_ENV_CMD =	$(ENV) -
+COMPONENT_TEST_ENV +=	PYTHONPATH=$(PROTO_DIR)$(PYTHON_VENDOR_PACKAGES)
+COMPONENT_TEST_CMD =	$(PYTHON)
+COMPONENT_TEST_ARGS +=	./runtests.py
+
+# test the built source
+$(BUILD_DIR)/%/.tested:	$(COMPONENT_TEST_DEP)
+	$(COMPONENT_PRE_TEST_ACTION)
+	(cd $(COMPONENT_TEST_DIR); $(COMPONENT_TEST_ENV_CMD) \
+		$(COMPONENT_TEST_ENV) \
+		$(COMPONENT_TEST_CMD) $(COMPONENT_TEST_ARGS) )
+	$(COMPONENT_POST_TEST_ACTION)
+	$(TOUCH) [email protected]
+
 clean::
 	$(RM) -r $(SOURCE_DIR) $(BUILD_DIR)