author | duke |
Wed, 05 Jul 2017 22:03:22 +0200 | |
changeset 40215 | ee3b233db289 |
parent 39102 | 5a820f7e00b9 |
child 41449 | de8df2220540 |
permissions | -rw-r--r-- |
10 | 1 |
# |
5214 | 2 |
# Makefile to run jtreg and other tests |
3 |
# |
|
4 |
||
5 |
# Product builds and langtools builds |
|
6 |
# |
|
7 |
# A full product build (or "control" build) creates a complete JDK image. |
|
8 |
# To test a product build, set TESTJAVA to the path for the image. |
|
10 | 9 |
# |
20602
88692440ebd1
8024842: Define ABS_TEST_OUTPUT_DIR via TEST_OUTPUT_DIR
mduigou
parents:
15384
diff
changeset
|
10 |
# A langtools build just builds the langtools components of a JDK. |
5214 | 11 |
# To test a langtools build, set TESTJAVA to the path for a recent JDK |
12 |
# build, and set TESTBOOTCLASSPATH to the compiled langtools classes -- |
|
13 |
# for example build/classes or dist/lib/classes.jar. |
|
14 |
||
15 |
# JPRT |
|
16 |
# JPRT may invoke this Makefile directly, as part of a langtools build, |
|
17 |
# or indirectly, via FOREST/test/Makefile, as part of a control build. |
|
10 | 18 |
|
19 |
# Get OS/ARCH specifics |
|
20 |
OSNAME = $(shell uname -s) |
|
21 |
ifeq ($(OSNAME), SunOS) |
|
10947
47788da3eb3f
7101933: langtools jtreg tests do not work with jprt on windows
jjh
parents:
5652
diff
changeset
|
22 |
SLASH_JAVA = /java |
10 | 23 |
PLATFORM = solaris |
24 |
ARCH = $(shell uname -p) |
|
25 |
ifeq ($(ARCH), i386) |
|
26 |
ARCH=i586 |
|
27 |
endif |
|
28 |
endif |
|
29 |
ifeq ($(OSNAME), Linux) |
|
10947
47788da3eb3f
7101933: langtools jtreg tests do not work with jprt on windows
jjh
parents:
5652
diff
changeset
|
30 |
SLASH_JAVA = /java |
10 | 31 |
PLATFORM = linux |
32 |
ARCH = $(shell uname -m) |
|
33 |
ifeq ($(ARCH), i386) |
|
34 |
ARCH=i586 |
|
35 |
endif |
|
36 |
endif |
|
12084
b367473ef0f1
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
10947
diff
changeset
|
37 |
ifeq ($(OSNAME), Darwin) |
b367473ef0f1
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
10947
diff
changeset
|
38 |
PLATFORM = bsd |
b367473ef0f1
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
10947
diff
changeset
|
39 |
ARCH = $(shell uname -m) |
b367473ef0f1
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
10947
diff
changeset
|
40 |
ifeq ($(ARCH), i386) |
b367473ef0f1
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
10947
diff
changeset
|
41 |
ARCH=i586 |
b367473ef0f1
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
10947
diff
changeset
|
42 |
endif |
b367473ef0f1
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
10947
diff
changeset
|
43 |
endif |
10 | 44 |
ifeq ($(OSNAME), Windows_NT) |
10947
47788da3eb3f
7101933: langtools jtreg tests do not work with jprt on windows
jjh
parents:
5652
diff
changeset
|
45 |
# MKS |
47788da3eb3f
7101933: langtools jtreg tests do not work with jprt on windows
jjh
parents:
5652
diff
changeset
|
46 |
PLATFORM=windows |
47788da3eb3f
7101933: langtools jtreg tests do not work with jprt on windows
jjh
parents:
5652
diff
changeset
|
47 |
endif |
47788da3eb3f
7101933: langtools jtreg tests do not work with jprt on windows
jjh
parents:
5652
diff
changeset
|
48 |
ifeq ($(PLATFORM),) |
10 | 49 |
PLATFORM = windows |
10947
47788da3eb3f
7101933: langtools jtreg tests do not work with jprt on windows
jjh
parents:
5652
diff
changeset
|
50 |
CYGPATH = | cygpath -m -s -f - |
47788da3eb3f
7101933: langtools jtreg tests do not work with jprt on windows
jjh
parents:
5652
diff
changeset
|
51 |
endif |
47788da3eb3f
7101933: langtools jtreg tests do not work with jprt on windows
jjh
parents:
5652
diff
changeset
|
52 |
|
47788da3eb3f
7101933: langtools jtreg tests do not work with jprt on windows
jjh
parents:
5652
diff
changeset
|
53 |
ifeq ($(PLATFORM), windows) |
47788da3eb3f
7101933: langtools jtreg tests do not work with jprt on windows
jjh
parents:
5652
diff
changeset
|
54 |
SLASH_JAVA = J: |
10 | 55 |
ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),ia64) |
56 |
ARCH=ia64 |
|
57 |
else |
|
58 |
ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),AMD64) |
|
59 |
ARCH=x64 |
|
60 |
else |
|
61 |
ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),EM64T) |
|
62 |
ARCH=x64 |
|
63 |
else |
|
64 |
ARCH=i586 |
|
65 |
endif |
|
66 |
endif |
|
67 |
endif |
|
5652
89482b760ef7
6954901: langtools/test/Makefile should check for bin/javac(.exe) instead of lib/tools.jar
jjg
parents:
5647
diff
changeset
|
68 |
EXE_SUFFIX=.exe |
10 | 69 |
endif |
70 |
||
71 |
# Root of this test area (important to use full paths in some places) |
|
10947
47788da3eb3f
7101933: langtools jtreg tests do not work with jprt on windows
jjh
parents:
5652
diff
changeset
|
72 |
TEST_ROOT := $(shell pwd $(CYGPATH) ) |
10 | 73 |
|
5214 | 74 |
# Default bundle of all test results (passed or not) (JPRT only) |
75 |
ifdef JPRT_JOB_ID |
|
76 |
JPRT_CLEAN = clean |
|
77 |
JPRT_ARCHIVE_BUNDLE = $(TEST_ROOT)/JPRT_ARCHIVE_BUNDLE.zip |
|
78 |
endif |
|
10 | 79 |
|
80 |
ifeq ($(PLATFORM), windows) |
|
81 |
SLASH_JAVA = J: |
|
82 |
else |
|
83 |
SLASH_JAVA = /java |
|
84 |
endif |
|
85 |
||
86 |
# Default JTREG to run |
|
39102
5a820f7e00b9
8158992: langtools/test/Makefile: improve support for control via variables
dlsmith
parents:
37941
diff
changeset
|
87 |
ifndef JTREG_HOME |
5a820f7e00b9
8158992: langtools/test/Makefile: improve support for control via variables
dlsmith
parents:
37941
diff
changeset
|
88 |
ifdef JPRT_JTREG_HOME |
5a820f7e00b9
8158992: langtools/test/Makefile: improve support for control via variables
dlsmith
parents:
37941
diff
changeset
|
89 |
JTREG_HOME = $(JPRT_JTREG_HOME) |
5a820f7e00b9
8158992: langtools/test/Makefile: improve support for control via variables
dlsmith
parents:
37941
diff
changeset
|
90 |
else ifdef JT_HOME |
5a820f7e00b9
8158992: langtools/test/Makefile: improve support for control via variables
dlsmith
parents:
37941
diff
changeset
|
91 |
JTREG_HOME = $(JT_HOME) |
5a820f7e00b9
8158992: langtools/test/Makefile: improve support for control via variables
dlsmith
parents:
37941
diff
changeset
|
92 |
else |
5a820f7e00b9
8158992: langtools/test/Makefile: improve support for control via variables
dlsmith
parents:
37941
diff
changeset
|
93 |
JTREG_HOME = $(SLASH_JAVA)/re/jtreg/4.2/promoted/latest/ |
5a820f7e00b9
8158992: langtools/test/Makefile: improve support for control via variables
dlsmith
parents:
37941
diff
changeset
|
94 |
endif |
3779 | 95 |
endif |
28141
a9bd48f9cf07
8066808: langtools/test/Makefile should not use OS-specific jtreg binary
jjg
parents:
28140
diff
changeset
|
96 |
JTREG = $(JTREG_HOME)/bin/jtreg |
a9bd48f9cf07
8066808: langtools/test/Makefile should not use OS-specific jtreg binary
jjg
parents:
28140
diff
changeset
|
97 |
JTDIFF = $(JTREG_HOME)/bin/jtdiff |
10 | 98 |
|
36526 | 99 |
# Problematic tests to be excluded |
100 |
PROBLEM_LISTS=ProblemList.txt |
|
101 |
||
102 |
# Create exclude list for this platform and arch |
|
103 |
ifdef NO_EXCLUDES |
|
104 |
JTREG_EXCLUSIONS = |
|
105 |
else |
|
106 |
JTREG_EXCLUSIONS = $(PROBLEM_LISTS:%=-exclude:%) |
|
107 |
endif |
|
108 |
||
5214 | 109 |
# Default JCK to run |
39102
5a820f7e00b9
8158992: langtools/test/Makefile: improve support for control via variables
dlsmith
parents:
37941
diff
changeset
|
110 |
ifndef JCK_HOME |
5a820f7e00b9
8158992: langtools/test/Makefile: improve support for control via variables
dlsmith
parents:
37941
diff
changeset
|
111 |
ifdef JPRT_JCK_HOME |
5a820f7e00b9
8158992: langtools/test/Makefile: improve support for control via variables
dlsmith
parents:
37941
diff
changeset
|
112 |
JCK_HOME = $(JPRT_JCK_HOME) |
5a820f7e00b9
8158992: langtools/test/Makefile: improve support for control via variables
dlsmith
parents:
37941
diff
changeset
|
113 |
else |
5a820f7e00b9
8158992: langtools/test/Makefile: improve support for control via variables
dlsmith
parents:
37941
diff
changeset
|
114 |
JCK_HOME = $(SLASH_JAVA)/re/jck/8/promoted/latest/binaries |
5a820f7e00b9
8158992: langtools/test/Makefile: improve support for control via variables
dlsmith
parents:
37941
diff
changeset
|
115 |
endif |
5214 | 116 |
endif |
117 |
||
118 |
# Default JDK for JTREG and JCK |
|
119 |
# |
|
28140
1fa50caeb63b
8066807: langtools/test/Makefile should use -agentvm not -samevm
jjg
parents:
27382
diff
changeset
|
120 |
# JT_JAVA is the version of java used to run jtreg/JCK. |
5214 | 121 |
# |
37941 | 122 |
ifndef JT_JAVA |
123 |
ifdef JPRT_JAVA_HOME |
|
124 |
JT_JAVA = $(JPRT_JAVA_HOME) |
|
125 |
else |
|
126 |
JT_JAVA = $(SLASH_JAVA)/re/jdk/1.9.0/archive/fcs/binaries/$(PLATFORM)-$(ARCH) |
|
127 |
endif |
|
10 | 128 |
endif |
129 |
||
130 |
# Default JDK to test |
|
3779 | 131 |
ifdef JPRT_IMPORT_PRODUCT_HOME |
132 |
TESTJAVA = $(JPRT_IMPORT_PRODUCT_HOME) |
|
133 |
else |
|
28140
1fa50caeb63b
8066807: langtools/test/Makefile should use -agentvm not -samevm
jjg
parents:
27382
diff
changeset
|
134 |
TESTJAVA = $(SLASH_JAVA)/re/jdk/1.9.0/promoted/latest/binaries/$(PLATFORM)-$(ARCH) |
3779 | 135 |
endif |
136 |
||
20602
88692440ebd1
8024842: Define ABS_TEST_OUTPUT_DIR via TEST_OUTPUT_DIR
mduigou
parents:
15384
diff
changeset
|
137 |
# PRODUCT_HOME is a JPRT variable pointing to a directory containing the output from |
5214 | 138 |
# make/Makefile |
139 |
# For langtools, this is a directory containing build and dist |
|
20602
88692440ebd1
8024842: Define ABS_TEST_OUTPUT_DIR via TEST_OUTPUT_DIR
mduigou
parents:
15384
diff
changeset
|
140 |
# For a control build, this is build/$(PRODUCT)-$(ARCH)/XYZ-image |
5652
89482b760ef7
6954901: langtools/test/Makefile should check for bin/javac(.exe) instead of lib/tools.jar
jjg
parents:
5647
diff
changeset
|
141 |
# (i.e, j2sdk-image or jdk-module-image) |
5214 | 142 |
ifdef PRODUCT_HOME |
143 |
ifeq ($(shell [ -r $(PRODUCT_HOME)/dist/lib/classes.jar ]; echo $$?),0) |
|
144 |
TESTBOOTCLASSPATH = $(PRODUCT_HOME)/dist/lib/classes.jar |
|
145 |
endif |
|
5652
89482b760ef7
6954901: langtools/test/Makefile should check for bin/javac(.exe) instead of lib/tools.jar
jjg
parents:
5647
diff
changeset
|
146 |
ifeq ($(shell [ -r $(PRODUCT_HOME)/bin/javac$(EXE_SUFFIX) ]; echo $$?),0) |
5214 | 147 |
TESTJAVA = $(PRODUCT_HOME) |
148 |
endif |
|
149 |
endif |
|
150 |
||
151 |
ifdef TESTBOOTCLASSPATH |
|
152 |
JTREG_OPTIONS += -Xbootclasspath/p:$(TESTBOOTCLASSPATH) |
|
153 |
### In the following, -refvmoptions is an undocumented option |
|
20602
88692440ebd1
8024842: Define ABS_TEST_OUTPUT_DIR via TEST_OUTPUT_DIR
mduigou
parents:
15384
diff
changeset
|
154 |
### The following does not work JCK 7 b30 2/6/2010. Awaiting b31. |
5214 | 155 |
JCK_OPTIONS += \ |
156 |
-vmoptions:-Xbootclasspath/p:$(TESTBOOTCLASSPATH) \ |
|
157 |
-refvmoptions:-Xbootclasspath/p:$(TESTBOOTCLASSPATH) |
|
158 |
endif |
|
159 |
||
37941 | 160 |
ifdef EXTRA_JTREG_OPTIONS |
161 |
JTREG_OPTIONS += $(EXTRA_JTREG_OPTIONS) |
|
162 |
endif |
|
163 |
||
20602
88692440ebd1
8024842: Define ABS_TEST_OUTPUT_DIR via TEST_OUTPUT_DIR
mduigou
parents:
15384
diff
changeset
|
164 |
# Concurrency is the number of tests that can execute at once. |
5214 | 165 |
# On an otherwise empty machine, suggest setting to (#cpus + 2) |
166 |
# If unset, the default is (#cpus) |
|
167 |
### RFE: determine and use #cpus |
|
14546
7e2a1569de76
8003357: Add support for jtreg -concurrency to langtools/test/Makefile
jjh
parents:
12084
diff
changeset
|
168 |
ifdef CONCURRENCY |
7e2a1569de76
8003357: Add support for jtreg -concurrency to langtools/test/Makefile
jjh
parents:
12084
diff
changeset
|
169 |
JTREG_OPTIONS += -agentvm -concurrency:$(CONCURRENCY) |
7e2a1569de76
8003357: Add support for jtreg -concurrency to langtools/test/Makefile
jjh
parents:
12084
diff
changeset
|
170 |
else |
28140
1fa50caeb63b
8066807: langtools/test/Makefile should use -agentvm not -samevm
jjg
parents:
27382
diff
changeset
|
171 |
JTREG_OPTIONS += -agentvm |
14546
7e2a1569de76
8003357: Add support for jtreg -concurrency to langtools/test/Makefile
jjh
parents:
12084
diff
changeset
|
172 |
endif |
7e2a1569de76
8003357: Add support for jtreg -concurrency to langtools/test/Makefile
jjh
parents:
12084
diff
changeset
|
173 |
|
5214 | 174 |
ifdef JCK_CONCURRENCY |
175 |
JCK_OPTIONS += -concurrency:$(JCK_CONCURRENCY) |
|
176 |
endif |
|
177 |
||
178 |
# JCK is executed using "Multi-JVM Group Mode", which is a hybrid |
|
179 |
# of otherVM and sameVM modes. New JVMs are created and reused for |
|
180 |
# a number of tests, then eventually discarded and a new one started. |
|
181 |
# This amortizes the JVM startup time. The "group size" defines |
|
182 |
# how many tests are run in a JVM before it is replaced. |
|
183 |
# If unset, the default is 100. |
|
184 |
JCK_GROUP_SIZE = 1000 |
|
185 |
ifdef JCK_GROUP_SIZE |
|
186 |
JCK_COMPILER_OPTIONS += \ |
|
187 |
-jtoptions:-Ejck.env.compiler.testCompile.groupMode.groupSize=$(JCK_GROUP_SIZE) \ |
|
188 |
-jtoptions:-Ejck.env.compiler.compRefExecute.groupMode.groupSize=$(JCK_GROUP_SIZE) |
|
189 |
### The following is not supported. Awaiting RFE 6924287 |
|
190 |
### 6924287: Jck4Jdk: Allow to configure test group size for group mode via simple command line option |
|
191 |
### JCK_RUNTIME_OPTIONS += \ |
|
192 |
### -jtoptions:-Ejck.env.runtime.testCompile.groupMode.groupSize=$(JCK_GROUP_SIZE) |
|
193 |
endif |
|
194 |
||
5647
9a0b03523aa9
6952188: update timeout for langtools jtreg tests on JPRT
jjg
parents:
5214
diff
changeset
|
195 |
# Timeouts -- by default, increase test timeouts when running on JPRT |
9a0b03523aa9
6952188: update timeout for langtools jtreg tests on JPRT
jjg
parents:
5214
diff
changeset
|
196 |
ifdef JPRT_JOB_ID |
9a0b03523aa9
6952188: update timeout for langtools jtreg tests on JPRT
jjg
parents:
5214
diff
changeset
|
197 |
ifndef JTREG_TIMEOUT_FACTOR |
9a0b03523aa9
6952188: update timeout for langtools jtreg tests on JPRT
jjg
parents:
5214
diff
changeset
|
198 |
JTREG_TIMEOUT_FACTOR = 3 |
9a0b03523aa9
6952188: update timeout for langtools jtreg tests on JPRT
jjg
parents:
5214
diff
changeset
|
199 |
endif |
9a0b03523aa9
6952188: update timeout for langtools jtreg tests on JPRT
jjg
parents:
5214
diff
changeset
|
200 |
endif |
9a0b03523aa9
6952188: update timeout for langtools jtreg tests on JPRT
jjg
parents:
5214
diff
changeset
|
201 |
ifdef JTREG_TIMEOUT_FACTOR |
9a0b03523aa9
6952188: update timeout for langtools jtreg tests on JPRT
jjg
parents:
5214
diff
changeset
|
202 |
JTREG_OPTIONS += -timeoutFactor:$(JTREG_TIMEOUT_FACTOR) |
9a0b03523aa9
6952188: update timeout for langtools jtreg tests on JPRT
jjg
parents:
5214
diff
changeset
|
203 |
endif |
9a0b03523aa9
6952188: update timeout for langtools jtreg tests on JPRT
jjg
parents:
5214
diff
changeset
|
204 |
|
27382
60a3693d0d87
8062449: Update langtools/test/Makefile to use JCK 9
dlsmith
parents:
24405
diff
changeset
|
205 |
ifdef JCK_TIMEOUT_FACTOR |
60a3693d0d87
8062449: Update langtools/test/Makefile to use JCK 9
dlsmith
parents:
24405
diff
changeset
|
206 |
JCK_OPTIONS += -timeout:$(JCK_TIMEOUT_FACTOR) |
60a3693d0d87
8062449: Update langtools/test/Makefile to use JCK 9
dlsmith
parents:
24405
diff
changeset
|
207 |
endif |
60a3693d0d87
8062449: Update langtools/test/Makefile to use JCK 9
dlsmith
parents:
24405
diff
changeset
|
208 |
|
24405
71b654b695b7
8042882: Support verbosity options in langtools testing
dlsmith
parents:
20602
diff
changeset
|
209 |
# Default verbosity setting for jtreg |
39102
5a820f7e00b9
8158992: langtools/test/Makefile: improve support for control via variables
dlsmith
parents:
37941
diff
changeset
|
210 |
JTREG_VERBOSE ?= fail,error,nopass |
24405
71b654b695b7
8042882: Support verbosity options in langtools testing
dlsmith
parents:
20602
diff
changeset
|
211 |
|
71b654b695b7
8042882: Support verbosity options in langtools testing
dlsmith
parents:
20602
diff
changeset
|
212 |
# Default verbosity setting for jck |
39102
5a820f7e00b9
8158992: langtools/test/Makefile: improve support for control via variables
dlsmith
parents:
37941
diff
changeset
|
213 |
JCK_VERBOSE ?= non-pass |
24405
71b654b695b7
8042882: Support verbosity options in langtools testing
dlsmith
parents:
20602
diff
changeset
|
214 |
|
5214 | 215 |
# Assertions: some tests show failures when assertions are enabled. |
216 |
# Since javac is typically loaded via the bootclassloader (either via TESTJAVA |
|
217 |
# or TESTBOOTCLASSPATH), you may need -esa to enable assertions in javac. |
|
218 |
JTREG_OPTIONS += $(ASSERTION_OPTIONS) |
|
219 |
JCK_OPTIONS += $(ASSERTION_OPTIONS:%=-vmoptions:%) |
|
220 |
||
221 |
# Include shared options |
|
222 |
JCK_COMPILER_OPTIONS += $(JCK_OPTIONS) |
|
223 |
JCK_RUNTIME_OPTIONS += $(JCK_OPTIONS) |
|
224 |
||
225 |
# Exit codes: |
|
226 |
# jtreg, jck: 0: OK, 1: tests failed, 2: tests error; 3+: SERIOUS |
|
227 |
FATAL_JTREG_EXIT = 3 |
|
228 |
FATAL_JCK_EXIT = 3 |
|
229 |
# jtdiff: 0: OK, 1: differences found; 2+: SERIOUS |
|
230 |
FATAL_JTDIFF_EXIT = 2 |
|
231 |
# |
|
232 |
# Exit -- used for final "normal" exit from "make". Redefine to "true" to avoid |
|
233 |
# having make exit with non-zero return code. |
|
234 |
EXIT = exit |
|
20602
88692440ebd1
8024842: Define ABS_TEST_OUTPUT_DIR via TEST_OUTPUT_DIR
mduigou
parents:
15384
diff
changeset
|
235 |
# Function to exit shell if exit code of preceding command is greater than or equal |
5214 | 236 |
# to a given level. Redefine function or preceding FATAL_*_EXIT codes as needed. |
237 |
EXIT_IF_FATAL = status=$$?; if [ $$status -ge $(1) ]; then exit $$status ; fi |
|
10 | 238 |
|
239 |
# Root of all test results |
|
5214 | 240 |
TEST_OUTPUT_DIR = $(TEST_ROOT)/../build/$(PLATFORM)-$(ARCH)/test/langtools |
241 |
ABS_TEST_OUTPUT_DIR := \ |
|
20602
88692440ebd1
8024842: Define ABS_TEST_OUTPUT_DIR via TEST_OUTPUT_DIR
mduigou
parents:
15384
diff
changeset
|
242 |
$(shell mkdir -p $(TEST_OUTPUT_DIR); \ |
88692440ebd1
8024842: Define ABS_TEST_OUTPUT_DIR via TEST_OUTPUT_DIR
mduigou
parents:
15384
diff
changeset
|
243 |
cd $(TEST_OUTPUT_DIR); \ |
10947
47788da3eb3f
7101933: langtools jtreg tests do not work with jprt on windows
jjh
parents:
5652
diff
changeset
|
244 |
pwd $(CYGPATH)) |
5214 | 245 |
# Subdirectories for different test runs |
246 |
JTREG_OUTPUT_DIR = $(ABS_TEST_OUTPUT_DIR)/jtreg |
|
247 |
JCK_COMPILER_OUTPUT_DIR = $(ABS_TEST_OUTPUT_DIR)/jck-compiler |
|
248 |
JCK_RUNTIME_OUTPUT_DIR = $(ABS_TEST_OUTPUT_DIR)/jck-runtime-Xcompile |
|
10 | 249 |
|
5214 | 250 |
# Default make rule -- warning, may take a while |
251 |
all: $(JPRT_CLEAN) jtreg-tests jck-compiler-tests jck-runtime-tests $(JPRT_ARCHIVE_BUNDLE) all-summary |
|
252 |
@echo "Testing completed successfully" |
|
253 |
||
15030
2d8dec41f029
8003562: Provide a CLI tool to analyze class dependencies
mchung
parents:
14546
diff
changeset
|
254 |
jtreg apt javac javadoc javah javap jdeps: $(JPRT_CLEAN) jtreg-tests $(JPRT_ARCHIVE_BUNDLE) jtreg-summary |
5214 | 255 |
@echo "Testing completed successfully" |
256 |
||
257 |
jck-compiler: $(JPRT_CLEAN) jck-compiler-tests $(JPRT_ARCHIVE_BUNDLE) jck-compiler-summary |
|
258 |
@echo "Testing completed successfully" |
|
259 |
||
260 |
jck-runtime: $(JPRT_CLEAN) jck-runtime-tests $(JPRT_ARCHIVE_BUNDLE) jck-runtime-summary |
|
10 | 261 |
@echo "Testing completed successfully" |
262 |
||
39102
5a820f7e00b9
8158992: langtools/test/Makefile: improve support for control via variables
dlsmith
parents:
37941
diff
changeset
|
263 |
# a way to select tests from outside |
5a820f7e00b9
8158992: langtools/test/Makefile: improve support for control via variables
dlsmith
parents:
37941
diff
changeset
|
264 |
# works for targets 'jtreg', 'jck-compiler', and 'jck-runtime' |
5a820f7e00b9
8158992: langtools/test/Makefile: improve support for control via variables
dlsmith
parents:
37941
diff
changeset
|
265 |
ifdef TEST_SELECTION |
5a820f7e00b9
8158992: langtools/test/Makefile: improve support for control via variables
dlsmith
parents:
37941
diff
changeset
|
266 |
JTREG_TESTDIRS = $(TEST_SELECTION) |
5a820f7e00b9
8158992: langtools/test/Makefile: improve support for control via variables
dlsmith
parents:
37941
diff
changeset
|
267 |
JCK_COMPILER_TESTDIRS = $(TEST_SELECTION) |
5a820f7e00b9
8158992: langtools/test/Makefile: improve support for control via variables
dlsmith
parents:
37941
diff
changeset
|
268 |
JCK_RUNTIME_TESTDIRS = $(TEST_SELECTION) |
5a820f7e00b9
8158992: langtools/test/Makefile: improve support for control via variables
dlsmith
parents:
37941
diff
changeset
|
269 |
endif |
5a820f7e00b9
8158992: langtools/test/Makefile: improve support for control via variables
dlsmith
parents:
37941
diff
changeset
|
270 |
|
10 | 271 |
# for use with JPRT -testrule |
5214 | 272 |
all: JTREG_TESTDIRS = . |
39102
5a820f7e00b9
8158992: langtools/test/Makefile: improve support for control via variables
dlsmith
parents:
37941
diff
changeset
|
273 |
jtreg: JTREG_TESTDIRS ?= . |
5214 | 274 |
apt: JTREG_TESTDIRS = tools/apt |
275 |
javac: JTREG_TESTDIRS = tools/javac |
|
276 |
javadoc: JTREG_TESTDIRS = tools/javadoc com/sun/javadoc |
|
277 |
javah: JTREG_TESTDIRS = tools/javah |
|
278 |
javap: JTREG_TESTDIRS = tools/javap |
|
15030
2d8dec41f029
8003562: Provide a CLI tool to analyze class dependencies
mchung
parents:
14546
diff
changeset
|
279 |
jdeps: JTREG_TESTDIRS = tools/jdeps |
5214 | 280 |
|
37941 | 281 |
|
5214 | 282 |
# Run jtreg tests |
283 |
# |
|
284 |
# JTREG_HOME |
|
285 |
# Installed location of jtreg |
|
286 |
# JT_JAVA |
|
287 |
# Version of java used to run jtreg. Should normally be the same as TESTJAVA |
|
288 |
# TESTJAVA |
|
20602
88692440ebd1
8024842: Define ABS_TEST_OUTPUT_DIR via TEST_OUTPUT_DIR
mduigou
parents:
15384
diff
changeset
|
289 |
# Version of java to be tested. |
24405
71b654b695b7
8042882: Support verbosity options in langtools testing
dlsmith
parents:
20602
diff
changeset
|
290 |
# JTREG_VERBOSE |
71b654b695b7
8042882: Support verbosity options in langtools testing
dlsmith
parents:
20602
diff
changeset
|
291 |
# Verbosity setting for jtreg |
5214 | 292 |
# JTREG_OPTIONS |
293 |
# Additional options for jtreg |
|
294 |
# JTREG_TESTDIRS |
|
295 |
# Directories of tests to be run |
|
296 |
# JTREG_OUTPUT_DIR |
|
297 |
# Where to write the results |
|
298 |
# JTREG_REFERENCE |
|
299 |
# (Optional) reference results (e.g. work, report or summary.txt) |
|
300 |
# |
|
12084
b367473ef0f1
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
10947
diff
changeset
|
301 |
jtreg_tests: jtreg-tests |
5214 | 302 |
jtreg-tests: check-jtreg FRC |
303 |
@rm -f -r $(JTREG_OUTPUT_DIR)/JTwork $(JTREG_OUTPUT_DIR)/JTreport \ |
|
304 |
$(JTREG_OUTPUT_DIR)/diff.html $(JTREG_OUTPUT_DIR)/status.txt |
|
305 |
@mkdir -p $(JTREG_OUTPUT_DIR) |
|
306 |
JT_JAVA=$(JT_JAVA) $(JTREG) \ |
|
307 |
-J-Xmx512m \ |
|
35809 | 308 |
-vmoption:-Xmx768m \ |
24405
71b654b695b7
8042882: Support verbosity options in langtools testing
dlsmith
parents:
20602
diff
changeset
|
309 |
-a -ignore:quiet $(if $(JTREG_VERBOSE),-v:$(JTREG_VERBOSE)) \ |
37941 | 310 |
-r:$(JTREG_OUTPUT_DIR)/JTreport \ |
311 |
-w:$(JTREG_OUTPUT_DIR)/JTwork \ |
|
312 |
-jdk:$(TESTJAVA) \ |
|
313 |
$(JAVA_ARGS:%=-vmoption:%) \ |
|
314 |
$(JTREG_EXCLUSIONS) \ |
|
5214 | 315 |
$(JTREG_OPTIONS) \ |
37941 | 316 |
$(JTREG_TESTDIRS) \ |
5214 | 317 |
|| ( $(call EXIT_IF_FATAL,$(FATAL_JTREG_EXIT)) ; \ |
318 |
echo $$status > $(JTREG_OUTPUT_DIR)/status.txt \ |
|
319 |
) |
|
320 |
ifdef JTREG_REFERENCE |
|
321 |
JT_JAVA=$(JT_JAVA) $(JTDIFF) -o $(JTREG_OUTPUT_DIR)/diff.html \ |
|
322 |
$(JTREG_REFERENCE) $(JTREG_OUTPUT_DIR)/JTreport \ |
|
323 |
|| ( $(call EXIT_IF_FATAL,$(FATAL_JTDIFF_EXIT)) ) |
|
324 |
endif |
|
325 |
||
326 |
jtreg-summary: FRC |
|
27382
60a3693d0d87
8062449: Update langtools/test/Makefile to use JCK 9
dlsmith
parents:
24405
diff
changeset
|
327 |
@if [ -r $(JTREG_OUTPUT_DIR)/status.txt ]; then \ |
5214 | 328 |
echo ; echo "Summary of jtreg test failures" ; \ |
329 |
cat $(JTREG_OUTPUT_DIR)/JTreport/text/summary.txt | \ |
|
330 |
grep -v 'Not run' | grep -v 'Passed' ; \ |
|
331 |
echo ; \ |
|
332 |
$(EXIT) `cat $(JTREG_OUTPUT_DIR)/status.txt` ; \ |
|
333 |
fi |
|
10 | 334 |
|
335 |
# Check to make sure these directories exist |
|
10947
47788da3eb3f
7101933: langtools jtreg tests do not work with jprt on windows
jjh
parents:
5652
diff
changeset
|
336 |
check-jtreg: $(PRODUCT_HOME) $(JTREG) |
5214 | 337 |
|
338 |
||
339 |
# Run JCK-compiler tests |
|
340 |
# |
|
341 |
# JCK_HOME |
|
342 |
# Installed location of JCK: should include JCK-compiler, and JCK-extras |
|
10947
47788da3eb3f
7101933: langtools jtreg tests do not work with jprt on windows
jjh
parents:
5652
diff
changeset
|
343 |
# Default is JCK 8. |
5214 | 344 |
# JT_JAVA |
345 |
# Version of java used to run JCK. Should normally be the same as TESTJAVA |
|
10947
47788da3eb3f
7101933: langtools jtreg tests do not work with jprt on windows
jjh
parents:
5652
diff
changeset
|
346 |
# Default is JDK 7 |
5214 | 347 |
# TESTJAVA |
20602
88692440ebd1
8024842: Define ABS_TEST_OUTPUT_DIR via TEST_OUTPUT_DIR
mduigou
parents:
15384
diff
changeset
|
348 |
# Version of java to be tested. |
24405
71b654b695b7
8042882: Support verbosity options in langtools testing
dlsmith
parents:
20602
diff
changeset
|
349 |
# JCK_VERBOSE |
71b654b695b7
8042882: Support verbosity options in langtools testing
dlsmith
parents:
20602
diff
changeset
|
350 |
# Verbosity setting for jtjck |
5214 | 351 |
# JCK_COMPILER_OPTIONS |
352 |
# Additional options for JCK-compiler |
|
353 |
# JCK_COMPILER_TESTDIRS |
|
354 |
# Directories of tests to be run |
|
355 |
# JCK_COMPILER_OUTPUT_DIR |
|
356 |
# Where to write the results |
|
357 |
# JCK_COMPILER_REFERENCE |
|
358 |
# (Optional) reference results (e.g. work, report or summary.txt) |
|
359 |
# |
|
360 |
jck-compiler-tests: check-jck FRC |
|
361 |
@rm -f -r $(JCK_COMPILER_OUTPUT_DIR)/work $(JCK_COMPILER_OUTPUT_DIR)/report \ |
|
362 |
$(JCK_COMPILER_OUTPUT_DIR)/diff.html $(JCK_COMPILER_OUTPUT_DIR)/status.txt |
|
363 |
@mkdir -p $(JCK_COMPILER_OUTPUT_DIR) |
|
24405
71b654b695b7
8042882: Support verbosity options in langtools testing
dlsmith
parents:
20602
diff
changeset
|
364 |
$(JT_JAVA)/bin/java -Xmx512m \ |
27382
60a3693d0d87
8062449: Update langtools/test/Makefile to use JCK 9
dlsmith
parents:
24405
diff
changeset
|
365 |
-jar $(JCK_HOME)/JCK-compiler-9/lib/jtjck.jar \ |
60a3693d0d87
8062449: Update langtools/test/Makefile to use JCK 9
dlsmith
parents:
24405
diff
changeset
|
366 |
$(if $(JCK_VERBOSE),$(if $(filter $(JCK_VERBOSE),summary),-v,-v:$(JCK_VERBOSE))) \ |
5214 | 367 |
-r:$(JCK_COMPILER_OUTPUT_DIR)/report \ |
368 |
-w:$(JCK_COMPILER_OUTPUT_DIR)/work \ |
|
369 |
-jdk:$(TESTJAVA) \ |
|
370 |
$(JCK_COMPILER_OPTIONS) \ |
|
371 |
$(JCK_COMPILER_TESTDIRS) \ |
|
372 |
|| ( $(call EXIT_IF_FATAL,$(FATAL_JCK_EXIT)) ; \ |
|
373 |
echo $$status > $(JCK_COMPILER_OUTPUT_DIR)/status.txt \ |
|
374 |
) |
|
375 |
ifdef JCK_COMPILER_REFERENCE |
|
376 |
JT_JAVA=$(JT_JAVA) $(JTDIFF) -o $(JCK_COMPILER_OUTPUT_DIR)/diff.html \ |
|
377 |
$(JCK_COMPILER_REFERENCE) $(JCK_COMPILER_OUTPUT_DIR)/report \ |
|
378 |
|| ( $(call EXIT_IF_FATAL,$(FATAL_JTDIFF_EXIT)) ) |
|
379 |
endif |
|
380 |
||
381 |
jck-compiler-summary: FRC |
|
27382
60a3693d0d87
8062449: Update langtools/test/Makefile to use JCK 9
dlsmith
parents:
24405
diff
changeset
|
382 |
@if [ -r $(JCK_COMPILER_OUTPUT_DIR)/status.txt ]; then \ |
5214 | 383 |
echo ; echo "Summary of JCK-compiler test failures" ; \ |
384 |
cat $(JCK_COMPILER_OUTPUT_DIR)/report/text/summary.txt | \ |
|
385 |
grep -v 'Not run' | grep -v 'Passed' ; \ |
|
386 |
echo ; \ |
|
387 |
$(EXIT) `cat $(JCK_COMPILER_OUTPUT_DIR)/status.txt` ; \ |
|
388 |
fi |
|
10 | 389 |
|
5214 | 390 |
# Run JCK-runtime tests in -Xcompile mode |
391 |
# This is a special mode to test javac by compiling the tests in the JCK-runtime test suite |
|
392 |
# Normal JCK-runtime invocation belongs in the jdk/ repository. |
|
393 |
# |
|
394 |
# JCK_HOME |
|
395 |
# Installed location of JCK: should include JCK-compiler, JCK-runtime and JCK-extras |
|
396 |
# JT_JAVA |
|
397 |
# Version of java used to run JCK. Should normally be the same as TESTJAVA |
|
398 |
# TESTJAVA |
|
20602
88692440ebd1
8024842: Define ABS_TEST_OUTPUT_DIR via TEST_OUTPUT_DIR
mduigou
parents:
15384
diff
changeset
|
399 |
# Version of java to be tested. |
24405
71b654b695b7
8042882: Support verbosity options in langtools testing
dlsmith
parents:
20602
diff
changeset
|
400 |
# JCK_VERBOSE |
71b654b695b7
8042882: Support verbosity options in langtools testing
dlsmith
parents:
20602
diff
changeset
|
401 |
# Verbosity setting for jtjck |
5214 | 402 |
# JCK_RUNTIME_OPTIONS |
403 |
# Additional options for JCK-runtime |
|
404 |
# JCK_RUNTIME_TESTDIRS |
|
405 |
# Directories of tests to be run |
|
406 |
# JCK_RUNTIME_OUTPUT_DIR |
|
407 |
# Where to write the results |
|
408 |
# JCK_RUNTIME_REFERENCE |
|
409 |
# (Optional) reference results (e.g. work, report or summary.txt) |
|
410 |
# |
|
411 |
jck-runtime-tests: check-jck FRC |
|
412 |
@rm -f -r $(JCK_RUNTIME_OUTPUT_DIR)/work $(JCK_RUNTIME_OUTPUT_DIR)/report \ |
|
413 |
$(JCK_RUNTIME_OUTPUT_DIR)/diff.html $(JCK_RUNTIME_OUTPUT_DIR)/status.txt |
|
414 |
@mkdir -p $(JCK_RUNTIME_OUTPUT_DIR) |
|
24405
71b654b695b7
8042882: Support verbosity options in langtools testing
dlsmith
parents:
20602
diff
changeset
|
415 |
$(JT_JAVA)/bin/java -Xmx512m \ |
27382
60a3693d0d87
8062449: Update langtools/test/Makefile to use JCK 9
dlsmith
parents:
24405
diff
changeset
|
416 |
-jar $(JCK_HOME)/JCK-runtime-9/lib/jtjck.jar \ |
60a3693d0d87
8062449: Update langtools/test/Makefile to use JCK 9
dlsmith
parents:
24405
diff
changeset
|
417 |
$(if $(JCK_VERBOSE),$(if $(filter $(JCK_VERBOSE),summary),-v,-v:$(JCK_VERBOSE))) \ |
5214 | 418 |
-r:$(JCK_RUNTIME_OUTPUT_DIR)/report \ |
419 |
-w:$(JCK_RUNTIME_OUTPUT_DIR)/work \ |
|
420 |
-jdk:$(TESTJAVA) \ |
|
421 |
-Xcompile \ |
|
422 |
$(JCK_RUNTIME_OPTIONS) \ |
|
423 |
$(JCK_RUNTIME_TESTDIRS) \ |
|
424 |
|| ( $(call EXIT_IF_FATAL,$(FATAL_JCK_EXIT)) ; \ |
|
425 |
echo $$status > $(JCK_RUNTIME_OUTPUT_DIR)/status.txt \ |
|
426 |
) |
|
427 |
ifdef JCK_RUNTIME_REFERENCE |
|
428 |
JT_JAVA=$(JT_JAVA) $(JTDIFF) -o $(JCK_RUNTIME_OUTPUT_DIR)/diff.html \ |
|
429 |
$(JCK_RUNTIME_REFERENCE) $(JCK_RUNTIME_OUTPUT_DIR)/report \ |
|
430 |
|| ( $(call EXIT_IF_FATAL,$(FATAL_JTDIFF_EXIT)) ) |
|
431 |
endif |
|
432 |
||
433 |
jck-runtime-summary: FRC |
|
27382
60a3693d0d87
8062449: Update langtools/test/Makefile to use JCK 9
dlsmith
parents:
24405
diff
changeset
|
434 |
@if [ -r $(JCK_RUNTIME_OUTPUT_DIR)/status.txt ]; then \ |
5214 | 435 |
echo ; echo "Summary of JCK-runtime test failures" ; \ |
436 |
cat $(JCK_RUNTIME_OUTPUT_DIR)/report/text/summary.txt | \ |
|
437 |
grep -v 'Not run' | grep -v 'Passed' ; \ |
|
438 |
echo ; \ |
|
439 |
$(EXIT) `cat $(JCK_RUNTIME_OUTPUT_DIR)/status.txt` ; \ |
|
440 |
fi |
|
441 |
||
442 |
# Check to make sure these directories exist |
|
35352
5558ce88298a
8147930: Langtools test Makefile still requires special make in Cygwin
erikj
parents:
28141
diff
changeset
|
443 |
check-jck: |
39102
5a820f7e00b9
8158992: langtools/test/Makefile: improve support for control via variables
dlsmith
parents:
37941
diff
changeset
|
444 |
@if [ ! -d '$(JCK_HOME)' ]; then \ |
35354
a9c8e2634f92
8147995: 8147930 uses incorrect whitespace in langtools/test/Makefile
jjg
parents:
35352
diff
changeset
|
445 |
echo "JCK_HOME $(JCK_HOME) missing" ; \ |
a9c8e2634f92
8147995: 8147930 uses incorrect whitespace in langtools/test/Makefile
jjg
parents:
35352
diff
changeset
|
446 |
$(EXIT) 1 ; \ |
a9c8e2634f92
8147995: 8147930 uses incorrect whitespace in langtools/test/Makefile
jjg
parents:
35352
diff
changeset
|
447 |
fi |
39102
5a820f7e00b9
8158992: langtools/test/Makefile: improve support for control via variables
dlsmith
parents:
37941
diff
changeset
|
448 |
@if [ ! -d '$(PRODUCT_HOME)' ]; then \ |
35354
a9c8e2634f92
8147995: 8147930 uses incorrect whitespace in langtools/test/Makefile
jjg
parents:
35352
diff
changeset
|
449 |
echo "PRODUCT_HOME $(PRODUCT_HOME) missing" ; \ |
a9c8e2634f92
8147995: 8147930 uses incorrect whitespace in langtools/test/Makefile
jjg
parents:
35352
diff
changeset
|
450 |
$(EXIT) 1 ; \ |
a9c8e2634f92
8147995: 8147930 uses incorrect whitespace in langtools/test/Makefile
jjg
parents:
35352
diff
changeset
|
451 |
fi |
5214 | 452 |
|
453 |
all-summary: FRC |
|
27382
60a3693d0d87
8062449: Update langtools/test/Makefile to use JCK 9
dlsmith
parents:
24405
diff
changeset
|
454 |
@if [ -n "`find $(TEST_OUTPUT_DIR) -name status.txt`" ]; then |
5214 | 455 |
echo ; echo "Summary of test failures" ; \ |
456 |
cat `find $(TEST_OUTPUT_DIR) -name summary.txt` | \ |
|
457 |
grep -v 'Not run' | grep -v 'Passed' ; \ |
|
458 |
echo ; \ |
|
459 |
$(EXIT) 1 |
|
460 |
fi |
|
10 | 461 |
|
462 |
# Bundle up the results |
|
463 |
$(JPRT_ARCHIVE_BUNDLE): FRC |
|
464 |
@rm -f $@ |
|
465 |
@mkdir -p $(@D) |
|
466 |
( cd $(TEST_OUTPUT_DIR) && zip -q -r $@ . ) |
|
467 |
||
468 |
# Cleanup |
|
469 |
clean: |
|
470 |
rm -f $(JPRT_ARCHIVE_BUNDLE) |
|
471 |
||
472 |
# Used to force a target rules to run |
|
473 |
FRC: |
|
474 |
||
475 |
# Phony targets (e.g. these are not filenames) |
|
5214 | 476 |
.PHONY: all clean \ |
15030
2d8dec41f029
8003562: Provide a CLI tool to analyze class dependencies
mchung
parents:
14546
diff
changeset
|
477 |
jtreg javac javadoc javah javap jdeps jtreg-tests jtreg-summary check-jtreg \ |
5214 | 478 |
jck-compiler jck-compiler-tests jck-compiler-summary \ |
479 |
jck-runtime jck-runtime-tests jck-runtime-summary check-jck |
|
10 | 480 |
|
5214 | 481 |
# No use of suffix rules |
482 |
.SUFFIXES: |
|
483 |