blob: cb8a2e8433f620fbe5ab016fd327c3ec50e4ad50 [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001#
Mike Duigou12f11832013-04-01 20:15:48 -07002# Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -07003# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# This code is free software; you can redistribute it and/or modify it
6# under the terms of the GNU General Public License version 2 only, as
Kelly O'Hairfe008ae2010-05-25 15:58:33 -07007# published by the Free Software Foundation. Oracle designates this
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -07008# particular file as subject to the "Classpath" exception as provided
Kelly O'Hairfe008ae2010-05-25 15:58:33 -07009# by Oracle in the LICENSE file that accompanied this code.
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -070010#
11# This code is distributed in the hope that it will be useful, but WITHOUT
12# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14# version 2 for more details (a copy is included in the LICENSE file that
15# accompanied this code).
16#
17# You should have received a copy of the GNU General Public License version
18# 2 along with this work; if not, write to the Free Software Foundation,
19# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20#
Kelly O'Hairfe008ae2010-05-25 15:58:33 -070021# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22# or visit www.oracle.com if you need additional information or have any
23# questions.
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -070024#
25
26#
27# Makefile to run various jdk tests
J. Duke319a3b92007-12-01 00:00:00 +000028#
29
Kelly O'Haird1258922009-11-08 15:11:10 -080030# Empty these to get rid of some default rules
31.SUFFIXES:
32.SUFFIXES: .java
33CO=
34GET=
35
36# Utilities used
37AWK = awk
38CAT = cat
39CD = cd
Kelly O'Hair56131862010-05-12 21:35:55 -070040CHMOD = chmod
Kelly O'Haird1258922009-11-08 15:11:10 -080041CP = cp
42CUT = cut
Kelly O'Hair56131862010-05-12 21:35:55 -070043DIRNAME = dirname
Kelly O'Haird1258922009-11-08 15:11:10 -080044ECHO = echo
45EGREP = egrep
46EXPAND = expand
Kelly O'Hair56131862010-05-12 21:35:55 -070047FIND = find
Kelly O'Haird1258922009-11-08 15:11:10 -080048MKDIR = mkdir
Kelly O'Haird1258922009-11-08 15:11:10 -080049PWD = pwd
50SED = sed
Kelly O'Haird1258922009-11-08 15:11:10 -080051SORT = sort
52TEE = tee
53UNAME = uname
54UNIQ = uniq
55WC = wc
Kelly O'Haird1258922009-11-08 15:11:10 -080056ZIP = zip
57
58# Get OS name from uname
59UNAME_S := $(shell $(UNAME) -s)
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -070060
61# Commands to run on paths to make mixed paths for java on windows
Kelly O'Haird1258922009-11-08 15:11:10 -080062GETMIXEDPATH=$(ECHO)
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -070063
64# Location of developer shared files
65SLASH_JAVA = /java
66
67# Platform specific settings
Kelly O'Haird1258922009-11-08 15:11:10 -080068ifeq ($(UNAME_S), SunOS)
69 OS_NAME = solaris
70 OS_ARCH := $(shell $(UNAME) -p)
71 OS_VERSION := $(shell $(UNAME) -r)
J. Duke319a3b92007-12-01 00:00:00 +000072endif
Kelly O'Haird1258922009-11-08 15:11:10 -080073ifeq ($(UNAME_S), Linux)
74 OS_NAME = linux
75 OS_ARCH := $(shell $(UNAME) -m)
Kelly O'Hair79132952010-03-12 09:03:02 -080076 # Check for unknown arch, try uname -p if uname -m says unknown
77 ifeq ($(OS_ARCH),unknown)
78 OS_ARCH := $(shell $(UNAME) -p)
79 endif
Kelly O'Haird1258922009-11-08 15:11:10 -080080 OS_VERSION := $(shell $(UNAME) -r)
J. Duke319a3b92007-12-01 00:00:00 +000081endif
Alan Bateman3269d852012-03-06 20:34:38 +000082ifeq ($(UNAME_S), Darwin)
83 OS_NAME = macosx
84 OS_ARCH := $(shell $(UNAME) -m)
85 # Check for unknown arch, try uname -p if uname -m says unknown
86 ifeq ($(OS_ARCH),unknown)
87 OS_ARCH := $(shell $(UNAME) -p)
88 endif
89 OS_VERSION := $(shell $(UNAME) -r)
90endif
Kelly O'Haird7382802010-05-20 13:57:58 -070091ifeq ($(OS_NAME),)
92 OS_NAME = windows
93 # GNU Make or MKS overrides $(PROCESSOR_ARCHITECTURE) to always
94 # return "x86". Use the first word of $(PROCESSOR_IDENTIFIER) instead.
95 ifeq ($(PROCESSOR_IDENTIFIER),)
96 PROC_ARCH:=$(shell $(UNAME) -m)
97 else
98 PROC_ARCH:=$(word 1, $(PROCESSOR_IDENTIFIER))
99 endif
100 OS_ARCH:=$(PROC_ARCH)
101 SLASH_JAVA = J:
102 EXESUFFIX = .exe
103 # These need to be different depending on MKS or CYGWIN
104 ifeq ($(findstring cygdrive,$(shell ($(CD) C:/ && $(PWD)))), )
105 GETMIXEDPATH = dosname -s
106 OS_VERSION := $(shell $(UNAME) -r)
107 else
108 GETMIXEDPATH = cygpath -m -s
109 OS_VERSION := $(shell $(UNAME) -s | $(CUT) -d'-' -f2)
J. Duke319a3b92007-12-01 00:00:00 +0000110 endif
Kelly O'Haird1258922009-11-08 15:11:10 -0800111endif
112
113# Only want major and minor numbers from os version
114OS_VERSION := $(shell $(ECHO) "$(OS_VERSION)" | $(CUT) -d'.' -f1,2)
115
Kelly O'Hair79132952010-03-12 09:03:02 -0800116# Name to use for x86_64 arch (historically amd64, but should change someday)
117OS_ARCH_X64_NAME:=amd64
118#OS_ARCH_X64_NAME:=x64
119
120# Alternate arch names (in case this arch is known by a second name)
121# PROBLEM_LISTS may use either name.
122OS_ARCH2-amd64:=x64
123#OS_ARCH2-x64:=amd64
124
125# Try and use the arch names consistently
Kelly O'Haird7382802010-05-20 13:57:58 -0700126OS_ARCH:=$(patsubst x64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
127OS_ARCH:=$(patsubst X64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
128OS_ARCH:=$(patsubst AMD64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
129OS_ARCH:=$(patsubst amd64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
130OS_ARCH:=$(patsubst x86_64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
131OS_ARCH:=$(patsubst 8664,$(OS_ARCH_X64_NAME),$(OS_ARCH))
132OS_ARCH:=$(patsubst EM64T,$(OS_ARCH_X64_NAME),$(OS_ARCH))
133OS_ARCH:=$(patsubst em64t,$(OS_ARCH_X64_NAME),$(OS_ARCH))
134OS_ARCH:=$(patsubst intel64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
135OS_ARCH:=$(patsubst Intel64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
136OS_ARCH:=$(patsubst INTEL64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
137OS_ARCH:=$(patsubst IA64,ia64,$(OS_ARCH))
138OS_ARCH:=$(patsubst X86,i586,$(OS_ARCH))
139OS_ARCH:=$(patsubst x86,i586,$(OS_ARCH))
140OS_ARCH:=$(patsubst i386,i586,$(OS_ARCH))
141OS_ARCH:=$(patsubst i486,i586,$(OS_ARCH))
142OS_ARCH:=$(patsubst i686,i586,$(OS_ARCH))
143OS_ARCH:=$(patsubst 386,i586,$(OS_ARCH))
144OS_ARCH:=$(patsubst 486,i586,$(OS_ARCH))
145OS_ARCH:=$(patsubst 586,i586,$(OS_ARCH))
146OS_ARCH:=$(patsubst 686,i586,$(OS_ARCH))
Kelly O'Haird1258922009-11-08 15:11:10 -0800147
Kelly O'Hair79132952010-03-12 09:03:02 -0800148# Default ARCH_DATA_MODEL settings
149ARCH_DATA_MODEL-i586 = 32
150ARCH_DATA_MODEL-$(OS_ARCH_X64_NAME) = 64
151ARCH_DATA_MODEL-ia64 = 64
152ARCH_DATA_MODEL-sparc = 32
153ARCH_DATA_MODEL-sparcv9 = 64
154
155# If ARCH_DATA_MODEL is not defined, try and pick a reasonable default
156ifndef ARCH_DATA_MODEL
157 ARCH_DATA_MODEL:=$(ARCH_DATA_MODEL-$(OS_ARCH))
158endif
Kelly O'Haird1258922009-11-08 15:11:10 -0800159ifndef ARCH_DATA_MODEL
160 ARCH_DATA_MODEL=32
161endif
Kelly O'Hair79132952010-03-12 09:03:02 -0800162
163# Platform directory name
164PLATFORM_OS = $(OS_NAME)-$(OS_ARCH)
165
166# Check ARCH_DATA_MODEL, adjust OS_ARCH accordingly on solaris
Kelly O'Haird1258922009-11-08 15:11:10 -0800167ARCH_DATA_MODEL_ERROR= \
Kelly O'Hair79132952010-03-12 09:03:02 -0800168 ARCH_DATA_MODEL=$(ARCH_DATA_MODEL) cannot be used with $(PLATFORM_OS)
Kelly O'Haird1258922009-11-08 15:11:10 -0800169ifeq ($(ARCH_DATA_MODEL),64)
Kelly O'Hair79132952010-03-12 09:03:02 -0800170 ifeq ($(PLATFORM_OS),solaris-i586)
171 OS_ARCH=$(OS_ARCH_X64_NAME)
Kelly O'Haird1258922009-11-08 15:11:10 -0800172 endif
Kelly O'Hair79132952010-03-12 09:03:02 -0800173 ifeq ($(PLATFORM_OS),solaris-sparc)
Kelly O'Haird1258922009-11-08 15:11:10 -0800174 OS_ARCH=sparcv9
175 endif
176 ifeq ($(OS_ARCH),i586)
177 x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
178 endif
179 ifeq ($(OS_ARCH),sparc)
180 x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
181 endif
182else
183 ifeq ($(ARCH_DATA_MODEL),32)
Kelly O'Hair79132952010-03-12 09:03:02 -0800184 ifeq ($(OS_ARCH),$(OS_ARCH_X64_NAME))
Kelly O'Haird1258922009-11-08 15:11:10 -0800185 x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
186 endif
187 ifeq ($(OS_ARCH),ia64)
188 x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
189 endif
190 ifeq ($(OS_ARCH),sparcv9)
191 x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
192 endif
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700193 else
Kelly O'Haird1258922009-11-08 15:11:10 -0800194 x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700195 endif
J. Duke319a3b92007-12-01 00:00:00 +0000196endif
197
Kelly O'Hair79132952010-03-12 09:03:02 -0800198# Alternate OS_ARCH name (defaults to OS_ARCH)
199OS_ARCH2:=$(OS_ARCH2-$(OS_ARCH))
200ifeq ($(OS_ARCH2),)
201 OS_ARCH2:=$(OS_ARCH)
202endif
203
J. Duke319a3b92007-12-01 00:00:00 +0000204# Root of this test area (important to use full paths in some places)
Kelly O'Haird1258922009-11-08 15:11:10 -0800205TEST_ROOT := $(shell $(PWD))
J. Duke319a3b92007-12-01 00:00:00 +0000206
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700207# Root of all test results
208ifdef ALT_OUTPUTDIR
209 ABS_OUTPUTDIR = $(ALT_OUTPUTDIR)
J. Duke319a3b92007-12-01 00:00:00 +0000210else
Kelly O'Hair79132952010-03-12 09:03:02 -0800211 ABS_OUTPUTDIR = $(TEST_ROOT)/../build/$(PLATFORM_OS)
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700212endif
Kelly O'Hair79132952010-03-12 09:03:02 -0800213ABS_PLATFORM_BUILD_ROOT = $(ABS_OUTPUTDIR)
214ABS_TEST_OUTPUT_DIR := $(ABS_PLATFORM_BUILD_ROOT)/testoutput/$(UNIQUE_DIR)
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700215
216# Expect JPRT to set PRODUCT_HOME (the product or jdk in this case to test)
217ifndef PRODUCT_HOME
218 # Try to use j2sdk-image if it exists
Kelly O'Hair79132952010-03-12 09:03:02 -0800219 ABS_JDK_IMAGE = $(ABS_PLATFORM_BUILD_ROOT)/j2sdk-image
220 PRODUCT_HOME := \
221 $(shell \
222 if [ -d $(ABS_JDK_IMAGE) ] ; then \
223 $(ECHO) "$(ABS_JDK_IMAGE)"; \
224 else \
225 $(ECHO) "$(ABS_PLATFORM_BUILD_ROOT)"; \
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700226 fi)
227 PRODUCT_HOME := $(PRODUCT_HOME)
J. Duke319a3b92007-12-01 00:00:00 +0000228endif
229
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700230# Expect JPRT to set JPRT_PRODUCT_ARGS (e.g. -server etc.)
231# Should be passed into 'java' only.
Kelly O'Haird1258922009-11-08 15:11:10 -0800232# Could include: -d64 -server -client OR any java option
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700233ifdef JPRT_PRODUCT_ARGS
234 JAVA_ARGS = $(JPRT_PRODUCT_ARGS)
235endif
J. Duke319a3b92007-12-01 00:00:00 +0000236
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700237# Expect JPRT to set JPRT_PRODUCT_VM_ARGS (e.g. -Xcomp etc.)
238# Should be passed into anything running the vm (java, javac, javadoc, ...).
239ifdef JPRT_PRODUCT_VM_ARGS
240 JAVA_VM_ARGS = $(JPRT_PRODUCT_VM_ARGS)
241endif
J. Duke319a3b92007-12-01 00:00:00 +0000242
Kelly O'Haird1258922009-11-08 15:11:10 -0800243# Check JAVA_ARGS arguments based on ARCH_DATA_MODEL etc.
244ifeq ($(OS_NAME),solaris)
245 D64_ERROR_MESSAGE=Mismatch between ARCH_DATA_MODEL=$(ARCH_DATA_MODEL) and use of -d64 in JAVA_ARGS=$(JAVA_ARGS)
246 ifeq ($(ARCH_DATA_MODEL),32)
247 ifneq ($(findstring -d64,$(JAVA_ARGS)),)
248 x:=$(warning "WARNING: $(D64_ERROR_MESSAGE)")
249 endif
250 endif
251 ifeq ($(ARCH_DATA_MODEL),64)
252 ifeq ($(findstring -d64,$(JAVA_ARGS)),)
253 x:=$(warning "WARNING: $(D64_ERROR_MESSAGE)")
254 endif
255 endif
256endif
257
Kelly O'Haird7382802010-05-20 13:57:58 -0700258# Macro to run make and set the shared library permissions
259define SharedLibraryPermissions
260$(MAKE) SHARED_LIBRARY_DIR=$1 UNIQUE_DIR=$@ shared_library_permissions
Kelly O'Hair56131862010-05-12 21:35:55 -0700261endef
262
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700263# Expect JPRT to set JPRT_ARCHIVE_BUNDLE (path to zip bundle for results)
264ARCHIVE_BUNDLE = $(ABS_TEST_OUTPUT_DIR)/ARCHIVE_BUNDLE.zip
265ifdef JPRT_ARCHIVE_BUNDLE
266 ARCHIVE_BUNDLE = $(JPRT_ARCHIVE_BUNDLE)
267endif
J. Duke319a3b92007-12-01 00:00:00 +0000268
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700269# How to create the test bundle (pass or fail, we want to create this)
270# Follow command with ";$(BUNDLE_UP_AND_EXIT)", so it always gets executed.
Kelly O'Hair56131862010-05-12 21:35:55 -0700271ZIP_UP_RESULTS = ( $(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)` \
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700272 && $(CD) $(ABS_TEST_OUTPUT_DIR) \
Kelly O'Hair119b6472011-03-22 11:08:09 -0700273 && $(CHMOD) -R a+r . \
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700274 && $(ZIP) -q -r $(ARCHIVE_BUNDLE) . )
Kelly O'Haird1258922009-11-08 15:11:10 -0800275SUMMARY_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTreport/text/summary.txt
276STATS_TXT_NAME = Stats.txt
277STATS_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/$(STATS_TXT_NAME)
278RUNLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/runlist.txt
279PASSLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/passlist.txt
280FAILLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/faillist.txt
Kelly O'Hair0ce235a2009-12-01 08:51:16 -0800281EXITCODE = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/exitcode.txt
282
283TESTEXIT = \
284 if [ ! -s $(EXITCODE) ] ; then \
285 $(ECHO) "ERROR: EXITCODE file not filled in."; \
286 $(ECHO) "1" > $(EXITCODE); \
287 fi ; \
288 testExitCode=`$(CAT) $(EXITCODE)`; \
289 $(ECHO) "EXIT CODE: $${testExitCode}"; \
Kelly O'Hair61c09152009-12-09 09:46:57 -0800290 exit $${testExitCode}
Kelly O'Hair0ce235a2009-12-01 08:51:16 -0800291
Kelly O'Haird1258922009-11-08 15:11:10 -0800292BUNDLE_UP_AND_EXIT = \
293( \
Kelly O'Hair0ce235a2009-12-01 08:51:16 -0800294 jtregExitCode=$$? && \
Kelly O'Haird1258922009-11-08 15:11:10 -0800295 _summary="$(SUMMARY_TXT)"; \
Kelly O'Hair0ce235a2009-12-01 08:51:16 -0800296 $(RM) -f $(STATS_TXT) $(RUNLIST) $(PASSLIST) $(FAILLIST) $(EXITCODE); \
297 $(ECHO) "$${jtregExitCode}" > $(EXITCODE); \
Kelly O'Haird1258922009-11-08 15:11:10 -0800298 if [ -r "$${_summary}" ] ; then \
Kelly O'Hair61c09152009-12-09 09:46:57 -0800299 $(ECHO) "Summary: $(UNIQUE_DIR)" > $(STATS_TXT); \
Kelly O'Haird1258922009-11-08 15:11:10 -0800300 $(EXPAND) $${_summary} | $(EGREP) -v ' Not run\.' > $(RUNLIST); \
301 $(EGREP) ' Passed\.' $(RUNLIST) \
302 | $(EGREP) -v ' Error\.' \
303 | $(EGREP) -v ' Failed\.' > $(PASSLIST); \
304 ( $(EGREP) ' Failed\.' $(RUNLIST); \
305 $(EGREP) ' Error\.' $(RUNLIST); \
306 $(EGREP) -v ' Passed\.' $(RUNLIST) ) \
307 | $(SORT) | $(UNIQ) > $(FAILLIST); \
Kelly O'Hair0ce235a2009-12-01 08:51:16 -0800308 if [ $${jtregExitCode} != 0 -o -s $(FAILLIST) ] ; then \
Kelly O'Haird1258922009-11-08 15:11:10 -0800309 $(EXPAND) $(FAILLIST) \
310 | $(CUT) -d' ' -f1 \
311 | $(SED) -e 's@^@FAILED: @' >> $(STATS_TXT); \
Kelly O'Hair0ce235a2009-12-01 08:51:16 -0800312 if [ $${jtregExitCode} = 0 ] ; then \
313 jtregExitCode=1; \
314 fi; \
Kelly O'Haird1258922009-11-08 15:11:10 -0800315 fi; \
316 runc="`$(CAT) $(RUNLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
317 passc="`$(CAT) $(PASSLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
318 failc="`$(CAT) $(FAILLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
319 exclc="`$(CAT) $(EXCLUDELIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
Kelly O'Hairb383b9b2010-06-20 14:53:36 -0700320 $(ECHO) "TEST STATS: name=$(UNIQUE_DIR) run=$${runc} pass=$${passc} fail=$${failc} excluded=$${exclc}" \
Kelly O'Haird1258922009-11-08 15:11:10 -0800321 >> $(STATS_TXT); \
322 else \
323 $(ECHO) "Missing file: $${_summary}" >> $(STATS_TXT); \
324 fi; \
Kelly O'Hair119b6472011-03-22 11:08:09 -0700325 if [ -f $(STATS_TXT) ] ; then \
326 $(CAT) $(STATS_TXT); \
327 fi; \
Kelly O'Haire4fce692010-03-06 14:59:23 -0800328 $(ZIP_UP_RESULTS) ; \
Kelly O'Hair0ce235a2009-12-01 08:51:16 -0800329 $(TESTEXIT) \
Kelly O'Haird1258922009-11-08 15:11:10 -0800330)
J. Duke319a3b92007-12-01 00:00:00 +0000331
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700332################################################################
J. Duke319a3b92007-12-01 00:00:00 +0000333
Kelly O'Hairf5bfcb02011-12-12 08:17:28 -0800334# Default make rule (runs default jdk tests)
335all: jdk_default
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700336 @$(ECHO) "Testing completed successfully"
J. Duke319a3b92007-12-01 00:00:00 +0000337
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700338# Prep for output
Mike Duigoucd2f2642013-04-01 12:02:19 -0700339prep:
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700340 @$(MKDIR) -p $(ABS_TEST_OUTPUT_DIR)
Kelly O'Hairb383b9b2010-06-20 14:53:36 -0700341 @$(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)`
J. Duke319a3b92007-12-01 00:00:00 +0000342
343# Cleanup
344clean:
Mike Duigou62b85e62013-02-06 11:28:25 -0800345 @$(RM) -r $(ABS_TEST_OUTPUT_DIR)
346 @$(RM) $(ARCHIVE_BUNDLE)
J. Duke319a3b92007-12-01 00:00:00 +0000347
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700348################################################################
349
350# jtreg tests
351
352# Expect JT_HOME to be set for jtreg tests. (home for jtreg)
Kelly O'Haird020b042009-11-23 09:51:52 -0800353ifndef JT_HOME
Weijun Wang035522b2011-09-22 12:05:26 +0800354 JT_HOME = $(SLASH_JAVA)/re/jtreg/4.1/promoted/latest/binaries/jtreg
Kelly O'Haird020b042009-11-23 09:51:52 -0800355 ifdef JPRT_JTREG_HOME
356 JT_HOME = $(JPRT_JTREG_HOME)
357 endif
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700358endif
359
360# Expect JPRT to set TESTDIRS to the jtreg test dirs
361ifndef TESTDIRS
Kelly O'Haird1258922009-11-08 15:11:10 -0800362 TESTDIRS = demo
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700363endif
364
Weijun Wang035522b2011-09-22 12:05:26 +0800365# Agentvm settings (default is false)
366ifndef USE_JTREG_AGENTVM
367 USE_JTREG_AGENTVM=false
Kelly O'Haird1258922009-11-08 15:11:10 -0800368endif
Weijun Wang035522b2011-09-22 12:05:26 +0800369# With agentvm, you cannot use -javaoptions?
370ifeq ($(USE_JTREG_AGENTVM),true)
371 JTREG_AGENTVM_OPTION = -agentvm
372 EXTRA_JTREG_OPTIONS += $(JTREG_AGENTVM_OPTION) $(JAVA_ARGS) $(JAVA_ARGS:%=-vmoption:%)
Kelly O'Haird1258922009-11-08 15:11:10 -0800373 JTREG_TEST_OPTIONS = $(JAVA_VM_ARGS:%=-vmoption:%)
374else
375 JTREG_TEST_OPTIONS = $(JAVA_ARGS:%=-javaoptions:%) $(JAVA_VM_ARGS:%=-vmoption:%)
376endif
377
Weijun Wang035522b2011-09-22 12:05:26 +0800378ifdef CONCURRENCY
379 EXTRA_JTREG_OPTIONS += -concurrency:$(CONCURRENCY)
380endif
381
Kelly O'Haird1258922009-11-08 15:11:10 -0800382# Some tests annoy me and fail frequently
383PROBLEM_LIST=ProblemList.txt
Kelly O'Haird020b042009-11-23 09:51:52 -0800384PROBLEM_LISTS=$(PROBLEM_LIST) $(wildcard closed/$(PROBLEM_LIST))
Kelly O'Haird1258922009-11-08 15:11:10 -0800385EXCLUDELIST=$(ABS_TEST_OUTPUT_DIR)/excludelist.txt
386
387# Create exclude list for this platform and arch
388ifdef NO_EXCLUDES
Kelly O'Hair119b6472011-03-22 11:08:09 -0700389$(EXCLUDELIST): $(PROBLEM_LISTS) $(TEST_DEPENDENCIES)
Kelly O'Haird1258922009-11-08 15:11:10 -0800390 @$(ECHO) "NOTHING_EXCLUDED" > $@
391else
Kelly O'Hair119b6472011-03-22 11:08:09 -0700392$(EXCLUDELIST): $(PROBLEM_LISTS) $(TEST_DEPENDENCIES)
Kelly O'Haird1258922009-11-08 15:11:10 -0800393 @$(RM) $@ $@.temp1 $@.temp2
Kelly O'Haird020b042009-11-23 09:51:52 -0800394 @(($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-all' ) ;\
Kelly O'Hairb383b9b2010-06-20 14:53:36 -0700395 ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(PLATFORM_OS)' ) ;\
Kelly O'Hair79132952010-03-12 09:03:02 -0800396 ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-$(OS_ARCH2)' ) ;\
Kelly O'Haird020b042009-11-23 09:51:52 -0800397 ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-$(OS_VERSION)') ;\
398 ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-$(OS_ARCH)' ) ;\
Kelly O'Hair79132952010-03-12 09:03:02 -0800399 ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-$(OS_ARCH2)' ) ;\
Kelly O'Haird020b042009-11-23 09:51:52 -0800400 ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-all' ) ;\
401 ($(ECHO) "#") ;\
Kelly O'Haird1258922009-11-08 15:11:10 -0800402 ) | $(SED) -e 's@^[\ ]*@@' \
403 | $(EGREP) -v '^#' > $@.temp1
Mike Duigou62b85e62013-02-06 11:28:25 -0800404 @for tdir in $(TESTDIRS) SOLARIS_10_SH_BUG_NO_EMPTY_FORS ; do \
Kelly O'Haird1258922009-11-08 15:11:10 -0800405 ( ( $(CAT) $@.temp1 | $(EGREP) "^$${tdir}" ) ; $(ECHO) "#" ) >> $@.temp2 ; \
406 done
407 @$(ECHO) "# at least one line" >> $@.temp2
408 @( $(EGREP) -v '^#' $@.temp2 ; true ) > $@
409 @$(ECHO) "Excluding list contains `$(EXPAND) $@ | $(WC) -l` items"
410endif
411
Kelly O'Haird020b042009-11-23 09:51:52 -0800412# Select list of directories that exist
413define TestDirs
414$(foreach i,$1,$(wildcard ${i})) $(foreach i,$1,$(wildcard closed/${i}))
415endef
Weijun Wang035522b2011-09-22 12:05:26 +0800416# Running batches of tests with or without agentvm
417define RunAgentvmBatch
418$(ECHO) "Running tests in agentvm mode: $?"
419$(MAKE) TEST_DEPENDENCIES="$?" TESTDIRS="$?" USE_JTREG_AGENTVM=true UNIQUE_DIR=$@ jtreg_tests
Kelly O'Haird1258922009-11-08 15:11:10 -0800420endef
421define RunOthervmBatch
Rama Pulavarthi691add82011-03-09 15:47:15 -0800422$(ECHO) "Running tests in othervm mode: $?"
Weijun Wang035522b2011-09-22 12:05:26 +0800423$(MAKE) TEST_DEPENDENCIES="$?" TESTDIRS="$?" USE_JTREG_AGENTVM=false UNIQUE_DIR=$@ jtreg_tests
Kelly O'Haird1258922009-11-08 15:11:10 -0800424endef
425define SummaryInfo
Kelly O'Hair61c09152009-12-09 09:46:57 -0800426$(ECHO) "########################################################"
Kelly O'Haird1258922009-11-08 15:11:10 -0800427$(CAT) $(?:%=$(ABS_TEST_OUTPUT_DIR)/%/$(STATS_TXT_NAME))
Kelly O'Hair61c09152009-12-09 09:46:57 -0800428$(ECHO) "########################################################"
Kelly O'Haird1258922009-11-08 15:11:10 -0800429endef
430
431# ------------------------------------------------------------------
432
433# Batches of tests (somewhat arbitrary assigments to jdk_* targets)
Mike Duigou62b85e62013-02-06 11:28:25 -0800434# NOTE: These *do not* run the same tests as make/jprt.properties
Kelly O'Hairf5bfcb02011-12-12 08:17:28 -0800435JDK_DEFAULT_TARGETS =
Kelly O'Haird1258922009-11-08 15:11:10 -0800436JDK_ALL_TARGETS =
437
438# Stable othervm testruns (minus items from PROBLEM_LIST)
Weijun Wang035522b2011-09-22 12:05:26 +0800439# Using agentvm has problems, and doesn't help performance as much as others.
Kelly O'Haird1258922009-11-08 15:11:10 -0800440JDK_ALL_TARGETS += jdk_awt
Weijun Wang6b8980e2011-09-08 09:04:28 +0800441jdk_awt: $(call TestDirs, com/sun/awt java/awt sun/awt \
442 javax/imageio javax/print sun/pisces)
Kelly O'Haird1258922009-11-08 15:11:10 -0800443 $(call RunOthervmBatch)
444
Alan Bateman697f1512012-02-20 19:33:32 +0000445# Stable othervm testruns (minus items from PROBLEM_LIST)
Kelly O'Haird1258922009-11-08 15:11:10 -0800446JDK_ALL_TARGETS += jdk_beans1
Kelly O'Hairf5bfcb02011-12-12 08:17:28 -0800447JDK_DEFAULT_TARGETS += jdk_beans1
Rama Pulavarthi691add82011-03-09 15:47:15 -0800448jdk_beans1: $(call TestDirs, \
449 java/beans/beancontext java/beans/PropertyChangeSupport \
Kelly O'Haird1258922009-11-08 15:11:10 -0800450 java/beans/Introspector java/beans/Performance \
Rama Pulavarthi691add82011-03-09 15:47:15 -0800451 java/beans/VetoableChangeSupport java/beans/Statement)
Alan Bateman697f1512012-02-20 19:33:32 +0000452 $(call RunOthervmBatch)
Kelly O'Haird1258922009-11-08 15:11:10 -0800453
454# Stable othervm testruns (minus items from PROBLEM_LIST)
Weijun Wang035522b2011-09-22 12:05:26 +0800455# Using agentvm has serious problems with these tests
Kelly O'Haird1258922009-11-08 15:11:10 -0800456JDK_ALL_TARGETS += jdk_beans2
Rama Pulavarthi691add82011-03-09 15:47:15 -0800457jdk_beans2: $(call TestDirs, \
458 java/beans/Beans java/beans/EventHandler java/beans/XMLDecoder \
459 java/beans/PropertyEditor)
Kelly O'Haird1258922009-11-08 15:11:10 -0800460 $(call RunOthervmBatch)
Kelly O'Hair61c09152009-12-09 09:46:57 -0800461
462# Stable othervm testruns (minus items from PROBLEM_LIST)
Weijun Wang035522b2011-09-22 12:05:26 +0800463# Using agentvm has serious problems with these tests
Kelly O'Haird1258922009-11-08 15:11:10 -0800464JDK_ALL_TARGETS += jdk_beans3
Rama Pulavarthi691add82011-03-09 15:47:15 -0800465jdk_beans3: $(call TestDirs, java/beans/XMLEncoder)
Kelly O'Haird1258922009-11-08 15:11:10 -0800466 $(call RunOthervmBatch)
467
Kelly O'Hair61c09152009-12-09 09:46:57 -0800468# All beans tests
Kelly O'Haird020b042009-11-23 09:51:52 -0800469jdk_beans: jdk_beans1 jdk_beans2 jdk_beans3
470 @$(SummaryInfo)
471
Weijun Wang035522b2011-09-22 12:05:26 +0800472# Stable agentvm testruns (minus items from PROBLEM_LIST)
Kelly O'Haird1258922009-11-08 15:11:10 -0800473JDK_ALL_TARGETS += jdk_io
Kelly O'Hairf5bfcb02011-12-12 08:17:28 -0800474JDK_DEFAULT_TARGETS += jdk_io
Rama Pulavarthi691add82011-03-09 15:47:15 -0800475jdk_io: $(call TestDirs, java/io)
Weijun Wang035522b2011-09-22 12:05:26 +0800476 $(call RunAgentvmBatch)
Kelly O'Haird1258922009-11-08 15:11:10 -0800477
Weijun Wang035522b2011-09-22 12:05:26 +0800478# Stable agentvm testruns (minus items from PROBLEM_LIST)
Kelly O'Haird1258922009-11-08 15:11:10 -0800479JDK_ALL_TARGETS += jdk_lang
Kelly O'Hairf5bfcb02011-12-12 08:17:28 -0800480JDK_DEFAULT_TARGETS += jdk_lang
Alan Bateman511c6ab2012-10-09 13:28:32 +0100481jdk_lang: $(call TestDirs, java/lang sun/invoke sun/misc vm)
Weijun Wang035522b2011-09-22 12:05:26 +0800482 $(call RunAgentvmBatch)
Kelly O'Haird1258922009-11-08 15:11:10 -0800483
484# Stable othervm testruns (minus items from PROBLEM_LIST)
Weijun Wang035522b2011-09-22 12:05:26 +0800485# Using agentvm has serious problems with these tests
Alan Bateman511c6ab2012-10-09 13:28:32 +0100486JDK_ALL_TARGETS += jdk_jmx
487jdk_jmx: $(call TestDirs, javax/management com/sun/jmx)
Kelly O'Haird1258922009-11-08 15:11:10 -0800488 $(call RunOthervmBatch)
489
490# Stable othervm testruns (minus items from PROBLEM_LIST)
Weijun Wang035522b2011-09-22 12:05:26 +0800491# Using agentvm has serious problems with these tests
Alan Bateman511c6ab2012-10-09 13:28:32 +0100492JDK_ALL_TARGETS += jdk_management
493jdk_management: $(call TestDirs, com/sun/management sun/management)
Kelly O'Haird1258922009-11-08 15:11:10 -0800494 $(call RunOthervmBatch)
495
Weijun Wang035522b2011-09-22 12:05:26 +0800496# Stable agentvm testruns (minus items from PROBLEM_LIST)
Kelly O'Haird1258922009-11-08 15:11:10 -0800497JDK_ALL_TARGETS += jdk_math
Kelly O'Hairf5bfcb02011-12-12 08:17:28 -0800498JDK_DEFAULT_TARGETS += jdk_math
Rama Pulavarthi691add82011-03-09 15:47:15 -0800499jdk_math: $(call TestDirs, java/math)
Weijun Wang035522b2011-09-22 12:05:26 +0800500 $(call RunAgentvmBatch)
Kelly O'Haird1258922009-11-08 15:11:10 -0800501
Stephen Colebournedf4d2352013-01-22 20:59:21 -0800502# Stable agentvm testruns (TestNG)
503JDK_DEFAULT_TARGETS += jdk_time
504jdk_time: $(call TestDirs, java/time)
505 $(call RunOthervmBatch)
506
Weijun Wang035522b2011-09-22 12:05:26 +0800507# Stable agentvm testruns (minus items from PROBLEM_LIST)
Alan Bateman511c6ab2012-10-09 13:28:32 +0100508JDK_ALL_TARGETS += jdk_other
509JDK_DEFAULT_TARGETS += jdk_other
510jdk_other: $(call TestDirs, \
511 demo/jvmti demo/zipfs sample \
512 javax/naming com/sun/jndi \
513 javax/script \
Rob McKennabf46e162012-12-12 15:57:14 +0000514 java/sql javax/sql \
Alan Bateman511c6ab2012-10-09 13:28:32 +0100515 javax/smartcardio \
Sean Mullanbe64e9b2012-12-18 13:48:48 -0500516 javax/xml/soap \
Alan Bateman511c6ab2012-10-09 13:28:32 +0100517 javax/xml/ws com/sun/internal/ws \
Jim Holmlundd11cb7e2012-10-20 22:49:26 +0100518 jdk/asm \
Alan Bateman511c6ab2012-10-09 13:28:32 +0100519 com/sun/org/apache/xerces \
520 com/sun/corba \
Alan Bateman511c6ab2012-10-09 13:28:32 +0100521 com/sun/tracing \
522 sun/usagetracker)
Weijun Wang035522b2011-09-22 12:05:26 +0800523 $(call RunAgentvmBatch)
Kelly O'Haird1258922009-11-08 15:11:10 -0800524
Weijun Wang035522b2011-09-22 12:05:26 +0800525# Stable agentvm testruns (minus items from PROBLEM_LIST)
Kelly O'Haird1258922009-11-08 15:11:10 -0800526JDK_ALL_TARGETS += jdk_net
Kelly O'Hairf5bfcb02011-12-12 08:17:28 -0800527JDK_DEFAULT_TARGETS += jdk_net
Alan Bateman511c6ab2012-10-09 13:28:32 +0100528jdk_net: $(call TestDirs, com/sun/net java/net sun/net com/oracle/net)
Weijun Wang035522b2011-09-22 12:05:26 +0800529 $(call RunAgentvmBatch)
Kelly O'Haird1258922009-11-08 15:11:10 -0800530
Weijun Wang035522b2011-09-22 12:05:26 +0800531# Stable agentvm testruns (minus items from PROBLEM_LIST)
Alan Bateman511c6ab2012-10-09 13:28:32 +0100532jdk_nio: $(call TestDirs, java/nio sun/nio com/oracle/nio)
Kelly O'Haird7382802010-05-20 13:57:58 -0700533 $(call SharedLibraryPermissions,java/nio/channels)
Weijun Wang035522b2011-09-22 12:05:26 +0800534 $(call RunAgentvmBatch)
Kelly O'Hair61c09152009-12-09 09:46:57 -0800535
Weijun Wang035522b2011-09-22 12:05:26 +0800536# Stable agentvm testruns (minus items from PROBLEM_LIST)
Chris Hegartyd97cf812011-06-23 13:00:14 +0100537jdk_sctp: $(call TestDirs, com/sun/nio/sctp)
Weijun Wang035522b2011-09-22 12:05:26 +0800538 $(call RunAgentvmBatch)
Chris Hegartyd97cf812011-06-23 13:00:14 +0100539
Kelly O'Haird1258922009-11-08 15:11:10 -0800540# Stable othervm testruns (minus items from PROBLEM_LIST)
Weijun Wang035522b2011-09-22 12:05:26 +0800541# Using agentvm has serious problems with these tests
Kelly O'Haird1258922009-11-08 15:11:10 -0800542JDK_ALL_TARGETS += jdk_rmi
Alan Bateman511c6ab2012-10-09 13:28:32 +0100543jdk_rmi: $(call TestDirs, java/rmi sun/rmi javax/rmi/ssl)
Kelly O'Haird1258922009-11-08 15:11:10 -0800544 $(call RunOthervmBatch)
545
Weijun Wang035522b2011-09-22 12:05:26 +0800546# Stable agentvm testruns (minus items from PROBLEM_LIST)
Kelly O'Haird1258922009-11-08 15:11:10 -0800547JDK_ALL_TARGETS += jdk_security1
Kelly O'Hairf5bfcb02011-12-12 08:17:28 -0800548JDK_DEFAULT_TARGETS += jdk_security1
Rama Pulavarthi691add82011-03-09 15:47:15 -0800549jdk_security1: $(call TestDirs, java/security)
Weijun Wang035522b2011-09-22 12:05:26 +0800550 $(call RunAgentvmBatch)
Kelly O'Haird1258922009-11-08 15:11:10 -0800551
Weijun Wang035522b2011-09-22 12:05:26 +0800552# Stable agentvm testruns (minus items from PROBLEM_LIST)
Kelly O'Haird1258922009-11-08 15:11:10 -0800553JDK_ALL_TARGETS += jdk_security2
Weijun Wang5dcff732011-08-30 10:46:27 +0800554jdk_security2: $(call TestDirs, javax/crypto javax/xml/crypto com/sun/crypto)
Weijun Wang035522b2011-09-22 12:05:26 +0800555 $(call RunAgentvmBatch)
Kelly O'Hair61c09152009-12-09 09:46:57 -0800556
Weijun Wang035522b2011-09-22 12:05:26 +0800557# Stable agentvm testruns (minus items from PROBLEM_LIST)
Kelly O'Haird1258922009-11-08 15:11:10 -0800558JDK_ALL_TARGETS += jdk_security3
Weijun Wang6b8980e2011-09-08 09:04:28 +0800559jdk_security3: $(call TestDirs, com/sun/security lib/security javax/security \
Valerie Pengeafb7ad2012-01-12 16:04:03 -0800560 sun/security com/sun/org/apache/xml/internal/security \
Alan Bateman511c6ab2012-10-09 13:28:32 +0100561 com/oracle/security)
Kelly O'Haird7382802010-05-20 13:57:58 -0700562 $(call SharedLibraryPermissions,sun/security)
Weijun Wang035522b2011-09-22 12:05:26 +0800563 $(call RunAgentvmBatch)
Kelly O'Haird1258922009-11-08 15:11:10 -0800564
Kelly O'Hair61c09152009-12-09 09:46:57 -0800565# All security tests
Kelly O'Haird020b042009-11-23 09:51:52 -0800566jdk_security: jdk_security1 jdk_security2 jdk_security3
567 @$(SummaryInfo)
568
Weijun Wang035522b2011-09-22 12:05:26 +0800569# Stable agentvm testruns (minus items from PROBLEM_LIST)
Weijun Wang6b8980e2011-09-08 09:04:28 +0800570JDK_ALL_TARGETS += jdk_sound
571jdk_sound: $(call TestDirs, javax/sound)
Weijun Wang035522b2011-09-22 12:05:26 +0800572 $(call RunAgentvmBatch)
Weijun Wang6b8980e2011-09-08 09:04:28 +0800573
Kelly O'Haird1258922009-11-08 15:11:10 -0800574# Stable othervm testruns (minus items from PROBLEM_LIST)
Weijun Wang035522b2011-09-22 12:05:26 +0800575# Using agentvm has problems, and doesn't help performance as much as others.
Kelly O'Haird1258922009-11-08 15:11:10 -0800576JDK_ALL_TARGETS += jdk_swing
Weijun Wang6b8980e2011-09-08 09:04:28 +0800577jdk_swing: $(call TestDirs, javax/swing sun/java2d \
578 demo/jfc com/sun/java/swing)
Kelly O'Haird1258922009-11-08 15:11:10 -0800579 $(call RunOthervmBatch)
580
Weijun Wang035522b2011-09-22 12:05:26 +0800581# Stable agentvm testruns (minus items from PROBLEM_LIST)
Kelly O'Haird1258922009-11-08 15:11:10 -0800582JDK_ALL_TARGETS += jdk_text
Kelly O'Hairf5bfcb02011-12-12 08:17:28 -0800583JDK_DEFAULT_TARGETS += jdk_text
Rama Pulavarthi691add82011-03-09 15:47:15 -0800584jdk_text: $(call TestDirs, java/text sun/text)
Weijun Wang035522b2011-09-22 12:05:26 +0800585 $(call RunAgentvmBatch)
Kelly O'Haird1258922009-11-08 15:11:10 -0800586
Weijun Wang035522b2011-09-22 12:05:26 +0800587# Stable agentvm testruns (minus items from PROBLEM_LIST)
Alan Bateman511c6ab2012-10-09 13:28:32 +0100588JDK_ALL_TARGETS += jdk_jdi
589jdk_jdi: $(call TestDirs, com/sun/jdi)
Weijun Wang035522b2011-09-22 12:05:26 +0800590 $(call RunAgentvmBatch)
Kelly O'Hair61c09152009-12-09 09:46:57 -0800591
592# Stable othervm testruns (minus items from PROBLEM_LIST)
Weijun Wang035522b2011-09-22 12:05:26 +0800593# Using agentvm has serious problems with these tests
Alan Bateman511c6ab2012-10-09 13:28:32 +0100594JDK_ALL_TARGETS += jdk_tools
595jdk_tools: $(call TestDirs, com/sun/tools sun/jvmstat sun/tools tools)
Kelly O'Haird7382802010-05-20 13:57:58 -0700596 $(call SharedLibraryPermissions,tools/launcher)
Weijun Wang035522b2011-09-22 12:05:26 +0800597 $(call RunAgentvmBatch)
Kelly O'Haird1258922009-11-08 15:11:10 -0800598
Staffan Larsena2535452012-06-07 15:28:38 +0200599# Stable othervm testruns (minus items from PROBLEM_LIST)
600# Using agentvm has serious problems with these tests
601ifdef OPENJDK
602jdk_jfr:
603else
604JDK_ALL_TARGETS += jdk_jfr
605jdk_jfr: $(call TestDirs, com/oracle/jfr)
606 $(call RunOthervmBatch)
607endif
608
Weijun Wang035522b2011-09-22 12:05:26 +0800609# Stable agentvm testruns (minus items from PROBLEM_LIST)
Kelly O'Haird1258922009-11-08 15:11:10 -0800610JDK_ALL_TARGETS += jdk_util
Kelly O'Hairf5bfcb02011-12-12 08:17:28 -0800611JDK_DEFAULT_TARGETS += jdk_util
Rama Pulavarthi691add82011-03-09 15:47:15 -0800612jdk_util: $(call TestDirs, java/util sun/util)
Weijun Wang035522b2011-09-22 12:05:26 +0800613 $(call RunAgentvmBatch)
Kelly O'Haird1258922009-11-08 15:11:10 -0800614
615# ------------------------------------------------------------------
616
Kelly O'Hairf5bfcb02011-12-12 08:17:28 -0800617# Run default tests
Mike Duigou62b85e62013-02-06 11:28:25 -0800618# note that this *does not* have the same meaning as jprt.properties :: jprt.make.rule.default.test.targets
Kelly O'Hairf5bfcb02011-12-12 08:17:28 -0800619jdk_default: $(JDK_DEFAULT_TARGETS)
620 @$(SummaryInfo)
621
Mike Duigou62b85e62013-02-06 11:28:25 -0800622# Run core tests
623# please keep this in sync with jdk/make/jprt.properties :: jprt.make.rule.core.test.targets
624jdk_core: jdk_lang jdk_math jdk_util jdk_io jdk_net jdk_nio \
625 jdk_security1 jdk_security2 jdk_security3 jdk_rmi \
626 jdk_management jdk_jmx jdk_text jdk_tools jdk_jfr jdk_other
627 @$(SummaryInfo)
628
Kelly O'Haird1258922009-11-08 15:11:10 -0800629# Run all tests
Mike Duigou62b85e62013-02-06 11:28:25 -0800630# note that this *does not* have the same meaning as jprt.properties :: jprt.make.rule.all.test.targets
Kelly O'Hairf5bfcb02011-12-12 08:17:28 -0800631jdk_all: $(JDK_ALL_TARGETS)
Kelly O'Haird1258922009-11-08 15:11:10 -0800632 @$(SummaryInfo)
633
634# These are all phony targets
Mike Duigou62b85e62013-02-06 11:28:25 -0800635PHONY_LIST += $(JDK_ALL_TARGETS) jdk_default jdk_core jdk_all
Kelly O'Haird1258922009-11-08 15:11:10 -0800636
637# ------------------------------------------------------------------
638
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700639# Default JTREG to run (win32 script works for everybody)
640JTREG = $(JT_HOME)/win32/bin/jtreg
Weijun Wang035522b2011-09-22 12:05:26 +0800641# Add any extra options (agentvm etc.)
Kelly O'Haird1258922009-11-08 15:11:10 -0800642JTREG_BASIC_OPTIONS += $(EXTRA_JTREG_OPTIONS)
643# Only run automatic tests
644JTREG_BASIC_OPTIONS += -a
Kelly O'Haird44fe662009-12-11 15:29:22 -0800645# Always turn on assertions
646JTREG_ASSERT_OPTION = -ea -esa
647JTREG_BASIC_OPTIONS += $(JTREG_ASSERT_OPTION)
Kelly O'Haird1258922009-11-08 15:11:10 -0800648# Report details on all failed or error tests, times too
649JTREG_BASIC_OPTIONS += -v:fail,error,time
650# Retain all files for failing tests
651JTREG_BASIC_OPTIONS += -retain:fail,error
652# Ignore tests are not run and completely silent about it
Kelly O'Haird44fe662009-12-11 15:29:22 -0800653JTREG_IGNORE_OPTION = -ignore:quiet
654JTREG_BASIC_OPTIONS += $(JTREG_IGNORE_OPTION)
Kelly O'Hair61c09152009-12-09 09:46:57 -0800655# Multiple by 4 the timeout numbers
Kelly O'Haird44fe662009-12-11 15:29:22 -0800656JTREG_TIMEOUT_OPTION = -timeoutFactor:4
657JTREG_BASIC_OPTIONS += $(JTREG_TIMEOUT_OPTION)
Kelly O'Haird1258922009-11-08 15:11:10 -0800658# Boost the max memory for jtreg to avoid gc thrashing
Kelly O'Haird44fe662009-12-11 15:29:22 -0800659JTREG_MEMORY_OPTION = -J-Xmx512m
660JTREG_BASIC_OPTIONS += $(JTREG_MEMORY_OPTION)
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700661
Kelly O'Haird1258922009-11-08 15:11:10 -0800662# Make sure jtreg exists
663$(JTREG): $(JT_HOME)
664
665# Run jtreg
666jtreg_tests: prep $(PRODUCT_HOME) $(JTREG) $(EXCLUDELIST)
667 @$(EXPAND) $(EXCLUDELIST) \
668 | $(CUT) -d' ' -f1 \
669 | $(SED) -e 's@^@Excluding: @'
670 ( \
671 ( JT_HOME=$(shell $(GETMIXEDPATH) "$(JT_HOME)"); \
672 export JT_HOME; \
Kelly O'Haird1258922009-11-08 15:11:10 -0800673 $(shell $(GETMIXEDPATH) "$(JTREG)") \
674 $(JTREG_BASIC_OPTIONS) \
675 -r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTreport \
676 -w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTwork \
677 -jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \
678 -exclude:$(shell $(GETMIXEDPATH) "$(EXCLUDELIST)") \
679 $(JTREG_TEST_OPTIONS) \
680 $(TESTDIRS) \
681 ) ; $(BUNDLE_UP_AND_EXIT) \
Kelly O'Hair0ce235a2009-12-01 08:51:16 -0800682 ) 2>&1 | $(TEE) $(ABS_TEST_OUTPUT_DIR)/output.txt ; $(TESTEXIT)
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700683
Kelly O'Haird7382802010-05-20 13:57:58 -0700684# Rule that may change execute permissions on shared library files.
685# Files in repositories should never have execute permissions, but there
686# are some tests that have pre-built shared libraries, and these windows
687# dll files must have execute permission. Adding execute permission
688# may happen automatically on windows when using certain versions of mercurial
689# but it cannot be guaranteed. And blindly adding execute permission might
690# be seen as a mercurial 'change', so we avoid adding execute permission to
691# repository files. But testing from a plain source tree needs the chmod a+rx.
692# Used on select directories and applying the chmod to all shared libraries
693# not just dll files. On windows, this may not work with MKS if the files
694# were installed with CYGWIN unzip or untar (MKS chmod may not do anything).
695# And with CYGWIN and sshd service, you may need CYGWIN=ntsec for this to work.
696#
697shared_library_permissions: $(SHARED_LIBRARY_DIR)
698 if [ ! -d $(TEST_ROOT)/../.hg ] ; then \
699 $(FIND) $< \( -name \*.dll -o -name \*.DLL -o -name \*.so \) \
700 -exec $(CHMOD) a+rx {} \; ; \
701 fi
702
703PHONY_LIST += jtreg_tests shared_library_permissions
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700704
705################################################################
706
J. Duke319a3b92007-12-01 00:00:00 +0000707# Phony targets (e.g. these are not filenames)
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700708.PHONY: all clean prep $(PHONY_LIST)
709
710################################################################