source: trunk/openjdk/hotspot/test/Makefile@ 144

Last change on this file since 144 was 2, checked in by dmik, 15 years ago

Imported OpenJDK 6 b19 sources from Oracle.

File size: 6.6 KB
Line 
1#
2# Copyright 1995-2009 Sun Microsystems, Inc. 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.
8#
9# This code is distributed in the hope that it will be useful, but WITHOUT
10# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12# version 2 for more details (a copy is included in the LICENSE file that
13# accompanied this code).
14#
15# You should have received a copy of the GNU General Public License version
16# 2 along with this work; if not, write to the Free Software Foundation,
17# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18#
19# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20# CA 95054 USA or visit www.sun.com if you need additional information or
21# have any questions.
22#
23#
24
25#
26# Makefile to run various jdk tests
27#
28
29# Get OS/ARCH specifics
30OSNAME = $(shell uname -s)
31ifeq ($(OSNAME), SunOS)
32 PLATFORM = solaris
33 SLASH_JAVA = /java
34 ARCH = $(shell uname -p)
35 ifeq ($(ARCH), i386)
36 ARCH=i586
37 endif
38endif
39ifeq ($(OSNAME), Linux)
40 PLATFORM = linux
41 SLASH_JAVA = /java
42 ARCH = $(shell uname -m)
43 ifeq ($(ARCH), i386)
44 ARCH = i586
45 endif
46endif
47ifeq ($(OSNAME), Windows_NT)
48 PLATFORM = windows
49 SLASH_JAVA = J:
50 ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),ia64)
51 ARCH = ia64
52 else
53 ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),AMD64)
54 ARCH = x64
55 else
56 ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),EM64T)
57 ARCH = x64
58 else
59 ARCH = i586
60 endif
61 endif
62 endif
63 EXESUFFIX = .exe
64endif
65
66ifdef ALT_SLASH_JAVA
67 SLASH_JAVA = $(ALT_SLASH_JAVA)
68endif
69
70# Utilities used
71CD = cd
72CP = cp
73ECHO = echo
74MKDIR = mkdir
75ZIP = zip
76
77# Root of this test area (important to use full paths in some places)
78TEST_ROOT := $(shell pwd)
79
80# Root of all test results
81ABS_BUILD_ROOT = $(TEST_ROOT)/../build/$(PLATFORM)-$(ARCH)
82ABS_TEST_OUTPUT_DIR = $(ABS_BUILD_ROOT)/testoutput
83
84# Expect JPRT to set PRODUCT_HOME (the product or jdk in this case to test)
85ifndef PRODUCT_HOME
86 # Try to use j2sdk-image if it exists
87 ABS_JDK_IMAGE = $(ABS_BUILD_ROOT)/j2sdk-image
88 PRODUCT_HOME := \
89 $(shell \
90 if [ -d $(ABS_JDK_IMAGE) ] ; then \
91 $(ECHO) "$(ABS_JDK_IMAGE)"; \
92 else \
93 $(ECHO) "$(ABS_BUILD_ROOT)" ; \
94 fi)
95endif
96
97# Expect JPRT to set JAVA_ARGS (e.g. -server etc.)
98JAVA_OPTIONS =
99ifdef JAVA_ARGS
100 JAVA_OPTIONS = $(JAVA_ARGS)
101endif
102
103# Expect JPRT to set JPRT_ARCHIVE_BUNDLE (path to zip bundle for results)
104ARCHIVE_BUNDLE = $(ABS_TEST_OUTPUT_DIR)/ARCHIVE_BUNDLE.zip
105ifdef JPRT_ARCHIVE_BUNDLE
106 ARCHIVE_BUNDLE = $(JPRT_ARCHIVE_BUNDLE)
107endif
108
109# How to create the test bundle (pass or fail, we want to create this)
110BUNDLE_UP = ( $(MKDIR) -p `dirname $(ARCHIVE_BUNDLE)` \
111 && $(CD) $(ABS_TEST_OUTPUT_DIR) \
112 && $(ZIP) -q -r $(ARCHIVE_BUNDLE) . )
113BUNDLE_UP_FAILED = ( exitCode=$$? && $(BUNDLE_UP) && exit $${exitCode} )
114
115################################################################
116
117# Default make rule (runs jtreg_tests)
118all: jtreg_tests
119 @$(ECHO) "Testing completed successfully"
120
121# Prep for output
122prep: clean
123 @$(MKDIR) -p $(ABS_TEST_OUTPUT_DIR)
124 @$(MKDIR) -p `dirname $(ARCHIVE_BUNDLE)`
125
126# Cleanup
127clean:
128 $(RM) -r $(ABS_TEST_OUTPUT_DIR)
129 $(RM) $(ARCHIVE_BUNDLE)
130
131################################################################
132
133# jtreg tests
134
135# Expect JT_HOME to be set for jtreg tests. (home for jtreg)
136JT_HOME = $(SLASH_JAVA)/re/jtreg/4.0/promoted/latest/binaries/jtreg
137ifdef JPRT_JTREG_HOME
138 JT_HOME = $(JPRT_JTREG_HOME)
139endif
140
141# Expect JPRT to set TESTDIRS to the jtreg test dirs
142JTREG_TESTDIRS = demo/jvmti/gctest demo/jvmti/hprof
143ifdef TESTDIRS
144 JTREG_TESTDIRS = $(TESTDIRS)
145endif
146
147# Default JTREG to run (win32 script works for everybody)
148JTREG = $(JT_HOME)/win32/bin/jtreg
149
150# Option to tell jtreg to not run tests marked with "ignore"
151ifeq ($(PLATFORM), windows)
152 JTREG_KEY_OPTION = -k:!ignore
153else
154 JTREG_KEY_OPTION = -k:\!ignore
155endif
156
157#EXTRA_JTREG_OPTIONS =
158
159jtreg_tests: prep $(JT_HOME) $(PRODUCT_HOME) $(JTREG)
160 $(JTREG) -a -v:fail,error \
161 $(JTREG_KEY_OPTION) \
162 $(EXTRA_JTREG_OPTIONS) \
163 -r:$(ABS_TEST_OUTPUT_DIR)/JTreport \
164 -w:$(ABS_TEST_OUTPUT_DIR)/JTwork \
165 -jdk:$(PRODUCT_HOME) \
166 $(JAVA_OPTIONS:%=-vmoption:%) \
167 $(JTREG_TESTDIRS) \
168 || $(BUNDLE_UP_FAILED)
169 $(BUNDLE_UP)
170
171PHONY_LIST += jtreg_tests
172
173################################################################
174
175# clienttest (make sure various basic java client options work)
176
177clienttest: prep $(PRODUCT_HOME)
178 $(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -version
179 $(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -help
180 $(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -X
181 $(RM) $(PRODUCT_HOME)/jre/lib/*/client/classes.jsa
182 $(RM) $(PRODUCT_HOME)/jre/lib/*/client/classes_g.jsa
183 $(RM) $(PRODUCT_HOME)/jre/bin/client/classes.jsa
184 $(RM) $(PRODUCT_HOME)/jre/bin/client/classes_g.jsa
185 $(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -Xshare:dump
186
187PHONY_LIST += clienttest
188
189################################################################
190
191# servertest (make sure various basic java server options work)
192
193servertest: prep $(PRODUCT_HOME)
194 $(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -version
195 $(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -help
196 $(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -X
197
198PHONY_LIST += servertest
199
200################################################################
201
202# packtest
203
204# Expect JPRT to set JPRT_PACKTEST_HOME.
205PACKTEST_HOME = /net/jprt-web.sfbay.sun.com/jprt/allproducts/packtest
206ifdef JPRT_PACKTEST_HOME
207 PACKTEST_HOME = $(JPRT_PACKTEST_HOME)
208endif
209
210#EXTRA_PACKTEST_OPTIONS =
211
212packtest: prep $(PACKTEST_HOME)/ptest $(PRODUCT_HOME)
213 ( $(CD) $(PACKTEST_HOME) && \
214 $(PACKTEST_HOME)/ptest \
215 -t "$(PRODUCT_HOME)" \
216 $(PACKTEST_STRESS_OPTION) \
217 $(EXTRA_PACKTEST_OPTIONS) \
218 -W $(ABS_TEST_OUTPUT_DIR) \
219 $(JAVA_OPTIONS:%=-J %) \
220 ) || $(BUNDLE_UP_FAILED)
221 $(BUNDLE_UP)
222
223packtest_stress: PACKTEST_STRESS_OPTION=-s
224packtest_stress: packtest
225
226PHONY_LIST += packtest packtest_stress
227
228################################################################
229
230# Phony targets (e.g. these are not filenames)
231.PHONY: all clean prep $(PHONY_LIST)
232
233################################################################
234
Note: See TracBrowser for help on using the repository browser.