hotspot/test/Makefile
changeset 27695 c6e0ac3339ac
parent 26922 8134a6d3fc02
child 28023 a4075664328d
--- a/hotspot/test/Makefile	Thu Nov 13 16:11:00 2014 -0800
+++ b/hotspot/test/Makefile	Mon Nov 17 12:57:49 2014 +0300
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,10 @@
 # Makefile to run various hotspot tests
 #
 
+ALT_MAKE ?= closed
+
+-include $(ALT_MAKE)/Makefile
+
 GETMIXEDPATH=echo
 
 # Utilities used
@@ -305,14 +309,27 @@
 
 PHONY_LIST += jtreg_tests
 
+# flags used to execute java in test targets
+TEST_FLAGS += -version -Xinternalversion -X -help 
+
+sanitytest: prep $(PRODUCT_HOME)
+	@for flag in $(TEST_FLAGS);                                             \
+	do                                                                      \
+	    echo Executing java $(JAVA_OPTIONS) $$flag;                         \
+	    $(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) $$flag;                    \
+	    res=$$?;                                                            \
+	    if [ $$res -ne 0 ]; then                                            \
+	        exit $$res;                                                     \
+	    fi;                                                                 \
+	done
+
+PHONY_LIST += sanitytest
+
 ################################################################
 
 # clienttest (make sure various basic java client options work)
 
-hotspot_clienttest clienttest: prep $(PRODUCT_HOME)
-	$(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -version
-	$(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -help
-	$(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -X
+hotspot_clienttest clienttest: sanitytest
 	$(RM) $(PRODUCT_HOME)/jre/lib/*/client/classes.jsa
 	$(RM) $(PRODUCT_HOME)/jre/bin/client/classes.jsa
 	$(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -Xshare:dump
@@ -323,10 +340,7 @@
 
 # minimaltest (make sure various basic java minimal options work)
 
-hotspot_minimaltest minimaltest: prep $(PRODUCT_HOME)
-	$(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -version
-	$(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -help
-	$(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -X
+hotspot_minimaltest minimaltest: sanitytest
 
 PHONY_LIST += hotspot_minimaltest minimaltest
 
@@ -334,10 +348,7 @@
 
 # servertest (make sure various basic java server options work)
 
-hotspot_servertest servertest: prep $(PRODUCT_HOME)
-	$(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -version
-	$(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -help
-	$(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -X
+hotspot_servertest servertest: sanitytest
 
 PHONY_LIST += hotspot_servertest servertest