< prev index next >

make/RunTests.gmk

Print this page




  44   endif
  45 endif
  46 
  47 $(eval $(call ParseKeywordVariable, TEST_OPTS, \
  48     SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR JCOV, \
  49     STRING_KEYWORDS := VM_OPTIONS JAVA_OPTIONS AOT_MODULES, \
  50 ))
  51 
  52 # Helper function to propagate TEST_OPTS values.
  53 #
  54 # Note: No spaces are allowed around the arguments.
  55 # Arg $1 The variable in TEST_OPTS to propagate
  56 # Arg $2 The control variable to propagate it to
  57 define SetTestOpt
  58   ifneq ($$(TEST_OPTS_$1), )
  59     $2_$1 := $$(TEST_OPTS_$1)
  60   endif
  61 endef
  62 
  63 # Setup _NT_SYMBOL_PATH on Windows
  64 ifeq ($(OPENJDK_TARGET_OS), windows)
  65   ifndef _NT_SYMBOL_PATH
  66     # Can't use PathList here as it adds quotes around the value.
  67     _NT_SYMBOL_PATH := \
  68         $(subst $(SPACE),;,$(strip \
  69             $(foreach p, $(sort $(dir $(wildcard \
  70                 $(addprefix $(SYMBOLS_IMAGE_DIR)/bin/, *.pdb */*.pdb)))), \
  71               $(call FixPath, $p) \
  72             ) \
  73         ))
  74     export _NT_SYMBOL_PATH
  75     $(call LogDebug, Rewriting _NT_SYMBOL_PATH to $(_NT_SYMBOL_PATH))
  76   endif
  77 endif
  78 
  79 ################################################################################
  80 # Hook to include the corresponding custom file, if present.
  81 $(eval $(call IncludeCustomExtension, RunTests.gmk))
  82 ################################################################################
  83 
  84 # This is the JDK that we will test


 207         VM_OPTIONS := $$($1_VM_OPTIONS), \
 208     )) \
 209     $$(eval $1_AOT_OPTIONS += $$($1_$$m_AOT_OPTIONS)) \
 210     $$(eval $1_AOT_TARGETS += $$($1_$$m_AOT_TARGETS)) \
 211   )
 212 endef
 213 
 214 ################################################################################
 215 # Setup global test running parameters
 216 ################################################################################
 217 
 218 # Each factor variable comes in 3 variants. The first one is reserved for users
 219 # to use on command line. The other two are for predifined configurations in JDL
 220 # and for machine specific configurations respectively.
 221 TEST_JOBS_FACTOR ?= 1
 222 TEST_JOBS_FACTOR_JDL ?= 1
 223 TEST_JOBS_FACTOR_MACHINE ?= 1
 224 
 225 ifeq ($(TEST_JOBS), 0)
 226   CORES_DIVIDER := 2
 227   ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
 228     # For smaller SPARC machines we see reasonable scaling of throughput up to
 229     # cpus/4 without affecting test reliability. On the bigger machines, cpus/4
 230     # causes intermittent timeouts.
 231     ifeq ($(shell $(EXPR) $(NUM_CORES) \> 16), 1)
 232       CORES_DIVIDER := 5
 233     else
 234       CORES_DIVIDER := 4
 235     endif
 236   endif
 237   MEMORY_DIVIDER := 2048
 238   TEST_JOBS := $(shell $(AWK) \
 239     'BEGIN { \
 240       c = $(NUM_CORES) / $(CORES_DIVIDER); \
 241       m = $(MEMORY_SIZE) / $(MEMORY_DIVIDER); \
 242       if (c > m) c = m; \
 243       c = c * $(TEST_JOBS_FACTOR); \
 244       c = c * $(TEST_JOBS_FACTOR_JDL); \
 245       c = c * $(TEST_JOBS_FACTOR_MACHINE); \
 246       if (c < 1) c = 1; \
 247       printf "%.0f", c; \


 791   $$(eval $$(call SetJtregValue,$1,JTREG_ASSERT,true))
 792   $$(eval $$(call SetJtregValue,$1,JTREG_MAX_MEM,512m))
 793   $$(eval $$(call SetJtregValue,$1,JTREG_NATIVEPATH))
 794   $$(eval $$(call SetJtregValue,$1,JTREG_BASIC_OPTIONS))
 795   $$(eval $$(call SetJtregValue,$1,JTREG_PROBLEM_LIST))
 796 
 797   # Only the problem list for the current test root should be used.
 798   $1_JTREG_PROBLEM_LIST := $$(filter $$($1_TEST_ROOT)%, $$($1_JTREG_PROBLEM_LIST))
 799 
 800   ifneq ($(TEST_JOBS), 0)
 801     $$(eval $$(call SetJtregValue,$1,JTREG_JOBS,$$(TEST_JOBS)))
 802   else
 803     $$(eval $$(call SetJtregValue,$1,JTREG_JOBS,$$(JOBS)))
 804   endif
 805 
 806   # Make sure MaxRAMPercentage is high enough to not cause OOM or swapping since
 807   # we may end up with a lot of JVM's
 808   $1_JTREG_MAX_RAM_PERCENTAGE := $$(shell $$(EXPR) 25 / $$($1_JTREG_JOBS))
 809 
 810   # SPARC is in general slower per core so need to scale up timeouts a bit.
 811   ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
 812     JTREG_TIMEOUT_FACTOR ?= 8
 813   else
 814     JTREG_TIMEOUT_FACTOR ?= 4
 815   endif
 816   JTREG_VERBOSE ?= fail,error,summary
 817   JTREG_RETAIN ?= fail,error
 818 
 819   ifneq ($$($1_JTREG_MAX_MEM), 0)
 820     $1_JTREG_BASIC_OPTIONS += -vmoption:-Xmx$$($1_JTREG_MAX_MEM)
 821     $1_JTREG_LAUNCHER_OPTIONS += -Xmx$$($1_JTREG_MAX_MEM)
 822   endif
 823 
 824   $1_JTREG_BASIC_OPTIONS += -$$($1_JTREG_TEST_MODE) \
 825       -verbose:$$(JTREG_VERBOSE) -retain:$$(JTREG_RETAIN) \
 826       -concurrency:$$($1_JTREG_JOBS) -timeoutFactor:$$(JTREG_TIMEOUT_FACTOR) \
 827       -vmoption:-XX:MaxRAMPercentage=$$($1_JTREG_MAX_RAM_PERCENTAGE)
 828 
 829   $1_JTREG_BASIC_OPTIONS += -automatic -ignore:quiet
 830 
 831   # Make it possible to specify the JIB_DATA_DIR for tests using the
 832   # JIB Artifact resolver
 833   $1_JTREG_BASIC_OPTIONS += -e:JIB_DATA_DIR
 834   # Some tests needs to find a boot JDK using the JDK8_HOME variable.
 835   $1_JTREG_BASIC_OPTIONS += -e:JDK8_HOME=$$(BOOT_JDK)
 836   # If running on Windows, propagate the _NT_SYMBOL_PATH to enable
 837   # symbol lookup in hserr files
 838   ifeq ($$(OPENJDK_TARGET_OS), windows)
 839     $1_JTREG_BASIC_OPTIONS += -e:_NT_SYMBOL_PATH
 840   endif
 841 
 842   $1_JTREG_BASIC_OPTIONS += \
 843       $$(addprefix -javaoption:, $$(JTREG_JAVA_OPTIONS)) \
 844       $$(addprefix -vmoption:, $$(JTREG_VM_OPTIONS)) \
 845       #
 846 
 847   ifeq ($$($1_JTREG_ASSERT), true)
 848     $1_JTREG_BASIC_OPTIONS += -ea -esa
 849   endif
 850 
 851   ifneq ($$($1_JTREG_NATIVEPATH), )
 852     $1_JTREG_BASIC_OPTIONS += -nativepath:$$($1_JTREG_NATIVEPATH)
 853   endif
 854 
 855   ifneq ($$($1_JTREG_PROBLEM_LIST), )
 856     $1_JTREG_BASIC_OPTIONS += $$(addprefix -exclude:, $$($1_JTREG_PROBLEM_LIST))
 857   endif
 858 




  44   endif
  45 endif
  46 
  47 $(eval $(call ParseKeywordVariable, TEST_OPTS, \
  48     SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR JCOV, \
  49     STRING_KEYWORDS := VM_OPTIONS JAVA_OPTIONS AOT_MODULES, \
  50 ))
  51 
  52 # Helper function to propagate TEST_OPTS values.
  53 #
  54 # Note: No spaces are allowed around the arguments.
  55 # Arg $1 The variable in TEST_OPTS to propagate
  56 # Arg $2 The control variable to propagate it to
  57 define SetTestOpt
  58   ifneq ($$(TEST_OPTS_$1), )
  59     $2_$1 := $$(TEST_OPTS_$1)
  60   endif
  61 endef
  62 
  63 # Setup _NT_SYMBOL_PATH on Windows
  64 ifeq ($(call isTargetOs, windows), true)
  65   ifndef _NT_SYMBOL_PATH
  66     # Can't use PathList here as it adds quotes around the value.
  67     _NT_SYMBOL_PATH := \
  68         $(subst $(SPACE),;,$(strip \
  69             $(foreach p, $(sort $(dir $(wildcard \
  70                 $(addprefix $(SYMBOLS_IMAGE_DIR)/bin/, *.pdb */*.pdb)))), \
  71               $(call FixPath, $p) \
  72             ) \
  73         ))
  74     export _NT_SYMBOL_PATH
  75     $(call LogDebug, Rewriting _NT_SYMBOL_PATH to $(_NT_SYMBOL_PATH))
  76   endif
  77 endif
  78 
  79 ################################################################################
  80 # Hook to include the corresponding custom file, if present.
  81 $(eval $(call IncludeCustomExtension, RunTests.gmk))
  82 ################################################################################
  83 
  84 # This is the JDK that we will test


 207         VM_OPTIONS := $$($1_VM_OPTIONS), \
 208     )) \
 209     $$(eval $1_AOT_OPTIONS += $$($1_$$m_AOT_OPTIONS)) \
 210     $$(eval $1_AOT_TARGETS += $$($1_$$m_AOT_TARGETS)) \
 211   )
 212 endef
 213 
 214 ################################################################################
 215 # Setup global test running parameters
 216 ################################################################################
 217 
 218 # Each factor variable comes in 3 variants. The first one is reserved for users
 219 # to use on command line. The other two are for predifined configurations in JDL
 220 # and for machine specific configurations respectively.
 221 TEST_JOBS_FACTOR ?= 1
 222 TEST_JOBS_FACTOR_JDL ?= 1
 223 TEST_JOBS_FACTOR_MACHINE ?= 1
 224 
 225 ifeq ($(TEST_JOBS), 0)
 226   CORES_DIVIDER := 2
 227   ifeq ($(call isTargetCpuArch, sparc), true)
 228     # For smaller SPARC machines we see reasonable scaling of throughput up to
 229     # cpus/4 without affecting test reliability. On the bigger machines, cpus/4
 230     # causes intermittent timeouts.
 231     ifeq ($(shell $(EXPR) $(NUM_CORES) \> 16), 1)
 232       CORES_DIVIDER := 5
 233     else
 234       CORES_DIVIDER := 4
 235     endif
 236   endif
 237   MEMORY_DIVIDER := 2048
 238   TEST_JOBS := $(shell $(AWK) \
 239     'BEGIN { \
 240       c = $(NUM_CORES) / $(CORES_DIVIDER); \
 241       m = $(MEMORY_SIZE) / $(MEMORY_DIVIDER); \
 242       if (c > m) c = m; \
 243       c = c * $(TEST_JOBS_FACTOR); \
 244       c = c * $(TEST_JOBS_FACTOR_JDL); \
 245       c = c * $(TEST_JOBS_FACTOR_MACHINE); \
 246       if (c < 1) c = 1; \
 247       printf "%.0f", c; \


 791   $$(eval $$(call SetJtregValue,$1,JTREG_ASSERT,true))
 792   $$(eval $$(call SetJtregValue,$1,JTREG_MAX_MEM,512m))
 793   $$(eval $$(call SetJtregValue,$1,JTREG_NATIVEPATH))
 794   $$(eval $$(call SetJtregValue,$1,JTREG_BASIC_OPTIONS))
 795   $$(eval $$(call SetJtregValue,$1,JTREG_PROBLEM_LIST))
 796 
 797   # Only the problem list for the current test root should be used.
 798   $1_JTREG_PROBLEM_LIST := $$(filter $$($1_TEST_ROOT)%, $$($1_JTREG_PROBLEM_LIST))
 799 
 800   ifneq ($(TEST_JOBS), 0)
 801     $$(eval $$(call SetJtregValue,$1,JTREG_JOBS,$$(TEST_JOBS)))
 802   else
 803     $$(eval $$(call SetJtregValue,$1,JTREG_JOBS,$$(JOBS)))
 804   endif
 805 
 806   # Make sure MaxRAMPercentage is high enough to not cause OOM or swapping since
 807   # we may end up with a lot of JVM's
 808   $1_JTREG_MAX_RAM_PERCENTAGE := $$(shell $$(EXPR) 25 / $$($1_JTREG_JOBS))
 809 
 810   # SPARC is in general slower per core so need to scale up timeouts a bit.
 811   ifeq ($(call isTargetCpuArch, sparc), true)
 812     JTREG_TIMEOUT_FACTOR ?= 8
 813   else
 814     JTREG_TIMEOUT_FACTOR ?= 4
 815   endif
 816   JTREG_VERBOSE ?= fail,error,summary
 817   JTREG_RETAIN ?= fail,error
 818 
 819   ifneq ($$($1_JTREG_MAX_MEM), 0)
 820     $1_JTREG_BASIC_OPTIONS += -vmoption:-Xmx$$($1_JTREG_MAX_MEM)
 821     $1_JTREG_LAUNCHER_OPTIONS += -Xmx$$($1_JTREG_MAX_MEM)
 822   endif
 823 
 824   $1_JTREG_BASIC_OPTIONS += -$$($1_JTREG_TEST_MODE) \
 825       -verbose:$$(JTREG_VERBOSE) -retain:$$(JTREG_RETAIN) \
 826       -concurrency:$$($1_JTREG_JOBS) -timeoutFactor:$$(JTREG_TIMEOUT_FACTOR) \
 827       -vmoption:-XX:MaxRAMPercentage=$$($1_JTREG_MAX_RAM_PERCENTAGE)
 828 
 829   $1_JTREG_BASIC_OPTIONS += -automatic -ignore:quiet
 830 
 831   # Make it possible to specify the JIB_DATA_DIR for tests using the
 832   # JIB Artifact resolver
 833   $1_JTREG_BASIC_OPTIONS += -e:JIB_DATA_DIR
 834   # Some tests needs to find a boot JDK using the JDK8_HOME variable.
 835   $1_JTREG_BASIC_OPTIONS += -e:JDK8_HOME=$$(BOOT_JDK)
 836   # If running on Windows, propagate the _NT_SYMBOL_PATH to enable
 837   # symbol lookup in hserr files
 838   ifeq ($$(call isTargetOs, windows), true)
 839     $1_JTREG_BASIC_OPTIONS += -e:_NT_SYMBOL_PATH
 840   endif
 841 
 842   $1_JTREG_BASIC_OPTIONS += \
 843       $$(addprefix -javaoption:, $$(JTREG_JAVA_OPTIONS)) \
 844       $$(addprefix -vmoption:, $$(JTREG_VM_OPTIONS)) \
 845       #
 846 
 847   ifeq ($$($1_JTREG_ASSERT), true)
 848     $1_JTREG_BASIC_OPTIONS += -ea -esa
 849   endif
 850 
 851   ifneq ($$($1_JTREG_NATIVEPATH), )
 852     $1_JTREG_BASIC_OPTIONS += -nativepath:$$($1_JTREG_NATIVEPATH)
 853   endif
 854 
 855   ifneq ($$($1_JTREG_PROBLEM_LIST), )
 856     $1_JTREG_BASIC_OPTIONS += $$(addprefix -exclude:, $$($1_JTREG_PROBLEM_LIST))
 857   endif
 858 


< prev index next >