author | twisti |
Mon, 27 Apr 2015 09:02:41 -0700 | |
changeset 30288 | 476c276de939 |
parent 30280 | b9efc9156778 |
child 30579 | 5208524ce05c |
child 30594 | e1b420c520a0 |
permissions | -rw-r--r-- |
1 | 1 |
# |
29179
8836e3bd543b
8072842: Add support for building native JTReg tests
ihse
parents:
29075
diff
changeset
|
2 |
# Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved. |
1 | 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 |
# |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
2868
diff
changeset
|
19 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
2868
diff
changeset
|
20 |
# or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
2868
diff
changeset
|
21 |
# questions. |
1132
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
22 |
# |
1 | 23 |
# |
24 |
||
25 |
# |
|
25628 | 26 |
# Makefile to run various hotspot tests |
1 | 27 |
# |
28 |
||
27695 | 29 |
ALT_MAKE ?= closed |
30 |
||
31 |
-include $(ALT_MAKE)/Makefile |
|
32 |
||
12225 | 33 |
GETMIXEDPATH=echo |
34 |
||
25628 | 35 |
# Utilities used |
36 |
AWK = awk |
|
37 |
CAT = cat |
|
38 |
CD = cd |
|
39 |
CHMOD = chmod |
|
40 |
CP = cp |
|
41 |
CUT = cut |
|
42 |
DIRNAME = dirname |
|
43 |
ECHO = echo |
|
44 |
EGREP = egrep |
|
45 |
EXPAND = expand |
|
46 |
FIND = find |
|
47 |
MKDIR = mkdir |
|
48 |
PWD = pwd |
|
49 |
SED = sed |
|
50 |
SORT = sort |
|
51 |
TEE = tee |
|
52 |
UNAME = uname |
|
53 |
UNIQ = uniq |
|
54 |
WC = wc |
|
55 |
ZIP = zip |
|
56 |
||
57 |
# Get OS name from uname (Cygwin inexplicably adds _NT-5.1) |
|
58 |
UNAME_S := $(shell $(UNAME) -s | $(CUT) -f1 -d_) |
|
59 |
ifeq ($(UNAME_S), SunOS) |
|
1 | 60 |
PLATFORM = solaris |
2024
859d11cea3f8
6799452: HotSpot tests Makefile should take care of ALT_SLASH_JAVA
twisti
parents:
1132
diff
changeset
|
61 |
SLASH_JAVA = /java |
1 | 62 |
ARCH = $(shell uname -p) |
63 |
ifeq ($(ARCH), i386) |
|
64 |
ARCH=i586 |
|
65 |
endif |
|
66 |
endif |
|
25628 | 67 |
ifeq ($(UNAME_S), Linux) |
1 | 68 |
PLATFORM = linux |
2024
859d11cea3f8
6799452: HotSpot tests Makefile should take care of ALT_SLASH_JAVA
twisti
parents:
1132
diff
changeset
|
69 |
SLASH_JAVA = /java |
1 | 70 |
ARCH = $(shell uname -m) |
71 |
ifeq ($(ARCH), i386) |
|
1132
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
72 |
ARCH = i586 |
1 | 73 |
endif |
74 |
endif |
|
25628 | 75 |
ifeq ($(UNAME_S), Darwin) |
10565 | 76 |
PLATFORM = bsd |
77 |
SLASH_JAVA = /java |
|
78 |
ARCH = $(shell uname -m) |
|
79 |
ifeq ($(ARCH), i386) |
|
80 |
ARCH = i586 |
|
81 |
endif |
|
82 |
endif |
|
25628 | 83 |
ifeq ($(findstring BSD,$(UNAME_S)), BSD) |
10565 | 84 |
PLATFORM = bsd |
85 |
SLASH_JAVA = /java |
|
86 |
ARCH = $(shell uname -m) |
|
87 |
ifeq ($(ARCH), i386) |
|
88 |
ARCH = i586 |
|
89 |
endif |
|
90 |
endif |
|
12225 | 91 |
ifeq ($(PLATFORM),) |
25628 | 92 |
# detect whether we're running in MKS or cygwin |
93 |
ifeq ($(UNAME_S), Windows_NT) # MKS |
|
12225 | 94 |
GETMIXEDPATH=dosname -s |
95 |
endif |
|
25628 | 96 |
ifeq ($(findstring CYGWIN,$(UNAME_S)), CYGWIN) |
97 |
GETMIXEDPATH=cygpath -m |
|
12225 | 98 |
endif |
1 | 99 |
PLATFORM = windows |
1132
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
100 |
SLASH_JAVA = J: |
1 | 101 |
ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),ia64) |
1132
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
102 |
ARCH = ia64 |
1 | 103 |
else |
104 |
ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),AMD64) |
|
1132
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
105 |
ARCH = x64 |
1 | 106 |
else |
107 |
ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),EM64T) |
|
1132
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
108 |
ARCH = x64 |
1 | 109 |
else |
1132
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
110 |
ARCH = i586 |
1 | 111 |
endif |
112 |
endif |
|
113 |
endif |
|
1132
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
114 |
EXESUFFIX = .exe |
1 | 115 |
endif |
116 |
||
2024
859d11cea3f8
6799452: HotSpot tests Makefile should take care of ALT_SLASH_JAVA
twisti
parents:
1132
diff
changeset
|
117 |
ifdef ALT_SLASH_JAVA |
859d11cea3f8
6799452: HotSpot tests Makefile should take care of ALT_SLASH_JAVA
twisti
parents:
1132
diff
changeset
|
118 |
SLASH_JAVA = $(ALT_SLASH_JAVA) |
859d11cea3f8
6799452: HotSpot tests Makefile should take care of ALT_SLASH_JAVA
twisti
parents:
1132
diff
changeset
|
119 |
endif |
859d11cea3f8
6799452: HotSpot tests Makefile should take care of ALT_SLASH_JAVA
twisti
parents:
1132
diff
changeset
|
120 |
|
1132
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
121 |
# Root of this test area (important to use full paths in some places) |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
122 |
TEST_ROOT := $(shell pwd) |
1 | 123 |
|
124 |
# Root of all test results |
|
7102
a20be5bfcbee
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
5547
diff
changeset
|
125 |
ifdef ALT_OUTPUTDIR |
a20be5bfcbee
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
5547
diff
changeset
|
126 |
ABS_BUILD_ROOT = $(ALT_OUTPUTDIR)/$(PLATFORM)-$(ARCH) |
a20be5bfcbee
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
5547
diff
changeset
|
127 |
else |
a20be5bfcbee
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
5547
diff
changeset
|
128 |
ABS_BUILD_ROOT = $(TEST_ROOT)/../build/$(PLATFORM)-$(ARCH) |
a20be5bfcbee
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
5547
diff
changeset
|
129 |
endif |
1132
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
130 |
ABS_TEST_OUTPUT_DIR = $(ABS_BUILD_ROOT)/testoutput |
1 | 131 |
|
1132
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
132 |
# Expect JPRT to set PRODUCT_HOME (the product or jdk in this case to test) |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
133 |
ifndef PRODUCT_HOME |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
134 |
# Try to use j2sdk-image if it exists |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
135 |
ABS_JDK_IMAGE = $(ABS_BUILD_ROOT)/j2sdk-image |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
136 |
PRODUCT_HOME := \ |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
137 |
$(shell \ |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
138 |
if [ -d $(ABS_JDK_IMAGE) ] ; then \ |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
139 |
$(ECHO) "$(ABS_JDK_IMAGE)"; \ |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
140 |
else \ |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
141 |
$(ECHO) "$(ABS_BUILD_ROOT)" ; \ |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
142 |
fi) |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
143 |
endif |
1 | 144 |
|
1132
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
145 |
# Expect JPRT to set JAVA_ARGS (e.g. -server etc.) |
29179
8836e3bd543b
8072842: Add support for building native JTReg tests
ihse
parents:
29075
diff
changeset
|
146 |
JAVA_OPTIONS = |
1132
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
147 |
ifdef JAVA_ARGS |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
148 |
JAVA_OPTIONS = $(JAVA_ARGS) |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
149 |
endif |
1 | 150 |
|
29179
8836e3bd543b
8072842: Add support for building native JTReg tests
ihse
parents:
29075
diff
changeset
|
151 |
# jtreg -nativepath <dir> |
8836e3bd543b
8072842: Add support for building native JTReg tests
ihse
parents:
29075
diff
changeset
|
152 |
# |
8836e3bd543b
8072842: Add support for building native JTReg tests
ihse
parents:
29075
diff
changeset
|
153 |
# Local make tests will be TEST_IMAGE_DIR and JPRT with jprt.use.reg.test.bundle=true |
8836e3bd543b
8072842: Add support for building native JTReg tests
ihse
parents:
29075
diff
changeset
|
154 |
# should be JPRT_TESTNATIVE_PATH |
8836e3bd543b
8072842: Add support for building native JTReg tests
ihse
parents:
29075
diff
changeset
|
155 |
ifdef TEST_IMAGE_DIR |
8836e3bd543b
8072842: Add support for building native JTReg tests
ihse
parents:
29075
diff
changeset
|
156 |
TESTNATIVE_DIR = $(TEST_IMAGE_DIR) |
8836e3bd543b
8072842: Add support for building native JTReg tests
ihse
parents:
29075
diff
changeset
|
157 |
else ifdef JPRT_TESTNATIVE_PATH |
8836e3bd543b
8072842: Add support for building native JTReg tests
ihse
parents:
29075
diff
changeset
|
158 |
TESTNATIVE_DIR = $(JPRT_TESTNATIVE_PATH) |
8836e3bd543b
8072842: Add support for building native JTReg tests
ihse
parents:
29075
diff
changeset
|
159 |
endif |
8836e3bd543b
8072842: Add support for building native JTReg tests
ihse
parents:
29075
diff
changeset
|
160 |
ifdef TESTNATIVE_DIR |
8836e3bd543b
8072842: Add support for building native JTReg tests
ihse
parents:
29075
diff
changeset
|
161 |
JTREG_NATIVE_PATH = -nativepath:$(shell $(GETMIXEDPATH) "$(TESTNATIVE_DIR)/hotspot/jtreg/native") |
8836e3bd543b
8072842: Add support for building native JTReg tests
ihse
parents:
29075
diff
changeset
|
162 |
endif |
8836e3bd543b
8072842: Add support for building native JTReg tests
ihse
parents:
29075
diff
changeset
|
163 |
|
1132
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
164 |
# Expect JPRT to set JPRT_ARCHIVE_BUNDLE (path to zip bundle for results) |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
165 |
ARCHIVE_BUNDLE = $(ABS_TEST_OUTPUT_DIR)/ARCHIVE_BUNDLE.zip |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
166 |
ifdef JPRT_ARCHIVE_BUNDLE |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
167 |
ARCHIVE_BUNDLE = $(JPRT_ARCHIVE_BUNDLE) |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
168 |
endif |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
169 |
|
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
170 |
# How to create the test bundle (pass or fail, we want to create this) |
25628 | 171 |
# Follow command with ";$(BUNDLE_UP_AND_EXIT)", so it always gets executed. |
172 |
ZIP_UP_RESULTS = ( $(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)` \ |
|
173 |
&& $(CD) $(ABS_TEST_OUTPUT_DIR) \ |
|
174 |
&& $(CHMOD) -R a+r . \ |
|
175 |
&& $(ZIP) -q -r $(ARCHIVE_BUNDLE) . ) |
|
176 |
||
177 |
# important results files |
|
178 |
SUMMARY_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTreport/text/summary.txt") |
|
179 |
STATS_TXT_NAME = Stats.txt |
|
180 |
STATS_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/$(STATS_TXT_NAME)") |
|
181 |
RUNLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/runlist.txt") |
|
182 |
PASSLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/passlist.txt") |
|
183 |
FAILLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/faillist.txt") |
|
184 |
EXITCODE = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/exitcode.txt") |
|
185 |
||
186 |
TESTEXIT = \ |
|
187 |
if [ ! -s $(EXITCODE) ] ; then \ |
|
188 |
$(ECHO) "ERROR: EXITCODE file not filled in."; \ |
|
189 |
$(ECHO) "1" > $(EXITCODE); \ |
|
190 |
fi ; \ |
|
191 |
testExitCode=`$(CAT) $(EXITCODE)`; \ |
|
192 |
$(ECHO) "EXIT CODE: $${testExitCode}"; \ |
|
193 |
exit $${testExitCode} |
|
194 |
||
195 |
BUNDLE_UP_AND_EXIT = \ |
|
196 |
( \ |
|
197 |
jtregExitCode=$$? && \ |
|
198 |
_summary="$(SUMMARY_TXT)"; \ |
|
199 |
$(RM) -f $(STATS_TXT) $(RUNLIST) $(PASSLIST) $(FAILLIST) $(EXITCODE); \ |
|
200 |
$(ECHO) "$${jtregExitCode}" > $(EXITCODE); \ |
|
201 |
if [ -r "$${_summary}" ] ; then \ |
|
202 |
$(ECHO) "Summary: $(UNIQUE_DIR)" > $(STATS_TXT); \ |
|
203 |
$(EXPAND) $${_summary} | $(EGREP) -v ' Not run\.' > $(RUNLIST); \ |
|
204 |
$(EGREP) ' Passed\.' $(RUNLIST) \ |
|
205 |
| $(EGREP) -v ' Error\.' \ |
|
206 |
| $(EGREP) -v ' Failed\.' > $(PASSLIST); \ |
|
207 |
( $(EGREP) ' Failed\.' $(RUNLIST); \ |
|
208 |
$(EGREP) ' Error\.' $(RUNLIST); \ |
|
209 |
$(EGREP) -v ' Passed\.' $(RUNLIST) ) \ |
|
210 |
| $(SORT) | $(UNIQ) > $(FAILLIST); \ |
|
211 |
if [ $${jtregExitCode} != 0 -o -s $(FAILLIST) ] ; then \ |
|
212 |
$(EXPAND) $(FAILLIST) \ |
|
213 |
| $(CUT) -d' ' -f1 \ |
|
214 |
| $(SED) -e 's@^@FAILED: @' >> $(STATS_TXT); \ |
|
215 |
if [ $${jtregExitCode} = 0 ] ; then \ |
|
216 |
jtregExitCode=1; \ |
|
217 |
fi; \ |
|
218 |
fi; \ |
|
219 |
runc="`$(CAT) $(RUNLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \ |
|
220 |
passc="`$(CAT) $(PASSLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \ |
|
221 |
failc="`$(CAT) $(FAILLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \ |
|
222 |
exclc="FIXME CODETOOLS-7900176"; \ |
|
223 |
$(ECHO) "TEST STATS: name=$(UNIQUE_DIR) run=$${runc} pass=$${passc} fail=$${failc}" \ |
|
224 |
>> $(STATS_TXT); \ |
|
225 |
else \ |
|
226 |
$(ECHO) "Missing file: $${_summary}" >> $(STATS_TXT); \ |
|
227 |
fi; \ |
|
228 |
if [ -f $(STATS_TXT) ] ; then \ |
|
229 |
$(CAT) $(STATS_TXT); \ |
|
230 |
fi; \ |
|
231 |
$(ZIP_UP_RESULTS) ; \ |
|
232 |
$(TESTEXIT) \ |
|
233 |
) |
|
1132
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
234 |
|
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
235 |
################################################################ |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
236 |
|
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
237 |
# Default make rule (runs jtreg_tests) |
25628 | 238 |
all: hotspot_all |
1132
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
239 |
@$(ECHO) "Testing completed successfully" |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
240 |
|
25628 | 241 |
# Support "hotspot_" prefixed test make targets (too) |
242 |
# The hotspot_% targets are used by the top level Makefile |
|
243 |
# Unless explicitly defined below, hotspot_<x> is interpreted as a jtreg test group name |
|
24433
492c1fb41098
8042804: Support invoking Hotspot tests from top level
mikael
parents:
22234
diff
changeset
|
244 |
hotspot_%: |
25628 | 245 |
$(ECHO) "Running tests: $@" |
246 |
$(MAKE) -j 1 TEST_SELECTION=":$@" UNIQUE_DIR=$@ jtreg_tests; |
|
24433
492c1fb41098
8042804: Support invoking Hotspot tests from top level
mikael
parents:
22234
diff
changeset
|
247 |
|
1132
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
248 |
# Prep for output |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
249 |
prep: clean |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
250 |
@$(MKDIR) -p $(ABS_TEST_OUTPUT_DIR) |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
251 |
@$(MKDIR) -p `dirname $(ARCHIVE_BUNDLE)` |
1 | 252 |
|
253 |
# Cleanup |
|
254 |
clean: |
|
1132
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
255 |
$(RM) -r $(ABS_TEST_OUTPUT_DIR) |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
256 |
$(RM) $(ARCHIVE_BUNDLE) |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
257 |
|
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
258 |
################################################################ |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
259 |
|
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
260 |
# jtreg tests |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
261 |
|
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
262 |
# Expect JT_HOME to be set for jtreg tests. (home for jtreg) |
17005
f7ab7c9c3784
8011678: test/Makefile should pick up JT_HOME environment variable
twisti
parents:
15239
diff
changeset
|
263 |
ifndef JT_HOME |
25628 | 264 |
JT_HOME = $(SLASH_JAVA)/re/jtreg/4.1/promoted/latest/binaries/jtreg |
265 |
ifdef JPRT_JTREG_HOME |
|
266 |
JT_HOME = $(JPRT_JTREG_HOME) |
|
267 |
endif |
|
1132
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
268 |
endif |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
269 |
|
25628 | 270 |
# When called from JPRT the TESTDIRS variable is set to the jtreg tests to run |
1132
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
271 |
ifdef TESTDIRS |
25628 | 272 |
TEST_SELECTION = $(TESTDIRS) |
273 |
endif |
|
274 |
||
275 |
ifdef CONCURRENCY |
|
276 |
EXTRA_JTREG_OPTIONS += -concurrency:$(CONCURRENCY) |
|
1132
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
277 |
endif |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
278 |
|
26922
8134a6d3fc02
8058936: hotspot/test/Makefile should use jtreg script from $JT_HOME/bin/jreg (instead of $JT_HOME/win32/bin/jtreg)
sla
parents:
26921
diff
changeset
|
279 |
# Default JTREG to run |
8134a6d3fc02
8058936: hotspot/test/Makefile should use jtreg script from $JT_HOME/bin/jreg (instead of $JT_HOME/win32/bin/jtreg)
sla
parents:
26921
diff
changeset
|
280 |
JTREG = $(JT_HOME)/bin/jtreg |
1132
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
281 |
|
30249
faf83ebbf040
8077608: [TESTBUG] Enable Hotspot jtreg tests to run in agentvm mode
ctornqvi
parents:
29179
diff
changeset
|
282 |
# Use agent mode |
faf83ebbf040
8077608: [TESTBUG] Enable Hotspot jtreg tests to run in agentvm mode
ctornqvi
parents:
29179
diff
changeset
|
283 |
JTREG_BASIC_OPTIONS += -agentvm |
25628 | 284 |
# Only run automatic tests |
285 |
JTREG_BASIC_OPTIONS += -a |
|
286 |
# Report details on all failed or error tests, times too |
|
287 |
JTREG_BASIC_OPTIONS += -v:fail,error,time |
|
288 |
# Retain all files for failing tests |
|
29075
ad5e1490d635
8073167: Undo change to -retain argument in hotspot/test/Makefile
cjplummer
parents:
29071
diff
changeset
|
289 |
JTREG_BASIC_OPTIONS += -retain:fail,error |
25628 | 290 |
# Ignore tests are not run and completely silent about it |
291 |
JTREG_IGNORE_OPTION = -ignore:quiet |
|
292 |
JTREG_BASIC_OPTIONS += $(JTREG_IGNORE_OPTION) |
|
28021
e19f567fcac2
8066508: JTReg tests timeout on slow devices when run using JPRT
cjplummer
parents:
26922
diff
changeset
|
293 |
# Multiply by 4 the timeout factor |
e19f567fcac2
8066508: JTReg tests timeout on slow devices when run using JPRT
cjplummer
parents:
26922
diff
changeset
|
294 |
JTREG_TIMEOUT_OPTION = -timeoutFactor:4 |
e19f567fcac2
8066508: JTReg tests timeout on slow devices when run using JPRT
cjplummer
parents:
26922
diff
changeset
|
295 |
JTREG_BASIC_OPTIONS += $(JTREG_TIMEOUT_OPTION) |
25628 | 296 |
# Add any extra options |
297 |
JTREG_BASIC_OPTIONS += $(EXTRA_JTREG_OPTIONS) |
|
298 |
# Set other vm and test options |
|
299 |
JTREG_TEST_OPTIONS = $(JAVA_ARGS:%=-javaoptions:%) $(JAVA_OPTIONS:%=-vmoption:%) $(JAVA_VM_ARGS:%=-vmoption:%) |
|
300 |
||
1132
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
301 |
# Option to tell jtreg to not run tests marked with "ignore" |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
302 |
ifeq ($(PLATFORM), windows) |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
303 |
JTREG_KEY_OPTION = -k:!ignore |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
304 |
else |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
305 |
JTREG_KEY_OPTION = -k:\!ignore |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
306 |
endif |
25628 | 307 |
JTREG_BASIC_OPTIONS += $(JTREG_KEY_OPTION) |
1132
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
308 |
|
25628 | 309 |
# Make sure jtreg exists |
310 |
$(JTREG): $(JT_HOME) |
|
1 | 311 |
|
25628 | 312 |
jtreg_tests: prep $(PRODUCT_HOME) $(JTREG) |
313 |
( \ |
|
314 |
( JT_HOME=$(shell $(GETMIXEDPATH) "$(JT_HOME)"); \ |
|
315 |
export JT_HOME; \ |
|
316 |
$(shell $(GETMIXEDPATH) "$(JTREG)") \ |
|
317 |
$(JTREG_BASIC_OPTIONS) \ |
|
318 |
-r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTreport") \ |
|
319 |
-w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTwork") \ |
|
320 |
-jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \ |
|
29179
8836e3bd543b
8072842: Add support for building native JTReg tests
ihse
parents:
29075
diff
changeset
|
321 |
$(JTREG_NATIVE_PATH) \ |
25628 | 322 |
$(JTREG_EXCLUSIONS) \ |
323 |
$(JTREG_TEST_OPTIONS) \ |
|
324 |
$(TEST_SELECTION) \ |
|
325 |
) ; \ |
|
326 |
$(BUNDLE_UP_AND_EXIT) \ |
|
327 |
) 2>&1 | $(TEE) $(ABS_TEST_OUTPUT_DIR)/output.txt ; $(TESTEXIT) |
|
1132
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
328 |
|
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
329 |
PHONY_LIST += jtreg_tests |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
330 |
|
27695 | 331 |
# flags used to execute java in test targets |
29179
8836e3bd543b
8072842: Add support for building native JTReg tests
ihse
parents:
29075
diff
changeset
|
332 |
TEST_FLAGS += -version -Xinternalversion -X -help |
27695 | 333 |
|
334 |
sanitytest: prep $(PRODUCT_HOME) |
|
335 |
@for flag in $(TEST_FLAGS); \ |
|
336 |
do \ |
|
337 |
echo Executing java $(JAVA_OPTIONS) $$flag; \ |
|
338 |
$(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) $$flag; \ |
|
339 |
res=$$?; \ |
|
340 |
if [ $$res -ne 0 ]; then \ |
|
341 |
exit $$res; \ |
|
342 |
fi; \ |
|
343 |
done |
|
344 |
||
345 |
PHONY_LIST += sanitytest |
|
346 |
||
1132
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
347 |
################################################################ |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
348 |
|
30267 | 349 |
# basicvmtest (make sure various basic java options work) |
350 |
||
351 |
# Set up the directory in which the jvm directories live (client/, server/, etc.) |
|
352 |
ifeq ($(PLATFORM),windows) |
|
353 |
JVMS_DIR := $(PRODUCT_HOME)/bin |
|
354 |
else ifeq ($(PLATFORM),bsd) |
|
355 |
JVMS_DIR := $(PRODUCT_HOME)/lib |
|
356 |
else |
|
357 |
# The jvms live in the architecture directory (amd64, sparcv9, |
|
358 |
# etc.). By using a wildcard there's no need to figure out the exact |
|
359 |
# name of that directory. |
|
360 |
JVMS_DIR := $(PRODUCT_HOME)/lib/* |
|
361 |
endif |
|
362 |
||
363 |
# Use the existance of a directory as a sign that jvm variant is available |
|
364 |
CANDIDATE_JVM_VARIANTS := client minimal server |
|
365 |
JVM_VARIANTS := $(strip $(foreach x,$(CANDIDATE_JVM_VARIANTS),$(if $(wildcard $(JVMS_DIR)/$(x)),$(x)))) |
|
366 |
||
367 |
hotspot_basicvmtest: |
|
368 |
for variant in $(JVM_VARIANTS); \ |
|
369 |
do \ |
|
370 |
$(MAKE) JAVA_ARGS="$(JAVA_ARGS) -$$variant" hotspot_$${variant}test; \ |
|
371 |
done |
|
372 |
||
373 |
PHONY_LIST += hotspot_basicvmtest |
|
374 |
||
375 |
################################################################ |
|
376 |
||
2868
051eb4af737f
6839151: Add a JPRT default test of -Xshare:dump when new hotspot is built
ohair
parents:
2105
diff
changeset
|
377 |
# clienttest (make sure various basic java client options work) |
051eb4af737f
6839151: Add a JPRT default test of -Xshare:dump when new hotspot is built
ohair
parents:
2105
diff
changeset
|
378 |
|
27695 | 379 |
hotspot_clienttest clienttest: sanitytest |
2868
051eb4af737f
6839151: Add a JPRT default test of -Xshare:dump when new hotspot is built
ohair
parents:
2105
diff
changeset
|
380 |
$(RM) $(PRODUCT_HOME)/jre/lib/*/client/classes.jsa |
051eb4af737f
6839151: Add a JPRT default test of -Xshare:dump when new hotspot is built
ohair
parents:
2105
diff
changeset
|
381 |
$(RM) $(PRODUCT_HOME)/jre/bin/client/classes.jsa |
051eb4af737f
6839151: Add a JPRT default test of -Xshare:dump when new hotspot is built
ohair
parents:
2105
diff
changeset
|
382 |
$(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -Xshare:dump |
051eb4af737f
6839151: Add a JPRT default test of -Xshare:dump when new hotspot is built
ohair
parents:
2105
diff
changeset
|
383 |
|
25628 | 384 |
PHONY_LIST += hotspot_clienttest clienttest |
2868
051eb4af737f
6839151: Add a JPRT default test of -Xshare:dump when new hotspot is built
ohair
parents:
2105
diff
changeset
|
385 |
|
051eb4af737f
6839151: Add a JPRT default test of -Xshare:dump when new hotspot is built
ohair
parents:
2105
diff
changeset
|
386 |
################################################################ |
051eb4af737f
6839151: Add a JPRT default test of -Xshare:dump when new hotspot is built
ohair
parents:
2105
diff
changeset
|
387 |
|
26921
de18c35bc62d
8058919: Add sanity test for minimal VM in test/Makefile
dholmes
parents:
25628
diff
changeset
|
388 |
# minimaltest (make sure various basic java minimal options work) |
de18c35bc62d
8058919: Add sanity test for minimal VM in test/Makefile
dholmes
parents:
25628
diff
changeset
|
389 |
|
27695 | 390 |
hotspot_minimaltest minimaltest: sanitytest |
26921
de18c35bc62d
8058919: Add sanity test for minimal VM in test/Makefile
dholmes
parents:
25628
diff
changeset
|
391 |
|
de18c35bc62d
8058919: Add sanity test for minimal VM in test/Makefile
dholmes
parents:
25628
diff
changeset
|
392 |
PHONY_LIST += hotspot_minimaltest minimaltest |
de18c35bc62d
8058919: Add sanity test for minimal VM in test/Makefile
dholmes
parents:
25628
diff
changeset
|
393 |
|
de18c35bc62d
8058919: Add sanity test for minimal VM in test/Makefile
dholmes
parents:
25628
diff
changeset
|
394 |
################################################################ |
de18c35bc62d
8058919: Add sanity test for minimal VM in test/Makefile
dholmes
parents:
25628
diff
changeset
|
395 |
|
2868
051eb4af737f
6839151: Add a JPRT default test of -Xshare:dump when new hotspot is built
ohair
parents:
2105
diff
changeset
|
396 |
# servertest (make sure various basic java server options work) |
051eb4af737f
6839151: Add a JPRT default test of -Xshare:dump when new hotspot is built
ohair
parents:
2105
diff
changeset
|
397 |
|
27695 | 398 |
hotspot_servertest servertest: sanitytest |
2868
051eb4af737f
6839151: Add a JPRT default test of -Xshare:dump when new hotspot is built
ohair
parents:
2105
diff
changeset
|
399 |
|
25628 | 400 |
PHONY_LIST += hotspot_servertest servertest |
2868
051eb4af737f
6839151: Add a JPRT default test of -Xshare:dump when new hotspot is built
ohair
parents:
2105
diff
changeset
|
401 |
|
051eb4af737f
6839151: Add a JPRT default test of -Xshare:dump when new hotspot is built
ohair
parents:
2105
diff
changeset
|
402 |
################################################################ |
051eb4af737f
6839151: Add a JPRT default test of -Xshare:dump when new hotspot is built
ohair
parents:
2105
diff
changeset
|
403 |
|
10994
fc93bca9c720
7102044: G1: VM crashes with assert(old_end != new_end) failed: don't call this otherwise
brutisso
parents:
10565
diff
changeset
|
404 |
# internalvmtests (run internal unit tests inside the VM) |
fc93bca9c720
7102044: G1: VM crashes with assert(old_end != new_end) failed: don't call this otherwise
brutisso
parents:
10565
diff
changeset
|
405 |
|
25628 | 406 |
hotspot_internalvmtests internalvmtests: prep $(PRODUCT_HOME) |
10994
fc93bca9c720
7102044: G1: VM crashes with assert(old_end != new_end) failed: don't call this otherwise
brutisso
parents:
10565
diff
changeset
|
407 |
$(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -XX:+ExecuteInternalVMTests -version |
fc93bca9c720
7102044: G1: VM crashes with assert(old_end != new_end) failed: don't call this otherwise
brutisso
parents:
10565
diff
changeset
|
408 |
|
25628 | 409 |
PHONY_LIST += hotspot_internalvmtests internalvmtests |
1132
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
410 |
|
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
411 |
################################################################ |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
412 |
|
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
413 |
# Phony targets (e.g. these are not filenames) |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
414 |
.PHONY: all clean prep $(PHONY_LIST) |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
415 |
|
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
416 |
################################################################ |