< prev index next >

make/RunTests.gmk

Print this page

  76 $(eval $(call IncludeCustomExtension, RunTests.gmk))
  77 ################################################################################
  78 
  79 # This is the JDK that we will test
  80 JDK_UNDER_TEST := $(JDK_IMAGE_DIR)
  81 
  82 TEST_RESULTS_DIR := $(OUTPUTDIR)/test-results
  83 TEST_SUPPORT_DIR := $(OUTPUTDIR)/test-support
  84 TEST_SUMMARY := $(TEST_RESULTS_DIR)/test-summary.txt
  85 TEST_LAST_IDS := $(TEST_SUPPORT_DIR)/test-last-ids.txt
  86 
  87 ifeq ($(CUSTOM_ROOT), )
  88   JTREG_TOPDIR := $(TOPDIR)
  89 else
  90   JTREG_TOPDIR := $(CUSTOM_ROOT)
  91 endif
  92 
  93 JTREG_FAILURE_HANDLER_DIR := $(TEST_IMAGE_DIR)/failure_handler
  94 JTREG_FAILURE_HANDLER := $(JTREG_FAILURE_HANDLER_DIR)/jtregFailureHandler.jar
  95 



  96 JTREG_FAILURE_HANDLER_TIMEOUT ?= 0
  97 
  98 ifneq ($(wildcard $(JTREG_FAILURE_HANDLER)), )
  99   JTREG_FAILURE_HANDLER_OPTIONS := \
 100       -timeoutHandlerDir:$(JTREG_FAILURE_HANDLER) \
 101       -observerDir:$(JTREG_FAILURE_HANDLER) \
 102       -timeoutHandler:jdk.test.failurehandler.jtreg.GatherProcessInfoTimeoutHandler \
 103       -observer:jdk.test.failurehandler.jtreg.GatherDiagnosticInfoObserver \
 104       -timeoutHandlerTimeout:$(JTREG_FAILURE_HANDLER_TIMEOUT)
 105 endif
 106 
 107 GTEST_LAUNCHER_DIRS := $(patsubst %/gtestLauncher, %, \
 108     $(wildcard $(TEST_IMAGE_DIR)/hotspot/gtest/*/gtestLauncher))
 109 GTEST_VARIANTS := $(strip $(patsubst $(TEST_IMAGE_DIR)/hotspot/gtest/%, %, \
 110     $(GTEST_LAUNCHER_DIRS)))
 111 
 112 COV_ENVIRONMENT :=
 113 JTREG_COV_OPTIONS :=
 114 
 115 ifeq ($(TEST_OPTS_JCOV), true)

 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 REPEAT_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 ))

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



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

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

 745   JTREG_RUN_PROBLEM_LISTS ?= false
 746   JTREG_RETRY_COUNT ?= 0
 747   JTREG_REPEAT_COUNT ?= 0
 748 
 749   ifneq ($$(JTREG_RETRY_COUNT), 0)
 750     ifneq ($$(JTREG_REPEAT_COUNT), 0)
 751       $$(info Error: Cannot use both JTREG_RETRY_COUNT and JTREG_REPEAT_COUNT together.)
 752       $$(info Please choose one or the other.)
 753       $$(error Cannot continue)
 754     endif
 755   endif
 756 






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

  76 $(eval $(call IncludeCustomExtension, RunTests.gmk))
  77 ################################################################################
  78 
  79 # This is the JDK that we will test
  80 JDK_UNDER_TEST := $(JDK_IMAGE_DIR)
  81 
  82 TEST_RESULTS_DIR := $(OUTPUTDIR)/test-results
  83 TEST_SUPPORT_DIR := $(OUTPUTDIR)/test-support
  84 TEST_SUMMARY := $(TEST_RESULTS_DIR)/test-summary.txt
  85 TEST_LAST_IDS := $(TEST_SUPPORT_DIR)/test-last-ids.txt
  86 
  87 ifeq ($(CUSTOM_ROOT), )
  88   JTREG_TOPDIR := $(TOPDIR)
  89 else
  90   JTREG_TOPDIR := $(CUSTOM_ROOT)
  91 endif
  92 
  93 JTREG_FAILURE_HANDLER_DIR := $(TEST_IMAGE_DIR)/failure_handler
  94 JTREG_FAILURE_HANDLER := $(JTREG_FAILURE_HANDLER_DIR)/jtregFailureHandler.jar
  95 
  96 JTREG_MAIN_WRAPPER_DIR := $(TEST_IMAGE_DIR)/jtreg_main_wrapper
  97 JTREG_MAIN_WRAPPER_JAR := $(JTREG_MAIN_WRAPPER_DIR)/jtregMainWrapper.jar
  98 
  99 JTREG_FAILURE_HANDLER_TIMEOUT ?= 0
 100 
 101 ifneq ($(wildcard $(JTREG_FAILURE_HANDLER)), )
 102   JTREG_FAILURE_HANDLER_OPTIONS := \
 103       -timeoutHandlerDir:$(JTREG_FAILURE_HANDLER) \
 104       -observerDir:$(JTREG_FAILURE_HANDLER) \
 105       -timeoutHandler:jdk.test.failurehandler.jtreg.GatherProcessInfoTimeoutHandler \
 106       -observer:jdk.test.failurehandler.jtreg.GatherDiagnosticInfoObserver \
 107       -timeoutHandlerTimeout:$(JTREG_FAILURE_HANDLER_TIMEOUT)
 108 endif
 109 
 110 GTEST_LAUNCHER_DIRS := $(patsubst %/gtestLauncher, %, \
 111     $(wildcard $(TEST_IMAGE_DIR)/hotspot/gtest/*/gtestLauncher))
 112 GTEST_VARIANTS := $(strip $(patsubst $(TEST_IMAGE_DIR)/hotspot/gtest/%, %, \
 113     $(GTEST_LAUNCHER_DIRS)))
 114 
 115 COV_ENVIRONMENT :=
 116 JTREG_COV_OPTIONS :=
 117 
 118 ifeq ($(TEST_OPTS_JCOV), true)

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

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

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