Skip to content

Commit 3cc03bc

Browse files
committed
Merge ac999a4 into 5961cb4
2 parents 5961cb4 + ac999a4 commit 3cc03bc

File tree

351 files changed

+12770
-2667
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

351 files changed

+12770
-2667
lines changed

closed/openjdk-tag.gmk

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
OPENJDK_TAG := jdk-11.0.5+10
1+
OPENJDK_TAG := jdk-11.0.6+2

make/Help.gmk

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ print-configurations:
119119
run-test-prebuilt:
120120
@( cd $(topdir) && \
121121
$(MAKE) --no-print-directory -r -R -I make/common/ -f make/RunTestsPrebuilt.gmk \
122-
run-test-prebuilt TEST="$(TEST)" )
122+
run-test-prebuilt CUSTOM_MAKE_DIR=$(CUSTOM_MAKE_DIR) TEST="$(TEST)" )
123123

124124
ALL_GLOBAL_TARGETS := help print-configurations run-test-prebuilt
125125

make/Main.gmk

+1
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,7 @@ else
637637
# Declare dependencies between hotspot-<variant>* targets
638638
$(foreach v, $(JVM_VARIANTS), \
639639
$(eval hotspot-$v: hotspot-$v-gensrc hotspot-$v-libs) \
640+
$(eval hotspot-$v-gensrc: java.base-copy) \
640641
$(eval hotspot-$v-libs: hotspot-$v-gensrc java.base-copy) \
641642
)
642643

make/RunTests.gmk

+83-29
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ ifneq ($(TEST_VM_OPTS), )
8282
endif
8383

8484
$(eval $(call ParseKeywordVariable, TEST_OPTS, \
85-
KEYWORDS := JOBS TIMEOUT, \
86-
STRING_KEYWORDS := VM_OPTIONS, \
85+
SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR, \
86+
STRING_KEYWORDS := VM_OPTIONS JAVA_OPTIONS, \
8787
))
8888

8989
# Helper function to propagate TEST_OPTS values.
@@ -102,10 +102,14 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
102102
ifndef _NT_SYMBOL_PATH
103103
# Can't use PathList here as it adds quotes around the value.
104104
_NT_SYMBOL_PATH := \
105-
$(subst $(SPACE),;, $(foreach p, $(sort $(dir $(wildcard \
106-
$(addprefix $(SYMBOLS_IMAGE_DIR)/bin/, *.pdb */*.pdb)))), $(call FixPath, $p)))
105+
$(subst $(SPACE),;,$(strip \
106+
$(foreach p, $(sort $(dir $(wildcard \
107+
$(addprefix $(SYMBOLS_IMAGE_DIR)/bin/, *.pdb */*.pdb)))), \
108+
$(call FixPath, $p) \
109+
) \
110+
))
107111
export _NT_SYMBOL_PATH
108-
$(info _NT_SYMBOL_PATH $(_NT_SYMBOL_PATH))
112+
$(info _NT_SYMBOL_PATH=$(_NT_SYMBOL_PATH))
109113
endif
110114
endif
111115

@@ -140,23 +144,51 @@ endif
140144
GTEST_LAUNCHER_DIRS := $(patsubst %/gtestLauncher, %, $(wildcard $(TEST_IMAGE_DIR)/hotspot/gtest/*/gtestLauncher))
141145
GTEST_VARIANTS := $(strip $(patsubst $(TEST_IMAGE_DIR)/hotspot/gtest/%, %, $(GTEST_LAUNCHER_DIRS)))
142146

147+
################################################################################
148+
# Setup global test running parameters
149+
################################################################################
150+
151+
# Each factor variable comes in 3 variants. The first one is reserved for users
152+
# to use on command line. The other two are for predifined configurations in JDL
153+
# and for machine specific configurations respectively.
154+
TEST_JOBS_FACTOR ?= 1
155+
TEST_JOBS_FACTOR_JDL ?= 1
156+
TEST_JOBS_FACTOR_MACHINE ?= 1
157+
158+
ifeq ($(TEST_JOBS), 0)
159+
# Concurrency based on min(cores / 2, 12) * TEST_JOBS_FACTOR
160+
TEST_JOBS := $(shell $(AWK) \
161+
'BEGIN { \
162+
c = $(NUM_CORES) / 2; \
163+
if (c > 12) c = 12; \
164+
c = c * $(TEST_JOBS_FACTOR); \
165+
c = c * $(TEST_JOBS_FACTOR_JDL); \
166+
c = c * $(TEST_JOBS_FACTOR_MACHINE); \
167+
if (c < 1) c = 1; \
168+
printf "%.0f", c; \
169+
}')
170+
endif
171+
143172
################################################################################
144173
# Parse control variables
145174
################################################################################
146175

147176
ifneq ($(TEST_OPTS), )
148177
# Inform the user
149178
$(info Running tests using TEST_OPTS control variable '$(TEST_OPTS)')
179+
endif
150180

151-
$(eval $(call SetTestOpt,VM_OPTIONS,JTREG))
152-
$(eval $(call SetTestOpt,VM_OPTIONS,GTEST))
181+
$(eval $(call SetTestOpt,VM_OPTIONS,JTREG))
182+
$(eval $(call SetTestOpt,JAVA_OPTIONS,JTREG))
183+
$(eval $(call SetTestOpt,VM_OPTIONS,GTEST))
184+
$(eval $(call SetTestOpt,JAVA_OPTIONS,GTEST))
153185

154-
$(eval $(call SetTestOpt,JOBS,JTREG))
155-
$(eval $(call SetTestOpt,TIMEOUT,JTREG))
156-
endif
186+
$(eval $(call SetTestOpt,JOBS,JTREG))
187+
$(eval $(call SetTestOpt,TIMEOUT_FACTOR,JTREG))
157188

158189
$(eval $(call ParseKeywordVariable, JTREG, \
159-
KEYWORDS := JOBS TIMEOUT TEST_MODE ASSERT VERBOSE RETAIN MAX_MEM, \
190+
SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR TEST_MODE ASSERT VERBOSE RETAIN MAX_MEM \
191+
EXTRA_PROBLEM_LISTS KEYWORDS, \
160192
STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS, \
161193
))
162194

@@ -166,8 +198,8 @@ ifneq ($(JTREG), )
166198
endif
167199

168200
$(eval $(call ParseKeywordVariable, GTEST, \
169-
KEYWORDS := REPEAT, \
170-
STRING_KEYWORDS := OPTIONS VM_OPTIONS, \
201+
SINGLE_KEYWORDS := REPEAT, \
202+
STRING_KEYWORDS := OPTIONS VM_OPTIONS JAVA_OPTIONS, \
171203
))
172204

173205
ifneq ($(GTEST), )
@@ -396,15 +428,16 @@ define SetupRunGtestTestBody
396428
$1_GTEST_REPEAT :=--gtest_repeat=$$(GTEST_REPEAT)
397429
endif
398430

399-
run-test-$1:
431+
run-test-$1: $(TEST_PREREQS)
400432
$$(call LogWarn)
401433
$$(call LogWarn, Running test '$$($1_TEST)')
402434
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
403435
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/gtest, \
404436
$$(FIXPATH) $$(TEST_IMAGE_DIR)/hotspot/gtest/$$($1_VARIANT)/gtestLauncher \
405-
-jdk $(JDK_IMAGE_DIR) $$($1_GTEST_FILTER) \
406-
--gtest_output=xml:$$($1_TEST_RESULTS_DIR)/gtest.xml \
407-
$$($1_GTEST_REPEAT) $$(GTEST_OPTIONS) $$(GTEST_VM_OPTIONS) \
437+
-jdk $(JDK_IMAGE_DIR) $$($1_GTEST_FILTER) \
438+
--gtest_output=xml:$$($1_TEST_RESULTS_DIR)/gtest.xml \
439+
$$($1_GTEST_REPEAT) $$(GTEST_OPTIONS) $$(GTEST_VM_OPTIONS) \
440+
$$($1_GTEST_JAVA_OPTIONS) \
408441
> >($(TEE) $$($1_TEST_RESULTS_DIR)/gtest.txt) \
409442
&& $$(ECHO) $$$$? > $$($1_EXITCODE) \
410443
|| $$(ECHO) $$$$? > $$($1_EXITCODE) \
@@ -475,12 +508,11 @@ define SetupRunJtregTestBody
475508

476509
$1_TEST_NAME := $$(strip $$(patsubst jtreg:%, %, $$($1_TEST)))
477510

478-
$1_COMPONENT := \
511+
$1_TEST_ROOT := \
479512
$$(strip $$(foreach root, $$(JTREG_TESTROOTS), \
480-
$$(if $$(filter $$(root)%, $$(JTREG_TOPDIR)/$$($1_TEST_NAME)), \
481-
$$(lastword $$(subst /, $$(SPACE), $$(root))) \
482-
) \
513+
$$(if $$(filter $$(root)%, $$(JTREG_TOPDIR)/$$($1_TEST_NAME)), $$(root)) \
483514
))
515+
$1_COMPONENT := $$(lastword $$(subst /, $$(SPACE), $$($1_TEST_ROOT)))
484516
# This will work only as long as just hotspot has the additional "jtreg" directory
485517
ifeq ($$($1_COMPONENT), jtreg)
486518
$1_COMPONENT := hotspot
@@ -503,6 +535,9 @@ define SetupRunJtregTestBody
503535
$$(eval $$(call SetJtregValue,$1,JTREG_BASIC_OPTIONS))
504536
$$(eval $$(call SetJtregValue,$1,JTREG_PROBLEM_LIST))
505537

538+
# Only the problem list for the current test root should be used.
539+
$1_JTREG_PROBLEM_LIST := $$(filter $$($1_TEST_ROOT)%, $$($1_JTREG_PROBLEM_LIST))
540+
506541
ifneq ($(TEST_JOBS), 0)
507542
$$(eval $$(call SetJtregValue,$1,JTREG_JOBS,$$(TEST_JOBS)))
508543
else
@@ -515,9 +550,9 @@ define SetupRunJtregTestBody
515550

516551
# SPARC is in general slower per core so need to scale up timeouts a bit.
517552
ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
518-
JTREG_TIMEOUT ?= 8
553+
JTREG_TIMEOUT_FACTOR ?= 8
519554
else
520-
JTREG_TIMEOUT ?= 4
555+
JTREG_TIMEOUT_FACTOR ?= 4
521556
endif
522557
JTREG_VERBOSE ?= fail,error,summary
523558
JTREG_RETAIN ?= fail,error
@@ -529,10 +564,10 @@ define SetupRunJtregTestBody
529564

530565
$1_JTREG_BASIC_OPTIONS += -$$($1_JTREG_TEST_MODE) \
531566
-verbose:$$(JTREG_VERBOSE) -retain:$$(JTREG_RETAIN) \
532-
-concurrency:$$($1_JTREG_JOBS) -timeoutFactor:$$(JTREG_TIMEOUT) \
567+
-concurrency:$$($1_JTREG_JOBS) -timeoutFactor:$$(JTREG_TIMEOUT_FACTOR) \
533568
-vmoption:-XX:MaxRAMPercentage=$$($1_JTREG_MAX_RAM_PERCENTAGE)
534569

535-
$1_JTREG_BASIC_OPTIONS += -automatic -keywords:\!ignore -ignore:quiet
570+
$1_JTREG_BASIC_OPTIONS += -automatic -ignore:quiet
536571

537572
# Make it possible to specify the JIB_DATA_DIR for tests using the
538573
# JIB Artifact resolver
@@ -562,8 +597,16 @@ define SetupRunJtregTestBody
562597
$1_JTREG_BASIC_OPTIONS += $$(addprefix -exclude:, $$($1_JTREG_PROBLEM_LIST))
563598
endif
564599

565-
ifneq ($$(JIB_JAR), )
566-
$1_JTREG_BASIC_OPTIONS += -cpa:$$(JIB_JAR)
600+
ifneq ($$(JTREG_EXTRA_PROBLEM_LISTS), )
601+
# Accept both absolute paths as well as relative to the current test root.
602+
$1_JTREG_BASIC_OPTIONS += $$(addprefix -exclude:, $$(wildcard \
603+
$$(JTREG_EXTRA_PROBLEM_LISTS) \
604+
$$(addprefix $$($1_TEST_ROOT)/, $$(JTREG_EXTRA_PROBLEM_LISTS)) \
605+
))
606+
endif
607+
608+
ifneq ($$(JIB_HOME), )
609+
$1_JTREG_BASIC_OPTIONS += -e:JIB_HOME=$$(JIB_HOME)
567610
endif
568611

569612
$1_JTREG_BASIC_OPTIONS += -e:TEST_IMAGE_GRAAL_DIR=${TEST_IMAGE_DIR}/hotspot/jtreg/graal
@@ -572,10 +615,21 @@ define SetupRunJtregTestBody
572615
$1_JTREG_LAUNCHER_OPTIONS += -Djava.library.path="$(JTREG_FAILURE_HANDLER_DIR)"
573616
endif
574617

618+
ifneq ($$(JTREG_KEYWORDS), )
619+
# The keywords string may contain problematic characters and may be quoted
620+
# already when it arrives here. Remove any existing quotes and replace them
621+
# with one set of single quotes.
622+
$1_JTREG_KEYWORDS := \
623+
$$(strip $$(subst $$(SQUOTE),,$$(subst $$(DQUOTE),,$$(JTREG_KEYWORDS))))
624+
ifneq ($$($1_JTREG_KEYWORDS), )
625+
$1_JTREG_BASIC_OPTIONS += -k:'$$($1_JTREG_KEYWORDS)'
626+
endif
627+
endif
628+
575629
clean-workdir-$1:
576630
$$(RM) -r $$($1_TEST_SUPPORT_DIR)
577631

578-
run-test-$1: clean-workdir-$1
632+
run-test-$1: clean-workdir-$1 $(TEST_PREREQS)
579633
$$(call LogWarn)
580634
$$(call LogWarn, Running test '$$($1_TEST)')
581635
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
@@ -662,7 +716,7 @@ define SetupRunSpecialTestBody
662716
$$(error Invalid special test specification: $$($1_TEST_NAME))
663717
endif
664718

665-
run-test-$1:
719+
run-test-$1: $(TEST_PREREQS)
666720
$$(call LogWarn)
667721
$$(call LogWarn, Running test '$$($1_TEST)')
668722
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))

make/RunTestsPrebuilt.gmk

+36-26
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,11 @@ TOPDIR := $(strip $(patsubst %/make/, %, $(dir $(makefile_path))))
4949
# given.
5050
# Note: No spaces are allowed around the arguments.
5151
#
52-
# $1: The name of the argument
52+
# $1: The name of the variable
5353
# $2: The default value, if any, or OPTIONAL (do not provide a default but
5454
# do not exit if it is missing)
5555
# $3: If NO_CHECK, disable checking for target file/directory existence
56+
# If MKDIR, create the default directory
5657
define SetupVariable
5758
ifeq ($$($1), )
5859
ifeq ($2, )
@@ -75,10 +76,17 @@ define SetupVariable
7576
endif
7677
# If $1 has a value (is not optional), and $3 is not set (to NO_CHECK),
7778
# and if wildcard is empty, then complain that the file is missing.
78-
ifeq ($$(strip $$(if $$($1), , OPTIONAL) $$(wildcard $$($1)) $3), )
79-
$$(info Error: Prebuilt variable $1 points to missing file/directory:)
80-
$$(info '$$($1)')
81-
$$(error Cannot continue.)
79+
ifeq ($3, MKDIR)
80+
ifneq ($$(findstring $$(LOG), info debug trace), )
81+
$$(info Creating directory for $1)
82+
endif
83+
$$(shell mkdir -p $$($1))
84+
else ifneq ($3, NO_CHECK)
85+
ifeq ($$(strip $$(if $$($1), , OPTIONAL) $$(wildcard $$($1))), )
86+
$$(info Error: Prebuilt variable $1 points to missing file/directory:)
87+
$$(info '$$($1)')
88+
$$(error Cannot continue.)
89+
endif
8290
endif
8391
endef
8492

@@ -106,14 +114,14 @@ endef
106114
# Verify that user has given correct additional input.
107115

108116
# These variables are absolutely necessary
109-
$(eval $(call SetupVariable,OUTPUTDIR))
117+
$(eval $(call SetupVariable,OUTPUTDIR,$(TOPDIR)/build/run-test-prebuilt,MKDIR))
110118
$(eval $(call SetupVariable,BOOT_JDK))
111119
$(eval $(call SetupVariable,JT_HOME))
112120

113121
# These can have default values based on the ones above
114122
$(eval $(call SetupVariable,JDK_IMAGE_DIR,$(OUTPUTDIR)/images/jdk))
115123
$(eval $(call SetupVariable,TEST_IMAGE_DIR,$(OUTPUTDIR)/images/test))
116-
$(eval $(call SetupVariable,SYMBOLS_IMAGE_DIR,$(OUTPUTDIR)/images/symbols))
124+
$(eval $(call SetupVariable,SYMBOLS_IMAGE_DIR,$(OUTPUTDIR)/images/symbols,NO_CHECK))
117125

118126
# Provide default values for tools that we need
119127
$(eval $(call SetupVariable,MAKE,make,NO_CHECK))
@@ -202,8 +210,8 @@ endif
202210

203211
ifeq ($(OPENJDK_TARGET_OS), windows)
204212
ifeq ($(wildcard $(TEST_IMAGE_DIR)/bin/fixpath.exe), )
205-
$$(info Error: fixpath is missing from test image '$(TEST_IMAGE_DIR)')
206-
$$(error Cannot continue.)
213+
$(info Error: fixpath is missing from test image '$(TEST_IMAGE_DIR)')
214+
$(error Cannot continue.)
207215
endif
208216
FIXPATH := $(TEST_IMAGE_DIR)/bin/fixpath.exe -c
209217
PATH_SEP:=;
@@ -214,27 +222,32 @@ endif
214222

215223
# Check number of cores and memory in MB
216224
ifeq ($(OPENJDK_TARGET_OS), linux)
217-
NUM_CORES := $(shell $(CAT) /proc/cpuinfo | $(GREP) -c processor)
218-
MEMORY_SIZE := $(shell \
225+
NUM_CORES := $(shell $(CAT) /proc/cpuinfo | $(GREP) -c processor)
226+
MEMORY_SIZE := $(shell \
219227
$(EXPR) `$(CAT) /proc/meminfo | $(GREP) MemTotal | $(AWK) '{print $$2}'` / 1024 \
220-
)
228+
)
221229
else ifeq ($(OPENJDK_TARGET_OS), macosx)
222-
NUM_CORES := $(shell /usr/sbin/sysctl -n hw.ncpu)
223-
MEMORY_SIZE := $(shell $(EXPR) `/usr/sbin/sysctl -n hw.memsize` / 1024 / 1024)
230+
NUM_CORES := $(shell /usr/sbin/sysctl -n hw.ncpu)
231+
MEMORY_SIZE := $(shell $(EXPR) `/usr/sbin/sysctl -n hw.memsize` / 1024 / 1024)
224232
else ifeq ($(OPENJDK_TARGET_OS), solaris)
225-
NUM_CORES := $(shell LC_MESSAGES=C /usr/sbin/psrinfo -v | $(GREP) -c on-line)
226-
MEMORY_SIZE := $(shell \
233+
NUM_CORES := $(shell LC_MESSAGES=C /usr/sbin/psrinfo -v | $(GREP) -c on-line)
234+
MEMORY_SIZE := $(shell \
227235
/usr/sbin/prtconf 2> /dev/null | $(GREP) "^Memory [Ss]ize" | $(AWK) '{print $$3}' \
228-
)
236+
)
229237
else ifeq ($(OPENJDK_TARGET_OS), windows)
230-
NUM_CORES := $(NUMBER_OF_PROCESSORS)
231-
MEMORY_SIZE := $(shell \
238+
NUM_CORES := $(NUMBER_OF_PROCESSORS)
239+
MEMORY_SIZE := $(shell \
232240
$(EXPR) `wmic computersystem get totalphysicalmemory -value | $(GREP) = \
233241
| $(CUT) -d "=" -f 2-` / 1024 / 1024 \
234-
)
235-
else
236-
NUM_CORES := 1
237-
MEMORY_SIZE := 1024
242+
)
243+
endif
244+
ifeq ($(NUM_CORES), )
245+
$(warn Could not find number of CPUs, assuming 1)
246+
NUM_CORES := 1
247+
endif
248+
ifeq ($(MEMORY_SIZE), )
249+
$(warn Could not find memory size, assuming 1024 MB)
250+
MEMORY_SIZE := 1024
238251
endif
239252

240253
################################################################################
@@ -289,9 +302,6 @@ run-test-prebuilt:
289302
@$(RM) -f $(MAKESUPPORT_OUTPUTDIR)/exit-with-error
290303
@cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -f make/RunTests.gmk run-test \
291304
TEST="$(TEST)"
292-
@if test -f $(MAKESUPPORT_OUTPUTDIR)/exit-with-error ; then \
293-
exit 1 ; \
294-
fi
295305

296306
all: run-test-prebuilt
297307

make/RunTestsPrebuiltSpec.gmk

+15-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ JLINK := $(FIXPATH) $(JLINK_CMD)
124124
JMOD := $(FIXPATH) $(JMOD_CMD)
125125
JARSIGNER := $(FIXPATH) $(JARSIGNER_CMD)
126126

127-
BUILD_JAVA := $(JAVA)
127+
BUILD_JAVA := $(JDK_IMAGE_DIR)/bin/JAVA
128128
################################################################################
129129
# Some common tools. Assume most common name and no path.
130130
AWK := awk
@@ -172,3 +172,17 @@ UNZIP := unzip
172172
EXPR := expr
173173
FILE := file
174174
HG := hg
175+
176+
# On Solaris gnu versions of some tools are required.
177+
ifeq ($(OPENJDK_BUILD_OS), solaris)
178+
AWK := gawk
179+
GREP := ggrep
180+
EGREP := ggrep -E
181+
FGREP := grep -F
182+
SED := gsed
183+
TAR := gtar
184+
endif
185+
186+
ifeq ($(OPENJDK_BUILD_OS), windows)
187+
CYGPATH := cygpath
188+
endif

0 commit comments

Comments
 (0)