22585171 Need to add rules to gem.mk in Userland make-rules
authorGeoffrey Gardella <geoffrey.gardella@oracle.com>
Mon, 25 Jan 2016 14:36:26 -0800
changeset 5328 34fe0d5ec7b7
parent 5327 e8b0f6b16632
child 5330 c36e3195e3e9
22585171 Need to add rules to gem.mk in Userland make-rules
make-rules/gem.mk
--- a/make-rules/gem.mk	Mon Jan 25 14:14:00 2016 -0800
+++ b/make-rules/gem.mk	Mon Jan 25 14:36:26 2016 -0800
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
 #
 GEM=/usr/ruby/$(RUBY_VERSION)/bin/gem
 
@@ -57,4 +57,68 @@
 	$(COMPONENT_POST_INSTALL_ACTION)
 	$(TOUCH) [email protected]
 
+COMPONENT_TEST_TARGETS =
+COMPONENT_SYSTEM_TEST_TARGETS = 
+
+# test the built source
+$(BUILD_DIR)/%/.tested-and-compared:    $(BUILD_DIR)/%/.built
+	$(RM) -rf $(COMPONENT_TEST_BUILD_DIR)
+	$(MKDIR) $(COMPONENT_TEST_BUILD_DIR)
+	$(COMPONENT_PRE_TEST_ACTION)
+	-(cd $(COMPONENT_TEST_DIR) ; \
+	    $(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
+	    $(COMPONENT_TEST_CMD) \
+	    $(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS)) \
+	    &> $(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_TEST_TARGETS))
+	$(COMPONENT_POST_TEST_ACTION)
+	$(COMPONENT_TEST_CLEANUP)
+	$(TOUCH) [email protected]
+
+
+# Test the installed packages.  The targets above depend on .built which
+# means $(CLONEY) has already run.  System-test needs cloning but not
+# building; thus ideally, we would want to depend on .cloned here and below,
+# but since we don't have that, we depend on .prep and run $(CLONEY) here.
+$(BUILD_DIR)/%/.system-tested-and-compared:    $(SOURCE_DIR)/.prep
+	$(RM) -rf $(COMPONENT_TEST_BUILD_DIR)
+	$(MKDIR) $(COMPONENT_TEST_BUILD_DIR)
+	$(CLONEY) $(SOURCE_DIR) $(@D)
+	$(COMPONENT_PRE_SYSTEM_TEST_ACTION)
+	-(cd $(COMPONENT_SYSTEM_TEST_DIR) ; \
+	    $(COMPONENT_SYSTEM_TEST_ENV_CMD) $(COMPONENT_SYSTEM_TEST_ENV) \
+	    $(COMPONENT_SYSTEM_TEST_CMD) \
+	    $(COMPONENT_SYSTEM_TEST_ARGS) $(COMPONENT_SYSTEM_TEST_TARGETS)) \
+	    &> $(COMPONENT_TEST_OUTPUT)
+	$(COMPONENT_POST_SYSTEM_TEST_ACTION)
+	$(COMPONENT_TEST_CREATE_TRANSFORMS)
+	$(COMPONENT_TEST_PERFORM_TRANSFORM)
+	$(COMPONENT_TEST_COMPARE)
+	$(COMPONENT_SYSTEM_TEST_CLEANUP)
+	$(TOUCH) [email protected]
+
+$(BUILD_DIR)/%/.system-tested:    $(SOURCE_DIR)/.prep
+	$(CLONEY) $(SOURCE_DIR) $(@D)
+	$(COMPONENT_PRE_SYSTEM_TEST_ACTION)
+	(cd $(COMPONENT_SYSTEM_TEST_DIR) ; \
+	    $(COMPONENT_SYSTEM_TEST_ENV_CMD) $(COMPONENT_SYSTEM_TEST_ENV) \
+	    $(COMPONENT_SYSTEM_TEST_CMD) \
+	    $(COMPONENT_SYSTEM_TEST_ARGS) $(COMPONENT_SYSTEM_TEST_TARGETS))
+	$(COMPONENT_POST_SYSTEM_TEST_ACTION)
+	$(COMPONENT_SYSTEM_TEST_CLEANUP)
+	$(TOUCH) [email protected]
+
 REQUIRED_PACKAGES += runtime/ruby