make-rules/ant.mk
changeset 2164 b580bc10e31a
parent 1352 1358a1e1ff4c
child 3558 2cec274f17fc
--- a/make-rules/ant.mk	Tue Oct 21 02:05:30 2014 -0700
+++ b/make-rules/ant.mk	Tue Oct 21 12:20:30 2014 -0700
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
 #
 
 ANT=/usr/bin/ant
@@ -46,6 +46,17 @@
 	$(COMPONENT_POST_INSTALL_ACTION)
 	$(TOUCH) $@
 
+COMPONENT_TEST_ENV += JAVA_HOME="$(JAVA_HOME)"
+COMPONENT_TEST_CMD = $(ANT)
+# test the built source
+$(BUILD_DIR)/%/.tested: $(BUILD_DIR)/%/.built
+	$(COMPONENT_PRE_TEST_ACTION)
+	(cd $(COMPONENT_TEST_DIR) ; $(ENV) $(COMPONENT_TEST_ENV) \
+		$(COMPONENT_TEST_CMD) \
+			$(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS))
+	$(COMPONENT_POST_TEST_ACTION)
+	$(TOUCH) $@
+
 ifeq   ($(strip $(PARFAIT_BUILD)),yes)
 parfait: build
 else