blob: 602d8fc0a91f103e6744b04c1c5f1aeb1657a73a [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001#
Kelly O'Haird1258922009-11-08 15:11:10 -08002# Copyright 1995-2009 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
40CHMOD = chmod
41CP = cp
42CUT = cut
43ECHO = echo
44EGREP = egrep
45EXPAND = expand
46EXPR = expr
47KILL = /usr/bin/kill
48MKDIR = mkdir
49NOHUP = nohup
50PWD = pwd
51SED = sed
52SLEEP = sleep
53SORT = sort
54TEE = tee
55UNAME = uname
56UNIQ = uniq
57WC = wc
58XHOST = xhost
59ZIP = zip
60
61# Get OS name from uname
62UNAME_S := $(shell $(UNAME) -s)
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -070063
64# Commands to run on paths to make mixed paths for java on windows
Kelly O'Haird1258922009-11-08 15:11:10 -080065GETMIXEDPATH=$(ECHO)
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -070066
67# Location of developer shared files
68SLASH_JAVA = /java
69
70# Platform specific settings
Kelly O'Haird1258922009-11-08 15:11:10 -080071ifeq ($(UNAME_S), SunOS)
72 OS_NAME = solaris
73 OS_ARCH := $(shell $(UNAME) -p)
74 OS_VERSION := $(shell $(UNAME) -r)
J. Duke319a3b92007-12-01 00:00:00 +000075endif
Kelly O'Haird1258922009-11-08 15:11:10 -080076ifeq ($(UNAME_S), Linux)
77 OS_NAME = linux
78 OS_ARCH := $(shell $(UNAME) -m)
79 OS_VERSION := $(shell $(UNAME) -r)
J. Duke319a3b92007-12-01 00:00:00 +000080endif
Kelly O'Haird1258922009-11-08 15:11:10 -080081ifndef OS_NAME
82 ifneq ($(PROCESSOR_IDENTIFIER), )
83 OS_NAME = windows
84 SLASH_JAVA = J:
85 # A variety of ways to say X64 arch :^(
86 OS_ARCH:=$(word 1, $(PROCESSOR_IDENTIFIER))
87 EXESUFFIX = .exe
88 # These need to be different depending on MKS or CYGWIN
89 ifeq ($(findstring cygdrive,$(shell ($(CD) C:/ && $(PWD)))), )
90 GETMIXEDPATH = dosname -s
91 OS_VERSION := $(shell $(UNAME) -r)
J. Duke319a3b92007-12-01 00:00:00 +000092 else
Kelly O'Haird1258922009-11-08 15:11:10 -080093 GETMIXEDPATH = cygpath -m -s
94 OS_VERSION := $(shell $(UNAME) -s | $(CUT) -d'-' -f2)
J. Duke319a3b92007-12-01 00:00:00 +000095 endif
96 endif
Kelly O'Haird1258922009-11-08 15:11:10 -080097endif
98
99# Only want major and minor numbers from os version
100OS_VERSION := $(shell $(ECHO) "$(OS_VERSION)" | $(CUT) -d'.' -f1,2)
101
102# Try and use names i586, x64, and ia64 consistently
103OS_ARCH:=$(subst X64,x64,$(OS_ARCH))
104OS_ARCH:=$(subst AMD64,x64,$(OS_ARCH))
105OS_ARCH:=$(subst amd64,x64,$(OS_ARCH))
106OS_ARCH:=$(subst x86_64,x64,$(OS_ARCH))
107OS_ARCH:=$(subst EM64T,x64,$(OS_ARCH))
108OS_ARCH:=$(subst em64t,x64,$(OS_ARCH))
109OS_ARCH:=$(subst intel64,x64,$(OS_ARCH))
110OS_ARCH:=$(subst Intel64,x64,$(OS_ARCH))
111OS_ARCH:=$(subst INTEL64,x64,$(OS_ARCH))
112OS_ARCH:=$(subst IA64,ia64,$(OS_ARCH))
113OS_ARCH:=$(subst X86,i586,$(OS_ARCH))
114OS_ARCH:=$(subst x86,i586,$(OS_ARCH))
115OS_ARCH:=$(subst i386,i586,$(OS_ARCH))
116OS_ARCH:=$(subst i486,i586,$(OS_ARCH))
117OS_ARCH:=$(subst i686,i586,$(OS_ARCH))
118
119# Check for ARCH_DATA_MODEL, adjust OS_ARCH accordingly
120ifndef ARCH_DATA_MODEL
121 ARCH_DATA_MODEL=32
122endif
123ARCH_DATA_MODEL_ERROR= \
124 ARCH_DATA_MODEL=$(ARCH_DATA_MODEL) cannot be used with $(OS_NAME)-$(ARCH)
125ifeq ($(ARCH_DATA_MODEL),64)
126 ifeq ($(OS_NAME)-$(OS_ARCH),solaris-i586)
127 OS_ARCH=x64
128 endif
129 ifeq ($(OS_NAME)-$(OS_ARCH),solaris-sparc)
130 OS_ARCH=sparcv9
131 endif
132 ifeq ($(OS_ARCH),i586)
133 x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
134 endif
135 ifeq ($(OS_ARCH),sparc)
136 x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
137 endif
138else
139 ifeq ($(ARCH_DATA_MODEL),32)
140 ifeq ($(OS_ARCH),x64)
141 x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
142 endif
143 ifeq ($(OS_ARCH),ia64)
144 x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
145 endif
146 ifeq ($(OS_ARCH),sparcv9)
147 x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
148 endif
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700149 else
Kelly O'Haird1258922009-11-08 15:11:10 -0800150 x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700151 endif
J. Duke319a3b92007-12-01 00:00:00 +0000152endif
153
154# Root of this test area (important to use full paths in some places)
Kelly O'Haird1258922009-11-08 15:11:10 -0800155TEST_ROOT := $(shell $(PWD))
J. Duke319a3b92007-12-01 00:00:00 +0000156
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700157# Root of all test results
158ifdef ALT_OUTPUTDIR
159 ABS_OUTPUTDIR = $(ALT_OUTPUTDIR)
J. Duke319a3b92007-12-01 00:00:00 +0000160else
Kelly O'Haird1258922009-11-08 15:11:10 -0800161 ABS_OUTPUTDIR = $(TEST_ROOT)/../build/$(OS_NAME)-$(OS_ARCH)
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700162endif
163ABS_BUILD_ROOT = $(ABS_OUTPUTDIR)
Kelly O'Haird1258922009-11-08 15:11:10 -0800164ABS_TEST_OUTPUT_DIR := $(ABS_BUILD_ROOT)/testoutput/$(UNIQUE_DIR)
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700165
166# Expect JPRT to set PRODUCT_HOME (the product or jdk in this case to test)
167ifndef PRODUCT_HOME
168 # Try to use j2sdk-image if it exists
169 ABS_JDK_IMAGE = $(ABS_BUILD_ROOT)/j2sdk-image
170 PRODUCT_HOME := \
171 $(shell \
172 if [ -d $(ABS_JDK_IMAGE) ] ; then \
173 $(ECHO) "$(ABS_JDK_IMAGE)"; \
174 else \
Kelly O'Haird1258922009-11-08 15:11:10 -0800175 $(ECHO) "$(ABS_BUILD_ROOT)"; \
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700176 fi)
177 PRODUCT_HOME := $(PRODUCT_HOME)
J. Duke319a3b92007-12-01 00:00:00 +0000178endif
179
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700180# Expect JPRT to set JPRT_PRODUCT_ARGS (e.g. -server etc.)
181# Should be passed into 'java' only.
Kelly O'Haird1258922009-11-08 15:11:10 -0800182# Could include: -d64 -server -client OR any java option
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700183ifdef JPRT_PRODUCT_ARGS
184 JAVA_ARGS = $(JPRT_PRODUCT_ARGS)
185endif
J. Duke319a3b92007-12-01 00:00:00 +0000186
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700187# Expect JPRT to set JPRT_PRODUCT_VM_ARGS (e.g. -Xcomp etc.)
188# Should be passed into anything running the vm (java, javac, javadoc, ...).
189ifdef JPRT_PRODUCT_VM_ARGS
190 JAVA_VM_ARGS = $(JPRT_PRODUCT_VM_ARGS)
191endif
J. Duke319a3b92007-12-01 00:00:00 +0000192
Kelly O'Haird1258922009-11-08 15:11:10 -0800193# Check JAVA_ARGS arguments based on ARCH_DATA_MODEL etc.
194ifeq ($(OS_NAME),solaris)
195 D64_ERROR_MESSAGE=Mismatch between ARCH_DATA_MODEL=$(ARCH_DATA_MODEL) and use of -d64 in JAVA_ARGS=$(JAVA_ARGS)
196 ifeq ($(ARCH_DATA_MODEL),32)
197 ifneq ($(findstring -d64,$(JAVA_ARGS)),)
198 x:=$(warning "WARNING: $(D64_ERROR_MESSAGE)")
199 endif
200 endif
201 ifeq ($(ARCH_DATA_MODEL),64)
202 ifeq ($(findstring -d64,$(JAVA_ARGS)),)
203 x:=$(warning "WARNING: $(D64_ERROR_MESSAGE)")
204 endif
205 endif
206endif
207
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700208# Expect JPRT to set JPRT_ARCHIVE_BUNDLE (path to zip bundle for results)
209ARCHIVE_BUNDLE = $(ABS_TEST_OUTPUT_DIR)/ARCHIVE_BUNDLE.zip
210ifdef JPRT_ARCHIVE_BUNDLE
211 ARCHIVE_BUNDLE = $(JPRT_ARCHIVE_BUNDLE)
212endif
J. Duke319a3b92007-12-01 00:00:00 +0000213
Kelly O'Haird1258922009-11-08 15:11:10 -0800214# DISPLAY settings for virtual frame buffer
215START_XVFB = start-Xvfb.sh
216NOHUP_OUTPUT = $(ABS_TEST_OUTPUT_DIR)/start-Xvfb.nohup-output.txt
217DISPLAY_PID_FILE=$(ABS_TEST_OUTPUT_DIR)/xvfb-display-number.txt
218DISPLAY_SLEEP_TIME=10
219DISPLAY_MAX_SLEEPS=10
220ifeq ($(OS_NAME),solaris)
221 VIRTUAL_FRAME_BUFFER = true
222endif
223ifeq ($(OS_NAME),linux)
224 VIRTUAL_FRAME_BUFFER = true
225endif
226
227# Does not work yet, display dies as soon as it gets used. :^(
228VIRTUAL_FRAME_BUFFER = false
229
230# Are we using a VIRTUAL_FRAME_BUFFER (Xvfb)
231ifeq ($(VIRTUAL_FRAME_BUFFER),true)
232
233 PREP_DISPLAY = \
234 $(CP) $(START_XVFB) $(ABS_TEST_OUTPUT_DIR); \
235 $(CHMOD) a+x $(ABS_TEST_OUTPUT_DIR)/$(START_XVFB); \
236 ( $(CD) $(ABS_TEST_OUTPUT_DIR) && \
237 $(NOHUP) $(ABS_TEST_OUTPUT_DIR)/$(START_XVFB) $(DISPLAY_PID_FILE) > $(NOHUP_OUTPUT) 2>&1 && \
238 $(SLEEP) $(DISPLAY_SLEEP_TIME) ) & \
239 count=1; \
240 while [ ! -s $(DISPLAY_PID_FILE) ] ; do \
241 $(ECHO) "Sleeping $(DISPLAY_SLEEP_TIME) more seconds, DISPLAY not ready"; \
242 $(SLEEP) $(DISPLAY_SLEEP_TIME); \
243 count=`$(EXPR) $${count} '+' 1`; \
244 if [ $${count} -gt $(DISPLAY_MAX_SLEEPS) ] ; then \
245 $(ECHO) "ERROR: DISPLAY not ready, giving up on DISPLAY"; \
246 exit 9; \
247 fi; \
248 done ; \
249 DISPLAY=":`$(CAT) $(DISPLAY_PID_FILE)`"; \
250 export DISPLAY; \
251 $(CAT) $(NOHUP_OUTPUT); \
252 $(ECHO) "Prepared DISPLAY=$${DISPLAY}"; \
253 $(XHOST) || \
254 ( $(ECHO) "ERROR: No display" ; exit 8)
255
256 KILL_DISPLAY = \
257 ( \
258 DISPLAY=":`$(CAT) $(DISPLAY_PID_FILE)`"; \
259 export DISPLAY; \
260 if [ -s "$(DISPLAY_PID_FILE)" ] ; then \
261 $(KILL) `$(CAT) $(DISPLAY_PID_FILE)` > /dev/null 2>&1; \
262 $(KILL) -9 `$(CAT) $(DISPLAY_PID_FILE)` > /dev/null 2>&1; \
263 fi; \
264 $(ECHO) "Killed DISPLAY=$${DISPLAY}"; \
265 )
266
267else
268
269 PREP_DISPLAY = $(ECHO) "VIRTUAL_FRAME_BUFFER=$(VIRTUAL_FRAME_BUFFER)"
270 KILL_DISPLAY = $(ECHO) "VIRTUAL_FRAME_BUFFER=$(VIRTUAL_FRAME_BUFFER)"
271
272endif
273
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700274# How to create the test bundle (pass or fail, we want to create this)
275# Follow command with ";$(BUNDLE_UP_AND_EXIT)", so it always gets executed.
276ZIP_UP_RESULTS = ( $(MKDIR) -p `dirname $(ARCHIVE_BUNDLE)` \
277 && $(CD) $(ABS_TEST_OUTPUT_DIR) \
278 && $(ZIP) -q -r $(ARCHIVE_BUNDLE) . )
Kelly O'Haird1258922009-11-08 15:11:10 -0800279SUMMARY_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTreport/text/summary.txt
280STATS_TXT_NAME = Stats.txt
281STATS_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/$(STATS_TXT_NAME)
282RUNLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/runlist.txt
283PASSLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/passlist.txt
284FAILLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/faillist.txt
285BUNDLE_UP_AND_EXIT = \
286( \
287 exitCode=$$? && \
288 _summary="$(SUMMARY_TXT)"; \
289 $(RM) -f $(STATS_TXT) $(RUNLIST) $(PASSLIST) $(FAILLIST); \
290 if [ -r "$${_summary}" ] ; then \
291 $(ECHO) "Summary: $${_summary}" > $(STATS_TXT); \
292 $(EXPAND) $${_summary} | $(EGREP) -v ' Not run\.' > $(RUNLIST); \
293 $(EGREP) ' Passed\.' $(RUNLIST) \
294 | $(EGREP) -v ' Error\.' \
295 | $(EGREP) -v ' Failed\.' > $(PASSLIST); \
296 ( $(EGREP) ' Failed\.' $(RUNLIST); \
297 $(EGREP) ' Error\.' $(RUNLIST); \
298 $(EGREP) -v ' Passed\.' $(RUNLIST) ) \
299 | $(SORT) | $(UNIQ) > $(FAILLIST); \
300 if [ $${exitCode} != 0 -o -s $(FAILLIST) ] ; then \
301 $(EXPAND) $(FAILLIST) \
302 | $(CUT) -d' ' -f1 \
303 | $(SED) -e 's@^@FAILED: @' >> $(STATS_TXT); \
304 fi; \
305 runc="`$(CAT) $(RUNLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
306 passc="`$(CAT) $(PASSLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
307 failc="`$(CAT) $(FAILLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
308 exclc="`$(CAT) $(EXCLUDELIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
309 $(ECHO) "TEST STATS: run=$${runc} pass=$${passc} fail=$${failc} excluded=$${exclc}" \
310 >> $(STATS_TXT); \
311 else \
312 $(ECHO) "Missing file: $${_summary}" >> $(STATS_TXT); \
313 fi; \
314 $(CAT) $(STATS_TXT); \
315 $(ZIP_UP_RESULTS) && $(KILL_DISPLAY) && \
316 exit $${exitCode} \
317)
J. Duke319a3b92007-12-01 00:00:00 +0000318
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700319################################################################
J. Duke319a3b92007-12-01 00:00:00 +0000320
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700321# Default make rule (runs jtreg_tests)
322all: jtreg_tests
323 @$(ECHO) "Testing completed successfully"
J. Duke319a3b92007-12-01 00:00:00 +0000324
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700325# Prep for output
326prep: clean
327 @$(MKDIR) -p $(ABS_TEST_OUTPUT_DIR)
328 @$(MKDIR) -p `dirname $(ARCHIVE_BUNDLE)`
J. Duke319a3b92007-12-01 00:00:00 +0000329
330# Cleanup
331clean:
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700332 $(RM) -r $(ABS_TEST_OUTPUT_DIR)
333 $(RM) $(ARCHIVE_BUNDLE)
J. Duke319a3b92007-12-01 00:00:00 +0000334
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700335################################################################
336
337# jtreg tests
338
339# Expect JT_HOME to be set for jtreg tests. (home for jtreg)
340JT_HOME = $(SLASH_JAVA)/re/jtreg/4.0/promoted/latest/binaries/jtreg
341ifdef JPRT_JTREG_HOME
342 JT_HOME = $(JPRT_JTREG_HOME)
343endif
344
345# Expect JPRT to set TESTDIRS to the jtreg test dirs
346ifndef TESTDIRS
Kelly O'Haird1258922009-11-08 15:11:10 -0800347 TESTDIRS = demo
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700348endif
349
Kelly O'Haird1258922009-11-08 15:11:10 -0800350# Samevm settings (default is false)
351ifndef USE_JTREG_SAMEVM
352 USE_JTREG_SAMEVM=false
353endif
354# With samevm, you cannot use -javaoptions?
355ifeq ($(USE_JTREG_SAMEVM),true)
356 EXTRA_JTREG_OPTIONS += -samevm $(JAVA_ARGS) $(JAVA_ARGS:%=-vmoption:%)
357 JTREG_TEST_OPTIONS = $(JAVA_VM_ARGS:%=-vmoption:%)
358else
359 JTREG_TEST_OPTIONS = $(JAVA_ARGS:%=-javaoptions:%) $(JAVA_VM_ARGS:%=-vmoption:%)
360endif
361
362# Some tests annoy me and fail frequently
363PROBLEM_LIST=ProblemList.txt
364EXCLUDELIST=$(ABS_TEST_OUTPUT_DIR)/excludelist.txt
365
366# Create exclude list for this platform and arch
367ifdef NO_EXCLUDES
368$(EXCLUDELIST): $(PROBLEM_LIST) $(TESTDIRS)
369 @$(ECHO) "NOTHING_EXCLUDED" > $@
370else
371$(EXCLUDELIST): $(PROBLEM_LIST) $(TESTDIRS)
372 @$(RM) $@ $@.temp1 $@.temp2
373 @( ( $(EGREP) -- '$(OS_NAME)-all' $< ) ;\
374 ( $(EGREP) -- '$(OS_NAME)-$(OS_ARCH)' $< ) ;\
375 ( $(EGREP) -- '$(OS_NAME)-$(OS_VERSION)' $< ) ;\
376 ( $(EGREP) -- 'generic-$(OS_ARCH)' $< ) ;\
377 ( $(EGREP) -- 'generic-all' $< ) ;\
378 ( $(ECHO) "#") ;\
379 ) | $(SED) -e 's@^[\ ]*@@' \
380 | $(EGREP) -v '^#' > $@.temp1
381 @for tdir in $(TESTDIRS) ; do \
382 ( ( $(CAT) $@.temp1 | $(EGREP) "^$${tdir}" ) ; $(ECHO) "#" ) >> $@.temp2 ; \
383 done
384 @$(ECHO) "# at least one line" >> $@.temp2
385 @( $(EGREP) -v '^#' $@.temp2 ; true ) > $@
386 @$(ECHO) "Excluding list contains `$(EXPAND) $@ | $(WC) -l` items"
387endif
388
389# Running batches of tests with or without samevm
390define RunSamevmBatch
391$(ECHO) "Running tests in samevm mode: $?"
392$(MAKE) TESTDIRS="$?" USE_JTREG_SAMEVM=true UNIQUE_DIR=$@ jtreg_tests
393endef
394define RunOthervmBatch
395$(ECHO) "Running tests in othervm mode: $?"
396$(MAKE) TESTDIRS="$?" USE_JTREG_SAMEVM=false UNIQUE_DIR=$@ jtreg_tests
397endef
398define SummaryInfo
399$(ECHO) "Summary for: $?"
400$(CAT) $(?:%=$(ABS_TEST_OUTPUT_DIR)/%/$(STATS_TXT_NAME))
401endef
402
403# ------------------------------------------------------------------
404
405# Batches of tests (somewhat arbitrary assigments to jdk_* targets)
406JDK_ALL_TARGETS =
407
408# Stable othervm testruns (minus items from PROBLEM_LIST)
409# Using samevm has problems, and doesn't help performance as much as others.
410JDK_ALL_TARGETS += jdk_awt
411jdk_awt: com/sun/awt java/awt sun/awt
412 $(call RunOthervmBatch)
413
414# Stable samevm testruns (minus items from PROBLEM_LIST)
415JDK_ALL_TARGETS += jdk_beans1
416jdk_beans1: java/beans/beancontext java/beans/PropertyChangeSupport \
417 java/beans/Introspector java/beans/Performance \
418 java/beans/VetoableChangeSupport java/beans/Statement
419 $(call RunSamevmBatch)
420
421# Stable othervm testruns (minus items from PROBLEM_LIST)
422# Using samevm has serious problems with these tests
423JDK_ALL_TARGETS += jdk_beans2
424jdk_beans2: java/beans/Beans java/beans/EventHandler java/beans/XMLDecoder \
425 java/beans/PropertyEditor
426 $(call RunOthervmBatch)
427JDK_ALL_TARGETS += jdk_beans3
428jdk_beans3: java/beans/XMLEncoder
429 $(call RunOthervmBatch)
430
431# Stable samevm testruns (minus items from PROBLEM_LIST)
432JDK_ALL_TARGETS += jdk_io
433jdk_io: java/io
434 $(call RunSamevmBatch)
435
436# Stable samevm testruns (minus items from PROBLEM_LIST)
437JDK_ALL_TARGETS += jdk_lang
438jdk_lang: java/lang
439 $(call RunSamevmBatch)
440
441# Stable othervm testruns (minus items from PROBLEM_LIST)
442# Using samevm has serious problems with these tests
443JDK_ALL_TARGETS += jdk_management1
444jdk_management1: javax/management
445 $(call RunOthervmBatch)
446
447# Stable othervm testruns (minus items from PROBLEM_LIST)
448# Using samevm has serious problems with these tests
449JDK_ALL_TARGETS += jdk_management2
450jdk_management2: com/sun/jmx com/sun/management sun/management
451 $(call RunOthervmBatch)
452
453# Stable samevm testruns (minus items from PROBLEM_LIST)
454JDK_ALL_TARGETS += jdk_math
455jdk_math: java/math
456 $(call RunSamevmBatch)
457
458# Stable samevm testruns (minus items from PROBLEM_LIST)
459JDK_ALL_TARGETS += jdk_misc
460jdk_misc: demo javax/imageio javax/naming javax/print javax/script \
461 javax/smartcardio javax/sound com/sun/java com/sun/jndi \
462 com/sun/org sun/misc sun/pisces
463 $(call RunSamevmBatch)
464
465# Stable samevm testruns (minus items from PROBLEM_LIST)
466JDK_ALL_TARGETS += jdk_net
467jdk_net: com/sun/net java/net sun/net
468 $(call RunSamevmBatch)
469
470# Stable samevm testruns (minus items from PROBLEM_LIST)
471JDK_ALL_TARGETS += jdk_nio1
472jdk_nio1: java/nio/file
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_nio2
478jdk_nio2: java/nio/Buffer java/nio/ByteOrder \
479 java/nio/channels java/nio/BufferPoolMXBean java/nio/MappedByteBuffer
480 $(call RunOthervmBatch)
481JDK_ALL_TARGETS += jdk_nio3
482jdk_nio3: com/sun/nio sun/nio
483 $(call RunOthervmBatch)
484
485# Stable othervm testruns (minus items from PROBLEM_LIST)
486# Using samevm has serious problems with these tests
487JDK_ALL_TARGETS += jdk_rmi
488jdk_rmi: java/rmi javax/rmi sun/rmi
489 $(call RunOthervmBatch)
490
491# Stable samevm testruns (minus items from PROBLEM_LIST)
492JDK_ALL_TARGETS += jdk_security1
493jdk_security1: java/security
494 $(call RunSamevmBatch)
495
496# Stable othervm testruns (minus items from PROBLEM_LIST)
497# Using samevm has serious problems with these tests
498JDK_ALL_TARGETS += jdk_security2
499jdk_security2: javax/crypto com/sun/crypto
500 $(call RunOthervmBatch)
501JDK_ALL_TARGETS += jdk_security3
502jdk_security3: com/sun/security lib/security javax/security sun/security
503 $(call RunOthervmBatch)
504
505# Stable othervm testruns (minus items from PROBLEM_LIST)
506# Using samevm has problems, and doesn't help performance as much as others.
507JDK_ALL_TARGETS += jdk_swing
508jdk_swing: javax/swing sun/java2d
509 $(call RunOthervmBatch)
510
511# Stable samevm testruns (minus items from PROBLEM_LIST)
512JDK_ALL_TARGETS += jdk_text
513jdk_text: java/text sun/text
514 $(call RunSamevmBatch)
515
516# Stable othervm testruns (minus items from PROBLEM_LIST)
517# Using samevm has serious problems with these tests
518JDK_ALL_TARGETS += jdk_tools1
519jdk_tools1: com/sun/jdi
520 $(call RunOthervmBatch)
521JDK_ALL_TARGETS += jdk_tools2
522jdk_tools2: com/sun/tools sun/jvmstat sun/tools tools vm com/sun/servicetag com/sun/tracing
523 $(call RunOthervmBatch)
524
525# Stable samevm testruns (minus items from PROBLEM_LIST)
526JDK_ALL_TARGETS += jdk_util
527jdk_util: java/util sun/util
528 $(call RunSamevmBatch)
529
530# ------------------------------------------------------------------
531
532# Run all tests
533jdk_all: $(filter-out jdk_awt jdk_rmi jdk_swing, $(JDK_ALL_TARGETS))
534 @$(SummaryInfo)
535
536# These are all phony targets
537PHONY_LIST += $(JDK_ALL_TARGETS)
538
539# ------------------------------------------------------------------
540
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700541# Default JTREG to run (win32 script works for everybody)
542JTREG = $(JT_HOME)/win32/bin/jtreg
Kelly O'Haird1258922009-11-08 15:11:10 -0800543# Add any extra options (samevm etc.)
544JTREG_BASIC_OPTIONS += $(EXTRA_JTREG_OPTIONS)
545# Only run automatic tests
546JTREG_BASIC_OPTIONS += -a
547# Report details on all failed or error tests, times too
548JTREG_BASIC_OPTIONS += -v:fail,error,time
549# Retain all files for failing tests
550JTREG_BASIC_OPTIONS += -retain:fail,error
551# Ignore tests are not run and completely silent about it
552JTREG_BASIC_OPTIONS += -ignore:quiet
553# Multiple by 2 the timeout numbers
554JTREG_BASIC_OPTIONS += -timeoutFactor:2
555# Boost the max memory for jtreg to avoid gc thrashing
556JTREG_BASIC_OPTIONS += -J-Xmx512m
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700557
Kelly O'Haird1258922009-11-08 15:11:10 -0800558# Make sure jtreg exists
559$(JTREG): $(JT_HOME)
560
561# Run jtreg
562jtreg_tests: prep $(PRODUCT_HOME) $(JTREG) $(EXCLUDELIST)
563 @$(EXPAND) $(EXCLUDELIST) \
564 | $(CUT) -d' ' -f1 \
565 | $(SED) -e 's@^@Excluding: @'
566 ( \
567 ( JT_HOME=$(shell $(GETMIXEDPATH) "$(JT_HOME)"); \
568 export JT_HOME; \
569 $(PREP_DISPLAY) && \
570 $(shell $(GETMIXEDPATH) "$(JTREG)") \
571 $(JTREG_BASIC_OPTIONS) \
572 -r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTreport \
573 -w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTwork \
574 -jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \
575 -exclude:$(shell $(GETMIXEDPATH) "$(EXCLUDELIST)") \
576 $(JTREG_TEST_OPTIONS) \
577 $(TESTDIRS) \
578 ) ; $(BUNDLE_UP_AND_EXIT) \
579 ) 2>&1 | $(TEE) $(ABS_TEST_OUTPUT_DIR)/output.txt
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700580
581PHONY_LIST += jtreg_tests
582
583################################################################
584
585# packtest
586
587# Expect JPRT to set JPRT_PACKTEST_HOME.
588PACKTEST_HOME = /net/jprt-web.sfbay.sun.com/jprt/allproducts/packtest
589ifdef JPRT_PACKTEST_HOME
590 PACKTEST_HOME = $(JPRT_PACKTEST_HOME)
591endif
592
593packtest: prep $(PACKTEST_HOME)/ptest $(PRODUCT_HOME)
594 ( $(CD) $(PACKTEST_HOME) && \
595 $(PACKTEST_HOME)/ptest \
596 -t "$(PRODUCT_HOME)" \
597 $(PACKTEST_STRESS_OPTION) \
598 $(EXTRA_PACKTEST_OPTIONS) \
599 -W $(ABS_TEST_OUTPUT_DIR) \
600 $(JAVA_ARGS:%=-J %) \
601 $(JAVA_VM_ARGS:%=-J %) \
602 ) ; $(BUNDLE_UP_AND_EXIT)
603
604packtest_stress: PACKTEST_STRESS_OPTION=-s
605packtest_stress: packtest
606
607PHONY_LIST += packtest packtest_stress
608
609################################################################
610
Mandy Chunge2f72482009-05-26 17:47:57 -0700611# perftest to collect statistics
612
613# Expect JPRT to set JPRT_PACKTEST_HOME.
614PERFTEST_HOME = ${TEST_ROOT}/perf
615ifdef JPRT_PERFTEST_HOME
616 PERFTEST_HOME = $(JPRT_PERFTEST_HOME)
617endif
618
619perftest: ( $(PERFTEST_HOME)/perftest \
620 -t $(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \
621 -w $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)") \
622 -h $(PERFTEST_HOME) \
623 ) ; $(BUNDLE_UP_AND_EXIT)
624
625
626PHONY_LIST += perftest
627
628################################################################
629
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700630# vmsqe tests
631
632# Expect JPRT to set JPRT_VMSQE_HOME.
633VMSQE_HOME = /java/sqe/comp/vm/testbase/sqe/vm/current/build/latest/vm
634ifdef JPRT_VMSQE_HOME
635 VMSQE_HOME = $(JPRT_VMSQE_HOME)
636endif
637
638# Expect JPRT to set JPRT_RUNVMSQE_HOME.
639RUNVMSQE_HOME = /net/jprt-web.sfbay.sun.com/jprt/allproducts/runvmsqe
640ifdef JPRT_RUNVMSQE_HOME
641 RUNVMSQE_HOME = $(JPRT_RUNVMSQE_HOME)
642endif
643
644# Expect JPRT to set JPRT_TONGA3_HOME.
645TONGA3_HOME = /java/sqe//tools/gtee/harness/tonga
646ifdef JPRT_TONGA3_HOME
647 TONGA3_HOME = $(JPRT_TONGA3_HOME)
648endif
649
650RUNVMSQE_BIN = $(RUNVMSQE_HOME)/bin/runvmsqe
651
652vmsqe_tests: prep $(VMSQE_HOME)/vm $(TONGA3_HOME) $(RUNVMSQE_BIN) $(PRODUCT_HOME)
653 $(RM) -r $(ABS_TEST_OUTPUT_DIR)/vmsqe
654 ( $(CD) $(ABS_TEST_OUTPUT_DIR) && \
655 $(RUNVMSQE_BIN) \
656 -jdk "$(PRODUCT_HOME)" \
657 -o "$(ABS_TEST_OUTPUT_DIR)/vmsqe" \
658 -testbase "$(VMSQE_HOME)/vm" \
659 -tonga "$(TONGA3_HOME)" \
660 -tongajdk "$(ALT_BOOTDIR)" \
661 $(JAVA_ARGS) \
662 $(JAVA_VM_ARGS) \
663 $(RUNVMSQE_TEST_OPTION) \
664 $(EXTRA_RUNVMSQE_OPTIONS) \
665 ) ; $(BUNDLE_UP_AND_EXIT)
666
667vmsqe_jdwp: RUNVMSQE_TEST_OPTION=-jdwp
668vmsqe_jdwp: vmsqe_tests
669
670vmsqe_jdi: RUNVMSQE_TEST_OPTION=-jdi
671vmsqe_jdi: vmsqe_tests
672
673vmsqe_jdb: RUNVMSQE_TEST_OPTION=-jdb
674vmsqe_jdb: vmsqe_tests
675
676vmsqe_quick-jdi: RUNVMSQE_TEST_OPTION=-quick-jdi
677vmsqe_quick-jdi: vmsqe_tests
678
679vmsqe_sajdi: RUNVMSQE_TEST_OPTION=-sajdi
680vmsqe_sajdi: vmsqe_tests
681
682vmsqe_jvmti: RUNVMSQE_TEST_OPTION=-jvmti
683vmsqe_jvmti: vmsqe_tests
684
685vmsqe_hprof: RUNVMSQE_TEST_OPTION=-hprof
686vmsqe_hprof: vmsqe_tests
687
688vmsqe_monitoring: RUNVMSQE_TEST_OPTION=-monitoring
689vmsqe_monitoring: vmsqe_tests
690
691PHONY_LIST += vmsqe_jdwp vmsqe_jdi vmsqe_jdb vmsqe_quick-jdi vmsqe_sajdi \
692 vmsqe_jvmti vmsqe_hprof vmsqe_monitoring vmsqe_tests
693
694################################################################
695
696# jck tests
697
698JCK_WORK_DIR = $(ABS_TEST_OUTPUT_DIR)/JCKwork
699JCK_REPORT_DIR = $(ABS_TEST_OUTPUT_DIR)/JCKreport
700JCK_PROPERTIES = $(ABS_TEST_OUTPUT_DIR)/jck.properties
701JCK_CONFIG = $(ABS_TEST_OUTPUT_DIR)/jck.config
702
703JCK_JAVA_EXE = $(PRODUCT_HOME)/bin/java$(EXESUFFIX)
704
705JCK_JAVATEST_JAR = $(JCK_HOME)/lib/javatest.jar
706JCK_JAVATEST = $(ALT_BOOTDIR)/bin/java -jar $(JCK_JAVATEST_JAR)
707
708$(JCK_CONFIG): $(TEST_ROOT)/JCK-$(JCK_BUNDLE_NAME)-$(JCK_RELEASE)-base.jti
709 $(RM) $@
710 $(MKDIR) -p $(@D)
711 $(CP) $< $@
712
713$(JCK_PROPERTIES): $(PRODUCT_HOME) $(JCK_JAVA_EXE)
714 $(RM) $@
715 $(MKDIR) -p $(@D)
716 $(ECHO) "jck.env.compiler.compRefExecute.cmdAsFile=$(JCK_JAVA_EXE)" >> $@
717 $(ECHO) "jck.env.compiler.compRefExecute.systemRoot=$(SYSTEMROOT)" >> $@
718 $(ECHO) "jck.env.compiler.testCompile.testCompileAPImultiJVM.cmdAsFile=$(JCK_JAVA_EXE)" >> $@
719 $(ECHO) "jck.tests.tests=$(JCK_BUNDLE_TESTDIRS)" >> $@
720
721jck_tests: prep $(JCK_HOME) $(JCK_PROPERTIES) $(JCK_CONFIG) $(JCK_JAVATEST_JAR)
722 $(MKDIR) -p $(JCK_WORK_DIR)
723 ( $(JCK_JAVATEST) \
724 -verbose:commands,non-pass \
725 -testSuite $(JCK_HOME) \
726 -workDir $(JCK_WORK_DIR) \
727 -config $(JCK_CONFIG) \
728 -set -file $(JCK_PROPERTIES) \
729 -runtests \
730 -writeReport $(JCK_REPORT_DIR) \
731 ) ; $(BUNDLE_UP_AND_EXIT)
732
733PHONY_LIST += jck_tests
734
735################################################################
736
737# jck6 tests
738
739JCK6_RELEASE = 6b
740JCK6_DEFAULT_HOME = $(SLASH_JAVA)/re/jck/$(JCK6_RELEASE)/archive/fcs/binaries
741
742# Expect JPRT to set JPRT_JCK6COMPILER_HOME.
743JCK6COMPILER_HOME = $(JCK6_DEFAULT_HOME)/JCK-compiler-$(JCK6_RELEASE)
744ifdef JPRT_JCK6COMPILER_HOME
745 JCK6COMPILER_HOME = $(JPRT_JCK6COMPILER_HOME)
746endif
747
748# Expect JPRT to set JPRT_JCK6RUNTIME_HOME.
749JCK6RUNTIME_HOME = $(JCK6_DEFAULT_HOME)/JCK-runtime-$(JCK6_RELEASE)
750ifdef JPRT_JCK6RUNTIME_HOME
751 JCK6RUNTIME_HOME = $(JPRT_JCK6RUNTIME_HOME)
752endif
753
754# Expect JPRT to set JPRT_JCK6DEVTOOLS_HOME.
755JCK6DEVTOOLS_HOME = $(JCK6_DEFAULT_HOME)/JCK-devtools-$(JCK6_RELEASE)
756ifdef JPRT_JCK6DEVTOOLS_HOME
757 JCK6DEVTOOLS_HOME = $(JPRT_JCK6DEVTOOLS_HOME)
758endif
759
760jck6_tests: JCK_HOME=$(JCK6_HOME)
761jck6_tests: JCK_RELEASE=$(JCK6_RELEASE)
762jck6_tests: jck_tests
763
764jck6compiler: JCK6_HOME=$(JCK6COMPILER_HOME)
765jck6compiler: JCK_BUNDLE_NAME=compiler
766jck6compiler: jck6_tests
767
768jck6compiler_lang: JCK_BUNDLE_TESTDIRS=lang
769jck6compiler_lang: jck6compiler
770
771jck6runtime: JCK6_HOME=$(JCK6RUNTIME_HOME)
772jck6runtime: JCK_BUNDLE_NAME=runtime
773jck6runtime: jck6_tests
774
775jck6runtime_lang: JCK_BUNDLE_TESTDIRS=lang
776jck6runtime_lang: jck6runtime
777
778jck6devtools: JCK6_HOME=$(JCK6DEVTOOLS_HOME)
779jck6devtools: JCK_BUNDLE_NAME=devtools
780jck6devtools: jck6_tests
781
782jck6devtools_lang: JCK_BUNDLE_TESTDIRS=lang
783jck6devtools_lang: jck6devtools
784
785PHONY_LIST += jck6compiler jck6runtime jck6devtools jck6_tests \
786 jck6compiler_lang jck6runtime_lang jck6devtools_lang
787
788################################################################
789
790# jck7 tests
791
792JCK7_RELEASE = 7
793JCK7_DEFAULT_HOME = $(SLASH_JAVA)/re/jck/$(JCK7_RELEASE)/archive/fcs/binaries
794
795# Expect JPRT to set JPRT_JCK7COMPILER_HOME.
796JCK7COMPILER_HOME = $(JCK7_DEFAULT_HOME)/JCK-compiler-$(JCK7_RELEASE)
797ifdef JPRT_JCK7COMPILER_HOME
798 JCK7COMPILER_HOME = $(JPRT_JCK7COMPILER_HOME)
799endif
800
801# Expect JPRT to set JPRT_JCK7RUNTIME_HOME.
802JCK7RUNTIME_HOME = $(JCK7_DEFAULT_HOME)/JCK-runtime-$(JCK7_RELEASE)
803ifdef JPRT_JCK7RUNTIME_HOME
804 JCK7RUNTIME_HOME = $(JPRT_JCK7RUNTIME_HOME)
805endif
806
807# Expect JPRT to set JPRT_JCK7DEVTOOLS_HOME.
808JCK7DEVTOOLS_HOME = $(JCK7_DEFAULT_HOME)/JCK-devtools-$(JCK7_RELEASE)
809ifdef JPRT_JCK7DEVTOOLS_HOME
810 JCK7DEVTOOLS_HOME = $(JPRT_JCK7DEVTOOLS_HOME)
811endif
812
813jck7_tests: JCK_HOME=$(JCK7_HOME)
814jck7_tests: JCK_RELEASE=$(JCK7_RELEASE)
815jck7_tests: jck_tests
816
817jck7compiler: JCK7_HOME=$(JCK7COMPILER_HOME)
818jck7compiler: JCK_BUNDLE_NAME=compiler
819jck7compiler: jck7_tests
820
821jck7compiler_lang: JCK_BUNDLE_TESTDIRS=lang
822jck7compiler_lang: jck7compiler
823
824jck7runtime: JCK7_HOME=$(JCK7RUNTIME_HOME)
825jck7runtime: JCK_BUNDLE_NAME=runtime
826jck7runtime: jck7_tests
827
828jck7runtime_lang: JCK_BUNDLE_TESTDIRS=lang
829jck7runtime_lang: jck7runtime
830
831jck7devtools: JCK7_HOME=$(JCK7DEVTOOLS_HOME)
832jck7devtools: JCK_BUNDLE_NAME=devtools
833jck7devtools: jck7_tests
834
835jck7devtools_lang: JCK_BUNDLE_TESTDIRS=lang
836jck7devtools_lang: jck7devtools
837
838PHONY_LIST += jck7compiler jck7runtime jck7devtools jck7_tests \
839 jck7compiler_lang jck7runtime_lang jck7devtools_lang
840
841################################################################
J. Duke319a3b92007-12-01 00:00:00 +0000842
843# Phony targets (e.g. these are not filenames)
Kelly O'Hair53b5f6a2009-03-31 16:12:56 -0700844.PHONY: all clean prep $(PHONY_LIST)
845
846################################################################
J. Duke319a3b92007-12-01 00:00:00 +0000847