make-rules/setup.py.mk
changeset 3558 2cec274f17fc
parent 3497 091183b2cc24
child 3817 30b42c38bbc4
--- a/make-rules/setup.py.mk	Wed Dec 17 13:31:44 2014 -0800
+++ b/make-rules/setup.py.mk	Wed Dec 17 15:33:37 2014 -0800
@@ -39,6 +39,12 @@
 $(BUILD_DIR)/$(MACH32)-%/.tested:	BITS=32
 $(BUILD_DIR)/$(MACH64)-%/.tested:	BITS=64
 
+$(BUILD_DIR)/%-2.6/.tested-and-compared:	PYTHON_VERSION=2.6
+$(BUILD_DIR)/%-2.7/.tested-and-compared:	PYTHON_VERSION=2.7
+$(BUILD_DIR)/%-3.4/.tested-and-compared:	PYTHON_VERSION=3.4
+$(BUILD_DIR)/$(MACH32)-%/.tested-and-compared:	BITS=32
+$(BUILD_DIR)/$(MACH64)-%/.tested-and-compared:	BITS=64
+
 BUILD_32 = $(PYTHON2_VERSIONS:%=$(BUILD_DIR)/$(MACH32)-%/.built)
 BUILD_64 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH64)-%/.built)
 BUILD_NO_ARCH = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH)-%/.built)
@@ -53,13 +59,6 @@
 INSTALL_32_and_64 = $(INSTALL_64)
 endif
 
-TEST_32 = $(PYTHON2_VERSIONS:%=$(BUILD_DIR)/$(MACH32)-%/.tested)
-TEST_64 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH64)-%/.tested)
-TEST_NO_ARCH = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH)-%/.tested)
-ifeq ($(PYTHON_VERSION),3.4)
-TEST_32_and_64 = $(TEST_64)
-endif
-
 PYTHON_ENV =	CC="$(CC)"
 PYTHON_ENV +=	CFLAGS="$(CFLAGS)"
 PYTHON_ENV +=	PATH="$(PATH):$(SPRO_VROOT)/bin"
@@ -117,6 +116,13 @@
 	$(COMPONENT_POST_INSTALL_ACTION)
 	$(TOUCH) [email protected]
 
+# Define bit specific and Python version specific filenames.
+COMPONENT_TEST_MASTER =	$(COMPONENT_TEST_RESULTS_DIR)/results-$(PYTHON_VERSION)-$(BITS).master
+COMPONENT_TEST_OUTPUT =	$(COMPONENT_TEST_RESULTS_DIR)/test-$(PYTHON_VERSION)-$(BITS)-results
+COMPONENT_TEST_DIFFS =	$(COMPONENT_TEST_RESULTS_DIR)/test-$(PYTHON_VERSION)-$(BITS)-diffs
+COMPONENT_TEST_SNAPSHOT = $(COMPONENT_TEST_RESULTS_DIR)/results-$(PYTHON_VERSION)-$(BITS).snapshot
+COMPONENT_TEST_TRANSFORM_CMD = $(COMPONENT_TEST_RESULTS_DIR)/transform-$(PYTHON_VERSION)-$(BITS)-results
+
 COMPONENT_TEST_DEP =	$(BUILD_DIR)/%/.installed
 COMPONENT_TEST_DIR =	$(COMPONENT_SRC)/test
 COMPONENT_TEST_ENV_CMD =	$(ENV)
@@ -124,13 +130,41 @@
 COMPONENT_TEST_CMD =	$(PYTHON)
 COMPONENT_TEST_ARGS +=	./runtests.py
 
+# determine the type of tests we want to run.
+ifeq ($(strip $(wildcard $(COMPONENT_TEST_RESULTS_DIR)/results-*.master)),)
+TEST_32 = $(PYTHON2_VERSIONS:%=$(BUILD_DIR)/$(MACH32)-%/.tested)
+TEST_64 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH64)-%/.tested)
+TEST_NO_ARCH = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH)-%/.tested)
+else
+TEST_32 = $(PYTHON2_VERSIONS:%=$(BUILD_DIR)/$(MACH32)-%/.tested-and-compared)
+TEST_64 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH64)-%/.tested-and-compared)
+TEST_NO_ARCH = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH)-%/.tested-and-compared)
+endif
+ifeq ($(PYTHON_VERSION),3.4)
+TEST_32_and_64 = $(TEST_64)
+endif
+
 # test the built source
-$(BUILD_DIR)/%/.tested:	$(COMPONENT_TEST_DEP)
+$(BUILD_DIR)/%/.tested-and-compared:    $(COMPONENT_TEST_DEP)
 	$(COMPONENT_PRE_TEST_ACTION)
-	(cd $(COMPONENT_TEST_DIR); $(COMPONENT_TEST_ENV_CMD) \
-		$(COMPONENT_TEST_ENV) \
-		$(COMPONENT_TEST_CMD) $(COMPONENT_TEST_ARGS) )
+	-(cd $(COMPONENT_TEST_DIR) ; \
+		$(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
+		$(COMPONENT_TEST_CMD) $(COMPONENT_TEST_ARGS)) \
+		&> $(COMPONENT_TEST_OUTPUT)
 	$(COMPONENT_POST_TEST_ACTION)
+	$(COMPONENT_TEST_CREATE_TRANSFORMS)
+	$(COMPONENT_TEST_PERFORM_TRANSFORM)
+	$(COMPONENT_TEST_COMPARE)
+	$(COMPONENT_TEST_CLEANUP)
+	$(TOUCH) [email protected]
+
+$(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)
+	$(COMPONENT_TEST_CLEANUP)
 	$(TOUCH) [email protected]
 
 ifeq   ($(strip $(PARFAIT_BUILD)),yes)