blob: e94a561695e611db539892c1eba291c34e09c176 [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001#
Kelly O'Haird2b1e202011-04-06 22:06:11 -07002# Copyright (c) 1995, 2011, 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
Kelly O'Haird7382802010-05-20 13:57:58 -070082ifeq ($(OS_NAME),)
83 OS_NAME = windows
84 # GNU Make or MKS overrides $(PROCESSOR_ARCHITECTURE) to always
85 # return "x86". Use the first word of $(PROCESSOR_IDENTIFIER) instead.
86 ifeq ($(PROCESSOR_IDENTIFIER),)
87 PROC_ARCH:=$(shell $(UNAME) -m)
88 else
89 PROC_ARCH:=$(word 1, $(PROCESSOR_IDENTIFIER))
90 endif
91 OS_ARCH:=$(PROC_ARCH)
92 SLASH_JAVA = J:
93 EXESUFFIX = .exe
94 # These need to be different depending on MKS or CYGWIN
95 ifeq ($(findstring cygdrive,$(shell ($(CD) C:/ && $(PWD)))), )
96 GETMIXEDPATH = dosname -s
97 OS_VERSION := $(shell $(UNAME) -r)
98 else
99 GETMIXEDPATH = cygpath -m -s
100 OS_VERSION := $(shell $(UNAME) -s | $(CUT) -d'-' -f2)
J. Duke319a3b92007-12-01 00:00:00 +0000101 endif
Kelly O'Haird1258922009-11-08 15:11:10 -0800102endif
103
104# Only want major and minor numbers from os version
105OS_VERSION := $(shell $(ECHO) "$(OS_VERSION)" | $(CUT) -d'.' -f1,2)
106
Kelly O'Hair79132952010-03-12 09:03:02 -0800107# Name to use for x86_64 arch (historically amd64, but should change someday)
108OS_ARCH_X64_NAME:=amd64
109#OS_ARCH_X64_NAME:=x64
110
111# Alternate arch names (in case this arch is known by a second name)
112# PROBLEM_LISTS may use either name.
113OS_ARCH2-amd64:=x64
114#OS_ARCH2-x64:=amd64
115
116# Try and use the arch names consistently
Kelly O'Haird7382802010-05-20 13:57:58 -0700117OS_ARCH:=$(patsubst x64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
118OS_ARCH:=$(patsubst X64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
119OS_ARCH:=$(patsubst AMD64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
120OS_ARCH:=$(patsubst amd64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
121OS_ARCH:=$(patsubst x86_64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
122OS_ARCH:=$(patsubst 8664,$(OS_ARCH_X64_NAME),$(OS_ARCH))
123OS_ARCH:=$(patsubst EM64T,$(OS_ARCH_X64_NAME),$(OS_ARCH))
124OS_ARCH:=$(patsubst em64t,$(OS_ARCH_X64_NAME),$(OS_ARCH))
125OS_ARCH:=$(patsubst intel64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
126OS_ARCH:=$(patsubst Intel64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
127OS_ARCH:=$(patsubst INTEL64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
128OS_ARCH:=$(patsubst IA64,ia64,$(OS_ARCH))
129OS_ARCH:=$(patsubst X86,i586,$(OS_ARCH))
130OS_ARCH:=$(patsubst x86,i586,$(OS_ARCH))
131OS_ARCH:=$(patsubst i386,i586,$(OS_ARCH))
132OS_ARCH:=$(patsubst i486,i586,$(OS_ARCH))
133OS_ARCH:=$(patsubst i686,i586,$(OS_ARCH))
134OS_ARCH:=$(patsubst 386,i586,$(OS_ARCH))
135OS_ARCH:=$(patsubst 486,i586,$(OS_ARCH))
136OS_ARCH:=$(patsubst 586,i586,$(OS_ARCH))
137OS_ARCH:=$(patsubst 686,i586,$(OS_ARCH))
Kelly O'Haird1258922009-11-08 15:11:10 -0800138
Kelly O'Hair79132952010-03-12 09:03:02 -0800139# Default ARCH_DATA_MODEL settings
140ARCH_DATA_MODEL-i586 = 32
141ARCH_DATA_MODEL-$(OS_ARCH_X64_NAME) = 64
142ARCH_DATA_MODEL-ia64 = 64
143ARCH_DATA_MODEL-sparc = 32
144ARCH_DATA_MODEL-sparcv9 = 64
145
146# If ARCH_DATA_MODEL is not defined, try and pick a reasonable default
147ifndef ARCH_DATA_MODEL
148 ARCH_DATA_MODEL:=$(ARCH_DATA_MODEL-$(OS_ARCH))
149endif
Kelly O'Haird1258922009-11-08 15:11:10 -0800150ifndef ARCH_DATA_MODEL
151 ARCH_DATA_MODEL=32
152endif
Kelly O'Hair79132952010-03-12 09:03:02 -0800153
154# Platform directory name
155PLATFORM_OS = $(OS_NAME)-$(OS_ARCH)
156
157# Check ARCH_DATA_MODEL, adjust OS_ARCH accordingly on solaris
Kelly O'Haird1258922009-11-08 15:11:10 -0800158ARCH_DATA_MODEL_ERROR= \
Kelly O'Hair79132952010-03-12 09:03:02 -0800159 ARCH_DATA_MODEL=$(ARCH_DATA_MODEL) cannot be used with $(PLATFORM_OS)
Kelly O'Haird1258922009-11-08 15:11:10 -0800160ifeq ($(ARCH_DATA_MODEL),64)
Kelly O'Hair79132952010-03-12 09:03:02 -0800161 ifeq ($(PLATFORM_OS),solaris-i586)
162 OS_ARCH=$(OS_ARCH_X64_NAME)
Kelly O'Haird1258922009-11-08 15:11:10 -0800163 endif
Kelly O'Hair79132952010-03-12 09:03:02 -0800164 ifeq ($(PLATFORM_OS),solaris-sparc)
Kelly O'Haird1258922009-11-08 15:11:10 -0800165 OS_ARCH=sparcv9
166 endif
167 ifeq ($(OS_ARCH),i586)
168 x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
169 endif
170 ifeq ($(OS_ARCH),sparc)
171 x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
172 endif
173else
174 ifeq ($(ARCH_DATA_MODEL),32)
Kelly O'Hair79132952010-03-12 09:03:02 -0800175 ifeq ($(OS_ARCH),$(OS_ARCH_X64_NAME))
Kelly O'Haird1258922009-11-08 15:11:10 -0800176 x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
177 endif
178 ifeq ($(OS_ARCH),ia64)
179 x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
180 endif
181 ifeq ($(OS_ARCH),sparcv9)
182 x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
183 endif
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700184 else
Kelly O'Haird1258922009-11-08 15:11:10 -0800185 x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700186 endif
J. Duke319a3b92007-12-01 00:00:00 +0000187endif
188
Kelly O'Hair79132952010-03-12 09:03:02 -0800189# Alternate OS_ARCH name (defaults to OS_ARCH)
190OS_ARCH2:=$(OS_ARCH2-$(OS_ARCH))
191ifeq ($(OS_ARCH2),)
192 OS_ARCH2:=$(OS_ARCH)
193endif
194
J. Duke319a3b92007-12-01 00:00:00 +0000195# Root of this test area (important to use full paths in some places)
Kelly O'Haird1258922009-11-08 15:11:10 -0800196TEST_ROOT := $(shell $(PWD))
J. Duke319a3b92007-12-01 00:00:00 +0000197
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700198# Root of all test results
199ifdef ALT_OUTPUTDIR
200 ABS_OUTPUTDIR = $(ALT_OUTPUTDIR)
J. Duke319a3b92007-12-01 00:00:00 +0000201else
Kelly O'Hair79132952010-03-12 09:03:02 -0800202 ABS_OUTPUTDIR = $(TEST_ROOT)/../build/$(PLATFORM_OS)
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700203endif
Kelly O'Hair79132952010-03-12 09:03:02 -0800204ABS_PLATFORM_BUILD_ROOT = $(ABS_OUTPUTDIR)
205ABS_TEST_OUTPUT_DIR := $(ABS_PLATFORM_BUILD_ROOT)/testoutput/$(UNIQUE_DIR)
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700206
207# Expect JPRT to set PRODUCT_HOME (the product or jdk in this case to test)
208ifndef PRODUCT_HOME
209 # Try to use j2sdk-image if it exists
Kelly O'Hair79132952010-03-12 09:03:02 -0800210 ABS_JDK_IMAGE = $(ABS_PLATFORM_BUILD_ROOT)/j2sdk-image
211 PRODUCT_HOME := \
212 $(shell \
213 if [ -d $(ABS_JDK_IMAGE) ] ; then \
214 $(ECHO) "$(ABS_JDK_IMAGE)"; \
215 else \
216 $(ECHO) "$(ABS_PLATFORM_BUILD_ROOT)"; \
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700217 fi)
218 PRODUCT_HOME := $(PRODUCT_HOME)
J. Duke319a3b92007-12-01 00:00:00 +0000219endif
220
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700221# Expect JPRT to set JPRT_PRODUCT_ARGS (e.g. -server etc.)
222# Should be passed into 'java' only.
Kelly O'Haird1258922009-11-08 15:11:10 -0800223# Could include: -d64 -server -client OR any java option
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700224ifdef JPRT_PRODUCT_ARGS
225 JAVA_ARGS = $(JPRT_PRODUCT_ARGS)
226endif
J. Duke319a3b92007-12-01 00:00:00 +0000227
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700228# Expect JPRT to set JPRT_PRODUCT_VM_ARGS (e.g. -Xcomp etc.)
229# Should be passed into anything running the vm (java, javac, javadoc, ...).
230ifdef JPRT_PRODUCT_VM_ARGS
231 JAVA_VM_ARGS = $(JPRT_PRODUCT_VM_ARGS)
232endif
J. Duke319a3b92007-12-01 00:00:00 +0000233
Kelly O'Haird1258922009-11-08 15:11:10 -0800234# Check JAVA_ARGS arguments based on ARCH_DATA_MODEL etc.
235ifeq ($(OS_NAME),solaris)
236 D64_ERROR_MESSAGE=Mismatch between ARCH_DATA_MODEL=$(ARCH_DATA_MODEL) and use of -d64 in JAVA_ARGS=$(JAVA_ARGS)
237 ifeq ($(ARCH_DATA_MODEL),32)
238 ifneq ($(findstring -d64,$(JAVA_ARGS)),)
239 x:=$(warning "WARNING: $(D64_ERROR_MESSAGE)")
240 endif
241 endif
242 ifeq ($(ARCH_DATA_MODEL),64)
243 ifeq ($(findstring -d64,$(JAVA_ARGS)),)
244 x:=$(warning "WARNING: $(D64_ERROR_MESSAGE)")
245 endif
246 endif
247endif
248
Kelly O'Haird7382802010-05-20 13:57:58 -0700249# Macro to run make and set the shared library permissions
250define SharedLibraryPermissions
251$(MAKE) SHARED_LIBRARY_DIR=$1 UNIQUE_DIR=$@ shared_library_permissions
Kelly O'Hair56131862010-05-12 21:35:55 -0700252endef
253
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700254# Expect JPRT to set JPRT_ARCHIVE_BUNDLE (path to zip bundle for results)
255ARCHIVE_BUNDLE = $(ABS_TEST_OUTPUT_DIR)/ARCHIVE_BUNDLE.zip
256ifdef JPRT_ARCHIVE_BUNDLE
257 ARCHIVE_BUNDLE = $(JPRT_ARCHIVE_BUNDLE)
258endif
J. Duke319a3b92007-12-01 00:00:00 +0000259
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700260# How to create the test bundle (pass or fail, we want to create this)
261# Follow command with ";$(BUNDLE_UP_AND_EXIT)", so it always gets executed.
Kelly O'Hair56131862010-05-12 21:35:55 -0700262ZIP_UP_RESULTS = ( $(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)` \
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700263 && $(CD) $(ABS_TEST_OUTPUT_DIR) \
Kelly O'Hair119b6472011-03-22 11:08:09 -0700264 && $(CHMOD) -R a+r . \
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700265 && $(ZIP) -q -r $(ARCHIVE_BUNDLE) . )
Kelly O'Haird1258922009-11-08 15:11:10 -0800266SUMMARY_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTreport/text/summary.txt
267STATS_TXT_NAME = Stats.txt
268STATS_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/$(STATS_TXT_NAME)
269RUNLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/runlist.txt
270PASSLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/passlist.txt
271FAILLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/faillist.txt
Kelly O'Hair0ce235a2009-12-01 08:51:16 -0800272EXITCODE = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/exitcode.txt
273
274TESTEXIT = \
275 if [ ! -s $(EXITCODE) ] ; then \
276 $(ECHO) "ERROR: EXITCODE file not filled in."; \
277 $(ECHO) "1" > $(EXITCODE); \
278 fi ; \
279 testExitCode=`$(CAT) $(EXITCODE)`; \
280 $(ECHO) "EXIT CODE: $${testExitCode}"; \
Kelly O'Hair61c09152009-12-09 09:46:57 -0800281 exit $${testExitCode}
Kelly O'Hair0ce235a2009-12-01 08:51:16 -0800282
Kelly O'Haird1258922009-11-08 15:11:10 -0800283BUNDLE_UP_AND_EXIT = \
284( \
Kelly O'Hair0ce235a2009-12-01 08:51:16 -0800285 jtregExitCode=$$? && \
Kelly O'Haird1258922009-11-08 15:11:10 -0800286 _summary="$(SUMMARY_TXT)"; \
Kelly O'Hair0ce235a2009-12-01 08:51:16 -0800287 $(RM) -f $(STATS_TXT) $(RUNLIST) $(PASSLIST) $(FAILLIST) $(EXITCODE); \
288 $(ECHO) "$${jtregExitCode}" > $(EXITCODE); \
Kelly O'Haird1258922009-11-08 15:11:10 -0800289 if [ -r "$${_summary}" ] ; then \
Kelly O'Hair61c09152009-12-09 09:46:57 -0800290 $(ECHO) "Summary: $(UNIQUE_DIR)" > $(STATS_TXT); \
Kelly O'Haird1258922009-11-08 15:11:10 -0800291 $(EXPAND) $${_summary} | $(EGREP) -v ' Not run\.' > $(RUNLIST); \
292 $(EGREP) ' Passed\.' $(RUNLIST) \
293 | $(EGREP) -v ' Error\.' \
294 | $(EGREP) -v ' Failed\.' > $(PASSLIST); \
295 ( $(EGREP) ' Failed\.' $(RUNLIST); \
296 $(EGREP) ' Error\.' $(RUNLIST); \
297 $(EGREP) -v ' Passed\.' $(RUNLIST) ) \
298 | $(SORT) | $(UNIQ) > $(FAILLIST); \
Kelly O'Hair0ce235a2009-12-01 08:51:16 -0800299 if [ $${jtregExitCode} != 0 -o -s $(FAILLIST) ] ; then \
Kelly O'Haird1258922009-11-08 15:11:10 -0800300 $(EXPAND) $(FAILLIST) \
301 | $(CUT) -d' ' -f1 \
302 | $(SED) -e 's@^@FAILED: @' >> $(STATS_TXT); \
Kelly O'Hair0ce235a2009-12-01 08:51:16 -0800303 if [ $${jtregExitCode} = 0 ] ; then \
304 jtregExitCode=1; \
305 fi; \
Kelly O'Haird1258922009-11-08 15:11:10 -0800306 fi; \
307 runc="`$(CAT) $(RUNLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
308 passc="`$(CAT) $(PASSLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
309 failc="`$(CAT) $(FAILLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
310 exclc="`$(CAT) $(EXCLUDELIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
Kelly O'Hairb383b9b2010-06-20 14:53:36 -0700311 $(ECHO) "TEST STATS: name=$(UNIQUE_DIR) run=$${runc} pass=$${passc} fail=$${failc} excluded=$${exclc}" \
Kelly O'Haird1258922009-11-08 15:11:10 -0800312 >> $(STATS_TXT); \
313 else \
314 $(ECHO) "Missing file: $${_summary}" >> $(STATS_TXT); \
315 fi; \
Kelly O'Hair119b6472011-03-22 11:08:09 -0700316 if [ -f $(STATS_TXT) ] ; then \
317 $(CAT) $(STATS_TXT); \
318 fi; \
Kelly O'Haire4fce692010-03-06 14:59:23 -0800319 $(ZIP_UP_RESULTS) ; \
Kelly O'Hair0ce235a2009-12-01 08:51:16 -0800320 $(TESTEXIT) \
Kelly O'Haird1258922009-11-08 15:11:10 -0800321)
J. Duke319a3b92007-12-01 00:00:00 +0000322
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700323################################################################
J. Duke319a3b92007-12-01 00:00:00 +0000324
Kelly O'Hairf5bfcb02011-12-12 08:17:28 -0800325# Default make rule (runs default jdk tests)
326all: jdk_default
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700327 @$(ECHO) "Testing completed successfully"
J. Duke319a3b92007-12-01 00:00:00 +0000328
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700329# Prep for output
330prep: clean
331 @$(MKDIR) -p $(ABS_TEST_OUTPUT_DIR)
Kelly O'Hairb383b9b2010-06-20 14:53:36 -0700332 @$(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)`
J. Duke319a3b92007-12-01 00:00:00 +0000333
334# Cleanup
335clean:
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700336 $(RM) -r $(ABS_TEST_OUTPUT_DIR)
337 $(RM) $(ARCHIVE_BUNDLE)
J. Duke319a3b92007-12-01 00:00:00 +0000338
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700339################################################################
340
341# jtreg tests
342
343# Expect JT_HOME to be set for jtreg tests. (home for jtreg)
Kelly O'Haird020b042009-11-23 09:51:52 -0800344ifndef JT_HOME
Weijun Wang035522b2011-09-22 12:05:26 +0800345 JT_HOME = $(SLASH_JAVA)/re/jtreg/4.1/promoted/latest/binaries/jtreg
Kelly O'Haird020b042009-11-23 09:51:52 -0800346 ifdef JPRT_JTREG_HOME
347 JT_HOME = $(JPRT_JTREG_HOME)
348 endif
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700349endif
350
351# Expect JPRT to set TESTDIRS to the jtreg test dirs
352ifndef TESTDIRS
Kelly O'Haird1258922009-11-08 15:11:10 -0800353 TESTDIRS = demo
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700354endif
355
Weijun Wang035522b2011-09-22 12:05:26 +0800356# Agentvm settings (default is false)
357ifndef USE_JTREG_AGENTVM
358 USE_JTREG_AGENTVM=false
Kelly O'Haird1258922009-11-08 15:11:10 -0800359endif
Weijun Wang035522b2011-09-22 12:05:26 +0800360# With agentvm, you cannot use -javaoptions?
361ifeq ($(USE_JTREG_AGENTVM),true)
362 JTREG_AGENTVM_OPTION = -agentvm
363 EXTRA_JTREG_OPTIONS += $(JTREG_AGENTVM_OPTION) $(JAVA_ARGS) $(JAVA_ARGS:%=-vmoption:%)
Kelly O'Haird1258922009-11-08 15:11:10 -0800364 JTREG_TEST_OPTIONS = $(JAVA_VM_ARGS:%=-vmoption:%)
365else
366 JTREG_TEST_OPTIONS = $(JAVA_ARGS:%=-javaoptions:%) $(JAVA_VM_ARGS:%=-vmoption:%)
367endif
368
Weijun Wang035522b2011-09-22 12:05:26 +0800369ifdef CONCURRENCY
370 EXTRA_JTREG_OPTIONS += -concurrency:$(CONCURRENCY)
371endif
372
Kelly O'Haird1258922009-11-08 15:11:10 -0800373# Some tests annoy me and fail frequently
374PROBLEM_LIST=ProblemList.txt
Kelly O'Haird020b042009-11-23 09:51:52 -0800375PROBLEM_LISTS=$(PROBLEM_LIST) $(wildcard closed/$(PROBLEM_LIST))
Kelly O'Haird1258922009-11-08 15:11:10 -0800376EXCLUDELIST=$(ABS_TEST_OUTPUT_DIR)/excludelist.txt
377
378# Create exclude list for this platform and arch
379ifdef NO_EXCLUDES
Kelly O'Hair119b6472011-03-22 11:08:09 -0700380$(EXCLUDELIST): $(PROBLEM_LISTS) $(TEST_DEPENDENCIES)
Kelly O'Haird1258922009-11-08 15:11:10 -0800381 @$(ECHO) "NOTHING_EXCLUDED" > $@
382else
Kelly O'Hair119b6472011-03-22 11:08:09 -0700383$(EXCLUDELIST): $(PROBLEM_LISTS) $(TEST_DEPENDENCIES)
Kelly O'Haird1258922009-11-08 15:11:10 -0800384 @$(RM) $@ $@.temp1 $@.temp2
Kelly O'Haird020b042009-11-23 09:51:52 -0800385 @(($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-all' ) ;\
Kelly O'Hairb383b9b2010-06-20 14:53:36 -0700386 ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(PLATFORM_OS)' ) ;\
Kelly O'Hair79132952010-03-12 09:03:02 -0800387 ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-$(OS_ARCH2)' ) ;\
Kelly O'Haird020b042009-11-23 09:51:52 -0800388 ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-$(OS_VERSION)') ;\
389 ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-$(OS_ARCH)' ) ;\
Kelly O'Hair79132952010-03-12 09:03:02 -0800390 ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-$(OS_ARCH2)' ) ;\
Kelly O'Haird020b042009-11-23 09:51:52 -0800391 ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-all' ) ;\
392 ($(ECHO) "#") ;\
Kelly O'Haird1258922009-11-08 15:11:10 -0800393 ) | $(SED) -e 's@^[\ ]*@@' \
394 | $(EGREP) -v '^#' > $@.temp1
Kelly O'Hair119b6472011-03-22 11:08:09 -0700395 for tdir in $(TESTDIRS) SOLARIS_10_SH_BUG_NO_EMPTY_FORS ; do \
Kelly O'Haird1258922009-11-08 15:11:10 -0800396 ( ( $(CAT) $@.temp1 | $(EGREP) "^$${tdir}" ) ; $(ECHO) "#" ) >> $@.temp2 ; \
397 done
398 @$(ECHO) "# at least one line" >> $@.temp2
399 @( $(EGREP) -v '^#' $@.temp2 ; true ) > $@
400 @$(ECHO) "Excluding list contains `$(EXPAND) $@ | $(WC) -l` items"
401endif
402
Kelly O'Haird020b042009-11-23 09:51:52 -0800403# Select list of directories that exist
404define TestDirs
405$(foreach i,$1,$(wildcard ${i})) $(foreach i,$1,$(wildcard closed/${i}))
406endef
Weijun Wang035522b2011-09-22 12:05:26 +0800407# Running batches of tests with or without agentvm
408define RunAgentvmBatch
409$(ECHO) "Running tests in agentvm mode: $?"
410$(MAKE) TEST_DEPENDENCIES="$?" TESTDIRS="$?" USE_JTREG_AGENTVM=true UNIQUE_DIR=$@ jtreg_tests
Kelly O'Haird1258922009-11-08 15:11:10 -0800411endef
412define RunOthervmBatch
Rama Pulavarthi691add82011-03-09 15:47:15 -0800413$(ECHO) "Running tests in othervm mode: $?"
Weijun Wang035522b2011-09-22 12:05:26 +0800414$(MAKE) TEST_DEPENDENCIES="$?" TESTDIRS="$?" USE_JTREG_AGENTVM=false UNIQUE_DIR=$@ jtreg_tests
Kelly O'Haird1258922009-11-08 15:11:10 -0800415endef
416define SummaryInfo
Kelly O'Hair61c09152009-12-09 09:46:57 -0800417$(ECHO) "########################################################"
Kelly O'Haird1258922009-11-08 15:11:10 -0800418$(CAT) $(?:%=$(ABS_TEST_OUTPUT_DIR)/%/$(STATS_TXT_NAME))
Kelly O'Hair61c09152009-12-09 09:46:57 -0800419$(ECHO) "########################################################"
Kelly O'Haird1258922009-11-08 15:11:10 -0800420endef
421
422# ------------------------------------------------------------------
423
424# Batches of tests (somewhat arbitrary assigments to jdk_* targets)
Kelly O'Hairf5bfcb02011-12-12 08:17:28 -0800425JDK_DEFAULT_TARGETS =
Kelly O'Haird1258922009-11-08 15:11:10 -0800426JDK_ALL_TARGETS =
427
428# Stable othervm testruns (minus items from PROBLEM_LIST)
Weijun Wang035522b2011-09-22 12:05:26 +0800429# Using agentvm has problems, and doesn't help performance as much as others.
Kelly O'Haird1258922009-11-08 15:11:10 -0800430JDK_ALL_TARGETS += jdk_awt
Weijun Wang6b8980e2011-09-08 09:04:28 +0800431jdk_awt: $(call TestDirs, com/sun/awt java/awt sun/awt \
432 javax/imageio javax/print sun/pisces)
Kelly O'Haird1258922009-11-08 15:11:10 -0800433 $(call RunOthervmBatch)
434
Weijun Wang035522b2011-09-22 12:05:26 +0800435# Stable agentvm testruns (minus items from PROBLEM_LIST)
Kelly O'Haird1258922009-11-08 15:11:10 -0800436JDK_ALL_TARGETS += jdk_beans1
Kelly O'Hairf5bfcb02011-12-12 08:17:28 -0800437JDK_DEFAULT_TARGETS += jdk_beans1
Rama Pulavarthi691add82011-03-09 15:47:15 -0800438jdk_beans1: $(call TestDirs, \
439 java/beans/beancontext java/beans/PropertyChangeSupport \
Kelly O'Haird1258922009-11-08 15:11:10 -0800440 java/beans/Introspector java/beans/Performance \
Rama Pulavarthi691add82011-03-09 15:47:15 -0800441 java/beans/VetoableChangeSupport java/beans/Statement)
Weijun Wang035522b2011-09-22 12:05:26 +0800442 $(call RunAgentvmBatch)
Kelly O'Haird1258922009-11-08 15:11:10 -0800443
444# Stable othervm testruns (minus items from PROBLEM_LIST)
Weijun Wang035522b2011-09-22 12:05:26 +0800445# Using agentvm has serious problems with these tests
Kelly O'Haird1258922009-11-08 15:11:10 -0800446JDK_ALL_TARGETS += jdk_beans2
Rama Pulavarthi691add82011-03-09 15:47:15 -0800447jdk_beans2: $(call TestDirs, \
448 java/beans/Beans java/beans/EventHandler java/beans/XMLDecoder \
449 java/beans/PropertyEditor)
Kelly O'Haird1258922009-11-08 15:11:10 -0800450 $(call RunOthervmBatch)
Kelly O'Hair61c09152009-12-09 09:46:57 -0800451
452# Stable othervm testruns (minus items from PROBLEM_LIST)
Weijun Wang035522b2011-09-22 12:05:26 +0800453# Using agentvm has serious problems with these tests
Kelly O'Haird1258922009-11-08 15:11:10 -0800454JDK_ALL_TARGETS += jdk_beans3
Rama Pulavarthi691add82011-03-09 15:47:15 -0800455jdk_beans3: $(call TestDirs, java/beans/XMLEncoder)
Kelly O'Haird1258922009-11-08 15:11:10 -0800456 $(call RunOthervmBatch)
457
Kelly O'Hair61c09152009-12-09 09:46:57 -0800458# All beans tests
Kelly O'Haird020b042009-11-23 09:51:52 -0800459jdk_beans: jdk_beans1 jdk_beans2 jdk_beans3
460 @$(SummaryInfo)
461
Weijun Wang035522b2011-09-22 12:05:26 +0800462# Stable agentvm testruns (minus items from PROBLEM_LIST)
Kelly O'Haird1258922009-11-08 15:11:10 -0800463JDK_ALL_TARGETS += jdk_io
Kelly O'Hairf5bfcb02011-12-12 08:17:28 -0800464JDK_DEFAULT_TARGETS += jdk_io
Rama Pulavarthi691add82011-03-09 15:47:15 -0800465jdk_io: $(call TestDirs, java/io)
Weijun Wang035522b2011-09-22 12:05:26 +0800466 $(call RunAgentvmBatch)
Kelly O'Haird1258922009-11-08 15:11:10 -0800467
Weijun Wang035522b2011-09-22 12:05:26 +0800468# Stable agentvm testruns (minus items from PROBLEM_LIST)
Kelly O'Haird1258922009-11-08 15:11:10 -0800469JDK_ALL_TARGETS += jdk_lang
Kelly O'Hairf5bfcb02011-12-12 08:17:28 -0800470JDK_DEFAULT_TARGETS += jdk_lang
Rama Pulavarthi691add82011-03-09 15:47:15 -0800471jdk_lang: $(call TestDirs, java/lang)
Weijun Wang035522b2011-09-22 12:05:26 +0800472 $(call RunAgentvmBatch)
Kelly O'Haird1258922009-11-08 15:11:10 -0800473
474# Stable othervm testruns (minus items from PROBLEM_LIST)
Weijun Wang035522b2011-09-22 12:05:26 +0800475# Using agentvm has serious problems with these tests
Kelly O'Haird1258922009-11-08 15:11:10 -0800476JDK_ALL_TARGETS += jdk_management1
Rama Pulavarthi691add82011-03-09 15:47:15 -0800477jdk_management1: $(call TestDirs, javax/management)
Kelly O'Haird1258922009-11-08 15:11:10 -0800478 $(call RunOthervmBatch)
479
480# Stable othervm testruns (minus items from PROBLEM_LIST)
Weijun Wang035522b2011-09-22 12:05:26 +0800481# Using agentvm has serious problems with these tests
Kelly O'Haird1258922009-11-08 15:11:10 -0800482JDK_ALL_TARGETS += jdk_management2
Rama Pulavarthi691add82011-03-09 15:47:15 -0800483jdk_management2: $(call TestDirs, com/sun/jmx com/sun/management sun/management)
Kelly O'Haird1258922009-11-08 15:11:10 -0800484 $(call RunOthervmBatch)
485
Kelly O'Hair61c09152009-12-09 09:46:57 -0800486# All management tests
Kelly O'Haird020b042009-11-23 09:51:52 -0800487jdk_management: jdk_management1 jdk_management2
488 @$(SummaryInfo)
489
Weijun Wang035522b2011-09-22 12:05:26 +0800490# Stable agentvm testruns (minus items from PROBLEM_LIST)
Kelly O'Haird1258922009-11-08 15:11:10 -0800491JDK_ALL_TARGETS += jdk_math
Kelly O'Hairf5bfcb02011-12-12 08:17:28 -0800492JDK_DEFAULT_TARGETS += jdk_math
Rama Pulavarthi691add82011-03-09 15:47:15 -0800493jdk_math: $(call TestDirs, java/math)
Weijun Wang035522b2011-09-22 12:05:26 +0800494 $(call RunAgentvmBatch)
Kelly O'Haird1258922009-11-08 15:11:10 -0800495
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_misc
Kelly O'Hairf5bfcb02011-12-12 08:17:28 -0800498JDK_DEFAULT_TARGETS += jdk_misc
Rama Pulavarthi691add82011-03-09 15:47:15 -0800499jdk_misc: $(call TestDirs, \
Weijun Wang6b8980e2011-09-08 09:04:28 +0800500 demo/jvmti demo/zipfs javax/naming javax/script \
501 javax/smartcardio com/sun/jndi com/sun/xml sun/misc)
Weijun Wang035522b2011-09-22 12:05:26 +0800502 $(call RunAgentvmBatch)
Kelly O'Haird1258922009-11-08 15:11:10 -0800503
Weijun Wang035522b2011-09-22 12:05:26 +0800504# Stable agentvm testruns (minus items from PROBLEM_LIST)
Kelly O'Haird1258922009-11-08 15:11:10 -0800505JDK_ALL_TARGETS += jdk_net
Kelly O'Hairf5bfcb02011-12-12 08:17:28 -0800506JDK_DEFAULT_TARGETS += jdk_net
Rama Pulavarthi691add82011-03-09 15:47:15 -0800507jdk_net: $(call TestDirs, com/sun/net java/net sun/net)
Weijun Wang035522b2011-09-22 12:05:26 +0800508 $(call RunAgentvmBatch)
Kelly O'Haird1258922009-11-08 15:11:10 -0800509
Weijun Wang035522b2011-09-22 12:05:26 +0800510# Stable agentvm testruns (minus items from PROBLEM_LIST)
Kelly O'Haird1258922009-11-08 15:11:10 -0800511JDK_ALL_TARGETS += jdk_nio1
Kelly O'Hairf5bfcb02011-12-12 08:17:28 -0800512JDK_DEFAULT_TARGETS += jdk_nio1
Rama Pulavarthi691add82011-03-09 15:47:15 -0800513jdk_nio1: $(call TestDirs, java/nio/file)
Weijun Wang035522b2011-09-22 12:05:26 +0800514 $(call RunAgentvmBatch)
Kelly O'Haird1258922009-11-08 15:11:10 -0800515
Weijun Wang035522b2011-09-22 12:05:26 +0800516# Stable agentvm testruns (minus items from PROBLEM_LIST)
Kelly O'Haird1258922009-11-08 15:11:10 -0800517JDK_ALL_TARGETS += jdk_nio2
Kelly O'Hairf5bfcb02011-12-12 08:17:28 -0800518JDK_DEFAULT_TARGETS += jdk_nio2
Rama Pulavarthi691add82011-03-09 15:47:15 -0800519jdk_nio2: $(call TestDirs, java/nio/Buffer java/nio/ByteOrder \
Mandy Chung793f1072011-03-29 15:50:55 -0700520 java/nio/channels java/nio/MappedByteBuffer)
Kelly O'Haird7382802010-05-20 13:57:58 -0700521 $(call SharedLibraryPermissions,java/nio/channels)
Weijun Wang035522b2011-09-22 12:05:26 +0800522 $(call RunAgentvmBatch)
Kelly O'Hair61c09152009-12-09 09:46:57 -0800523
Weijun Wang035522b2011-09-22 12:05:26 +0800524# Stable agentvm testruns (minus items from PROBLEM_LIST)
Kelly O'Haird1258922009-11-08 15:11:10 -0800525JDK_ALL_TARGETS += jdk_nio3
Kelly O'Hairf5bfcb02011-12-12 08:17:28 -0800526JDK_DEFAULT_TARGETS += jdk_nio3
Chris Hegartyd97cf812011-06-23 13:00:14 +0100527jdk_nio3: $(call TestDirs, sun/nio)
Weijun Wang035522b2011-09-22 12:05:26 +0800528 $(call RunAgentvmBatch)
Kelly O'Haird1258922009-11-08 15:11:10 -0800529
Kelly O'Hair61c09152009-12-09 09:46:57 -0800530# All nio tests
Kelly O'Haird020b042009-11-23 09:51:52 -0800531jdk_nio: jdk_nio1 jdk_nio2 jdk_nio3
532 @$(SummaryInfo)
533
Weijun Wang035522b2011-09-22 12:05:26 +0800534# Stable agentvm testruns (minus items from PROBLEM_LIST)
Chris Hegartyd97cf812011-06-23 13:00:14 +0100535jdk_sctp: $(call TestDirs, com/sun/nio/sctp)
Weijun Wang035522b2011-09-22 12:05:26 +0800536 $(call RunAgentvmBatch)
Chris Hegartyd97cf812011-06-23 13:00:14 +0100537
Kelly O'Haird1258922009-11-08 15:11:10 -0800538# Stable othervm testruns (minus items from PROBLEM_LIST)
Weijun Wang035522b2011-09-22 12:05:26 +0800539# Using agentvm has serious problems with these tests
Kelly O'Haird1258922009-11-08 15:11:10 -0800540JDK_ALL_TARGETS += jdk_rmi
Rama Pulavarthi691add82011-03-09 15:47:15 -0800541jdk_rmi: $(call TestDirs, java/rmi javax/rmi sun/rmi)
Kelly O'Haird1258922009-11-08 15:11:10 -0800542 $(call RunOthervmBatch)
543
Weijun Wang035522b2011-09-22 12:05:26 +0800544# Stable agentvm testruns (minus items from PROBLEM_LIST)
Kelly O'Haird1258922009-11-08 15:11:10 -0800545JDK_ALL_TARGETS += jdk_security1
Kelly O'Hairf5bfcb02011-12-12 08:17:28 -0800546JDK_DEFAULT_TARGETS += jdk_security1
Rama Pulavarthi691add82011-03-09 15:47:15 -0800547jdk_security1: $(call TestDirs, java/security)
Weijun Wang035522b2011-09-22 12:05:26 +0800548 $(call RunAgentvmBatch)
Kelly O'Haird1258922009-11-08 15:11:10 -0800549
Weijun Wang035522b2011-09-22 12:05:26 +0800550# Stable agentvm testruns (minus items from PROBLEM_LIST)
Kelly O'Haird1258922009-11-08 15:11:10 -0800551JDK_ALL_TARGETS += jdk_security2
Weijun Wang5dcff732011-08-30 10:46:27 +0800552jdk_security2: $(call TestDirs, javax/crypto javax/xml/crypto com/sun/crypto)
Weijun Wang035522b2011-09-22 12:05:26 +0800553 $(call RunAgentvmBatch)
Kelly O'Hair61c09152009-12-09 09:46:57 -0800554
Weijun Wang035522b2011-09-22 12:05:26 +0800555# Stable agentvm testruns (minus items from PROBLEM_LIST)
Kelly O'Haird1258922009-11-08 15:11:10 -0800556JDK_ALL_TARGETS += jdk_security3
Weijun Wang6b8980e2011-09-08 09:04:28 +0800557jdk_security3: $(call TestDirs, com/sun/security lib/security javax/security \
558 sun/security com/sun/org/apache/xml/internal/security)
Kelly O'Haird7382802010-05-20 13:57:58 -0700559 $(call SharedLibraryPermissions,sun/security)
Weijun Wang035522b2011-09-22 12:05:26 +0800560 $(call RunAgentvmBatch)
Kelly O'Haird1258922009-11-08 15:11:10 -0800561
Kelly O'Hair61c09152009-12-09 09:46:57 -0800562# All security tests
Kelly O'Haird020b042009-11-23 09:51:52 -0800563jdk_security: jdk_security1 jdk_security2 jdk_security3
564 @$(SummaryInfo)
565
Weijun Wang035522b2011-09-22 12:05:26 +0800566# Stable agentvm testruns (minus items from PROBLEM_LIST)
Weijun Wang6b8980e2011-09-08 09:04:28 +0800567JDK_ALL_TARGETS += jdk_sound
568jdk_sound: $(call TestDirs, javax/sound)
Weijun Wang035522b2011-09-22 12:05:26 +0800569 $(call RunAgentvmBatch)
Weijun Wang6b8980e2011-09-08 09:04:28 +0800570
Kelly O'Haird1258922009-11-08 15:11:10 -0800571# Stable othervm testruns (minus items from PROBLEM_LIST)
Weijun Wang035522b2011-09-22 12:05:26 +0800572# Using agentvm has problems, and doesn't help performance as much as others.
Kelly O'Haird1258922009-11-08 15:11:10 -0800573JDK_ALL_TARGETS += jdk_swing
Weijun Wang6b8980e2011-09-08 09:04:28 +0800574jdk_swing: $(call TestDirs, javax/swing sun/java2d \
575 demo/jfc com/sun/java/swing)
Kelly O'Haird1258922009-11-08 15:11:10 -0800576 $(call RunOthervmBatch)
577
Weijun Wang035522b2011-09-22 12:05:26 +0800578# Stable agentvm testruns (minus items from PROBLEM_LIST)
Kelly O'Haird1258922009-11-08 15:11:10 -0800579JDK_ALL_TARGETS += jdk_text
Kelly O'Hairf5bfcb02011-12-12 08:17:28 -0800580JDK_DEFAULT_TARGETS += jdk_text
Rama Pulavarthi691add82011-03-09 15:47:15 -0800581jdk_text: $(call TestDirs, java/text sun/text)
Weijun Wang035522b2011-09-22 12:05:26 +0800582 $(call RunAgentvmBatch)
Kelly O'Haird1258922009-11-08 15:11:10 -0800583
Weijun Wang035522b2011-09-22 12:05:26 +0800584# Stable agentvm testruns (minus items from PROBLEM_LIST)
Kelly O'Haird1258922009-11-08 15:11:10 -0800585JDK_ALL_TARGETS += jdk_tools1
Rama Pulavarthi691add82011-03-09 15:47:15 -0800586jdk_tools1: $(call TestDirs, com/sun/jdi)
Weijun Wang035522b2011-09-22 12:05:26 +0800587 $(call RunAgentvmBatch)
Kelly O'Hair61c09152009-12-09 09:46:57 -0800588
589# Stable othervm testruns (minus items from PROBLEM_LIST)
Weijun Wang035522b2011-09-22 12:05:26 +0800590# Using agentvm has serious problems with these tests
Kelly O'Haird1258922009-11-08 15:11:10 -0800591JDK_ALL_TARGETS += jdk_tools2
Rama Pulavarthi691add82011-03-09 15:47:15 -0800592jdk_tools2: $(call TestDirs, \
593 com/sun/tools sun/jvmstat sun/tools tools vm \
594 com/sun/servicetag com/sun/tracing)
Kelly O'Haird7382802010-05-20 13:57:58 -0700595 $(call SharedLibraryPermissions,tools/launcher)
Weijun Wang035522b2011-09-22 12:05:26 +0800596 $(call RunAgentvmBatch)
Kelly O'Haird1258922009-11-08 15:11:10 -0800597
Kelly O'Hair61c09152009-12-09 09:46:57 -0800598# All tools tests
Kelly O'Haird020b042009-11-23 09:51:52 -0800599jdk_tools: jdk_tools1 jdk_tools2
600 @$(SummaryInfo)
601
Weijun Wang035522b2011-09-22 12:05:26 +0800602# Stable agentvm testruns (minus items from PROBLEM_LIST)
Kelly O'Haird1258922009-11-08 15:11:10 -0800603JDK_ALL_TARGETS += jdk_util
Kelly O'Hairf5bfcb02011-12-12 08:17:28 -0800604JDK_DEFAULT_TARGETS += jdk_util
Rama Pulavarthi691add82011-03-09 15:47:15 -0800605jdk_util: $(call TestDirs, java/util sun/util)
Weijun Wang035522b2011-09-22 12:05:26 +0800606 $(call RunAgentvmBatch)
Kelly O'Haird1258922009-11-08 15:11:10 -0800607
608# ------------------------------------------------------------------
609
Kelly O'Hairf5bfcb02011-12-12 08:17:28 -0800610# Run default tests
611jdk_default: $(JDK_DEFAULT_TARGETS)
612 @$(SummaryInfo)
613
Kelly O'Haird1258922009-11-08 15:11:10 -0800614# Run all tests
Kelly O'Hairf5bfcb02011-12-12 08:17:28 -0800615jdk_all: $(JDK_ALL_TARGETS)
Kelly O'Haird1258922009-11-08 15:11:10 -0800616 @$(SummaryInfo)
617
618# These are all phony targets
619PHONY_LIST += $(JDK_ALL_TARGETS)
620
621# ------------------------------------------------------------------
622
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700623# Default JTREG to run (win32 script works for everybody)
624JTREG = $(JT_HOME)/win32/bin/jtreg
Weijun Wang035522b2011-09-22 12:05:26 +0800625# Add any extra options (agentvm etc.)
Kelly O'Haird1258922009-11-08 15:11:10 -0800626JTREG_BASIC_OPTIONS += $(EXTRA_JTREG_OPTIONS)
627# Only run automatic tests
628JTREG_BASIC_OPTIONS += -a
Kelly O'Haird44fe662009-12-11 15:29:22 -0800629# Always turn on assertions
630JTREG_ASSERT_OPTION = -ea -esa
631JTREG_BASIC_OPTIONS += $(JTREG_ASSERT_OPTION)
Kelly O'Haird1258922009-11-08 15:11:10 -0800632# Report details on all failed or error tests, times too
633JTREG_BASIC_OPTIONS += -v:fail,error,time
634# Retain all files for failing tests
635JTREG_BASIC_OPTIONS += -retain:fail,error
636# Ignore tests are not run and completely silent about it
Kelly O'Haird44fe662009-12-11 15:29:22 -0800637JTREG_IGNORE_OPTION = -ignore:quiet
638JTREG_BASIC_OPTIONS += $(JTREG_IGNORE_OPTION)
Kelly O'Hair61c09152009-12-09 09:46:57 -0800639# Multiple by 4 the timeout numbers
Kelly O'Haird44fe662009-12-11 15:29:22 -0800640JTREG_TIMEOUT_OPTION = -timeoutFactor:4
641JTREG_BASIC_OPTIONS += $(JTREG_TIMEOUT_OPTION)
Kelly O'Haird1258922009-11-08 15:11:10 -0800642# Boost the max memory for jtreg to avoid gc thrashing
Kelly O'Haird44fe662009-12-11 15:29:22 -0800643JTREG_MEMORY_OPTION = -J-Xmx512m
644JTREG_BASIC_OPTIONS += $(JTREG_MEMORY_OPTION)
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700645
Kelly O'Haird1258922009-11-08 15:11:10 -0800646# Make sure jtreg exists
647$(JTREG): $(JT_HOME)
648
649# Run jtreg
650jtreg_tests: prep $(PRODUCT_HOME) $(JTREG) $(EXCLUDELIST)
651 @$(EXPAND) $(EXCLUDELIST) \
652 | $(CUT) -d' ' -f1 \
653 | $(SED) -e 's@^@Excluding: @'
654 ( \
655 ( JT_HOME=$(shell $(GETMIXEDPATH) "$(JT_HOME)"); \
656 export JT_HOME; \
Kelly O'Haird1258922009-11-08 15:11:10 -0800657 $(shell $(GETMIXEDPATH) "$(JTREG)") \
658 $(JTREG_BASIC_OPTIONS) \
659 -r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTreport \
660 -w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTwork \
661 -jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \
662 -exclude:$(shell $(GETMIXEDPATH) "$(EXCLUDELIST)") \
663 $(JTREG_TEST_OPTIONS) \
664 $(TESTDIRS) \
665 ) ; $(BUNDLE_UP_AND_EXIT) \
Kelly O'Hair0ce235a2009-12-01 08:51:16 -0800666 ) 2>&1 | $(TEE) $(ABS_TEST_OUTPUT_DIR)/output.txt ; $(TESTEXIT)
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700667
Kelly O'Haird7382802010-05-20 13:57:58 -0700668# Rule that may change execute permissions on shared library files.
669# Files in repositories should never have execute permissions, but there
670# are some tests that have pre-built shared libraries, and these windows
671# dll files must have execute permission. Adding execute permission
672# may happen automatically on windows when using certain versions of mercurial
673# but it cannot be guaranteed. And blindly adding execute permission might
674# be seen as a mercurial 'change', so we avoid adding execute permission to
675# repository files. But testing from a plain source tree needs the chmod a+rx.
676# Used on select directories and applying the chmod to all shared libraries
677# not just dll files. On windows, this may not work with MKS if the files
678# were installed with CYGWIN unzip or untar (MKS chmod may not do anything).
679# And with CYGWIN and sshd service, you may need CYGWIN=ntsec for this to work.
680#
681shared_library_permissions: $(SHARED_LIBRARY_DIR)
682 if [ ! -d $(TEST_ROOT)/../.hg ] ; then \
683 $(FIND) $< \( -name \*.dll -o -name \*.DLL -o -name \*.so \) \
684 -exec $(CHMOD) a+rx {} \; ; \
685 fi
686
687PHONY_LIST += jtreg_tests shared_library_permissions
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700688
689################################################################
690
691# packtest
692
693# Expect JPRT to set JPRT_PACKTEST_HOME.
694PACKTEST_HOME = /net/jprt-web.sfbay.sun.com/jprt/allproducts/packtest
695ifdef JPRT_PACKTEST_HOME
696 PACKTEST_HOME = $(JPRT_PACKTEST_HOME)
697endif
698
699packtest: prep $(PACKTEST_HOME)/ptest $(PRODUCT_HOME)
700 ( $(CD) $(PACKTEST_HOME) && \
701 $(PACKTEST_HOME)/ptest \
702 -t "$(PRODUCT_HOME)" \
703 $(PACKTEST_STRESS_OPTION) \
704 $(EXTRA_PACKTEST_OPTIONS) \
705 -W $(ABS_TEST_OUTPUT_DIR) \
706 $(JAVA_ARGS:%=-J %) \
707 $(JAVA_VM_ARGS:%=-J %) \
708 ) ; $(BUNDLE_UP_AND_EXIT)
709
710packtest_stress: PACKTEST_STRESS_OPTION=-s
711packtest_stress: packtest
712
713PHONY_LIST += packtest packtest_stress
714
715################################################################
716
Mandy Chung793f1072011-03-29 15:50:55 -0700717# perftest to collect statistics
Mandy Chunge2f72482009-05-26 17:47:57 -0700718
719# Expect JPRT to set JPRT_PACKTEST_HOME.
Kelly O'Haird7382802010-05-20 13:57:58 -0700720PERFTEST_HOME = $(TEST_ROOT)/perf
Mandy Chunge2f72482009-05-26 17:47:57 -0700721ifdef JPRT_PERFTEST_HOME
722 PERFTEST_HOME = $(JPRT_PERFTEST_HOME)
723endif
724
725perftest: ( $(PERFTEST_HOME)/perftest \
726 -t $(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \
727 -w $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)") \
728 -h $(PERFTEST_HOME) \
729 ) ; $(BUNDLE_UP_AND_EXIT)
730
731
732PHONY_LIST += perftest
733
734################################################################
735
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700736# vmsqe tests
737
738# Expect JPRT to set JPRT_VMSQE_HOME.
Kelly O'Hair119b6472011-03-22 11:08:09 -0700739VMSQE_HOME = $(SLASH_JAVA)/sqe/comp/vm/testbase/sqe/vm/current/build/latest/vm
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700740ifdef JPRT_VMSQE_HOME
741 VMSQE_HOME = $(JPRT_VMSQE_HOME)
742endif
743
744# Expect JPRT to set JPRT_RUNVMSQE_HOME.
745RUNVMSQE_HOME = /net/jprt-web.sfbay.sun.com/jprt/allproducts/runvmsqe
746ifdef JPRT_RUNVMSQE_HOME
747 RUNVMSQE_HOME = $(JPRT_RUNVMSQE_HOME)
748endif
749
750# Expect JPRT to set JPRT_TONGA3_HOME.
Kelly O'Hair119b6472011-03-22 11:08:09 -0700751TONGA3_HOME = $(SLASH_JAVA)/sqe/tools/gtee/harness/tonga
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700752ifdef JPRT_TONGA3_HOME
753 TONGA3_HOME = $(JPRT_TONGA3_HOME)
754endif
755
756RUNVMSQE_BIN = $(RUNVMSQE_HOME)/bin/runvmsqe
757
758vmsqe_tests: prep $(VMSQE_HOME)/vm $(TONGA3_HOME) $(RUNVMSQE_BIN) $(PRODUCT_HOME)
759 $(RM) -r $(ABS_TEST_OUTPUT_DIR)/vmsqe
760 ( $(CD) $(ABS_TEST_OUTPUT_DIR) && \
761 $(RUNVMSQE_BIN) \
762 -jdk "$(PRODUCT_HOME)" \
763 -o "$(ABS_TEST_OUTPUT_DIR)/vmsqe" \
764 -testbase "$(VMSQE_HOME)/vm" \
765 -tonga "$(TONGA3_HOME)" \
766 -tongajdk "$(ALT_BOOTDIR)" \
767 $(JAVA_ARGS) \
768 $(JAVA_VM_ARGS) \
769 $(RUNVMSQE_TEST_OPTION) \
770 $(EXTRA_RUNVMSQE_OPTIONS) \
771 ) ; $(BUNDLE_UP_AND_EXIT)
772
773vmsqe_jdwp: RUNVMSQE_TEST_OPTION=-jdwp
774vmsqe_jdwp: vmsqe_tests
775
776vmsqe_jdi: RUNVMSQE_TEST_OPTION=-jdi
777vmsqe_jdi: vmsqe_tests
778
779vmsqe_jdb: RUNVMSQE_TEST_OPTION=-jdb
780vmsqe_jdb: vmsqe_tests
781
782vmsqe_quick-jdi: RUNVMSQE_TEST_OPTION=-quick-jdi
783vmsqe_quick-jdi: vmsqe_tests
784
785vmsqe_sajdi: RUNVMSQE_TEST_OPTION=-sajdi
786vmsqe_sajdi: vmsqe_tests
787
788vmsqe_jvmti: RUNVMSQE_TEST_OPTION=-jvmti
789vmsqe_jvmti: vmsqe_tests
790
791vmsqe_hprof: RUNVMSQE_TEST_OPTION=-hprof
792vmsqe_hprof: vmsqe_tests
793
794vmsqe_monitoring: RUNVMSQE_TEST_OPTION=-monitoring
795vmsqe_monitoring: vmsqe_tests
796
797PHONY_LIST += vmsqe_jdwp vmsqe_jdi vmsqe_jdb vmsqe_quick-jdi vmsqe_sajdi \
798 vmsqe_jvmti vmsqe_hprof vmsqe_monitoring vmsqe_tests
799
800################################################################
801
802# jck tests
803
Kelly O'Hair119b6472011-03-22 11:08:09 -0700804# Default is to use jck 7 from /java/re
805JCK7_DEFAULT_HOME = $(SLASH_JAVA)/re/jck/7/promoted/latest/binaries
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700806
807# Expect JPRT to set JPRT_JCK7COMPILER_HOME.
Kelly O'Hair119b6472011-03-22 11:08:09 -0700808JCK7COMPILER_HOME = $(JCK7_DEFAULT_HOME)/JCK-compiler-7
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700809ifdef JPRT_JCK7COMPILER_HOME
Kelly O'Hair119b6472011-03-22 11:08:09 -0700810 JCK7COMPILER_HOME = $(JPRT_JCK7COMPILER_HOME)/JCK-compiler-7
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700811endif
812
813# Expect JPRT to set JPRT_JCK7RUNTIME_HOME.
Kelly O'Hair119b6472011-03-22 11:08:09 -0700814JCK7RUNTIME_HOME = $(JCK7_DEFAULT_HOME)/JCK-runtime-7
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700815ifdef JPRT_JCK7RUNTIME_HOME
Kelly O'Hair119b6472011-03-22 11:08:09 -0700816 JCK7RUNTIME_HOME = $(JPRT_JCK7RUNTIME_HOME)/JCK-runtime-7
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700817endif
818
819# Expect JPRT to set JPRT_JCK7DEVTOOLS_HOME.
Kelly O'Hair119b6472011-03-22 11:08:09 -0700820JCK7DEVTOOLS_HOME = $(JCK7_DEFAULT_HOME)/JCK-devtools-7
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700821ifdef JPRT_JCK7DEVTOOLS_HOME
Kelly O'Hair119b6472011-03-22 11:08:09 -0700822 JCK7DEVTOOLS_HOME = $(JPRT_JCK7DEVTOOLS_HOME)/JCK-devtools-7
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700823endif
824
Kelly O'Hair119b6472011-03-22 11:08:09 -0700825# The jtjck.jar utility to use to run the tests
826JTJCK_JAR = $(JCK_HOME)/lib/jtjck.jar
827JTJCK_JAVA_ARGS = -XX:MaxPermSize=256m -Xmx512m
Weijun Wang6b8980e2011-09-08 09:04:28 +0800828JTJCK_OPTIONS = -headless -v
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700829
Kelly O'Hair119b6472011-03-22 11:08:09 -0700830# Default tests to run
831ifndef JCK_COMPILER_TESTS
Weijun Wang6b8980e2011-09-08 09:04:28 +0800832 JCK_COMPILER_TESTS =
Kelly O'Hair119b6472011-03-22 11:08:09 -0700833endif
834ifndef JCK_RUNTIME_TESTS
Weijun Wang6b8980e2011-09-08 09:04:28 +0800835 JCK_RUNTIME_TESTS =
Kelly O'Hair119b6472011-03-22 11:08:09 -0700836endif
837ifndef JCK_DEVTOOLS_TESTS
Weijun Wang6b8980e2011-09-08 09:04:28 +0800838 JCK_DEVTOOLS_TESTS =
Kelly O'Hair119b6472011-03-22 11:08:09 -0700839endif
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700840
Kelly O'Hair119b6472011-03-22 11:08:09 -0700841# Generic rule used to run jck tests
842_generic_jck_tests: prep $(PRODUCT_HOME) $(EXCLUDELIST)
843 @$(EXPAND) $(EXCLUDELIST) \
844 | $(CUT) -d' ' -f1 \
845 | $(SED) -e 's@^@Excluding: @'
846 ( $(CD) $(ABS_TEST_OUTPUT_DIR) && \
847 $(PRODUCT_HOME)/bin/java $(JTJCK_JAVA_ARGS) \
848 -jar "$(JTJCK_JAR)" \
849 $(JTJCK_OPTIONS) \
850 -r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTreport \
851 -w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTwork \
852 -jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \
853 $(TESTDIRS) \
854 ) ; $(BUNDLE_UP_AND_EXIT)
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700855
Kelly O'Hair119b6472011-03-22 11:08:09 -0700856# JCK7 compiler tests
857jck7compiler:
858 $(MAKE) UNIQUE_DIR=$@ \
859 JCK_HOME=$(JCK7COMPILER_HOME) \
860 TESTDIRS="$(JCK_COMPILER_TESTS)" \
861 _generic_jck_tests
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700862
Kelly O'Hair119b6472011-03-22 11:08:09 -0700863# JCK7 runtime tests
Weijun Wang6b8980e2011-09-08 09:04:28 +0800864jck7runtime:
Kelly O'Hair119b6472011-03-22 11:08:09 -0700865 $(MAKE) UNIQUE_DIR=$@ \
866 JCK_HOME=$(JCK7RUNTIME_HOME) \
867 TESTDIRS="$(JCK_RUNTIME_TESTS)" \
868 _generic_jck_tests
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700869
Kelly O'Hair119b6472011-03-22 11:08:09 -0700870# JCK7 devtools tests
Weijun Wang6b8980e2011-09-08 09:04:28 +0800871jck7devtools:
Kelly O'Hair119b6472011-03-22 11:08:09 -0700872 $(MAKE) UNIQUE_DIR=$@ \
873 JCK_HOME=$(JCK7DEVTOOLS_HOME) \
874 TESTDIRS="$(JCK_DEVTOOLS_TESTS)" \
875 _generic_jck_tests
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700876
Kelly O'Hair119b6472011-03-22 11:08:09 -0700877# Run all 3 sets of JCK7 tests
878jck_all: jck7runtime jck7devtools jck7compiler
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700879
Kelly O'Hair119b6472011-03-22 11:08:09 -0700880PHONY_LIST += jck_all _generic_jck_tests \
881 jck7compiler jck7runtime jck7devtools
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700882
883################################################################
J. Duke319a3b92007-12-01 00:00:00 +0000884
885# Phony targets (e.g. these are not filenames)
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700886.PHONY: all clean prep $(PHONY_LIST)
887
888################################################################
J. Duke319a3b92007-12-01 00:00:00 +0000889