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)
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 $(eval $(call SetTestOpt,REPORT,JTREG))
200
201 $(eval $(call ParseKeywordVariable, JTREG, \
202 SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR FAILURE_HANDLER_TIMEOUT \
203 TEST_MODE ASSERT VERBOSE RETAIN MAX_MEM RUN_PROBLEM_LISTS \
204 RETRY_COUNT REPEAT_COUNT MAX_OUTPUT REPORT $(CUSTOM_JTREG_SINGLE_KEYWORDS), \
205 STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS KEYWORDS \
206 EXTRA_PROBLEM_LISTS LAUNCHER_OPTIONS \
207 $(CUSTOM_JTREG_STRING_KEYWORDS), \
208 ))
209
210 ifneq ($(JTREG), )
211 # Inform the user
212 $(info Running tests using JTREG control variable '$(JTREG)')
213 endif
214
215 ### Gtest
216
217 $(eval $(call SetTestOpt,VM_OPTIONS,GTEST))
218 $(eval $(call SetTestOpt,JAVA_OPTIONS,GTEST))
219
220 $(eval $(call ParseKeywordVariable, GTEST, \
221 SINGLE_KEYWORDS := REPEAT, \
222 STRING_KEYWORDS := OPTIONS VM_OPTIONS JAVA_OPTIONS, \
223 ))
735 $$(eval $$(call SetJtregValue,$1,JTREG_BASIC_OPTIONS))
736 $$(eval $$(call SetJtregValue,$1,JTREG_PROBLEM_LIST))
737
738 # Only the problem list for the current test root should be used.
739 $1_JTREG_PROBLEM_LIST := $$(filter $$($1_TEST_ROOT)%, $$($1_JTREG_PROBLEM_LIST))
740
741 ifneq ($(TEST_JOBS), 0)
742 $$(eval $$(call SetJtregValue,$1,JTREG_JOBS,$$(TEST_JOBS)))
743 else
744 $$(eval $$(call SetJtregValue,$1,JTREG_JOBS,$$(JOBS)))
745 endif
746
747 # Make sure MaxRAMPercentage is high enough to not cause OOM or swapping since
748 # we may end up with a lot of JVM's
749 $1_JTREG_MAX_RAM_PERCENTAGE := $$(shell $(AWK) 'BEGIN { print 25 / $$($1_JTREG_JOBS); }')
750
751 JTREG_TIMEOUT_FACTOR ?= 4
752
753 JTREG_VERBOSE ?= fail,error,summary
754 JTREG_RETAIN ?= fail,error
755 JTREG_RUN_PROBLEM_LISTS ?= false
756 JTREG_RETRY_COUNT ?= 0
757 JTREG_REPEAT_COUNT ?= 0
758 JTREG_REPORT ?= files
759
760 ifneq ($$(JTREG_RETRY_COUNT), 0)
761 ifneq ($$(JTREG_REPEAT_COUNT), 0)
762 $$(info Error: Cannot use both JTREG_RETRY_COUNT and JTREG_REPEAT_COUNT together.)
763 $$(info Please choose one or the other.)
764 $$(error Cannot continue)
765 endif
766 endif
767
768 ifneq ($$(JTREG_LAUNCHER_OPTIONS), )
769 $1_JTREG_LAUNCHER_OPTIONS += $$(JTREG_LAUNCHER_OPTIONS)
770 endif
771
772 ifneq ($$(JTREG_MAX_OUTPUT), )
773 $1_JTREG_LAUNCHER_OPTIONS += -Djavatest.maxOutputSize=$$(JTREG_MAX_OUTPUT)
774 endif
775
776 ifneq ($$($1_JTREG_MAX_MEM), 0)
777 $1_JTREG_BASIC_OPTIONS += -vmoption:-Xmx$$($1_JTREG_MAX_MEM)
778 $1_JTREG_LAUNCHER_OPTIONS += -Xmx$$($1_JTREG_MAX_MEM)
779 endif
780
781 # Make sure the tmp dir is normalized as some tests will react badly otherwise
782 $1_TEST_TMP_DIR := $$(abspath $$($1_TEST_SUPPORT_DIR)/tmp)
783
784 # test.boot.jdk is used by some test cases that want to execute a previous
785 # version of the JDK.
786 $1_JTREG_BASIC_OPTIONS += -$$($1_JTREG_TEST_MODE) \
787 -verbose:$$(JTREG_VERBOSE) -retain:$$(JTREG_RETAIN) \
|
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_TEST_THREAD_FACTORY_DIR := $(TEST_IMAGE_DIR)/jtreg_test_thread_factory
97 JTREG_TEST_THREAD_FACTORY_JAR := $(JTREG_TEST_THREAD_FACTORY_DIR)/jtregTestThreadFactory.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)
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 $(eval $(call SetTestOpt,REPORT,JTREG))
203
204 $(eval $(call ParseKeywordVariable, JTREG, \
205 SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR FAILURE_HANDLER_TIMEOUT \
206 TEST_MODE ASSERT VERBOSE RETAIN TEST_THREAD_FACTORY MAX_MEM RUN_PROBLEM_LISTS \
207 RETRY_COUNT REPEAT_COUNT MAX_OUTPUT REPORT $(CUSTOM_JTREG_SINGLE_KEYWORDS), \
208 STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS KEYWORDS \
209 EXTRA_PROBLEM_LISTS LAUNCHER_OPTIONS \
210 $(CUSTOM_JTREG_STRING_KEYWORDS), \
211 ))
212
213 ifneq ($(JTREG), )
214 # Inform the user
215 $(info Running tests using JTREG control variable '$(JTREG)')
216 endif
217
218 ### Gtest
219
220 $(eval $(call SetTestOpt,VM_OPTIONS,GTEST))
221 $(eval $(call SetTestOpt,JAVA_OPTIONS,GTEST))
222
223 $(eval $(call ParseKeywordVariable, GTEST, \
224 SINGLE_KEYWORDS := REPEAT, \
225 STRING_KEYWORDS := OPTIONS VM_OPTIONS JAVA_OPTIONS, \
226 ))
738 $$(eval $$(call SetJtregValue,$1,JTREG_BASIC_OPTIONS))
739 $$(eval $$(call SetJtregValue,$1,JTREG_PROBLEM_LIST))
740
741 # Only the problem list for the current test root should be used.
742 $1_JTREG_PROBLEM_LIST := $$(filter $$($1_TEST_ROOT)%, $$($1_JTREG_PROBLEM_LIST))
743
744 ifneq ($(TEST_JOBS), 0)
745 $$(eval $$(call SetJtregValue,$1,JTREG_JOBS,$$(TEST_JOBS)))
746 else
747 $$(eval $$(call SetJtregValue,$1,JTREG_JOBS,$$(JOBS)))
748 endif
749
750 # Make sure MaxRAMPercentage is high enough to not cause OOM or swapping since
751 # we may end up with a lot of JVM's
752 $1_JTREG_MAX_RAM_PERCENTAGE := $$(shell $(AWK) 'BEGIN { print 25 / $$($1_JTREG_JOBS); }')
753
754 JTREG_TIMEOUT_FACTOR ?= 4
755
756 JTREG_VERBOSE ?= fail,error,summary
757 JTREG_RETAIN ?= fail,error
758 JTREG_TEST_THREAD_FACTORY ?=
759 JTREG_RUN_PROBLEM_LISTS ?= false
760 JTREG_RETRY_COUNT ?= 0
761 JTREG_REPEAT_COUNT ?= 0
762 JTREG_REPORT ?= files
763
764 ifneq ($$(JTREG_RETRY_COUNT), 0)
765 ifneq ($$(JTREG_REPEAT_COUNT), 0)
766 $$(info Error: Cannot use both JTREG_RETRY_COUNT and JTREG_REPEAT_COUNT together.)
767 $$(info Please choose one or the other.)
768 $$(error Cannot continue)
769 endif
770 endif
771
772 ifneq ($$(JTREG_TEST_THREAD_FACTORY), )
773 $1_JTREG_BASIC_OPTIONS += -testThreadFactoryPath:$$(JTREG_TEST_THREAD_FACTORY_JAR)
774 $1_JTREG_BASIC_OPTIONS += -testThreadFactory:$$(JTREG_TEST_THREAD_FACTORY)
775 $1_JTREG_BASIC_OPTIONS += -exclude:$$(addprefix $$($1_TEST_ROOT)/, ProblemList-$$(JTREG_TEST_THREAD_FACTORY).txt)
776 endif
777
778 ifneq ($$(JTREG_LAUNCHER_OPTIONS), )
779 $1_JTREG_LAUNCHER_OPTIONS += $$(JTREG_LAUNCHER_OPTIONS)
780 endif
781
782 ifneq ($$(JTREG_MAX_OUTPUT), )
783 $1_JTREG_LAUNCHER_OPTIONS += -Djavatest.maxOutputSize=$$(JTREG_MAX_OUTPUT)
784 endif
785
786 ifneq ($$($1_JTREG_MAX_MEM), 0)
787 $1_JTREG_BASIC_OPTIONS += -vmoption:-Xmx$$($1_JTREG_MAX_MEM)
788 $1_JTREG_LAUNCHER_OPTIONS += -Xmx$$($1_JTREG_MAX_MEM)
789 endif
790
791 # Make sure the tmp dir is normalized as some tests will react badly otherwise
792 $1_TEST_TMP_DIR := $$(abspath $$($1_TEST_SUPPORT_DIR)/tmp)
793
794 # test.boot.jdk is used by some test cases that want to execute a previous
795 # version of the JDK.
796 $1_JTREG_BASIC_OPTIONS += -$$($1_JTREG_TEST_MODE) \
797 -verbose:$$(JTREG_VERBOSE) -retain:$$(JTREG_RETAIN) \
|