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