blob: 5d5d04a0136bc161a34099e807476a5466a1a9b4 [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001#
Kelly O'Haire4fce692010-03-06 14:59:23 -08002# Copyright 1995-2010 Sun Microsystems, Inc. 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
7# published by the Free Software Foundation. Sun designates this
8# particular file as subject to the "Classpath" exception as provided
9# by Sun in the LICENSE file that accompanied this code.
10#
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#
21# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22# CA 95054 USA or visit www.sun.com if you need additional information or
23# have any questions.
24#
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'Haird1258922009-11-08 15:11:10 -080082ifndef OS_NAME
83 ifneq ($(PROCESSOR_IDENTIFIER), )
84 OS_NAME = windows
85 SLASH_JAVA = J:
86 # A variety of ways to say X64 arch :^(
87 OS_ARCH:=$(word 1, $(PROCESSOR_IDENTIFIER))
88 EXESUFFIX = .exe
89 # These need to be different depending on MKS or CYGWIN
90 ifeq ($(findstring cygdrive,$(shell ($(CD) C:/ && $(PWD)))), )
91 GETMIXEDPATH = dosname -s
92 OS_VERSION := $(shell $(UNAME) -r)
J. Duke319a3b92007-12-01 00:00:00 +000093 else
Kelly O'Haird1258922009-11-08 15:11:10 -080094 GETMIXEDPATH = cygpath -m -s
95 OS_VERSION := $(shell $(UNAME) -s | $(CUT) -d'-' -f2)
J. Duke319a3b92007-12-01 00:00:00 +000096 endif
97 endif
Kelly O'Haird1258922009-11-08 15:11:10 -080098endif
99
100# Only want major and minor numbers from os version
101OS_VERSION := $(shell $(ECHO) "$(OS_VERSION)" | $(CUT) -d'.' -f1,2)
102
Kelly O'Hair79132952010-03-12 09:03:02 -0800103# Name to use for x86_64 arch (historically amd64, but should change someday)
104OS_ARCH_X64_NAME:=amd64
105#OS_ARCH_X64_NAME:=x64
106
107# Alternate arch names (in case this arch is known by a second name)
108# PROBLEM_LISTS may use either name.
109OS_ARCH2-amd64:=x64
110#OS_ARCH2-x64:=amd64
111
112# Try and use the arch names consistently
113OS_ARCH:=$(subst x64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
114OS_ARCH:=$(subst X64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
115OS_ARCH:=$(subst AMD64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
116OS_ARCH:=$(subst amd64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
117OS_ARCH:=$(subst x86_64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
118OS_ARCH:=$(subst EM64T,$(OS_ARCH_X64_NAME),$(OS_ARCH))
119OS_ARCH:=$(subst em64t,$(OS_ARCH_X64_NAME),$(OS_ARCH))
120OS_ARCH:=$(subst intel64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
121OS_ARCH:=$(subst Intel64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
122OS_ARCH:=$(subst INTEL64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
Kelly O'Haird1258922009-11-08 15:11:10 -0800123OS_ARCH:=$(subst IA64,ia64,$(OS_ARCH))
124OS_ARCH:=$(subst X86,i586,$(OS_ARCH))
125OS_ARCH:=$(subst x86,i586,$(OS_ARCH))
126OS_ARCH:=$(subst i386,i586,$(OS_ARCH))
127OS_ARCH:=$(subst i486,i586,$(OS_ARCH))
128OS_ARCH:=$(subst i686,i586,$(OS_ARCH))
129
Kelly O'Hair79132952010-03-12 09:03:02 -0800130# Default ARCH_DATA_MODEL settings
131ARCH_DATA_MODEL-i586 = 32
132ARCH_DATA_MODEL-$(OS_ARCH_X64_NAME) = 64
133ARCH_DATA_MODEL-ia64 = 64
134ARCH_DATA_MODEL-sparc = 32
135ARCH_DATA_MODEL-sparcv9 = 64
136
137# If ARCH_DATA_MODEL is not defined, try and pick a reasonable default
138ifndef ARCH_DATA_MODEL
139 ARCH_DATA_MODEL:=$(ARCH_DATA_MODEL-$(OS_ARCH))
140endif
Kelly O'Haird1258922009-11-08 15:11:10 -0800141ifndef ARCH_DATA_MODEL
142 ARCH_DATA_MODEL=32
143endif
Kelly O'Hair79132952010-03-12 09:03:02 -0800144
145# Platform directory name
146PLATFORM_OS = $(OS_NAME)-$(OS_ARCH)
147
148# Check ARCH_DATA_MODEL, adjust OS_ARCH accordingly on solaris
Kelly O'Haird1258922009-11-08 15:11:10 -0800149ARCH_DATA_MODEL_ERROR= \
Kelly O'Hair79132952010-03-12 09:03:02 -0800150 ARCH_DATA_MODEL=$(ARCH_DATA_MODEL) cannot be used with $(PLATFORM_OS)
Kelly O'Haird1258922009-11-08 15:11:10 -0800151ifeq ($(ARCH_DATA_MODEL),64)
Kelly O'Hair79132952010-03-12 09:03:02 -0800152 ifeq ($(PLATFORM_OS),solaris-i586)
153 OS_ARCH=$(OS_ARCH_X64_NAME)
Kelly O'Haird1258922009-11-08 15:11:10 -0800154 endif
Kelly O'Hair79132952010-03-12 09:03:02 -0800155 ifeq ($(PLATFORM_OS),solaris-sparc)
Kelly O'Haird1258922009-11-08 15:11:10 -0800156 OS_ARCH=sparcv9
157 endif
158 ifeq ($(OS_ARCH),i586)
159 x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
160 endif
161 ifeq ($(OS_ARCH),sparc)
162 x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
163 endif
164else
165 ifeq ($(ARCH_DATA_MODEL),32)
Kelly O'Hair79132952010-03-12 09:03:02 -0800166 ifeq ($(OS_ARCH),$(OS_ARCH_X64_NAME))
Kelly O'Haird1258922009-11-08 15:11:10 -0800167 x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
168 endif
169 ifeq ($(OS_ARCH),ia64)
170 x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
171 endif
172 ifeq ($(OS_ARCH),sparcv9)
173 x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
174 endif
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700175 else
Kelly O'Haird1258922009-11-08 15:11:10 -0800176 x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700177 endif
J. Duke319a3b92007-12-01 00:00:00 +0000178endif
179
Kelly O'Hair79132952010-03-12 09:03:02 -0800180# Alternate OS_ARCH name (defaults to OS_ARCH)
181OS_ARCH2:=$(OS_ARCH2-$(OS_ARCH))
182ifeq ($(OS_ARCH2),)
183 OS_ARCH2:=$(OS_ARCH)
184endif
185
J. Duke319a3b92007-12-01 00:00:00 +0000186# Root of this test area (important to use full paths in some places)
Kelly O'Haird1258922009-11-08 15:11:10 -0800187TEST_ROOT := $(shell $(PWD))
J. Duke319a3b92007-12-01 00:00:00 +0000188
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700189# Root of all test results
190ifdef ALT_OUTPUTDIR
191 ABS_OUTPUTDIR = $(ALT_OUTPUTDIR)
J. Duke319a3b92007-12-01 00:00:00 +0000192else
Kelly O'Hair79132952010-03-12 09:03:02 -0800193 ABS_OUTPUTDIR = $(TEST_ROOT)/../build/$(PLATFORM_OS)
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700194endif
Kelly O'Hair79132952010-03-12 09:03:02 -0800195ABS_PLATFORM_BUILD_ROOT = $(ABS_OUTPUTDIR)
196ABS_TEST_OUTPUT_DIR := $(ABS_PLATFORM_BUILD_ROOT)/testoutput/$(UNIQUE_DIR)
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700197
198# Expect JPRT to set PRODUCT_HOME (the product or jdk in this case to test)
199ifndef PRODUCT_HOME
200 # Try to use j2sdk-image if it exists
Kelly O'Hair79132952010-03-12 09:03:02 -0800201 ABS_JDK_IMAGE = $(ABS_PLATFORM_BUILD_ROOT)/j2sdk-image
202 PRODUCT_HOME := \
203 $(shell \
204 if [ -d $(ABS_JDK_IMAGE) ] ; then \
205 $(ECHO) "$(ABS_JDK_IMAGE)"; \
206 else \
207 $(ECHO) "$(ABS_PLATFORM_BUILD_ROOT)"; \
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700208 fi)
209 PRODUCT_HOME := $(PRODUCT_HOME)
J. Duke319a3b92007-12-01 00:00:00 +0000210endif
211
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700212# Expect JPRT to set JPRT_PRODUCT_ARGS (e.g. -server etc.)
213# Should be passed into 'java' only.
Kelly O'Haird1258922009-11-08 15:11:10 -0800214# Could include: -d64 -server -client OR any java option
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700215ifdef JPRT_PRODUCT_ARGS
216 JAVA_ARGS = $(JPRT_PRODUCT_ARGS)
217endif
J. Duke319a3b92007-12-01 00:00:00 +0000218
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700219# Expect JPRT to set JPRT_PRODUCT_VM_ARGS (e.g. -Xcomp etc.)
220# Should be passed into anything running the vm (java, javac, javadoc, ...).
221ifdef JPRT_PRODUCT_VM_ARGS
222 JAVA_VM_ARGS = $(JPRT_PRODUCT_VM_ARGS)
223endif
J. Duke319a3b92007-12-01 00:00:00 +0000224
Kelly O'Haird1258922009-11-08 15:11:10 -0800225# Check JAVA_ARGS arguments based on ARCH_DATA_MODEL etc.
226ifeq ($(OS_NAME),solaris)
227 D64_ERROR_MESSAGE=Mismatch between ARCH_DATA_MODEL=$(ARCH_DATA_MODEL) and use of -d64 in JAVA_ARGS=$(JAVA_ARGS)
228 ifeq ($(ARCH_DATA_MODEL),32)
229 ifneq ($(findstring -d64,$(JAVA_ARGS)),)
230 x:=$(warning "WARNING: $(D64_ERROR_MESSAGE)")
231 endif
232 endif
233 ifeq ($(ARCH_DATA_MODEL),64)
234 ifeq ($(findstring -d64,$(JAVA_ARGS)),)
235 x:=$(warning "WARNING: $(D64_ERROR_MESSAGE)")
236 endif
237 endif
238endif
239
Kelly O'Hair56131862010-05-12 21:35:55 -0700240# Temp file to hold list of shared library files possibly needing execute
241# permissions at runtime.
242SHARED_LIBRARY_LIST=$(ABS_TEST_OUTPUT_DIR)/shared_libraries.txt
243
244# Macro that may change execute permissions on library files and check for them.
245# Files in repositories should not really have execute permissions, however
246# windows dll files require execute permission. Adding execute permission
247# may happen automatically on windows when using certain versions of mercurial
248# but it cannot be guaranteed. And blindly adding execute permission might
249# be seen as a mercurial 'change', so we avoid adding execute permission to
250# repository files. Testing from a plain source tree may need the chmod a+x.
251# Used on select directories.
252define CheckLibraryExecutePermissions # dir
253$(MKDIR) -p `$(DIRNAME) $(SHARED_LIBRARY_LIST)`
254$(RM) $(SHARED_LIBRARY_LIST)
255$(FIND) $1 -name \*.dll -o -name \*.DLL -o -name \*.so > $(SHARED_LIBRARY_LIST)
256if [ -s $(SHARED_LIBRARY_LIST) -a ! -d $(TEST_ROOT)/../.hg ] ; then \
257 $(ECHO) "$(CHMOD) a+x `$(CAT) $(SHARED_LIBRARY_LIST)`"; \
258 $(CHMOD) a+x `$(CAT) $(SHARED_LIBRARY_LIST)`; \
259fi
260if [ -s $(SHARED_LIBRARY_LIST) ] ; then \
261 for i in `$(CAT) $(SHARED_LIBRARY_LIST)` ; do \
262 if [ ! -x $${i} ] ; then \
263 $(ECHO) "WARNING: File does not have execute permission: $${i}"; \
264 fi; \
265 done; \
266fi
267endef
268
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700269# Expect JPRT to set JPRT_ARCHIVE_BUNDLE (path to zip bundle for results)
270ARCHIVE_BUNDLE = $(ABS_TEST_OUTPUT_DIR)/ARCHIVE_BUNDLE.zip
271ifdef JPRT_ARCHIVE_BUNDLE
272 ARCHIVE_BUNDLE = $(JPRT_ARCHIVE_BUNDLE)
273endif
J. Duke319a3b92007-12-01 00:00:00 +0000274
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700275# How to create the test bundle (pass or fail, we want to create this)
276# Follow command with ";$(BUNDLE_UP_AND_EXIT)", so it always gets executed.
Kelly O'Hair56131862010-05-12 21:35:55 -0700277ZIP_UP_RESULTS = ( $(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)` \
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700278 && $(CD) $(ABS_TEST_OUTPUT_DIR) \
279 && $(ZIP) -q -r $(ARCHIVE_BUNDLE) . )
Kelly O'Haird1258922009-11-08 15:11:10 -0800280SUMMARY_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTreport/text/summary.txt
281STATS_TXT_NAME = Stats.txt
282STATS_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/$(STATS_TXT_NAME)
283RUNLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/runlist.txt
284PASSLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/passlist.txt
285FAILLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/faillist.txt
Kelly O'Hair0ce235a2009-12-01 08:51:16 -0800286EXITCODE = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/exitcode.txt
287
288TESTEXIT = \
289 if [ ! -s $(EXITCODE) ] ; then \
290 $(ECHO) "ERROR: EXITCODE file not filled in."; \
291 $(ECHO) "1" > $(EXITCODE); \
292 fi ; \
293 testExitCode=`$(CAT) $(EXITCODE)`; \
294 $(ECHO) "EXIT CODE: $${testExitCode}"; \
Kelly O'Hair61c09152009-12-09 09:46:57 -0800295 exit $${testExitCode}
Kelly O'Hair0ce235a2009-12-01 08:51:16 -0800296
Kelly O'Haird1258922009-11-08 15:11:10 -0800297BUNDLE_UP_AND_EXIT = \
298( \
Kelly O'Hair0ce235a2009-12-01 08:51:16 -0800299 jtregExitCode=$$? && \
Kelly O'Haird1258922009-11-08 15:11:10 -0800300 _summary="$(SUMMARY_TXT)"; \
Kelly O'Hair0ce235a2009-12-01 08:51:16 -0800301 $(RM) -f $(STATS_TXT) $(RUNLIST) $(PASSLIST) $(FAILLIST) $(EXITCODE); \
302 $(ECHO) "$${jtregExitCode}" > $(EXITCODE); \
Kelly O'Haird1258922009-11-08 15:11:10 -0800303 if [ -r "$${_summary}" ] ; then \
Kelly O'Hair61c09152009-12-09 09:46:57 -0800304 $(ECHO) "Summary: $(UNIQUE_DIR)" > $(STATS_TXT); \
Kelly O'Haird1258922009-11-08 15:11:10 -0800305 $(EXPAND) $${_summary} | $(EGREP) -v ' Not run\.' > $(RUNLIST); \
306 $(EGREP) ' Passed\.' $(RUNLIST) \
307 | $(EGREP) -v ' Error\.' \
308 | $(EGREP) -v ' Failed\.' > $(PASSLIST); \
309 ( $(EGREP) ' Failed\.' $(RUNLIST); \
310 $(EGREP) ' Error\.' $(RUNLIST); \
311 $(EGREP) -v ' Passed\.' $(RUNLIST) ) \
312 | $(SORT) | $(UNIQ) > $(FAILLIST); \
Kelly O'Hair0ce235a2009-12-01 08:51:16 -0800313 if [ $${jtregExitCode} != 0 -o -s $(FAILLIST) ] ; then \
Kelly O'Haird1258922009-11-08 15:11:10 -0800314 $(EXPAND) $(FAILLIST) \
315 | $(CUT) -d' ' -f1 \
316 | $(SED) -e 's@^@FAILED: @' >> $(STATS_TXT); \
Kelly O'Hair0ce235a2009-12-01 08:51:16 -0800317 if [ $${jtregExitCode} = 0 ] ; then \
318 jtregExitCode=1; \
319 fi; \
Kelly O'Haird1258922009-11-08 15:11:10 -0800320 fi; \
321 runc="`$(CAT) $(RUNLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
322 passc="`$(CAT) $(PASSLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
323 failc="`$(CAT) $(FAILLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
324 exclc="`$(CAT) $(EXCLUDELIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
325 $(ECHO) "TEST STATS: run=$${runc} pass=$${passc} fail=$${failc} excluded=$${exclc}" \
326 >> $(STATS_TXT); \
327 else \
328 $(ECHO) "Missing file: $${_summary}" >> $(STATS_TXT); \
329 fi; \
330 $(CAT) $(STATS_TXT); \
Kelly O'Haire4fce692010-03-06 14:59:23 -0800331 $(ZIP_UP_RESULTS) ; \
Kelly O'Hair0ce235a2009-12-01 08:51:16 -0800332 $(TESTEXIT) \
Kelly O'Haird1258922009-11-08 15:11:10 -0800333)
J. Duke319a3b92007-12-01 00:00:00 +0000334
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700335################################################################
J. Duke319a3b92007-12-01 00:00:00 +0000336
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700337# Default make rule (runs jtreg_tests)
338all: jtreg_tests
339 @$(ECHO) "Testing completed successfully"
J. Duke319a3b92007-12-01 00:00:00 +0000340
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700341# Prep for output
342prep: clean
343 @$(MKDIR) -p $(ABS_TEST_OUTPUT_DIR)
344 @$(MKDIR) -p `dirname $(ARCHIVE_BUNDLE)`
J. Duke319a3b92007-12-01 00:00:00 +0000345
346# Cleanup
347clean:
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700348 $(RM) -r $(ABS_TEST_OUTPUT_DIR)
349 $(RM) $(ARCHIVE_BUNDLE)
J. Duke319a3b92007-12-01 00:00:00 +0000350
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700351################################################################
352
353# jtreg tests
354
355# Expect JT_HOME to be set for jtreg tests. (home for jtreg)
Kelly O'Haird020b042009-11-23 09:51:52 -0800356ifndef JT_HOME
357 JT_HOME = $(SLASH_JAVA)/re/jtreg/4.0/promoted/latest/binaries/jtreg
358 ifdef JPRT_JTREG_HOME
359 JT_HOME = $(JPRT_JTREG_HOME)
360 endif
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700361endif
362
363# Expect JPRT to set TESTDIRS to the jtreg test dirs
364ifndef TESTDIRS
Kelly O'Haird1258922009-11-08 15:11:10 -0800365 TESTDIRS = demo
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700366endif
367
Kelly O'Haird1258922009-11-08 15:11:10 -0800368# Samevm settings (default is false)
369ifndef USE_JTREG_SAMEVM
370 USE_JTREG_SAMEVM=false
371endif
372# With samevm, you cannot use -javaoptions?
373ifeq ($(USE_JTREG_SAMEVM),true)
Kelly O'Haird44fe662009-12-11 15:29:22 -0800374 JTREG_SAMEVM_OPTION = -samevm
375 EXTRA_JTREG_OPTIONS += $(JTREG_SAMEVM_OPTION) $(JAVA_ARGS) $(JAVA_ARGS:%=-vmoption:%)
Kelly O'Haird1258922009-11-08 15:11:10 -0800376 JTREG_TEST_OPTIONS = $(JAVA_VM_ARGS:%=-vmoption:%)
377else
378 JTREG_TEST_OPTIONS = $(JAVA_ARGS:%=-javaoptions:%) $(JAVA_VM_ARGS:%=-vmoption:%)
379endif
380
381# Some tests annoy me and fail frequently
382PROBLEM_LIST=ProblemList.txt
Kelly O'Haird020b042009-11-23 09:51:52 -0800383PROBLEM_LISTS=$(PROBLEM_LIST) $(wildcard closed/$(PROBLEM_LIST))
Kelly O'Haird1258922009-11-08 15:11:10 -0800384EXCLUDELIST=$(ABS_TEST_OUTPUT_DIR)/excludelist.txt
385
386# Create exclude list for this platform and arch
387ifdef NO_EXCLUDES
Kelly O'Haird020b042009-11-23 09:51:52 -0800388$(EXCLUDELIST): $(PROBLEM_LISTS) $(TESTDIRS)
Kelly O'Haird1258922009-11-08 15:11:10 -0800389 @$(ECHO) "NOTHING_EXCLUDED" > $@
390else
Kelly O'Haird020b042009-11-23 09:51:52 -0800391$(EXCLUDELIST): $(PROBLEM_LISTS) $(TESTDIRS)
Kelly O'Haird1258922009-11-08 15:11:10 -0800392 @$(RM) $@ $@.temp1 $@.temp2
Kelly O'Haird020b042009-11-23 09:51:52 -0800393 @(($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-all' ) ;\
394 ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-$(OS_ARCH)' ) ;\
Kelly O'Hair79132952010-03-12 09:03:02 -0800395 ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-$(OS_ARCH2)' ) ;\
Kelly O'Haird020b042009-11-23 09:51:52 -0800396 ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-$(OS_VERSION)') ;\
397 ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-$(OS_ARCH)' ) ;\
Kelly O'Hair79132952010-03-12 09:03:02 -0800398 ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-$(OS_ARCH2)' ) ;\
Kelly O'Haird020b042009-11-23 09:51:52 -0800399 ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-all' ) ;\
400 ($(ECHO) "#") ;\
Kelly O'Haird1258922009-11-08 15:11:10 -0800401 ) | $(SED) -e 's@^[\ ]*@@' \
402 | $(EGREP) -v '^#' > $@.temp1
403 @for tdir in $(TESTDIRS) ; do \
404 ( ( $(CAT) $@.temp1 | $(EGREP) "^$${tdir}" ) ; $(ECHO) "#" ) >> $@.temp2 ; \
405 done
406 @$(ECHO) "# at least one line" >> $@.temp2
407 @( $(EGREP) -v '^#' $@.temp2 ; true ) > $@
408 @$(ECHO) "Excluding list contains `$(EXPAND) $@ | $(WC) -l` items"
409endif
410
Kelly O'Haird020b042009-11-23 09:51:52 -0800411# Select list of directories that exist
412define TestDirs
413$(foreach i,$1,$(wildcard ${i})) $(foreach i,$1,$(wildcard closed/${i}))
414endef
Kelly O'Haird1258922009-11-08 15:11:10 -0800415# Running batches of tests with or without samevm
416define RunSamevmBatch
Kelly O'Haird020b042009-11-23 09:51:52 -0800417$(ECHO) "Running tests in samevm mode: $(call TestDirs, $?)"
418$(MAKE) TESTDIRS="$(call TestDirs, $?)" USE_JTREG_SAMEVM=true UNIQUE_DIR=$@ jtreg_tests
Kelly O'Haird1258922009-11-08 15:11:10 -0800419endef
420define RunOthervmBatch
Kelly O'Haird020b042009-11-23 09:51:52 -0800421$(ECHO) "Running tests in othervm mode: $(call TestDirs, $?)"
422$(MAKE) TESTDIRS="$(call TestDirs, $?)" USE_JTREG_SAMEVM=false UNIQUE_DIR=$@ jtreg_tests
Kelly O'Haird1258922009-11-08 15:11:10 -0800423endef
424define SummaryInfo
Kelly O'Hair61c09152009-12-09 09:46:57 -0800425$(ECHO) "########################################################"
Kelly O'Haird1258922009-11-08 15:11:10 -0800426$(CAT) $(?:%=$(ABS_TEST_OUTPUT_DIR)/%/$(STATS_TXT_NAME))
Kelly O'Hair61c09152009-12-09 09:46:57 -0800427$(ECHO) "########################################################"
Kelly O'Haird1258922009-11-08 15:11:10 -0800428endef
429
430# ------------------------------------------------------------------
431
432# Batches of tests (somewhat arbitrary assigments to jdk_* targets)
433JDK_ALL_TARGETS =
434
435# Stable othervm testruns (minus items from PROBLEM_LIST)
436# Using samevm has problems, and doesn't help performance as much as others.
437JDK_ALL_TARGETS += jdk_awt
438jdk_awt: com/sun/awt java/awt sun/awt
439 $(call RunOthervmBatch)
440
441# Stable samevm testruns (minus items from PROBLEM_LIST)
442JDK_ALL_TARGETS += jdk_beans1
443jdk_beans1: java/beans/beancontext java/beans/PropertyChangeSupport \
444 java/beans/Introspector java/beans/Performance \
445 java/beans/VetoableChangeSupport java/beans/Statement
446 $(call RunSamevmBatch)
447
448# Stable othervm testruns (minus items from PROBLEM_LIST)
449# Using samevm has serious problems with these tests
450JDK_ALL_TARGETS += jdk_beans2
451jdk_beans2: java/beans/Beans java/beans/EventHandler java/beans/XMLDecoder \
452 java/beans/PropertyEditor
453 $(call RunOthervmBatch)
Kelly O'Hair61c09152009-12-09 09:46:57 -0800454
455# Stable othervm testruns (minus items from PROBLEM_LIST)
456# Using samevm has serious problems with these tests
Kelly O'Haird1258922009-11-08 15:11:10 -0800457JDK_ALL_TARGETS += jdk_beans3
458jdk_beans3: java/beans/XMLEncoder
459 $(call RunOthervmBatch)
460
Kelly O'Hair61c09152009-12-09 09:46:57 -0800461# All beans tests
Kelly O'Haird020b042009-11-23 09:51:52 -0800462jdk_beans: jdk_beans1 jdk_beans2 jdk_beans3
463 @$(SummaryInfo)
464
Kelly O'Haird1258922009-11-08 15:11:10 -0800465# Stable samevm testruns (minus items from PROBLEM_LIST)
466JDK_ALL_TARGETS += jdk_io
467jdk_io: java/io
468 $(call RunSamevmBatch)
469
470# Stable samevm testruns (minus items from PROBLEM_LIST)
471JDK_ALL_TARGETS += jdk_lang
472jdk_lang: java/lang
473 $(call RunSamevmBatch)
474
475# Stable othervm testruns (minus items from PROBLEM_LIST)
476# Using samevm has serious problems with these tests
477JDK_ALL_TARGETS += jdk_management1
478jdk_management1: javax/management
479 $(call RunOthervmBatch)
480
481# Stable othervm testruns (minus items from PROBLEM_LIST)
482# Using samevm has serious problems with these tests
483JDK_ALL_TARGETS += jdk_management2
484jdk_management2: com/sun/jmx com/sun/management sun/management
485 $(call RunOthervmBatch)
486
Kelly O'Hair61c09152009-12-09 09:46:57 -0800487# All management tests
Kelly O'Haird020b042009-11-23 09:51:52 -0800488jdk_management: jdk_management1 jdk_management2
489 @$(SummaryInfo)
490
Kelly O'Haird1258922009-11-08 15:11:10 -0800491# Stable samevm testruns (minus items from PROBLEM_LIST)
492JDK_ALL_TARGETS += jdk_math
493jdk_math: java/math
494 $(call RunSamevmBatch)
495
496# Stable samevm testruns (minus items from PROBLEM_LIST)
497JDK_ALL_TARGETS += jdk_misc
498jdk_misc: demo javax/imageio javax/naming javax/print javax/script \
499 javax/smartcardio javax/sound com/sun/java com/sun/jndi \
500 com/sun/org sun/misc sun/pisces
501 $(call RunSamevmBatch)
502
503# Stable samevm testruns (minus items from PROBLEM_LIST)
504JDK_ALL_TARGETS += jdk_net
505jdk_net: com/sun/net java/net sun/net
506 $(call RunSamevmBatch)
507
508# Stable samevm testruns (minus items from PROBLEM_LIST)
509JDK_ALL_TARGETS += jdk_nio1
510jdk_nio1: java/nio/file
511 $(call RunSamevmBatch)
512
513# Stable othervm testruns (minus items from PROBLEM_LIST)
514# Using samevm has serious problems with these tests
515JDK_ALL_TARGETS += jdk_nio2
516jdk_nio2: java/nio/Buffer java/nio/ByteOrder \
517 java/nio/channels java/nio/BufferPoolMXBean java/nio/MappedByteBuffer
Kelly O'Hair56131862010-05-12 21:35:55 -0700518 $(call CheckLibraryExecutePermissions,java/nio/channels)
Kelly O'Haird1258922009-11-08 15:11:10 -0800519 $(call RunOthervmBatch)
Kelly O'Hair61c09152009-12-09 09:46:57 -0800520
521# Stable othervm testruns (minus items from PROBLEM_LIST)
522# Using samevm has serious problems with these tests
Kelly O'Haird1258922009-11-08 15:11:10 -0800523JDK_ALL_TARGETS += jdk_nio3
524jdk_nio3: com/sun/nio sun/nio
525 $(call RunOthervmBatch)
526
Kelly O'Hair61c09152009-12-09 09:46:57 -0800527# All nio tests
Kelly O'Haird020b042009-11-23 09:51:52 -0800528jdk_nio: jdk_nio1 jdk_nio2 jdk_nio3
529 @$(SummaryInfo)
530
Kelly O'Haird1258922009-11-08 15:11:10 -0800531# Stable othervm testruns (minus items from PROBLEM_LIST)
532# Using samevm has serious problems with these tests
533JDK_ALL_TARGETS += jdk_rmi
534jdk_rmi: java/rmi javax/rmi sun/rmi
535 $(call RunOthervmBatch)
536
537# Stable samevm testruns (minus items from PROBLEM_LIST)
538JDK_ALL_TARGETS += jdk_security1
539jdk_security1: java/security
540 $(call RunSamevmBatch)
541
542# Stable othervm testruns (minus items from PROBLEM_LIST)
543# Using samevm has serious problems with these tests
544JDK_ALL_TARGETS += jdk_security2
545jdk_security2: javax/crypto com/sun/crypto
546 $(call RunOthervmBatch)
Kelly O'Hair61c09152009-12-09 09:46:57 -0800547
548# Stable othervm testruns (minus items from PROBLEM_LIST)
549# Using samevm has serious problems with these tests
Kelly O'Haird1258922009-11-08 15:11:10 -0800550JDK_ALL_TARGETS += jdk_security3
551jdk_security3: com/sun/security lib/security javax/security sun/security
Kelly O'Hair56131862010-05-12 21:35:55 -0700552 $(call CheckLibraryExecutePermissions,sun/security)
Kelly O'Haird1258922009-11-08 15:11:10 -0800553 $(call RunOthervmBatch)
554
Kelly O'Hair61c09152009-12-09 09:46:57 -0800555# All security tests
Kelly O'Haird020b042009-11-23 09:51:52 -0800556jdk_security: jdk_security1 jdk_security2 jdk_security3
557 @$(SummaryInfo)
558
Kelly O'Haird1258922009-11-08 15:11:10 -0800559# Stable othervm testruns (minus items from PROBLEM_LIST)
560# Using samevm has problems, and doesn't help performance as much as others.
561JDK_ALL_TARGETS += jdk_swing
562jdk_swing: javax/swing sun/java2d
563 $(call RunOthervmBatch)
564
565# Stable samevm testruns (minus items from PROBLEM_LIST)
566JDK_ALL_TARGETS += jdk_text
567jdk_text: java/text sun/text
568 $(call RunSamevmBatch)
569
Kelly O'Hair61c09152009-12-09 09:46:57 -0800570# Stable samevm testruns (minus items from PROBLEM_LIST)
Kelly O'Haird1258922009-11-08 15:11:10 -0800571JDK_ALL_TARGETS += jdk_tools1
572jdk_tools1: com/sun/jdi
Kelly O'Hair547328d2009-11-25 08:24:58 -0800573 $(call RunSamevmBatch)
Kelly O'Hair61c09152009-12-09 09:46:57 -0800574
575# Stable othervm testruns (minus items from PROBLEM_LIST)
576# Using samevm has serious problems with these tests
Kelly O'Haird1258922009-11-08 15:11:10 -0800577JDK_ALL_TARGETS += jdk_tools2
578jdk_tools2: com/sun/tools sun/jvmstat sun/tools tools vm com/sun/servicetag com/sun/tracing
Kelly O'Hair56131862010-05-12 21:35:55 -0700579 $(call CheckLibraryExecutePermissions,tools/launcher)
Kelly O'Haird1258922009-11-08 15:11:10 -0800580 $(call RunOthervmBatch)
581
Kelly O'Hair61c09152009-12-09 09:46:57 -0800582# All tools tests
Kelly O'Haird020b042009-11-23 09:51:52 -0800583jdk_tools: jdk_tools1 jdk_tools2
584 @$(SummaryInfo)
585
Kelly O'Haird1258922009-11-08 15:11:10 -0800586# Stable samevm testruns (minus items from PROBLEM_LIST)
587JDK_ALL_TARGETS += jdk_util
588jdk_util: java/util sun/util
589 $(call RunSamevmBatch)
590
591# ------------------------------------------------------------------
592
593# Run all tests
Kelly O'Hair61c09152009-12-09 09:46:57 -0800594FILTER_OUT_LIST=jdk_awt jdk_rmi jdk_swing
595JDK_ALL_STABLE_TARGETS := $(filter-out $(FILTER_OUT_LIST), $(JDK_ALL_TARGETS))
596jdk_all: $(JDK_ALL_STABLE_TARGETS)
Kelly O'Haird1258922009-11-08 15:11:10 -0800597 @$(SummaryInfo)
598
599# These are all phony targets
600PHONY_LIST += $(JDK_ALL_TARGETS)
601
602# ------------------------------------------------------------------
603
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700604# Default JTREG to run (win32 script works for everybody)
605JTREG = $(JT_HOME)/win32/bin/jtreg
Kelly O'Haird1258922009-11-08 15:11:10 -0800606# Add any extra options (samevm etc.)
607JTREG_BASIC_OPTIONS += $(EXTRA_JTREG_OPTIONS)
608# Only run automatic tests
609JTREG_BASIC_OPTIONS += -a
Kelly O'Haird44fe662009-12-11 15:29:22 -0800610# Always turn on assertions
611JTREG_ASSERT_OPTION = -ea -esa
612JTREG_BASIC_OPTIONS += $(JTREG_ASSERT_OPTION)
Kelly O'Haird1258922009-11-08 15:11:10 -0800613# Report details on all failed or error tests, times too
614JTREG_BASIC_OPTIONS += -v:fail,error,time
615# Retain all files for failing tests
616JTREG_BASIC_OPTIONS += -retain:fail,error
617# Ignore tests are not run and completely silent about it
Kelly O'Haird44fe662009-12-11 15:29:22 -0800618JTREG_IGNORE_OPTION = -ignore:quiet
619JTREG_BASIC_OPTIONS += $(JTREG_IGNORE_OPTION)
Kelly O'Hair61c09152009-12-09 09:46:57 -0800620# Multiple by 4 the timeout numbers
Kelly O'Haird44fe662009-12-11 15:29:22 -0800621JTREG_TIMEOUT_OPTION = -timeoutFactor:4
622JTREG_BASIC_OPTIONS += $(JTREG_TIMEOUT_OPTION)
Kelly O'Haird1258922009-11-08 15:11:10 -0800623# Boost the max memory for jtreg to avoid gc thrashing
Kelly O'Haird44fe662009-12-11 15:29:22 -0800624JTREG_MEMORY_OPTION = -J-Xmx512m
625JTREG_BASIC_OPTIONS += $(JTREG_MEMORY_OPTION)
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700626
Kelly O'Haird1258922009-11-08 15:11:10 -0800627# Make sure jtreg exists
628$(JTREG): $(JT_HOME)
629
630# Run jtreg
631jtreg_tests: prep $(PRODUCT_HOME) $(JTREG) $(EXCLUDELIST)
632 @$(EXPAND) $(EXCLUDELIST) \
633 | $(CUT) -d' ' -f1 \
634 | $(SED) -e 's@^@Excluding: @'
635 ( \
636 ( JT_HOME=$(shell $(GETMIXEDPATH) "$(JT_HOME)"); \
637 export JT_HOME; \
Kelly O'Haird1258922009-11-08 15:11:10 -0800638 $(shell $(GETMIXEDPATH) "$(JTREG)") \
639 $(JTREG_BASIC_OPTIONS) \
640 -r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTreport \
641 -w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTwork \
642 -jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \
643 -exclude:$(shell $(GETMIXEDPATH) "$(EXCLUDELIST)") \
644 $(JTREG_TEST_OPTIONS) \
645 $(TESTDIRS) \
646 ) ; $(BUNDLE_UP_AND_EXIT) \
Kelly O'Hair0ce235a2009-12-01 08:51:16 -0800647 ) 2>&1 | $(TEE) $(ABS_TEST_OUTPUT_DIR)/output.txt ; $(TESTEXIT)
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700648
649PHONY_LIST += jtreg_tests
650
651################################################################
652
653# packtest
654
655# Expect JPRT to set JPRT_PACKTEST_HOME.
656PACKTEST_HOME = /net/jprt-web.sfbay.sun.com/jprt/allproducts/packtest
657ifdef JPRT_PACKTEST_HOME
658 PACKTEST_HOME = $(JPRT_PACKTEST_HOME)
659endif
660
661packtest: prep $(PACKTEST_HOME)/ptest $(PRODUCT_HOME)
662 ( $(CD) $(PACKTEST_HOME) && \
663 $(PACKTEST_HOME)/ptest \
664 -t "$(PRODUCT_HOME)" \
665 $(PACKTEST_STRESS_OPTION) \
666 $(EXTRA_PACKTEST_OPTIONS) \
667 -W $(ABS_TEST_OUTPUT_DIR) \
668 $(JAVA_ARGS:%=-J %) \
669 $(JAVA_VM_ARGS:%=-J %) \
670 ) ; $(BUNDLE_UP_AND_EXIT)
671
672packtest_stress: PACKTEST_STRESS_OPTION=-s
673packtest_stress: packtest
674
675PHONY_LIST += packtest packtest_stress
676
677################################################################
678
Mandy Chunge2f72482009-05-26 17:47:57 -0700679# perftest to collect statistics
680
681# Expect JPRT to set JPRT_PACKTEST_HOME.
682PERFTEST_HOME = ${TEST_ROOT}/perf
683ifdef JPRT_PERFTEST_HOME
684 PERFTEST_HOME = $(JPRT_PERFTEST_HOME)
685endif
686
687perftest: ( $(PERFTEST_HOME)/perftest \
688 -t $(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \
689 -w $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)") \
690 -h $(PERFTEST_HOME) \
691 ) ; $(BUNDLE_UP_AND_EXIT)
692
693
694PHONY_LIST += perftest
695
696################################################################
697
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700698# vmsqe tests
699
700# Expect JPRT to set JPRT_VMSQE_HOME.
701VMSQE_HOME = /java/sqe/comp/vm/testbase/sqe/vm/current/build/latest/vm
702ifdef JPRT_VMSQE_HOME
703 VMSQE_HOME = $(JPRT_VMSQE_HOME)
704endif
705
706# Expect JPRT to set JPRT_RUNVMSQE_HOME.
707RUNVMSQE_HOME = /net/jprt-web.sfbay.sun.com/jprt/allproducts/runvmsqe
708ifdef JPRT_RUNVMSQE_HOME
709 RUNVMSQE_HOME = $(JPRT_RUNVMSQE_HOME)
710endif
711
712# Expect JPRT to set JPRT_TONGA3_HOME.
713TONGA3_HOME = /java/sqe//tools/gtee/harness/tonga
714ifdef JPRT_TONGA3_HOME
715 TONGA3_HOME = $(JPRT_TONGA3_HOME)
716endif
717
718RUNVMSQE_BIN = $(RUNVMSQE_HOME)/bin/runvmsqe
719
720vmsqe_tests: prep $(VMSQE_HOME)/vm $(TONGA3_HOME) $(RUNVMSQE_BIN) $(PRODUCT_HOME)
721 $(RM) -r $(ABS_TEST_OUTPUT_DIR)/vmsqe
722 ( $(CD) $(ABS_TEST_OUTPUT_DIR) && \
723 $(RUNVMSQE_BIN) \
724 -jdk "$(PRODUCT_HOME)" \
725 -o "$(ABS_TEST_OUTPUT_DIR)/vmsqe" \
726 -testbase "$(VMSQE_HOME)/vm" \
727 -tonga "$(TONGA3_HOME)" \
728 -tongajdk "$(ALT_BOOTDIR)" \
729 $(JAVA_ARGS) \
730 $(JAVA_VM_ARGS) \
731 $(RUNVMSQE_TEST_OPTION) \
732 $(EXTRA_RUNVMSQE_OPTIONS) \
733 ) ; $(BUNDLE_UP_AND_EXIT)
734
735vmsqe_jdwp: RUNVMSQE_TEST_OPTION=-jdwp
736vmsqe_jdwp: vmsqe_tests
737
738vmsqe_jdi: RUNVMSQE_TEST_OPTION=-jdi
739vmsqe_jdi: vmsqe_tests
740
741vmsqe_jdb: RUNVMSQE_TEST_OPTION=-jdb
742vmsqe_jdb: vmsqe_tests
743
744vmsqe_quick-jdi: RUNVMSQE_TEST_OPTION=-quick-jdi
745vmsqe_quick-jdi: vmsqe_tests
746
747vmsqe_sajdi: RUNVMSQE_TEST_OPTION=-sajdi
748vmsqe_sajdi: vmsqe_tests
749
750vmsqe_jvmti: RUNVMSQE_TEST_OPTION=-jvmti
751vmsqe_jvmti: vmsqe_tests
752
753vmsqe_hprof: RUNVMSQE_TEST_OPTION=-hprof
754vmsqe_hprof: vmsqe_tests
755
756vmsqe_monitoring: RUNVMSQE_TEST_OPTION=-monitoring
757vmsqe_monitoring: vmsqe_tests
758
759PHONY_LIST += vmsqe_jdwp vmsqe_jdi vmsqe_jdb vmsqe_quick-jdi vmsqe_sajdi \
760 vmsqe_jvmti vmsqe_hprof vmsqe_monitoring vmsqe_tests
761
762################################################################
763
764# jck tests
765
766JCK_WORK_DIR = $(ABS_TEST_OUTPUT_DIR)/JCKwork
767JCK_REPORT_DIR = $(ABS_TEST_OUTPUT_DIR)/JCKreport
768JCK_PROPERTIES = $(ABS_TEST_OUTPUT_DIR)/jck.properties
769JCK_CONFIG = $(ABS_TEST_OUTPUT_DIR)/jck.config
770
771JCK_JAVA_EXE = $(PRODUCT_HOME)/bin/java$(EXESUFFIX)
772
773JCK_JAVATEST_JAR = $(JCK_HOME)/lib/javatest.jar
774JCK_JAVATEST = $(ALT_BOOTDIR)/bin/java -jar $(JCK_JAVATEST_JAR)
775
776$(JCK_CONFIG): $(TEST_ROOT)/JCK-$(JCK_BUNDLE_NAME)-$(JCK_RELEASE)-base.jti
777 $(RM) $@
778 $(MKDIR) -p $(@D)
779 $(CP) $< $@
780
781$(JCK_PROPERTIES): $(PRODUCT_HOME) $(JCK_JAVA_EXE)
782 $(RM) $@
783 $(MKDIR) -p $(@D)
784 $(ECHO) "jck.env.compiler.compRefExecute.cmdAsFile=$(JCK_JAVA_EXE)" >> $@
785 $(ECHO) "jck.env.compiler.compRefExecute.systemRoot=$(SYSTEMROOT)" >> $@
786 $(ECHO) "jck.env.compiler.testCompile.testCompileAPImultiJVM.cmdAsFile=$(JCK_JAVA_EXE)" >> $@
787 $(ECHO) "jck.tests.tests=$(JCK_BUNDLE_TESTDIRS)" >> $@
788
789jck_tests: prep $(JCK_HOME) $(JCK_PROPERTIES) $(JCK_CONFIG) $(JCK_JAVATEST_JAR)
790 $(MKDIR) -p $(JCK_WORK_DIR)
791 ( $(JCK_JAVATEST) \
792 -verbose:commands,non-pass \
793 -testSuite $(JCK_HOME) \
794 -workDir $(JCK_WORK_DIR) \
795 -config $(JCK_CONFIG) \
796 -set -file $(JCK_PROPERTIES) \
797 -runtests \
798 -writeReport $(JCK_REPORT_DIR) \
799 ) ; $(BUNDLE_UP_AND_EXIT)
800
801PHONY_LIST += jck_tests
802
803################################################################
804
805# jck6 tests
806
807JCK6_RELEASE = 6b
808JCK6_DEFAULT_HOME = $(SLASH_JAVA)/re/jck/$(JCK6_RELEASE)/archive/fcs/binaries
809
810# Expect JPRT to set JPRT_JCK6COMPILER_HOME.
811JCK6COMPILER_HOME = $(JCK6_DEFAULT_HOME)/JCK-compiler-$(JCK6_RELEASE)
812ifdef JPRT_JCK6COMPILER_HOME
813 JCK6COMPILER_HOME = $(JPRT_JCK6COMPILER_HOME)
814endif
815
816# Expect JPRT to set JPRT_JCK6RUNTIME_HOME.
817JCK6RUNTIME_HOME = $(JCK6_DEFAULT_HOME)/JCK-runtime-$(JCK6_RELEASE)
818ifdef JPRT_JCK6RUNTIME_HOME
819 JCK6RUNTIME_HOME = $(JPRT_JCK6RUNTIME_HOME)
820endif
821
822# Expect JPRT to set JPRT_JCK6DEVTOOLS_HOME.
823JCK6DEVTOOLS_HOME = $(JCK6_DEFAULT_HOME)/JCK-devtools-$(JCK6_RELEASE)
824ifdef JPRT_JCK6DEVTOOLS_HOME
825 JCK6DEVTOOLS_HOME = $(JPRT_JCK6DEVTOOLS_HOME)
826endif
827
828jck6_tests: JCK_HOME=$(JCK6_HOME)
829jck6_tests: JCK_RELEASE=$(JCK6_RELEASE)
830jck6_tests: jck_tests
831
832jck6compiler: JCK6_HOME=$(JCK6COMPILER_HOME)
833jck6compiler: JCK_BUNDLE_NAME=compiler
834jck6compiler: jck6_tests
835
836jck6compiler_lang: JCK_BUNDLE_TESTDIRS=lang
837jck6compiler_lang: jck6compiler
838
839jck6runtime: JCK6_HOME=$(JCK6RUNTIME_HOME)
840jck6runtime: JCK_BUNDLE_NAME=runtime
841jck6runtime: jck6_tests
842
843jck6runtime_lang: JCK_BUNDLE_TESTDIRS=lang
844jck6runtime_lang: jck6runtime
845
846jck6devtools: JCK6_HOME=$(JCK6DEVTOOLS_HOME)
847jck6devtools: JCK_BUNDLE_NAME=devtools
848jck6devtools: jck6_tests
849
850jck6devtools_lang: JCK_BUNDLE_TESTDIRS=lang
851jck6devtools_lang: jck6devtools
852
853PHONY_LIST += jck6compiler jck6runtime jck6devtools jck6_tests \
854 jck6compiler_lang jck6runtime_lang jck6devtools_lang
855
856################################################################
857
858# jck7 tests
859
860JCK7_RELEASE = 7
861JCK7_DEFAULT_HOME = $(SLASH_JAVA)/re/jck/$(JCK7_RELEASE)/archive/fcs/binaries
862
863# Expect JPRT to set JPRT_JCK7COMPILER_HOME.
864JCK7COMPILER_HOME = $(JCK7_DEFAULT_HOME)/JCK-compiler-$(JCK7_RELEASE)
865ifdef JPRT_JCK7COMPILER_HOME
866 JCK7COMPILER_HOME = $(JPRT_JCK7COMPILER_HOME)
867endif
868
869# Expect JPRT to set JPRT_JCK7RUNTIME_HOME.
870JCK7RUNTIME_HOME = $(JCK7_DEFAULT_HOME)/JCK-runtime-$(JCK7_RELEASE)
871ifdef JPRT_JCK7RUNTIME_HOME
872 JCK7RUNTIME_HOME = $(JPRT_JCK7RUNTIME_HOME)
873endif
874
875# Expect JPRT to set JPRT_JCK7DEVTOOLS_HOME.
876JCK7DEVTOOLS_HOME = $(JCK7_DEFAULT_HOME)/JCK-devtools-$(JCK7_RELEASE)
877ifdef JPRT_JCK7DEVTOOLS_HOME
878 JCK7DEVTOOLS_HOME = $(JPRT_JCK7DEVTOOLS_HOME)
879endif
880
881jck7_tests: JCK_HOME=$(JCK7_HOME)
882jck7_tests: JCK_RELEASE=$(JCK7_RELEASE)
883jck7_tests: jck_tests
884
885jck7compiler: JCK7_HOME=$(JCK7COMPILER_HOME)
886jck7compiler: JCK_BUNDLE_NAME=compiler
887jck7compiler: jck7_tests
888
889jck7compiler_lang: JCK_BUNDLE_TESTDIRS=lang
890jck7compiler_lang: jck7compiler
891
892jck7runtime: JCK7_HOME=$(JCK7RUNTIME_HOME)
893jck7runtime: JCK_BUNDLE_NAME=runtime
894jck7runtime: jck7_tests
895
896jck7runtime_lang: JCK_BUNDLE_TESTDIRS=lang
897jck7runtime_lang: jck7runtime
898
899jck7devtools: JCK7_HOME=$(JCK7DEVTOOLS_HOME)
900jck7devtools: JCK_BUNDLE_NAME=devtools
901jck7devtools: jck7_tests
902
903jck7devtools_lang: JCK_BUNDLE_TESTDIRS=lang
904jck7devtools_lang: jck7devtools
905
906PHONY_LIST += jck7compiler jck7runtime jck7devtools jck7_tests \
907 jck7compiler_lang jck7runtime_lang jck7devtools_lang
908
909################################################################
J. Duke319a3b92007-12-01 00:00:00 +0000910
911# Phony targets (e.g. these are not filenames)
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700912.PHONY: all clean prep $(PHONY_LIST)
913
914################################################################
J. Duke319a3b92007-12-01 00:00:00 +0000915