source: trunk/openjdk/jdk/test/Makefile

Last change on this file was 309, checked in by dmik, 14 years ago

trunk: Merged in openjdk6 b24 from branches/vendor/oracle.

File size: 22.5 KB
Line 
1#
2# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
3# 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. Oracle designates this
8# particular file as subject to the "Classpath" exception as provided
9# by Oracle 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 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.
24#
25
26#
27# Makefile to run various jdk tests
28#
29
30# 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
43DIRNAME = dirname
44ECHO = echo
45EGREP = egrep
46EXPAND = expand
47FIND = find
48MKDIR = mkdir
49PWD = pwd
50SED = sed
51SORT = sort
52TEE = tee
53UNAME = uname
54UNIQ = uniq
55WC = wc
56ZIP = zip
57
58# Get OS name from uname
59UNAME_S := $(shell $(UNAME) -s)
60
61# Commands to run on paths to make mixed paths for java on windows
62GETMIXEDPATH=$(ECHO)
63
64# Location of developer shared files
65SLASH_JAVA = /java
66
67# Platform specific settings
68ifeq ($(UNAME_S), SunOS)
69 OS_NAME = solaris
70 OS_ARCH := $(shell $(UNAME) -p)
71 OS_VERSION := $(shell $(UNAME) -r)
72endif
73ifeq ($(UNAME_S), Linux)
74 OS_NAME = linux
75 OS_ARCH := $(shell $(UNAME) -m)
76 # 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
80 OS_VERSION := $(shell $(UNAME) -r)
81endif
82ifeq ($(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)
101 endif
102endif
103
104# Only want major and minor numbers from os version
105OS_VERSION := $(shell $(ECHO) "$(OS_VERSION)" | $(CUT) -d'.' -f1,2)
106
107# 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
117OS_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))
138
139# 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
150ifndef ARCH_DATA_MODEL
151 ARCH_DATA_MODEL=32
152endif
153
154# Platform directory name
155PLATFORM_OS = $(OS_NAME)-$(OS_ARCH)
156
157# Check ARCH_DATA_MODEL, adjust OS_ARCH accordingly on solaris
158ARCH_DATA_MODEL_ERROR= \
159 ARCH_DATA_MODEL=$(ARCH_DATA_MODEL) cannot be used with $(PLATFORM_OS)
160ifeq ($(ARCH_DATA_MODEL),64)
161 ifeq ($(PLATFORM_OS),solaris-i586)
162 OS_ARCH=$(OS_ARCH_X64_NAME)
163 endif
164 ifeq ($(PLATFORM_OS),solaris-sparc)
165 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)
175 ifeq ($(OS_ARCH),$(OS_ARCH_X64_NAME))
176 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
184 else
185 x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
186 endif
187endif
188
189# Alternate OS_ARCH name (defaults to OS_ARCH)
190OS_ARCH2:=$(OS_ARCH2-$(OS_ARCH))
191ifeq ($(OS_ARCH2),)
192 OS_ARCH2:=$(OS_ARCH)
193endif
194
195# Root of this test area (important to use full paths in some places)
196TEST_ROOT := $(shell $(PWD))
197
198# Root of all test results
199ifdef ALT_OUTPUTDIR
200 ABS_OUTPUTDIR = $(ALT_OUTPUTDIR)
201else
202 ABS_OUTPUTDIR = $(TEST_ROOT)/../build/$(PLATFORM_OS)
203endif
204ABS_PLATFORM_BUILD_ROOT = $(ABS_OUTPUTDIR)
205ABS_TEST_OUTPUT_DIR := $(ABS_PLATFORM_BUILD_ROOT)/testoutput/$(UNIQUE_DIR)
206
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
210 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)"; \
217 fi)
218 PRODUCT_HOME := $(PRODUCT_HOME)
219endif
220
221# Expect JPRT to set JPRT_PRODUCT_ARGS (e.g. -server etc.)
222# Should be passed into 'java' only.
223# Could include: -d64 -server -client OR any java option
224ifdef JPRT_PRODUCT_ARGS
225 JAVA_ARGS = $(JPRT_PRODUCT_ARGS)
226endif
227
228# 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
233
234# 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
249# Macro to run make and set the shared library permissions
250define SharedLibraryPermissions
251$(MAKE) SHARED_LIBRARY_DIR=$1 UNIQUE_DIR=$@ shared_library_permissions
252endef
253
254# 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
259
260# 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.
262ZIP_UP_RESULTS = ( $(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)` \
263 && $(CD) $(ABS_TEST_OUTPUT_DIR) \
264 && $(ZIP) -q -r $(ARCHIVE_BUNDLE) . )
265SUMMARY_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
271EXITCODE = $(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}"; \
280 exit $${testExitCode}
281
282BUNDLE_UP_AND_EXIT = \
283( \
284 jtregExitCode=$$? && \
285 _summary="$(SUMMARY_TXT)"; \
286 $(RM) -f $(STATS_TXT) $(RUNLIST) $(PASSLIST) $(FAILLIST) $(EXITCODE); \
287 $(ECHO) "$${jtregExitCode}" > $(EXITCODE); \
288 if [ -r "$${_summary}" ] ; then \
289 $(ECHO) "Summary: $(UNIQUE_DIR)" > $(STATS_TXT); \
290 $(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); \
298 if [ $${jtregExitCode} != 0 -o -s $(FAILLIST) ] ; then \
299 $(EXPAND) $(FAILLIST) \
300 | $(CUT) -d' ' -f1 \
301 | $(SED) -e 's@^@FAILED: @' >> $(STATS_TXT); \
302 if [ $${jtregExitCode} = 0 ] ; then \
303 jtregExitCode=1; \
304 fi; \
305 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;}'`"; \
310 $(ECHO) "TEST STATS: name=$(UNIQUE_DIR) run=$${runc} pass=$${passc} fail=$${failc} excluded=$${exclc}" \
311 >> $(STATS_TXT); \
312 else \
313 $(ECHO) "Missing file: $${_summary}" >> $(STATS_TXT); \
314 fi; \
315 $(CAT) $(STATS_TXT); \
316 $(ZIP_UP_RESULTS) ; \
317 $(TESTEXIT) \
318)
319
320################################################################
321
322# Default make rule (runs jtreg_tests)
323all: jtreg_tests
324 @$(ECHO) "Testing completed successfully"
325
326# Prep for output
327prep: clean
328 @$(MKDIR) -p $(ABS_TEST_OUTPUT_DIR)
329 @$(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)`
330
331# Cleanup
332clean:
333 $(RM) -r $(ABS_TEST_OUTPUT_DIR)
334 $(RM) $(ARCHIVE_BUNDLE)
335
336################################################################
337
338# jtreg tests
339
340# Expect JT_HOME to be set for jtreg tests. (home for jtreg)
341ifndef 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
346endif
347
348# Expect JPRT to set TESTDIRS to the jtreg test dirs
349ifndef TESTDIRS
350 TESTDIRS = demo
351endif
352
353# Samevm settings (default is false)
354ifndef USE_JTREG_SAMEVM
355 USE_JTREG_SAMEVM=false
356endif
357# With samevm, you cannot use -javaoptions? (-agentvm is more reliable -samevm)
358ifeq ($(USE_JTREG_SAMEVM),true)
359 #JTREG_SAMEVM_OPTION = -samevm
360 JTREG_SAMEVM_OPTION = -agentvm
361 EXTRA_JTREG_OPTIONS += $(JTREG_SAMEVM_OPTION) $(JAVA_ARGS) $(JAVA_ARGS:%=-vmoption:%)
362 JTREG_TEST_OPTIONS = $(JAVA_VM_ARGS:%=-vmoption:%)
363else
364 JTREG_TEST_OPTIONS = $(JAVA_ARGS:%=-javaoptions:%) $(JAVA_VM_ARGS:%=-vmoption:%)
365endif
366
367# Some tests annoy me and fail frequently
368PROBLEM_LIST=ProblemList.txt
369PROBLEM_LISTS=$(PROBLEM_LIST)
370EXCLUDELIST=$(ABS_TEST_OUTPUT_DIR)/excludelist.txt
371
372# Create exclude list for this platform and arch
373ifdef NO_EXCLUDES
374$(EXCLUDELIST): $(PROBLEM_LISTS) $(TESTDIRS)
375 @$(ECHO) "NOTHING_EXCLUDED" > $@
376else
377$(EXCLUDELIST): $(PROBLEM_LISTS) $(TESTDIRS)
378 @$(RM) $@ $@.temp1 $@.temp2
379 @(($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-all' ) ;\
380 ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(PLATFORM_OS)' ) ;\
381 ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-$(OS_ARCH2)' ) ;\
382 ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-$(OS_VERSION)') ;\
383 ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-$(OS_ARCH)' ) ;\
384 ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-$(OS_ARCH2)' ) ;\
385 ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-all' ) ;\
386 ($(ECHO) "#") ;\
387 ) | $(SED) -e 's@^[\ ]*@@' \
388 | $(EGREP) -v '^#' > $@.temp1
389 @for tdir in $(TESTDIRS) ; do \
390 ( ( $(CAT) $@.temp1 | $(EGREP) "^$${tdir}" ) ; $(ECHO) "#" ) >> $@.temp2 ; \
391 done
392 @$(ECHO) "# at least one line" >> $@.temp2
393 @( $(EGREP) -v '^#' $@.temp2 ; true ) > $@
394 @$(ECHO) "Excluding list contains `$(EXPAND) $@ | $(WC) -l` items"
395endif
396
397# Select list of directories that exist
398define TestDirs
399$(foreach i,$1,$(wildcard ${i}))
400endef
401# Running batches of tests with or without samevm
402define RunSamevmBatch
403$(ECHO) "Running tests in samevm mode: $(call TestDirs, $?)"
404$(MAKE) TESTDIRS="$(call TestDirs, $?)" USE_JTREG_SAMEVM=true UNIQUE_DIR=$@ jtreg_tests
405endef
406define RunOthervmBatch
407$(ECHO) "Running tests in othervm mode: $(call TestDirs, $?)"
408$(MAKE) TESTDIRS="$(call TestDirs, $?)" USE_JTREG_SAMEVM=false UNIQUE_DIR=$@ jtreg_tests
409endef
410define SummaryInfo
411$(ECHO) "########################################################"
412$(CAT) $(?:%=$(ABS_TEST_OUTPUT_DIR)/%/$(STATS_TXT_NAME))
413$(ECHO) "########################################################"
414endef
415
416# ------------------------------------------------------------------
417
418# Batches of tests (somewhat arbitrary assigments to jdk_* targets)
419JDK_ALL_TARGETS =
420
421# Stable othervm testruns (minus items from PROBLEM_LIST)
422# Using samevm has problems, and doesn't help performance as much as others.
423JDK_ALL_TARGETS += jdk_awt
424jdk_awt: java/awt sun/awt
425 $(call RunOthervmBatch)
426
427# Stable samevm testruns (minus items from PROBLEM_LIST)
428JDK_ALL_TARGETS += jdk_beans1
429jdk_beans1: java/beans/beancontext java/beans/PropertyChangeSupport \
430 java/beans/Introspector java/beans/Performance \
431 java/beans/VetoableChangeSupport java/beans/Statement
432 $(call RunSamevmBatch)
433
434# Stable othervm testruns (minus items from PROBLEM_LIST)
435# Using samevm has serious problems with these tests
436JDK_ALL_TARGETS += jdk_beans2
437jdk_beans2: java/beans/Beans java/beans/EventHandler java/beans/XMLDecoder \
438 java/beans/PropertyEditor
439 $(call RunOthervmBatch)
440
441# Stable othervm testruns (minus items from PROBLEM_LIST)
442# Using samevm has serious problems with these tests
443JDK_ALL_TARGETS += jdk_beans3
444jdk_beans3: java/beans/XMLEncoder
445 $(call RunOthervmBatch)
446
447# All beans tests
448jdk_beans: jdk_beans1 jdk_beans2 jdk_beans3
449 @$(SummaryInfo)
450
451# Stable samevm testruns (minus items from PROBLEM_LIST)
452JDK_ALL_TARGETS += jdk_io
453jdk_io: java/io
454 $(call RunSamevmBatch)
455
456# Stable samevm testruns (minus items from PROBLEM_LIST)
457JDK_ALL_TARGETS += jdk_lang
458jdk_lang: java/lang
459 $(call RunSamevmBatch)
460
461# Stable othervm testruns (minus items from PROBLEM_LIST)
462# Using samevm has serious problems with these tests
463JDK_ALL_TARGETS += jdk_management1
464jdk_management1: javax/management
465 $(call RunOthervmBatch)
466
467# Stable othervm testruns (minus items from PROBLEM_LIST)
468# Using samevm has serious problems with these tests
469JDK_ALL_TARGETS += jdk_management2
470jdk_management2: com/sun/jmx com/sun/management sun/management
471 $(call RunOthervmBatch)
472
473# All management tests
474jdk_management: jdk_management1 jdk_management2
475 @$(SummaryInfo)
476
477# Stable samevm testruns (minus items from PROBLEM_LIST)
478JDK_ALL_TARGETS += jdk_math
479jdk_math: java/math
480 $(call RunSamevmBatch)
481
482# Stable samevm testruns (minus items from PROBLEM_LIST)
483JDK_ALL_TARGETS += jdk_misc
484jdk_misc: demo javax/imageio javax/naming javax/print javax/script \
485 javax/smartcardio javax/sound com/sun/java com/sun/jndi \
486 com/sun/org sun/misc sun/pisces
487 $(call RunSamevmBatch)
488
489# Stable samevm testruns (minus items from PROBLEM_LIST)
490JDK_ALL_TARGETS += jdk_net
491jdk_net: com/sun/net java/net sun/net
492 $(call RunSamevmBatch)
493
494# Stable othervm testruns (minus items from PROBLEM_LIST)
495# Using samevm has serious problems with these tests
496JDK_ALL_TARGETS += jdk_nio
497jdk_nio: java/nio sun/nio
498 $(call RunOthervmBatch)
499
500# Stable othervm testruns (minus items from PROBLEM_LIST)
501# Using samevm has serious problems with these tests
502JDK_ALL_TARGETS += jdk_rmi
503jdk_rmi: java/rmi javax/rmi sun/rmi
504 $(call RunOthervmBatch)
505
506# Stable samevm testruns (minus items from PROBLEM_LIST)
507JDK_ALL_TARGETS += jdk_security1
508jdk_security1: java/security
509 $(call RunSamevmBatch)
510
511# Stable othervm testruns (minus items from PROBLEM_LIST)
512# Using samevm has serious problems with these tests
513JDK_ALL_TARGETS += jdk_security2
514jdk_security2: javax/crypto com/sun/crypto
515 $(call RunOthervmBatch)
516
517# Stable othervm testruns (minus items from PROBLEM_LIST)
518# Using samevm has serious problems with these tests
519JDK_ALL_TARGETS += jdk_security3
520jdk_security3: com/sun/security lib/security javax/security sun/security
521 $(call SharedLibraryPermissions,sun/security)
522 $(call RunOthervmBatch)
523
524# All security tests
525jdk_security: jdk_security1 jdk_security2 jdk_security3
526 @$(SummaryInfo)
527
528# Stable othervm testruns (minus items from PROBLEM_LIST)
529# Using samevm has problems, and doesn't help performance as much as others.
530JDK_ALL_TARGETS += jdk_swing
531jdk_swing: javax/swing sun/java2d
532 $(call RunOthervmBatch)
533
534# Stable samevm testruns (minus items from PROBLEM_LIST)
535JDK_ALL_TARGETS += jdk_text
536jdk_text: java/text sun/text
537 $(call RunSamevmBatch)
538
539# Stable othervm testruns (minus items from PROBLEM_LIST)
540# Using samevm has serious problems with these tests, but just with openjdk6?
541# Normally the com/sun/jdi tests should work with samevm.
542# But on openjdk6 jtreg will occasionally complain with:
543# Error. Error while cleaning up threads after test
544# This could be a hotspot vm issue. So someday, change this to Samevm.
545JDK_ALL_TARGETS += jdk_tools1
546jdk_tools1: com/sun/jdi
547 $(call RunOthervmBatch)
548
549# Stable othervm testruns (minus items from PROBLEM_LIST)
550# Using samevm has serious problems with these tests
551JDK_ALL_TARGETS += jdk_tools2
552jdk_tools2: com/sun/tools sun/jvmstat sun/tools tools vm
553 $(call SharedLibraryPermissions,tools/launcher)
554 $(call RunOthervmBatch)
555
556# All tools tests
557jdk_tools: jdk_tools1 jdk_tools2
558 @$(SummaryInfo)
559
560# Stable samevm testruns (minus items from PROBLEM_LIST)
561JDK_ALL_TARGETS += jdk_util
562jdk_util: java/util sun/util
563 $(call RunSamevmBatch)
564
565# ------------------------------------------------------------------
566
567# Run all tests
568FILTER_OUT_LIST=jdk_awt jdk_rmi jdk_swing
569JDK_ALL_STABLE_TARGETS := $(filter-out $(FILTER_OUT_LIST), $(JDK_ALL_TARGETS))
570jdk_all: $(JDK_ALL_STABLE_TARGETS)
571 @$(SummaryInfo)
572
573# These are all phony targets
574PHONY_LIST += $(JDK_ALL_TARGETS)
575
576# ------------------------------------------------------------------
577
578# Default JTREG to run (win32 script works for everybody)
579JTREG = $(JT_HOME)/win32/bin/jtreg
580# Add any extra options (samevm etc.)
581JTREG_BASIC_OPTIONS += $(EXTRA_JTREG_OPTIONS)
582# Only run automatic tests
583JTREG_BASIC_OPTIONS += -a
584# Always turn on assertions
585JTREG_ASSERT_OPTION = -ea -esa
586JTREG_BASIC_OPTIONS += $(JTREG_ASSERT_OPTION)
587# Report details on all failed or error tests, times too
588JTREG_BASIC_OPTIONS += -v:fail,error,time
589# Retain all files for failing tests
590JTREG_BASIC_OPTIONS += -retain:fail,error
591# Ignore tests are not run and completely silent about it
592JTREG_IGNORE_OPTION = -ignore:quiet
593JTREG_BASIC_OPTIONS += $(JTREG_IGNORE_OPTION)
594# Multiple by 4 the timeout numbers
595JTREG_TIMEOUT_OPTION = -timeoutFactor:4
596JTREG_BASIC_OPTIONS += $(JTREG_TIMEOUT_OPTION)
597# Boost the max memory for jtreg to avoid gc thrashing
598JTREG_MEMORY_OPTION = -J-Xmx512m
599JTREG_BASIC_OPTIONS += $(JTREG_MEMORY_OPTION)
600
601# Make sure jtreg exists
602$(JTREG): $(JT_HOME)
603
604# Run jtreg
605jtreg_tests: prep $(PRODUCT_HOME) $(JTREG) $(EXCLUDELIST)
606 @$(EXPAND) $(EXCLUDELIST) \
607 | $(CUT) -d' ' -f1 \
608 | $(SED) -e 's@^@Excluding: @'
609 ( \
610 ( JT_HOME=$(shell $(GETMIXEDPATH) "$(JT_HOME)"); \
611 export JT_HOME; \
612 $(shell $(GETMIXEDPATH) "$(JTREG)") \
613 $(JTREG_BASIC_OPTIONS) \
614 -r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTreport \
615 -w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTwork \
616 -jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \
617 -exclude:$(shell $(GETMIXEDPATH) "$(EXCLUDELIST)") \
618 $(JTREG_TEST_OPTIONS) \
619 $(TESTDIRS) \
620 ) ; $(BUNDLE_UP_AND_EXIT) \
621 ) 2>&1 | $(TEE) $(ABS_TEST_OUTPUT_DIR)/output.txt ; $(TESTEXIT)
622
623# Rule that may change execute permissions on shared library files.
624# Files in repositories should never have execute permissions, but there
625# are some tests that have pre-built shared libraries, and these windows
626# dll files must have execute permission. Adding execute permission
627# may happen automatically on windows when using certain versions of mercurial
628# but it cannot be guaranteed. And blindly adding execute permission might
629# be seen as a mercurial 'change', so we avoid adding execute permission to
630# repository files. But testing from a plain source tree needs the chmod a+rx.
631# Used on select directories and applying the chmod to all shared libraries
632# not just dll files. On windows, this may not work with MKS if the files
633# were installed with CYGWIN unzip or untar (MKS chmod may not do anything).
634# And with CYGWIN and sshd service, you may need CYGWIN=ntsec for this to work.
635#
636shared_library_permissions: $(SHARED_LIBRARY_DIR)
637 if [ ! -d $(TEST_ROOT)/../.hg ] ; then \
638 $(FIND) $< \( -name \*.dll -o -name \*.DLL -o -name \*.so \) \
639 -exec $(CHMOD) a+rx {} \; ; \
640 fi
641
642PHONY_LIST += jtreg_tests shared_library_permissions
643
644################################################################
645
646# Phony targets (e.g. these are not filenames)
647.PHONY: all clean prep $(PHONY_LIST)
648
649################################################################
650
Note: See TracBrowser for help on using the repository browser.