blob: ad4ca160486a784a2931b079783ae225363a7bb7 [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001#
Kelly O'Hairfe008ae2010-05-25 15:58:33 -07002# Copyright (c) 1995, 2010, 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) \
264 && $(ZIP) -q -r $(ARCHIVE_BUNDLE) . )
Kelly O'Haird1258922009-11-08 15:11:10 -0800265SUMMARY_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTreport/text/summary.txt
266STATS_TXT_NAME = Stats.txt
267STATS_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/$(STATS_TXT_NAME)
268RUNLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/runlist.txt
269PASSLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/passlist.txt
270FAILLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/faillist.txt
Kelly O'Hair0ce235a2009-12-01 08:51:16 -0800271EXITCODE = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/exitcode.txt
272
273TESTEXIT = \
274 if [ ! -s $(EXITCODE) ] ; then \
275 $(ECHO) "ERROR: EXITCODE file not filled in."; \
276 $(ECHO) "1" > $(EXITCODE); \
277 fi ; \
278 testExitCode=`$(CAT) $(EXITCODE)`; \
279 $(ECHO) "EXIT CODE: $${testExitCode}"; \
Kelly O'Hair61c09152009-12-09 09:46:57 -0800280 exit $${testExitCode}
Kelly O'Hair0ce235a2009-12-01 08:51:16 -0800281
Kelly O'Haird1258922009-11-08 15:11:10 -0800282BUNDLE_UP_AND_EXIT = \
283( \
Kelly O'Hair0ce235a2009-12-01 08:51:16 -0800284 jtregExitCode=$$? && \
Kelly O'Haird1258922009-11-08 15:11:10 -0800285 _summary="$(SUMMARY_TXT)"; \
Kelly O'Hair0ce235a2009-12-01 08:51:16 -0800286 $(RM) -f $(STATS_TXT) $(RUNLIST) $(PASSLIST) $(FAILLIST) $(EXITCODE); \
287 $(ECHO) "$${jtregExitCode}" > $(EXITCODE); \
Kelly O'Haird1258922009-11-08 15:11:10 -0800288 if [ -r "$${_summary}" ] ; then \
Kelly O'Hair61c09152009-12-09 09:46:57 -0800289 $(ECHO) "Summary: $(UNIQUE_DIR)" > $(STATS_TXT); \
Kelly O'Haird1258922009-11-08 15:11:10 -0800290 $(EXPAND) $${_summary} | $(EGREP) -v ' Not run\.' > $(RUNLIST); \
291 $(EGREP) ' Passed\.' $(RUNLIST) \
292 | $(EGREP) -v ' Error\.' \
293 | $(EGREP) -v ' Failed\.' > $(PASSLIST); \
294 ( $(EGREP) ' Failed\.' $(RUNLIST); \
295 $(EGREP) ' Error\.' $(RUNLIST); \
296 $(EGREP) -v ' Passed\.' $(RUNLIST) ) \
297 | $(SORT) | $(UNIQ) > $(FAILLIST); \
Kelly O'Hair0ce235a2009-12-01 08:51:16 -0800298 if [ $${jtregExitCode} != 0 -o -s $(FAILLIST) ] ; then \
Kelly O'Haird1258922009-11-08 15:11:10 -0800299 $(EXPAND) $(FAILLIST) \
300 | $(CUT) -d' ' -f1 \
301 | $(SED) -e 's@^@FAILED: @' >> $(STATS_TXT); \
Kelly O'Hair0ce235a2009-12-01 08:51:16 -0800302 if [ $${jtregExitCode} = 0 ] ; then \
303 jtregExitCode=1; \
304 fi; \
Kelly O'Haird1258922009-11-08 15:11:10 -0800305 fi; \
306 runc="`$(CAT) $(RUNLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
307 passc="`$(CAT) $(PASSLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
308 failc="`$(CAT) $(FAILLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
309 exclc="`$(CAT) $(EXCLUDELIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
Kelly O'Hairb383b9b2010-06-20 14:53:36 -0700310 $(ECHO) "TEST STATS: name=$(UNIQUE_DIR) run=$${runc} pass=$${passc} fail=$${failc} excluded=$${exclc}" \
Kelly O'Haird1258922009-11-08 15:11:10 -0800311 >> $(STATS_TXT); \
312 else \
313 $(ECHO) "Missing file: $${_summary}" >> $(STATS_TXT); \
314 fi; \
315 $(CAT) $(STATS_TXT); \
Kelly O'Haire4fce692010-03-06 14:59:23 -0800316 $(ZIP_UP_RESULTS) ; \
Kelly O'Hair0ce235a2009-12-01 08:51:16 -0800317 $(TESTEXIT) \
Kelly O'Haird1258922009-11-08 15:11:10 -0800318)
J. Duke319a3b92007-12-01 00:00:00 +0000319
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700320################################################################
J. Duke319a3b92007-12-01 00:00:00 +0000321
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700322# Default make rule (runs jtreg_tests)
323all: jtreg_tests
324 @$(ECHO) "Testing completed successfully"
J. Duke319a3b92007-12-01 00:00:00 +0000325
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700326# Prep for output
327prep: clean
328 @$(MKDIR) -p $(ABS_TEST_OUTPUT_DIR)
Kelly O'Hairb383b9b2010-06-20 14:53:36 -0700329 @$(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)`
J. Duke319a3b92007-12-01 00:00:00 +0000330
331# Cleanup
332clean:
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700333 $(RM) -r $(ABS_TEST_OUTPUT_DIR)
334 $(RM) $(ARCHIVE_BUNDLE)
J. Duke319a3b92007-12-01 00:00:00 +0000335
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700336################################################################
337
338# jtreg tests
339
340# Expect JT_HOME to be set for jtreg tests. (home for jtreg)
Kelly O'Haird020b042009-11-23 09:51:52 -0800341ifndef JT_HOME
342 JT_HOME = $(SLASH_JAVA)/re/jtreg/4.0/promoted/latest/binaries/jtreg
343 ifdef JPRT_JTREG_HOME
344 JT_HOME = $(JPRT_JTREG_HOME)
345 endif
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700346endif
347
348# Expect JPRT to set TESTDIRS to the jtreg test dirs
349ifndef TESTDIRS
Kelly O'Haird1258922009-11-08 15:11:10 -0800350 TESTDIRS = demo
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700351endif
352
Kelly O'Haird1258922009-11-08 15:11:10 -0800353# Samevm settings (default is false)
354ifndef USE_JTREG_SAMEVM
355 USE_JTREG_SAMEVM=false
356endif
357# With samevm, you cannot use -javaoptions?
358ifeq ($(USE_JTREG_SAMEVM),true)
Kelly O'Haird44fe662009-12-11 15:29:22 -0800359 JTREG_SAMEVM_OPTION = -samevm
360 EXTRA_JTREG_OPTIONS += $(JTREG_SAMEVM_OPTION) $(JAVA_ARGS) $(JAVA_ARGS:%=-vmoption:%)
Kelly O'Haird1258922009-11-08 15:11:10 -0800361 JTREG_TEST_OPTIONS = $(JAVA_VM_ARGS:%=-vmoption:%)
362else
363 JTREG_TEST_OPTIONS = $(JAVA_ARGS:%=-javaoptions:%) $(JAVA_VM_ARGS:%=-vmoption:%)
364endif
365
366# Some tests annoy me and fail frequently
367PROBLEM_LIST=ProblemList.txt
Kelly O'Haird020b042009-11-23 09:51:52 -0800368PROBLEM_LISTS=$(PROBLEM_LIST) $(wildcard closed/$(PROBLEM_LIST))
Kelly O'Haird1258922009-11-08 15:11:10 -0800369EXCLUDELIST=$(ABS_TEST_OUTPUT_DIR)/excludelist.txt
370
371# Create exclude list for this platform and arch
372ifdef NO_EXCLUDES
Kelly O'Haird020b042009-11-23 09:51:52 -0800373$(EXCLUDELIST): $(PROBLEM_LISTS) $(TESTDIRS)
Kelly O'Haird1258922009-11-08 15:11:10 -0800374 @$(ECHO) "NOTHING_EXCLUDED" > $@
375else
Kelly O'Haird020b042009-11-23 09:51:52 -0800376$(EXCLUDELIST): $(PROBLEM_LISTS) $(TESTDIRS)
Kelly O'Haird1258922009-11-08 15:11:10 -0800377 @$(RM) $@ $@.temp1 $@.temp2
Kelly O'Haird020b042009-11-23 09:51:52 -0800378 @(($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-all' ) ;\
Kelly O'Hairb383b9b2010-06-20 14:53:36 -0700379 ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(PLATFORM_OS)' ) ;\
Kelly O'Hair79132952010-03-12 09:03:02 -0800380 ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-$(OS_ARCH2)' ) ;\
Kelly O'Haird020b042009-11-23 09:51:52 -0800381 ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-$(OS_VERSION)') ;\
382 ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-$(OS_ARCH)' ) ;\
Kelly O'Hair79132952010-03-12 09:03:02 -0800383 ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-$(OS_ARCH2)' ) ;\
Kelly O'Haird020b042009-11-23 09:51:52 -0800384 ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-all' ) ;\
385 ($(ECHO) "#") ;\
Kelly O'Haird1258922009-11-08 15:11:10 -0800386 ) | $(SED) -e 's@^[\ ]*@@' \
387 | $(EGREP) -v '^#' > $@.temp1
388 @for tdir in $(TESTDIRS) ; do \
389 ( ( $(CAT) $@.temp1 | $(EGREP) "^$${tdir}" ) ; $(ECHO) "#" ) >> $@.temp2 ; \
390 done
391 @$(ECHO) "# at least one line" >> $@.temp2
392 @( $(EGREP) -v '^#' $@.temp2 ; true ) > $@
393 @$(ECHO) "Excluding list contains `$(EXPAND) $@ | $(WC) -l` items"
394endif
395
Kelly O'Haird020b042009-11-23 09:51:52 -0800396# Select list of directories that exist
397define TestDirs
398$(foreach i,$1,$(wildcard ${i})) $(foreach i,$1,$(wildcard closed/${i}))
399endef
Kelly O'Haird1258922009-11-08 15:11:10 -0800400# Running batches of tests with or without samevm
401define RunSamevmBatch
Kelly O'Haird020b042009-11-23 09:51:52 -0800402$(ECHO) "Running tests in samevm mode: $(call TestDirs, $?)"
403$(MAKE) TESTDIRS="$(call TestDirs, $?)" USE_JTREG_SAMEVM=true UNIQUE_DIR=$@ jtreg_tests
Kelly O'Haird1258922009-11-08 15:11:10 -0800404endef
405define RunOthervmBatch
Kelly O'Haird020b042009-11-23 09:51:52 -0800406$(ECHO) "Running tests in othervm mode: $(call TestDirs, $?)"
407$(MAKE) TESTDIRS="$(call TestDirs, $?)" USE_JTREG_SAMEVM=false UNIQUE_DIR=$@ jtreg_tests
Kelly O'Haird1258922009-11-08 15:11:10 -0800408endef
409define SummaryInfo
Kelly O'Hair61c09152009-12-09 09:46:57 -0800410$(ECHO) "########################################################"
Kelly O'Haird1258922009-11-08 15:11:10 -0800411$(CAT) $(?:%=$(ABS_TEST_OUTPUT_DIR)/%/$(STATS_TXT_NAME))
Kelly O'Hair61c09152009-12-09 09:46:57 -0800412$(ECHO) "########################################################"
Kelly O'Haird1258922009-11-08 15:11:10 -0800413endef
414
415# ------------------------------------------------------------------
416
417# Batches of tests (somewhat arbitrary assigments to jdk_* targets)
418JDK_ALL_TARGETS =
419
420# Stable othervm testruns (minus items from PROBLEM_LIST)
421# Using samevm has problems, and doesn't help performance as much as others.
422JDK_ALL_TARGETS += jdk_awt
423jdk_awt: com/sun/awt java/awt sun/awt
424 $(call RunOthervmBatch)
425
426# Stable samevm testruns (minus items from PROBLEM_LIST)
427JDK_ALL_TARGETS += jdk_beans1
428jdk_beans1: java/beans/beancontext java/beans/PropertyChangeSupport \
429 java/beans/Introspector java/beans/Performance \
430 java/beans/VetoableChangeSupport java/beans/Statement
431 $(call RunSamevmBatch)
432
433# Stable othervm testruns (minus items from PROBLEM_LIST)
434# Using samevm has serious problems with these tests
435JDK_ALL_TARGETS += jdk_beans2
436jdk_beans2: java/beans/Beans java/beans/EventHandler java/beans/XMLDecoder \
437 java/beans/PropertyEditor
438 $(call RunOthervmBatch)
Kelly O'Hair61c09152009-12-09 09:46:57 -0800439
440# Stable othervm testruns (minus items from PROBLEM_LIST)
441# Using samevm has serious problems with these tests
Kelly O'Haird1258922009-11-08 15:11:10 -0800442JDK_ALL_TARGETS += jdk_beans3
443jdk_beans3: java/beans/XMLEncoder
444 $(call RunOthervmBatch)
445
Kelly O'Hair61c09152009-12-09 09:46:57 -0800446# All beans tests
Kelly O'Haird020b042009-11-23 09:51:52 -0800447jdk_beans: jdk_beans1 jdk_beans2 jdk_beans3
448 @$(SummaryInfo)
449
Kelly O'Haird1258922009-11-08 15:11:10 -0800450# Stable samevm testruns (minus items from PROBLEM_LIST)
451JDK_ALL_TARGETS += jdk_io
452jdk_io: java/io
453 $(call RunSamevmBatch)
454
455# Stable samevm testruns (minus items from PROBLEM_LIST)
456JDK_ALL_TARGETS += jdk_lang
457jdk_lang: java/lang
458 $(call RunSamevmBatch)
459
460# Stable othervm testruns (minus items from PROBLEM_LIST)
461# Using samevm has serious problems with these tests
462JDK_ALL_TARGETS += jdk_management1
463jdk_management1: javax/management
464 $(call RunOthervmBatch)
465
466# Stable othervm testruns (minus items from PROBLEM_LIST)
467# Using samevm has serious problems with these tests
468JDK_ALL_TARGETS += jdk_management2
469jdk_management2: com/sun/jmx com/sun/management sun/management
470 $(call RunOthervmBatch)
471
Kelly O'Hair61c09152009-12-09 09:46:57 -0800472# All management tests
Kelly O'Haird020b042009-11-23 09:51:52 -0800473jdk_management: jdk_management1 jdk_management2
474 @$(SummaryInfo)
475
Kelly O'Haird1258922009-11-08 15:11:10 -0800476# Stable samevm testruns (minus items from PROBLEM_LIST)
477JDK_ALL_TARGETS += jdk_math
478jdk_math: java/math
479 $(call RunSamevmBatch)
480
481# Stable samevm testruns (minus items from PROBLEM_LIST)
482JDK_ALL_TARGETS += jdk_misc
483jdk_misc: demo javax/imageio javax/naming javax/print javax/script \
484 javax/smartcardio javax/sound com/sun/java com/sun/jndi \
485 com/sun/org sun/misc sun/pisces
486 $(call RunSamevmBatch)
487
488# Stable samevm testruns (minus items from PROBLEM_LIST)
489JDK_ALL_TARGETS += jdk_net
490jdk_net: com/sun/net java/net sun/net
491 $(call RunSamevmBatch)
492
493# Stable samevm testruns (minus items from PROBLEM_LIST)
494JDK_ALL_TARGETS += jdk_nio1
495jdk_nio1: java/nio/file
496 $(call RunSamevmBatch)
497
498# Stable othervm testruns (minus items from PROBLEM_LIST)
499# Using samevm has serious problems with these tests
500JDK_ALL_TARGETS += jdk_nio2
501jdk_nio2: java/nio/Buffer java/nio/ByteOrder \
502 java/nio/channels java/nio/BufferPoolMXBean java/nio/MappedByteBuffer
Kelly O'Haird7382802010-05-20 13:57:58 -0700503 $(call SharedLibraryPermissions,java/nio/channels)
Kelly O'Haird1258922009-11-08 15:11:10 -0800504 $(call RunOthervmBatch)
Kelly O'Hair61c09152009-12-09 09:46:57 -0800505
506# Stable othervm testruns (minus items from PROBLEM_LIST)
507# Using samevm has serious problems with these tests
Kelly O'Haird1258922009-11-08 15:11:10 -0800508JDK_ALL_TARGETS += jdk_nio3
509jdk_nio3: com/sun/nio sun/nio
510 $(call RunOthervmBatch)
511
Kelly O'Hair61c09152009-12-09 09:46:57 -0800512# All nio tests
Kelly O'Haird020b042009-11-23 09:51:52 -0800513jdk_nio: jdk_nio1 jdk_nio2 jdk_nio3
514 @$(SummaryInfo)
515
Kelly O'Haird1258922009-11-08 15:11:10 -0800516# Stable othervm testruns (minus items from PROBLEM_LIST)
517# Using samevm has serious problems with these tests
518JDK_ALL_TARGETS += jdk_rmi
519jdk_rmi: java/rmi javax/rmi sun/rmi
520 $(call RunOthervmBatch)
521
522# Stable samevm testruns (minus items from PROBLEM_LIST)
523JDK_ALL_TARGETS += jdk_security1
524jdk_security1: java/security
525 $(call RunSamevmBatch)
526
527# Stable othervm testruns (minus items from PROBLEM_LIST)
528# Using samevm has serious problems with these tests
529JDK_ALL_TARGETS += jdk_security2
530jdk_security2: javax/crypto com/sun/crypto
531 $(call RunOthervmBatch)
Kelly O'Hair61c09152009-12-09 09:46:57 -0800532
533# Stable othervm testruns (minus items from PROBLEM_LIST)
534# Using samevm has serious problems with these tests
Kelly O'Haird1258922009-11-08 15:11:10 -0800535JDK_ALL_TARGETS += jdk_security3
536jdk_security3: com/sun/security lib/security javax/security sun/security
Kelly O'Haird7382802010-05-20 13:57:58 -0700537 $(call SharedLibraryPermissions,sun/security)
Kelly O'Haird1258922009-11-08 15:11:10 -0800538 $(call RunOthervmBatch)
539
Kelly O'Hair61c09152009-12-09 09:46:57 -0800540# All security tests
Kelly O'Haird020b042009-11-23 09:51:52 -0800541jdk_security: jdk_security1 jdk_security2 jdk_security3
542 @$(SummaryInfo)
543
Kelly O'Haird1258922009-11-08 15:11:10 -0800544# Stable othervm testruns (minus items from PROBLEM_LIST)
545# Using samevm has problems, and doesn't help performance as much as others.
546JDK_ALL_TARGETS += jdk_swing
547jdk_swing: javax/swing sun/java2d
548 $(call RunOthervmBatch)
549
550# Stable samevm testruns (minus items from PROBLEM_LIST)
551JDK_ALL_TARGETS += jdk_text
552jdk_text: java/text sun/text
553 $(call RunSamevmBatch)
554
Kelly O'Hair61c09152009-12-09 09:46:57 -0800555# Stable samevm testruns (minus items from PROBLEM_LIST)
Kelly O'Haird1258922009-11-08 15:11:10 -0800556JDK_ALL_TARGETS += jdk_tools1
557jdk_tools1: com/sun/jdi
Kelly O'Hair547328d2009-11-25 08:24:58 -0800558 $(call RunSamevmBatch)
Kelly O'Hair61c09152009-12-09 09:46:57 -0800559
560# Stable othervm testruns (minus items from PROBLEM_LIST)
561# Using samevm has serious problems with these tests
Kelly O'Haird1258922009-11-08 15:11:10 -0800562JDK_ALL_TARGETS += jdk_tools2
563jdk_tools2: com/sun/tools sun/jvmstat sun/tools tools vm com/sun/servicetag com/sun/tracing
Kelly O'Haird7382802010-05-20 13:57:58 -0700564 $(call SharedLibraryPermissions,tools/launcher)
Kelly O'Hairb383b9b2010-06-20 14:53:36 -0700565 $(call RunSamevmBatch)
Kelly O'Haird1258922009-11-08 15:11:10 -0800566
Kelly O'Hair61c09152009-12-09 09:46:57 -0800567# All tools tests
Kelly O'Haird020b042009-11-23 09:51:52 -0800568jdk_tools: jdk_tools1 jdk_tools2
569 @$(SummaryInfo)
570
Kelly O'Haird1258922009-11-08 15:11:10 -0800571# Stable samevm testruns (minus items from PROBLEM_LIST)
572JDK_ALL_TARGETS += jdk_util
573jdk_util: java/util sun/util
574 $(call RunSamevmBatch)
575
576# ------------------------------------------------------------------
577
578# Run all tests
Kelly O'Hair61c09152009-12-09 09:46:57 -0800579FILTER_OUT_LIST=jdk_awt jdk_rmi jdk_swing
580JDK_ALL_STABLE_TARGETS := $(filter-out $(FILTER_OUT_LIST), $(JDK_ALL_TARGETS))
581jdk_all: $(JDK_ALL_STABLE_TARGETS)
Kelly O'Haird1258922009-11-08 15:11:10 -0800582 @$(SummaryInfo)
583
584# These are all phony targets
585PHONY_LIST += $(JDK_ALL_TARGETS)
586
587# ------------------------------------------------------------------
588
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700589# Default JTREG to run (win32 script works for everybody)
590JTREG = $(JT_HOME)/win32/bin/jtreg
Kelly O'Haird1258922009-11-08 15:11:10 -0800591# Add any extra options (samevm etc.)
592JTREG_BASIC_OPTIONS += $(EXTRA_JTREG_OPTIONS)
593# Only run automatic tests
594JTREG_BASIC_OPTIONS += -a
Kelly O'Haird44fe662009-12-11 15:29:22 -0800595# Always turn on assertions
596JTREG_ASSERT_OPTION = -ea -esa
597JTREG_BASIC_OPTIONS += $(JTREG_ASSERT_OPTION)
Kelly O'Haird1258922009-11-08 15:11:10 -0800598# Report details on all failed or error tests, times too
599JTREG_BASIC_OPTIONS += -v:fail,error,time
600# Retain all files for failing tests
601JTREG_BASIC_OPTIONS += -retain:fail,error
602# Ignore tests are not run and completely silent about it
Kelly O'Haird44fe662009-12-11 15:29:22 -0800603JTREG_IGNORE_OPTION = -ignore:quiet
604JTREG_BASIC_OPTIONS += $(JTREG_IGNORE_OPTION)
Kelly O'Hair61c09152009-12-09 09:46:57 -0800605# Multiple by 4 the timeout numbers
Kelly O'Haird44fe662009-12-11 15:29:22 -0800606JTREG_TIMEOUT_OPTION = -timeoutFactor:4
607JTREG_BASIC_OPTIONS += $(JTREG_TIMEOUT_OPTION)
Kelly O'Haird1258922009-11-08 15:11:10 -0800608# Boost the max memory for jtreg to avoid gc thrashing
Kelly O'Haird44fe662009-12-11 15:29:22 -0800609JTREG_MEMORY_OPTION = -J-Xmx512m
610JTREG_BASIC_OPTIONS += $(JTREG_MEMORY_OPTION)
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700611
Kelly O'Haird1258922009-11-08 15:11:10 -0800612# Make sure jtreg exists
613$(JTREG): $(JT_HOME)
614
615# Run jtreg
616jtreg_tests: prep $(PRODUCT_HOME) $(JTREG) $(EXCLUDELIST)
617 @$(EXPAND) $(EXCLUDELIST) \
618 | $(CUT) -d' ' -f1 \
619 | $(SED) -e 's@^@Excluding: @'
620 ( \
621 ( JT_HOME=$(shell $(GETMIXEDPATH) "$(JT_HOME)"); \
622 export JT_HOME; \
Kelly O'Haird1258922009-11-08 15:11:10 -0800623 $(shell $(GETMIXEDPATH) "$(JTREG)") \
624 $(JTREG_BASIC_OPTIONS) \
625 -r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTreport \
626 -w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTwork \
627 -jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \
628 -exclude:$(shell $(GETMIXEDPATH) "$(EXCLUDELIST)") \
629 $(JTREG_TEST_OPTIONS) \
630 $(TESTDIRS) \
631 ) ; $(BUNDLE_UP_AND_EXIT) \
Kelly O'Hair0ce235a2009-12-01 08:51:16 -0800632 ) 2>&1 | $(TEE) $(ABS_TEST_OUTPUT_DIR)/output.txt ; $(TESTEXIT)
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700633
Kelly O'Haird7382802010-05-20 13:57:58 -0700634# Rule that may change execute permissions on shared library files.
635# Files in repositories should never have execute permissions, but there
636# are some tests that have pre-built shared libraries, and these windows
637# dll files must have execute permission. Adding execute permission
638# may happen automatically on windows when using certain versions of mercurial
639# but it cannot be guaranteed. And blindly adding execute permission might
640# be seen as a mercurial 'change', so we avoid adding execute permission to
641# repository files. But testing from a plain source tree needs the chmod a+rx.
642# Used on select directories and applying the chmod to all shared libraries
643# not just dll files. On windows, this may not work with MKS if the files
644# were installed with CYGWIN unzip or untar (MKS chmod may not do anything).
645# And with CYGWIN and sshd service, you may need CYGWIN=ntsec for this to work.
646#
647shared_library_permissions: $(SHARED_LIBRARY_DIR)
648 if [ ! -d $(TEST_ROOT)/../.hg ] ; then \
649 $(FIND) $< \( -name \*.dll -o -name \*.DLL -o -name \*.so \) \
650 -exec $(CHMOD) a+rx {} \; ; \
651 fi
652
653PHONY_LIST += jtreg_tests shared_library_permissions
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700654
655################################################################
656
657# packtest
658
659# Expect JPRT to set JPRT_PACKTEST_HOME.
660PACKTEST_HOME = /net/jprt-web.sfbay.sun.com/jprt/allproducts/packtest
661ifdef JPRT_PACKTEST_HOME
662 PACKTEST_HOME = $(JPRT_PACKTEST_HOME)
663endif
664
665packtest: prep $(PACKTEST_HOME)/ptest $(PRODUCT_HOME)
666 ( $(CD) $(PACKTEST_HOME) && \
667 $(PACKTEST_HOME)/ptest \
668 -t "$(PRODUCT_HOME)" \
669 $(PACKTEST_STRESS_OPTION) \
670 $(EXTRA_PACKTEST_OPTIONS) \
671 -W $(ABS_TEST_OUTPUT_DIR) \
672 $(JAVA_ARGS:%=-J %) \
673 $(JAVA_VM_ARGS:%=-J %) \
674 ) ; $(BUNDLE_UP_AND_EXIT)
675
676packtest_stress: PACKTEST_STRESS_OPTION=-s
677packtest_stress: packtest
678
679PHONY_LIST += packtest packtest_stress
680
681################################################################
682
Mandy Chunge2f72482009-05-26 17:47:57 -0700683# perftest to collect statistics
684
685# Expect JPRT to set JPRT_PACKTEST_HOME.
Kelly O'Haird7382802010-05-20 13:57:58 -0700686PERFTEST_HOME = $(TEST_ROOT)/perf
Mandy Chunge2f72482009-05-26 17:47:57 -0700687ifdef JPRT_PERFTEST_HOME
688 PERFTEST_HOME = $(JPRT_PERFTEST_HOME)
689endif
690
691perftest: ( $(PERFTEST_HOME)/perftest \
692 -t $(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \
693 -w $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)") \
694 -h $(PERFTEST_HOME) \
695 ) ; $(BUNDLE_UP_AND_EXIT)
696
697
698PHONY_LIST += perftest
699
700################################################################
701
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700702# vmsqe tests
703
704# Expect JPRT to set JPRT_VMSQE_HOME.
705VMSQE_HOME = /java/sqe/comp/vm/testbase/sqe/vm/current/build/latest/vm
706ifdef JPRT_VMSQE_HOME
707 VMSQE_HOME = $(JPRT_VMSQE_HOME)
708endif
709
710# Expect JPRT to set JPRT_RUNVMSQE_HOME.
711RUNVMSQE_HOME = /net/jprt-web.sfbay.sun.com/jprt/allproducts/runvmsqe
712ifdef JPRT_RUNVMSQE_HOME
713 RUNVMSQE_HOME = $(JPRT_RUNVMSQE_HOME)
714endif
715
716# Expect JPRT to set JPRT_TONGA3_HOME.
717TONGA3_HOME = /java/sqe//tools/gtee/harness/tonga
718ifdef JPRT_TONGA3_HOME
719 TONGA3_HOME = $(JPRT_TONGA3_HOME)
720endif
721
722RUNVMSQE_BIN = $(RUNVMSQE_HOME)/bin/runvmsqe
723
724vmsqe_tests: prep $(VMSQE_HOME)/vm $(TONGA3_HOME) $(RUNVMSQE_BIN) $(PRODUCT_HOME)
725 $(RM) -r $(ABS_TEST_OUTPUT_DIR)/vmsqe
726 ( $(CD) $(ABS_TEST_OUTPUT_DIR) && \
727 $(RUNVMSQE_BIN) \
728 -jdk "$(PRODUCT_HOME)" \
729 -o "$(ABS_TEST_OUTPUT_DIR)/vmsqe" \
730 -testbase "$(VMSQE_HOME)/vm" \
731 -tonga "$(TONGA3_HOME)" \
732 -tongajdk "$(ALT_BOOTDIR)" \
733 $(JAVA_ARGS) \
734 $(JAVA_VM_ARGS) \
735 $(RUNVMSQE_TEST_OPTION) \
736 $(EXTRA_RUNVMSQE_OPTIONS) \
737 ) ; $(BUNDLE_UP_AND_EXIT)
738
739vmsqe_jdwp: RUNVMSQE_TEST_OPTION=-jdwp
740vmsqe_jdwp: vmsqe_tests
741
742vmsqe_jdi: RUNVMSQE_TEST_OPTION=-jdi
743vmsqe_jdi: vmsqe_tests
744
745vmsqe_jdb: RUNVMSQE_TEST_OPTION=-jdb
746vmsqe_jdb: vmsqe_tests
747
748vmsqe_quick-jdi: RUNVMSQE_TEST_OPTION=-quick-jdi
749vmsqe_quick-jdi: vmsqe_tests
750
751vmsqe_sajdi: RUNVMSQE_TEST_OPTION=-sajdi
752vmsqe_sajdi: vmsqe_tests
753
754vmsqe_jvmti: RUNVMSQE_TEST_OPTION=-jvmti
755vmsqe_jvmti: vmsqe_tests
756
757vmsqe_hprof: RUNVMSQE_TEST_OPTION=-hprof
758vmsqe_hprof: vmsqe_tests
759
760vmsqe_monitoring: RUNVMSQE_TEST_OPTION=-monitoring
761vmsqe_monitoring: vmsqe_tests
762
763PHONY_LIST += vmsqe_jdwp vmsqe_jdi vmsqe_jdb vmsqe_quick-jdi vmsqe_sajdi \
764 vmsqe_jvmti vmsqe_hprof vmsqe_monitoring vmsqe_tests
765
766################################################################
767
768# jck tests
769
770JCK_WORK_DIR = $(ABS_TEST_OUTPUT_DIR)/JCKwork
771JCK_REPORT_DIR = $(ABS_TEST_OUTPUT_DIR)/JCKreport
772JCK_PROPERTIES = $(ABS_TEST_OUTPUT_DIR)/jck.properties
773JCK_CONFIG = $(ABS_TEST_OUTPUT_DIR)/jck.config
774
775JCK_JAVA_EXE = $(PRODUCT_HOME)/bin/java$(EXESUFFIX)
776
777JCK_JAVATEST_JAR = $(JCK_HOME)/lib/javatest.jar
778JCK_JAVATEST = $(ALT_BOOTDIR)/bin/java -jar $(JCK_JAVATEST_JAR)
779
780$(JCK_CONFIG): $(TEST_ROOT)/JCK-$(JCK_BUNDLE_NAME)-$(JCK_RELEASE)-base.jti
781 $(RM) $@
782 $(MKDIR) -p $(@D)
783 $(CP) $< $@
784
785$(JCK_PROPERTIES): $(PRODUCT_HOME) $(JCK_JAVA_EXE)
786 $(RM) $@
787 $(MKDIR) -p $(@D)
788 $(ECHO) "jck.env.compiler.compRefExecute.cmdAsFile=$(JCK_JAVA_EXE)" >> $@
789 $(ECHO) "jck.env.compiler.compRefExecute.systemRoot=$(SYSTEMROOT)" >> $@
790 $(ECHO) "jck.env.compiler.testCompile.testCompileAPImultiJVM.cmdAsFile=$(JCK_JAVA_EXE)" >> $@
791 $(ECHO) "jck.tests.tests=$(JCK_BUNDLE_TESTDIRS)" >> $@
792
793jck_tests: prep $(JCK_HOME) $(JCK_PROPERTIES) $(JCK_CONFIG) $(JCK_JAVATEST_JAR)
794 $(MKDIR) -p $(JCK_WORK_DIR)
795 ( $(JCK_JAVATEST) \
796 -verbose:commands,non-pass \
797 -testSuite $(JCK_HOME) \
798 -workDir $(JCK_WORK_DIR) \
799 -config $(JCK_CONFIG) \
800 -set -file $(JCK_PROPERTIES) \
801 -runtests \
802 -writeReport $(JCK_REPORT_DIR) \
803 ) ; $(BUNDLE_UP_AND_EXIT)
804
805PHONY_LIST += jck_tests
806
807################################################################
808
809# jck6 tests
810
811JCK6_RELEASE = 6b
812JCK6_DEFAULT_HOME = $(SLASH_JAVA)/re/jck/$(JCK6_RELEASE)/archive/fcs/binaries
813
814# Expect JPRT to set JPRT_JCK6COMPILER_HOME.
815JCK6COMPILER_HOME = $(JCK6_DEFAULT_HOME)/JCK-compiler-$(JCK6_RELEASE)
816ifdef JPRT_JCK6COMPILER_HOME
817 JCK6COMPILER_HOME = $(JPRT_JCK6COMPILER_HOME)
818endif
819
820# Expect JPRT to set JPRT_JCK6RUNTIME_HOME.
821JCK6RUNTIME_HOME = $(JCK6_DEFAULT_HOME)/JCK-runtime-$(JCK6_RELEASE)
822ifdef JPRT_JCK6RUNTIME_HOME
823 JCK6RUNTIME_HOME = $(JPRT_JCK6RUNTIME_HOME)
824endif
825
826# Expect JPRT to set JPRT_JCK6DEVTOOLS_HOME.
827JCK6DEVTOOLS_HOME = $(JCK6_DEFAULT_HOME)/JCK-devtools-$(JCK6_RELEASE)
828ifdef JPRT_JCK6DEVTOOLS_HOME
829 JCK6DEVTOOLS_HOME = $(JPRT_JCK6DEVTOOLS_HOME)
830endif
831
832jck6_tests: JCK_HOME=$(JCK6_HOME)
833jck6_tests: JCK_RELEASE=$(JCK6_RELEASE)
834jck6_tests: jck_tests
835
836jck6compiler: JCK6_HOME=$(JCK6COMPILER_HOME)
837jck6compiler: JCK_BUNDLE_NAME=compiler
838jck6compiler: jck6_tests
839
840jck6compiler_lang: JCK_BUNDLE_TESTDIRS=lang
841jck6compiler_lang: jck6compiler
842
843jck6runtime: JCK6_HOME=$(JCK6RUNTIME_HOME)
844jck6runtime: JCK_BUNDLE_NAME=runtime
845jck6runtime: jck6_tests
846
847jck6runtime_lang: JCK_BUNDLE_TESTDIRS=lang
848jck6runtime_lang: jck6runtime
849
850jck6devtools: JCK6_HOME=$(JCK6DEVTOOLS_HOME)
851jck6devtools: JCK_BUNDLE_NAME=devtools
852jck6devtools: jck6_tests
853
854jck6devtools_lang: JCK_BUNDLE_TESTDIRS=lang
855jck6devtools_lang: jck6devtools
856
857PHONY_LIST += jck6compiler jck6runtime jck6devtools jck6_tests \
858 jck6compiler_lang jck6runtime_lang jck6devtools_lang
859
860################################################################
861
862# jck7 tests
863
864JCK7_RELEASE = 7
865JCK7_DEFAULT_HOME = $(SLASH_JAVA)/re/jck/$(JCK7_RELEASE)/archive/fcs/binaries
866
867# Expect JPRT to set JPRT_JCK7COMPILER_HOME.
868JCK7COMPILER_HOME = $(JCK7_DEFAULT_HOME)/JCK-compiler-$(JCK7_RELEASE)
869ifdef JPRT_JCK7COMPILER_HOME
870 JCK7COMPILER_HOME = $(JPRT_JCK7COMPILER_HOME)
871endif
872
873# Expect JPRT to set JPRT_JCK7RUNTIME_HOME.
874JCK7RUNTIME_HOME = $(JCK7_DEFAULT_HOME)/JCK-runtime-$(JCK7_RELEASE)
875ifdef JPRT_JCK7RUNTIME_HOME
876 JCK7RUNTIME_HOME = $(JPRT_JCK7RUNTIME_HOME)
877endif
878
879# Expect JPRT to set JPRT_JCK7DEVTOOLS_HOME.
880JCK7DEVTOOLS_HOME = $(JCK7_DEFAULT_HOME)/JCK-devtools-$(JCK7_RELEASE)
881ifdef JPRT_JCK7DEVTOOLS_HOME
882 JCK7DEVTOOLS_HOME = $(JPRT_JCK7DEVTOOLS_HOME)
883endif
884
885jck7_tests: JCK_HOME=$(JCK7_HOME)
886jck7_tests: JCK_RELEASE=$(JCK7_RELEASE)
887jck7_tests: jck_tests
888
889jck7compiler: JCK7_HOME=$(JCK7COMPILER_HOME)
890jck7compiler: JCK_BUNDLE_NAME=compiler
891jck7compiler: jck7_tests
892
893jck7compiler_lang: JCK_BUNDLE_TESTDIRS=lang
894jck7compiler_lang: jck7compiler
895
896jck7runtime: JCK7_HOME=$(JCK7RUNTIME_HOME)
897jck7runtime: JCK_BUNDLE_NAME=runtime
898jck7runtime: jck7_tests
899
900jck7runtime_lang: JCK_BUNDLE_TESTDIRS=lang
901jck7runtime_lang: jck7runtime
902
903jck7devtools: JCK7_HOME=$(JCK7DEVTOOLS_HOME)
904jck7devtools: JCK_BUNDLE_NAME=devtools
905jck7devtools: jck7_tests
906
907jck7devtools_lang: JCK_BUNDLE_TESTDIRS=lang
908jck7devtools_lang: jck7devtools
909
910PHONY_LIST += jck7compiler jck7runtime jck7devtools jck7_tests \
911 jck7compiler_lang jck7runtime_lang jck7devtools_lang
912
913################################################################
J. Duke319a3b92007-12-01 00:00:00 +0000914
915# Phony targets (e.g. these are not filenames)
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700916.PHONY: all clean prep $(PHONY_LIST)
917
918################################################################
J. Duke319a3b92007-12-01 00:00:00 +0000919