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