8156658: Common way to run jtreg tests
authorsla
Wed, 11 May 2016 11:06:59 +0200
changeset 37941 d8b9240efe5d
parent 37940 ead113a2f92e
child 37942 b0e834553947
8156658: Common way to run jtreg tests Reviewed-by: erikj, dsamersoff
langtools/test/Makefile
--- a/langtools/test/Makefile	Tue May 10 15:36:21 2016 -0700
+++ b/langtools/test/Makefile	Wed May 11 11:06:59 2016 +0200
@@ -86,6 +86,8 @@
 # Default JTREG to run
 ifdef JPRT_JTREG_HOME
   JTREG_HOME = $(JPRT_JTREG_HOME)
+else ifdef JT_HOME
+  JTREG_HOME = $(JT_HOME)
 else
   JTREG_HOME = $(SLASH_JAVA)/re/jtreg/4.1-jigsaw/nightly/binaries/jtreg/
 endif
@@ -113,10 +115,12 @@
 #
 # JT_JAVA is the version of java used to run jtreg/JCK. 
 #
-ifdef JPRT_JAVA_HOME
-  JT_JAVA = $(JPRT_JAVA_HOME)
-else
-  JT_JAVA = $(SLASH_JAVA)/re/jdk/1.9.0/archive/fcs/binaries/$(PLATFORM)-$(ARCH)
+ifndef JT_JAVA
+  ifdef JPRT_JAVA_HOME
+    JT_JAVA = $(JPRT_JAVA_HOME)
+  else
+    JT_JAVA = $(SLASH_JAVA)/re/jdk/1.9.0/archive/fcs/binaries/$(PLATFORM)-$(ARCH)
+  endif
 endif
 
 # Default JDK to test
@@ -149,6 +153,10 @@
 	-refvmoptions:-Xbootclasspath/p:$(TESTBOOTCLASSPATH)
 endif
 
+ifdef EXTRA_JTREG_OPTIONS
+  JTREG_OPTIONS += $(EXTRA_JTREG_OPTIONS)
+endif
+
 # Concurrency is the number of tests that can execute at once.
 # On an otherwise empty machine, suggest setting to (#cpus + 2)
 # If unset, the default is (#cpus)
@@ -262,6 +270,12 @@
 javap:		JTREG_TESTDIRS = tools/javap
 jdeps:		JTREG_TESTDIRS = tools/jdeps
 
+# a way to select jtreg tests from outside
+ifdef TEST_SELECTION
+  JTREG_TESTDIRS = $(TEST_SELECTION)
+endif
+
+
 # Run jtreg tests
 #
 # JTREG_HOME
@@ -290,13 +304,13 @@
 	  -J-Xmx512m \
 	  -vmoption:-Xmx768m \
 	  -a -ignore:quiet $(if $(JTREG_VERBOSE),-v:$(JTREG_VERBOSE)) \
-          -r:$(JTREG_OUTPUT_DIR)/JTreport \
-          -w:$(JTREG_OUTPUT_DIR)/JTwork \
-          -jdk:$(TESTJAVA) \
-          $(JAVA_ARGS:%=-vmoption:%) \
-          $(JTREG_EXCLUSIONS) \
+	  -r:$(JTREG_OUTPUT_DIR)/JTreport \
+	  -w:$(JTREG_OUTPUT_DIR)/JTwork \
+	  -jdk:$(TESTJAVA) \
+	  $(JAVA_ARGS:%=-vmoption:%) \
+	  $(JTREG_EXCLUSIONS) \
 	  $(JTREG_OPTIONS) \
-          $(JTREG_TESTDIRS) \
+	  $(JTREG_TESTDIRS) \
 	|| ( $(call EXIT_IF_FATAL,$(FATAL_JTREG_EXIT)) ; \
 	    echo $$status > $(JTREG_OUTPUT_DIR)/status.txt \
 	)