Fix CDS support. Change ParseKeywordVariable parameter name to enable JTREG_KEYWORDS parameter. Fix test list arg. ihse-runtestprebuilt-branch
authorerikj
Fri, 05 Oct 2018 09:59:30 -0700
branchihse-runtestprebuilt-branch
changeset 56931 aff106ae3507
parent 56924 3ff24f395d16
child 56932 7346896cdea2
Fix CDS support. Change ParseKeywordVariable parameter name to enable JTREG_KEYWORDS parameter. Fix test list arg.
make/RunTests.gmk
make/RunTestsPrebuiltSpec.gmk
make/common/MakeBase.gmk
--- a/make/RunTests.gmk	Wed Oct 03 17:17:47 2018 -0700
+++ b/make/RunTests.gmk	Fri Oct 05 09:59:30 2018 -0700
@@ -45,7 +45,7 @@
 endif
 
 $(eval $(call ParseKeywordVariable, TEST_OPTS, \
-    KEYWORDS := JOBS TIMEOUT GENERATE_CDS_ARCHIVE, \
+    SINGLE_KEYWORDS := JOBS TIMEOUT GENERATE_CDS_ARCHIVE, \
     STRING_KEYWORDS := VM_OPTIONS, \
 ))
 
@@ -132,9 +132,12 @@
 ifeq ($(TEST_OPTS_GENERATE_CDS_ARCHIVE), true)
   CDS_ARCHIVE_FILE := $(TEST_RESULTS_DIR)/cds_archive.jsa
 
-  $(CDS_ARCHIVE_FILE): $(JDK_IMAGE_DIR)
-	$(FIXPATH) $(PRODUCT_HOME)/bin/java -XX:+UnlockDiagnosticVMOptions \
-	    -XX:SharedArchiveFile=$(CDS_ARCHIVE_FILE) -Xshare:dump
+  $(CDS_ARCHIVE_FILE): $(JDK_IMAGE_DIR)/release
+	$(call MakeTargetDir)
+	$(call ExecuteWithLog, $(CDS_ARCHIVE_FILE), \
+	    $(FIXPATH) $(JDK_IMAGE_DIR)/bin/java -XX:+UnlockDiagnosticVMOptions \
+	        -XX:SharedArchiveFile=$(CDS_ARCHIVE_FILE) -Xshare:dump \
+	)
 
   CDS_VM_ARGS := -XX:+UnlockDiagnosticVMOptions -XX:SharedArchiveFile=$(CDS_ARCHIVE_FILE)
   JTREG_OPTIONS += $(addprefix -vmoption:, $(CDS_VM_ARGS))
@@ -157,8 +160,8 @@
 endif
 
 $(eval $(call ParseKeywordVariable, JTREG, \
-    KEYWORDS := JOBS TIMEOUT TEST_MODE ASSERT VERBOSE RETAIN MAX_MEM \
-        EXTRA_PROBLEM_LISTS, \
+    SINGLE_KEYWORDS := JOBS TIMEOUT TEST_MODE ASSERT VERBOSE RETAIN MAX_MEM \
+        EXTRA_PROBLEM_LISTS KEYWORDS, \
     STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS, \
 ))
 
@@ -168,7 +171,7 @@
 endif
 
 $(eval $(call ParseKeywordVariable, GTEST, \
-    KEYWORDS := REPEAT, \
+    SINGLE_KEYWORDS := REPEAT, \
     STRING_KEYWORDS := OPTIONS VM_OPTIONS, \
 ))
 
@@ -404,9 +407,10 @@
 	$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
 	$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/gtest, \
 	    $$(FIXPATH) $$(TEST_IMAGE_DIR)/hotspot/gtest/$$($1_VARIANT)/gtestLauncher \
-	         -jdk $(JDK_IMAGE_DIR) $$($1_GTEST_FILTER) \
-	         --gtest_output=xml:$$($1_TEST_RESULTS_DIR)/gtest.xml \
-	         $$($1_GTEST_REPEAT) $$(GTEST_OPTIONS) $$(GTEST_VM_OPTIONS) \
+	        -jdk $(JDK_IMAGE_DIR) $$($1_GTEST_FILTER) \
+	        --gtest_output=xml:$$($1_TEST_RESULTS_DIR)/gtest.xml \
+	        $$($1_GTEST_REPEAT) $$(GTEST_OPTIONS) \
+	        $$(CDS_VM_ARGS) $$(GTEST_VM_OPTIONS) \
 	        > >($(TEE) $$($1_TEST_RESULTS_DIR)/gtest.txt) \
 	    && $$(ECHO) $$$$? > $$($1_EXITCODE) \
 	    || $$(ECHO) $$$$? > $$($1_EXITCODE) \
@@ -504,6 +508,9 @@
   $$(eval $$(call SetJtregValue,$1,JTREG_BASIC_OPTIONS))
   $$(eval $$(call SetJtregValue,$1,JTREG_PROBLEM_LIST))
 
+  # Only the problem list for the current test root should be used.
+  $1_JTREG_PROBLEM_LIST := $$(filter $$($1_TEST_ROOT)%, $$($1_JTREG_PROBLEM_LIST))
+
   ifneq ($(TEST_JOBS), 0)
     $$(eval $$(call SetJtregValue,$1,JTREG_JOBS,$$(TEST_JOBS)))
   else
@@ -514,6 +521,8 @@
   # we may end up with a lot of JVM's
   $1_JTREG_MAX_RAM_PERCENTAGE := $$(shell $$(EXPR) 25 / $$($1_JTREG_JOBS))
 
+  $$(call PrintVar, TEST_OPTS_TIMEOUT)
+  $$(call PrintVar, JTREG_TIMEOUT)
   JTREG_TIMEOUT ?= 4
   JTREG_VERBOSE ?= fail,error,summary
   JTREG_RETAIN ?= fail,error
@@ -528,7 +537,7 @@
       -concurrency:$$($1_JTREG_JOBS) -timeoutFactor:$$(JTREG_TIMEOUT) \
       -vmoption:-XX:MaxRAMPercentage=$$($1_JTREG_MAX_RAM_PERCENTAGE)
 
-  $1_JTREG_BASIC_OPTIONS += -automatic -keywords:\!ignore -ignore:quiet
+  $1_JTREG_BASIC_OPTIONS += -automatic -ignore:quiet
 
   # Make it possible to specify the JIB_DATA_DIR for tests using the
   # JIB Artifact resolver
@@ -576,6 +585,14 @@
     $1_JTREG_LAUNCHER_OPTIONS += -Djava.library.path="$(JTREG_FAILURE_HANDLER_DIR)"
   endif
 
+  ifneq ($$(JTREG_KEYWORDS), )
+    # The keywords string may contain problematic characters and may be quoted
+    # already when it arrives here. Remove any existing quotes and replace them
+    # with one set of single quotes.
+    $1_JTREG_BASIC_OPTIONS += \
+        -k:'$$(patsubst $$(SQUOTE)%$$(SQUOTE),%,$$(patsubst $$(DQUOTE)%$$(DQUOTE),%,$$(JTREG_KEYWORDS)))'
+  endif
+
   clean-workdir-$1:
 	$$(RM) -r $$($1_TEST_SUPPORT_DIR)
 
--- a/make/RunTestsPrebuiltSpec.gmk	Wed Oct 03 17:17:47 2018 -0700
+++ b/make/RunTestsPrebuiltSpec.gmk	Fri Oct 05 09:59:30 2018 -0700
@@ -180,5 +180,5 @@
   EGREP := ggrep -E
   FGREP := grep -F
   SED := gsed
-  TAR := GTAR
+  TAR := gtar
 endif
--- a/make/common/MakeBase.gmk	Wed Oct 03 17:17:47 2018 -0700
+++ b/make/common/MakeBase.gmk	Fri Oct 05 09:59:30 2018 -0700
@@ -842,7 +842,7 @@
 # Parameter 1 is the name of the rule, and is also the name of the variable.
 #
 # Remaining parameters are named arguments. These include:
-#   KEYWORDS          A list of valid keywords
+#   SINGLE_KEYWORDS   A list of valid keywords with single string values
 #   STRING_KEYWORDS   A list of valid keywords, processed as string. This means
 #       that '%20' will be replaced by ' ' to allow for multi-word strings.
 #
@@ -856,7 +856,7 @@
       $$(eval mangled_part_eval := $$(call DoubleDollar, $$(mangled_part))) \
       $$(eval part := $$$$(subst ||||,$$$$(SPACE),$$$$(mangled_part_eval))) \
       $$(eval $1_NO_MATCH := true) \
-      $$(foreach keyword, $$($1_KEYWORDS), \
+      $$(foreach keyword, $$($1_SINGLE_KEYWORDS), \
         $$(eval keyword_eval := $$(call DoubleDollar, $$(keyword))) \
         $$(if $$(filter $$(keyword)=%, $$(part)), \
           $$(eval $(strip $1)_$$$$(keyword_eval) := $$$$(strip $$$$(patsubst $$$$(keyword_eval)=%, %, $$$$(part)))) \
@@ -871,11 +871,11 @@
         ) \
       ) \
       $$(if $$($1_NO_MATCH), \
-        $$(if $$(filter $$(part), $$($1_KEYWORDS) $$($1_STRING_KEYWORDS)), \
+        $$(if $$(filter $$(part), $$($1_SINGLE_KEYWORDS) $$($1_STRING_KEYWORDS)), \
           $$(info Keyword $$(part) for $1 needs to be assigned a value.) \
         , \
           $$(info $$(part) is not a valid keyword for $1.) \
-          $$(info Valid keywords: $$($1_KEYWORDS) $$($1_STRING_KEYWORDS).) \
+          $$(info Valid keywords: $$($1_SINGLE_KEYWORDS) $$($1_STRING_KEYWORDS).) \
         ) \
         $$(error Cannot continue) \
       ) \