< prev index next >

make/RunTests.gmk

Print this page

 182 ################################################################################
 183 # Parse control variables
 184 ################################################################################
 185 
 186 ifneq ($(TEST_OPTS), )
 187   # Inform the user
 188   $(info Running tests using TEST_OPTS control variable '$(TEST_OPTS)')
 189 endif
 190 
 191 ### Jtreg
 192 
 193 $(eval $(call SetTestOpt,VM_OPTIONS,JTREG))
 194 $(eval $(call SetTestOpt,JAVA_OPTIONS,JTREG))
 195 
 196 $(eval $(call SetTestOpt,JOBS,JTREG))
 197 $(eval $(call SetTestOpt,TIMEOUT_FACTOR,JTREG))
 198 $(eval $(call SetTestOpt,FAILURE_HANDLER_TIMEOUT,JTREG))
 199 
 200 $(eval $(call ParseKeywordVariable, JTREG, \
 201     SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR FAILURE_HANDLER_TIMEOUT \
 202         TEST_MODE ASSERT VERBOSE RETAIN MAX_MEM RUN_PROBLEM_LISTS \
 203         RETRY_COUNT MAX_OUTPUT $(CUSTOM_JTREG_SINGLE_KEYWORDS), \
 204     STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS KEYWORDS \
 205         EXTRA_PROBLEM_LISTS LAUNCHER_OPTIONS \
 206         $(CUSTOM_JTREG_STRING_KEYWORDS), \
 207 ))
 208 
 209 ifneq ($(JTREG), )
 210   # Inform the user
 211   $(info Running tests using JTREG control variable '$(JTREG)')
 212 endif
 213 
 214 ### Gtest
 215 
 216 $(eval $(call SetTestOpt,VM_OPTIONS,GTEST))
 217 $(eval $(call SetTestOpt,JAVA_OPTIONS,GTEST))
 218 
 219 $(eval $(call ParseKeywordVariable, GTEST, \
 220     SINGLE_KEYWORDS := REPEAT, \
 221     STRING_KEYWORDS := OPTIONS VM_OPTIONS JAVA_OPTIONS, \
 222 ))

 577   $1_EXITCODE := $$($1_TEST_RESULTS_DIR)/exitcode.txt
 578 
 579   $1_TEST_NAME := $$(strip $$(patsubst micro:%, %, $$($1_TEST)))
 580 
 581   $$(eval $$(call SetMicroValue,$1,MICRO_BENCHMARKS_JAR,$$(TEST_IMAGE_DIR)/micro/benchmarks.jar))
 582   $$(eval $$(call SetMicroValue,$1,MICRO_TEST_JDK,$$(JDK_UNDER_TEST)))
 583   $$(eval $$(call SetMicroValue,$1,MICRO_JAVA_OPTIONS))
 584 
 585   # Current tests needs to open java.io
 586   $1_MICRO_JAVA_OPTIONS += --add-opens=java.base/java.io=ALL-UNNAMED
 587 
 588   # Save output as JSON or CSV file
 589   ifneq ($$(MICRO_RESULTS_FORMAT), )
 590     $1_MICRO_BASIC_OPTIONS += -rf $$(MICRO_RESULTS_FORMAT)
 591     $1_MICRO_BASIC_OPTIONS += -rff $$($1_TEST_RESULTS_DIR)/jmh-result.$(MICRO_RESULTS_FORMAT)
 592   endif
 593 
 594   # Set library path for native dependencies
 595   $1_JMH_JVM_ARGS := -Djava.library.path=$$(TEST_IMAGE_DIR)/micro/native
 596 



 597   ifneq ($$(MICRO_VM_OPTIONS)$$(MICRO_JAVA_OPTIONS), )
 598     $1_JMH_JVM_ARGS += $$(MICRO_VM_OPTIONS) $$(MICRO_JAVA_OPTIONS)
 599   endif
 600 
 601   $1_MICRO_VM_OPTIONS := -jvmArgs $(call ShellQuote,$$($1_JMH_JVM_ARGS))
 602 
 603   ifneq ($$(MICRO_ITER), )
 604     $1_MICRO_ITER := -i $$(MICRO_ITER)
 605   endif
 606   ifneq ($$(MICRO_FORK), )
 607     $1_MICRO_FORK := -f $$(MICRO_FORK)
 608   endif
 609   ifneq ($$(MICRO_TIME), )
 610     $1_MICRO_TIME := -r $$(MICRO_TIME)
 611   endif
 612   ifneq ($$(MICRO_WARMUP_ITER), )
 613     $1_MICRO_WARMUP_ITER := -wi $$(MICRO_WARMUP_ITER)
 614   endif
 615   ifneq ($$(MICRO_WARMUP_TIME), )
 616     $1_MICRO_WARMUP_TIME := -w $$(MICRO_WARMUP_TIME)

 726   $$(eval $$(call SetJtregValue,$1,JTREG_BASIC_OPTIONS))
 727   $$(eval $$(call SetJtregValue,$1,JTREG_PROBLEM_LIST))
 728 
 729   # Only the problem list for the current test root should be used.
 730   $1_JTREG_PROBLEM_LIST := $$(filter $$($1_TEST_ROOT)%, $$($1_JTREG_PROBLEM_LIST))
 731 
 732   ifneq ($(TEST_JOBS), 0)
 733     $$(eval $$(call SetJtregValue,$1,JTREG_JOBS,$$(TEST_JOBS)))
 734   else
 735     $$(eval $$(call SetJtregValue,$1,JTREG_JOBS,$$(JOBS)))
 736   endif
 737 
 738   # Make sure MaxRAMPercentage is high enough to not cause OOM or swapping since
 739   # we may end up with a lot of JVM's
 740   $1_JTREG_MAX_RAM_PERCENTAGE := $$(shell $(AWK) 'BEGIN { print 25 / $$($1_JTREG_JOBS); }')
 741 
 742   JTREG_TIMEOUT_FACTOR ?= 4
 743 
 744   JTREG_VERBOSE ?= fail,error,summary
 745   JTREG_RETAIN ?= fail,error

 746   JTREG_RUN_PROBLEM_LISTS ?= false
 747   JTREG_RETRY_COUNT ?= 0
 748 





 749   ifneq ($$(JTREG_LAUNCHER_OPTIONS), )
 750     $1_JTREG_LAUNCHER_OPTIONS += $$(JTREG_LAUNCHER_OPTIONS)
 751   endif
 752 
 753   ifneq ($$(JTREG_MAX_OUTPUT), )
 754     $1_JTREG_LAUNCHER_OPTIONS += -Djavatest.maxOutputSize=$$(JTREG_MAX_OUTPUT)
 755   endif
 756 
 757   ifneq ($$($1_JTREG_MAX_MEM), 0)
 758     $1_JTREG_BASIC_OPTIONS += -vmoption:-Xmx$$($1_JTREG_MAX_MEM)
 759     $1_JTREG_LAUNCHER_OPTIONS += -Xmx$$($1_JTREG_MAX_MEM)
 760   endif
 761 
 762   # Make sure the tmp dir is normalized as some tests will react badly otherwise
 763   $1_TEST_TMP_DIR := $$(abspath $$($1_TEST_SUPPORT_DIR)/tmp)
 764 
 765   $1_JTREG_BASIC_OPTIONS += -$$($1_JTREG_TEST_MODE) \
 766       -verbose:$$(JTREG_VERBOSE) -retain:$$(JTREG_RETAIN) \
 767       -concurrency:$$($1_JTREG_JOBS) -timeoutFactor:$$(JTREG_TIMEOUT_FACTOR) \
 768       -vmoption:-XX:MaxRAMPercentage=$$($1_JTREG_MAX_RAM_PERCENTAGE) \

 182 ################################################################################
 183 # Parse control variables
 184 ################################################################################
 185 
 186 ifneq ($(TEST_OPTS), )
 187   # Inform the user
 188   $(info Running tests using TEST_OPTS control variable '$(TEST_OPTS)')
 189 endif
 190 
 191 ### Jtreg
 192 
 193 $(eval $(call SetTestOpt,VM_OPTIONS,JTREG))
 194 $(eval $(call SetTestOpt,JAVA_OPTIONS,JTREG))
 195 
 196 $(eval $(call SetTestOpt,JOBS,JTREG))
 197 $(eval $(call SetTestOpt,TIMEOUT_FACTOR,JTREG))
 198 $(eval $(call SetTestOpt,FAILURE_HANDLER_TIMEOUT,JTREG))
 199 
 200 $(eval $(call ParseKeywordVariable, JTREG, \
 201     SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR FAILURE_HANDLER_TIMEOUT \
 202         TEST_MODE ASSERT VERBOSE RETAIN MAIN_WRAPPER  MAX_MEM RUN_PROBLEM_LISTS \
 203         RETRY_COUNT MAX_OUTPUT $(CUSTOM_JTREG_SINGLE_KEYWORDS), \
 204     STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS KEYWORDS \
 205         EXTRA_PROBLEM_LISTS LAUNCHER_OPTIONS \
 206         $(CUSTOM_JTREG_STRING_KEYWORDS), \
 207 ))
 208 
 209 ifneq ($(JTREG), )
 210   # Inform the user
 211   $(info Running tests using JTREG control variable '$(JTREG)')
 212 endif
 213 
 214 ### Gtest
 215 
 216 $(eval $(call SetTestOpt,VM_OPTIONS,GTEST))
 217 $(eval $(call SetTestOpt,JAVA_OPTIONS,GTEST))
 218 
 219 $(eval $(call ParseKeywordVariable, GTEST, \
 220     SINGLE_KEYWORDS := REPEAT, \
 221     STRING_KEYWORDS := OPTIONS VM_OPTIONS JAVA_OPTIONS, \
 222 ))

 577   $1_EXITCODE := $$($1_TEST_RESULTS_DIR)/exitcode.txt
 578 
 579   $1_TEST_NAME := $$(strip $$(patsubst micro:%, %, $$($1_TEST)))
 580 
 581   $$(eval $$(call SetMicroValue,$1,MICRO_BENCHMARKS_JAR,$$(TEST_IMAGE_DIR)/micro/benchmarks.jar))
 582   $$(eval $$(call SetMicroValue,$1,MICRO_TEST_JDK,$$(JDK_UNDER_TEST)))
 583   $$(eval $$(call SetMicroValue,$1,MICRO_JAVA_OPTIONS))
 584 
 585   # Current tests needs to open java.io
 586   $1_MICRO_JAVA_OPTIONS += --add-opens=java.base/java.io=ALL-UNNAMED
 587 
 588   # Save output as JSON or CSV file
 589   ifneq ($$(MICRO_RESULTS_FORMAT), )
 590     $1_MICRO_BASIC_OPTIONS += -rf $$(MICRO_RESULTS_FORMAT)
 591     $1_MICRO_BASIC_OPTIONS += -rff $$($1_TEST_RESULTS_DIR)/jmh-result.$(MICRO_RESULTS_FORMAT)
 592   endif
 593 
 594   # Set library path for native dependencies
 595   $1_JMH_JVM_ARGS := -Djava.library.path=$$(TEST_IMAGE_DIR)/micro/native
 596 
 597   # Allow preview features in microbenchmarks
 598   $1_JMH_JVM_ARGS += --enable-preview
 599 
 600   ifneq ($$(MICRO_VM_OPTIONS)$$(MICRO_JAVA_OPTIONS), )
 601     $1_JMH_JVM_ARGS += $$(MICRO_VM_OPTIONS) $$(MICRO_JAVA_OPTIONS)
 602   endif
 603 
 604   $1_MICRO_VM_OPTIONS := -jvmArgs $(call ShellQuote,$$($1_JMH_JVM_ARGS))
 605 
 606   ifneq ($$(MICRO_ITER), )
 607     $1_MICRO_ITER := -i $$(MICRO_ITER)
 608   endif
 609   ifneq ($$(MICRO_FORK), )
 610     $1_MICRO_FORK := -f $$(MICRO_FORK)
 611   endif
 612   ifneq ($$(MICRO_TIME), )
 613     $1_MICRO_TIME := -r $$(MICRO_TIME)
 614   endif
 615   ifneq ($$(MICRO_WARMUP_ITER), )
 616     $1_MICRO_WARMUP_ITER := -wi $$(MICRO_WARMUP_ITER)
 617   endif
 618   ifneq ($$(MICRO_WARMUP_TIME), )
 619     $1_MICRO_WARMUP_TIME := -w $$(MICRO_WARMUP_TIME)

 729   $$(eval $$(call SetJtregValue,$1,JTREG_BASIC_OPTIONS))
 730   $$(eval $$(call SetJtregValue,$1,JTREG_PROBLEM_LIST))
 731 
 732   # Only the problem list for the current test root should be used.
 733   $1_JTREG_PROBLEM_LIST := $$(filter $$($1_TEST_ROOT)%, $$($1_JTREG_PROBLEM_LIST))
 734 
 735   ifneq ($(TEST_JOBS), 0)
 736     $$(eval $$(call SetJtregValue,$1,JTREG_JOBS,$$(TEST_JOBS)))
 737   else
 738     $$(eval $$(call SetJtregValue,$1,JTREG_JOBS,$$(JOBS)))
 739   endif
 740 
 741   # Make sure MaxRAMPercentage is high enough to not cause OOM or swapping since
 742   # we may end up with a lot of JVM's
 743   $1_JTREG_MAX_RAM_PERCENTAGE := $$(shell $(AWK) 'BEGIN { print 25 / $$($1_JTREG_JOBS); }')
 744 
 745   JTREG_TIMEOUT_FACTOR ?= 4
 746 
 747   JTREG_VERBOSE ?= fail,error,summary
 748   JTREG_RETAIN ?= fail,error
 749   JTREG_MAIN_WRAPPER ?=
 750   JTREG_RUN_PROBLEM_LISTS ?= false
 751   JTREG_RETRY_COUNT ?= 0
 752 
 753   ifneq ($$(JTREG_MAIN_WRAPPER), )
 754     JT_HOME = $$(JT_HOME_MW)
 755     $1_JTREG_BASIC_OPTIONS += -mainWrapper:$$(JTREG_MAIN_WRAPPER)
 756   endif
 757 
 758   ifneq ($$(JTREG_LAUNCHER_OPTIONS), )
 759     $1_JTREG_LAUNCHER_OPTIONS += $$(JTREG_LAUNCHER_OPTIONS)
 760   endif
 761 
 762   ifneq ($$(JTREG_MAX_OUTPUT), )
 763     $1_JTREG_LAUNCHER_OPTIONS += -Djavatest.maxOutputSize=$$(JTREG_MAX_OUTPUT)
 764   endif
 765 
 766   ifneq ($$($1_JTREG_MAX_MEM), 0)
 767     $1_JTREG_BASIC_OPTIONS += -vmoption:-Xmx$$($1_JTREG_MAX_MEM)
 768     $1_JTREG_LAUNCHER_OPTIONS += -Xmx$$($1_JTREG_MAX_MEM)
 769   endif
 770 
 771   # Make sure the tmp dir is normalized as some tests will react badly otherwise
 772   $1_TEST_TMP_DIR := $$(abspath $$($1_TEST_SUPPORT_DIR)/tmp)
 773 
 774   $1_JTREG_BASIC_OPTIONS += -$$($1_JTREG_TEST_MODE) \
 775       -verbose:$$(JTREG_VERBOSE) -retain:$$(JTREG_RETAIN) \
 776       -concurrency:$$($1_JTREG_JOBS) -timeoutFactor:$$(JTREG_TIMEOUT_FACTOR) \
 777       -vmoption:-XX:MaxRAMPercentage=$$($1_JTREG_MAX_RAM_PERCENTAGE) \
< prev index next >