Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/test/functional/DDR_Test/tck_ddrext.xml
6000 views
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
Copyright (c) 2016, 2021 IBM Corp. and others
4
5
This program and the accompanying materials are made available under
6
the terms of the Eclipse Public License 2.0 which accompanies this
7
distribution and is available at https://www.eclipse.org/legal/epl-2.0/
8
or the Apache License, Version 2.0 which accompanies this distribution and
9
is available at https://www.apache.org/licenses/LICENSE-2.0.
10
11
This Source Code may also be made available under the following
12
Secondary Licenses when the conditions for such availability set
13
forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
14
General Public License, version 2 with the GNU Classpath
15
Exception [1] and GNU General Public License, version 2 with the
16
OpenJDK Assembly Exception [2].
17
18
[1] https://www.gnu.org/software/classpath/license.html
19
[2] http://openjdk.java.net/legal/assembly-exception.html
20
21
SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
22
-->
23
<project name="DDR Extension Test" default="clean">
24
<taskdef resource="net/sf/antcontrib/antlib.xml" />
25
26
<property name="JAVA_COMMAND" value="${JAVA_COMMAND}" />
27
<property name="TEST_ROOT" value="${TEST_ROOT}" />
28
<property name="LIB_DIR" value="${LIB_DIR}" />
29
<property name="TEST_JDK_HOME" value="${TEST_JDK_HOME}" />
30
<property name="TEST_RESROOT" value="${TEST_RESROOT}" />
31
<property name="REPORTDIR" value="${REPORTDIR}" />
32
<property name="JDK_VERSION" value="${JDK_VERSION}" />
33
<property name="EXTRADUMPOPT" value="" />
34
<property name="ADDITIONALEXPORTS" value="" />
35
<property name="JVM_OPTIONS" value="" />
36
<property name="TESTNUM" value="" />
37
<property name="COREGEN" value="j9vm.test.corehelper.CoreGen" />
38
<property name="TEST_LIB_PATH" value="" />
39
40
<!-- MacOSX needs to set TEST_LIB_PATH_VAL for testDDRExtJunit_MonitorsAndDeadlock* to load native library -->
41
<if>
42
<contains string="${os.name}" substring="Mac OS X" />
43
<then>
44
<property name="TEST_LIB_PATH_VAL" value="${TEST_LIB_PATH}" />
45
</then>
46
<else>
47
<property name="TEST_LIB_PATH_VAL" value="" />
48
</else>
49
</if>
50
<property name="dump.name" value="DDREXT.J9CORE.DMP" />
51
<property name="system.dump" value="${REPORTDIR}/${dump.name}" />
52
<if>
53
<equals arg1="${OS}" arg2="os.zos" />
54
<then>
55
<property name="DUMP_OPTION" value="-Xdump:system:defaults:label=%uid.${dump.name},request=exclusive+compact+prepwalk -Xscmx16m -Xshareclasses:name=ddrextjunitSCC,addtestjithints -Xjit -Xaot:forceaot,count=5,disableAsyncCompilation -Xmx512M" />
56
<if>
57
<equals arg1="${BITS}" arg2="bits.64" />
58
<then>
59
<property name="zos.core.suffix" value=".X001" />
60
</then>
61
<else>
62
<property name="zos.core.suffix" value="" />
63
</else>
64
</if>
65
</then>
66
<else>
67
<property name="DUMP_OPTION" value="-Xdump:system:defaults:label=${system.dump},request=exclusive+compact+prepwalk -Xscmx16m -Xshareclasses:name=ddrextjunitSCC,addtestjithints -Xjit:count=0 -Xaot:forceaot,count=5,disableAsyncCompilation -Xmx512M" />
68
</else>
69
</if>
70
71
<if>
72
<equals arg1="${JDK_VERSION}" arg2="8" />
73
<then>
74
<path id="tck.class.path.j9ddr.jar">
75
<pathelement location="${TEST_JDK_HOME}/jre/lib/ddr/j9ddr.jar" />
76
</path>
77
</then>
78
<else>
79
<path id="tck.class.path.j9ddr.jar" />
80
</else>
81
</if>
82
<path id="tck.class.path">
83
<pathelement location="${LIB_DIR}/junit4.jar" />
84
<pathelement location="${LIB_DIR}/testng.jar" />
85
<pathelement location="${LIB_DIR}/commons-exec.jar" />
86
<pathelement location="${LIB_DIR}/asm-all.jar" />
87
<pathelement location="${LIB_DIR}/commons-cli.jar" />
88
<pathelement location="${RESOURCES_DIR}" />
89
<pathelement location="${TEST_RESROOT}/DDR_Test.jar" />
90
<path refid="tck.class.path.j9ddr.jar" />
91
</path>
92
93
<target name="TCK.destroy.cache" depends="TCK.generate.dump" description="Destroy the cache">
94
<echo>Destroying cache</echo>
95
<echo>Running j9vm.test.corehelper.StackMapCoreGenerator to destroy the cache</echo>
96
<echo>Using JVM : ${JAVA_COMMAND}</echo>
97
<echo>classname = "j9vm.test.corehelper.StackMapCoreGenerator"</echo>
98
<echo>Java VM Args:</echo>
99
<echo> jvmarg = -Xshareclasses:name=ddrextjunitSCC,destroy</echo>
100
<java fork="true" jvm="${JAVA_COMMAND}" classname="j9vm.test.corehelper.StackMapCoreGenerator"
101
timeout="1200000" failonerror="false">
102
<jvmarg value="-Xshareclasses:name=ddrextjunitSCC,destroy" />
103
<classpath refid="tck.class.path" />
104
</java>
105
</target>
106
107
<!-- MacOSX needs -XstartOnFirstThread -->
108
<condition property="StartOnFirstThread" value="-XstartOnFirstThread" else="">
109
<os family="mac" />
110
</condition>
111
112
<if>
113
<equals arg1="${JDK_VERSION}" arg2="8" />
114
<then>
115
<macrodef name="java-wrapper">
116
<attribute name="classname" />
117
<attribute name="failonerror" />
118
<attribute name="fork" default="true" />
119
<attribute name="jvm" />
120
<attribute name="timeout" />
121
<element name="common-elements" />
122
<element name="modular-elements" />
123
<sequential>
124
<java classname="@{classname}" failonerror="@{failonerror}" fork="@{fork}" jvm="@{jvm}" timeout="@{timeout}">
125
<common-elements />
126
</java>
127
</sequential>
128
</macrodef>
129
</then>
130
<else>
131
<macrodef name="java-wrapper">
132
<attribute name="classname" />
133
<attribute name="failonerror" />
134
<attribute name="fork" default="true" />
135
<attribute name="jvm" />
136
<attribute name="timeout" />
137
<element name="common-elements" />
138
<element name="modular-elements" />
139
<sequential>
140
<java classname="@{classname}" failonerror="@{failonerror}" fork="@{fork}" jvm="@{jvm}" timeout="@{timeout}">
141
<common-elements />
142
<modular-elements />
143
</java>
144
</sequential>
145
</macrodef>
146
</else>
147
</if>
148
149
<target name="TCK.run.tests.ddrext" depends="TCK.destroy.cache">
150
<echo>Running the DDR Extension Test</echo>
151
<java-wrapper fork="true" jvm="${JAVA_COMMAND}" classname="j9vm.test.ddrext.AutoRun"
152
timeout="1200000" failonerror="true">
153
<common-elements>
154
<jvmarg line="${ADDITIONALEXPORTS} ${StartOnFirstThread}" />
155
<arg value="${system.dump}" />
156
<arg value="${test.list}" />
157
<arg value="${TEST_RESROOT}/ddrplugin.jar" />
158
<classpath refid="tck.class.path" />
159
</common-elements>
160
<modular-elements>
161
<jvmarg value="--add-exports=openj9.dtfj/com.ibm.j9ddr=ALL-UNNAMED" />
162
<jvmarg value="--add-exports=openj9.dtfj/com.ibm.j9ddr.corereaders=ALL-UNNAMED" />
163
<jvmarg value="--add-exports=openj9.dtfj/com.ibm.j9ddr.corereaders.memory=ALL-UNNAMED" />
164
<jvmarg value="--add-exports=openj9.dtfj/com.ibm.j9ddr.corereaders.osthread=ALL-UNNAMED" />
165
<jvmarg value="--add-exports=openj9.dtfj/com.ibm.j9ddr.events=ALL-UNNAMED" />
166
<jvmarg value="--add-exports=openj9.dtfj/com.ibm.j9ddr.tools.ddrinteractive=ALL-UNNAMED" />
167
<jvmarg value="--add-exports=openj9.dtfj/com.ibm.j9ddr.tools.ddrinteractive.annotations=ALL-UNNAMED" />
168
<jvmarg value="--add-exports=openj9.dtfj/com.ibm.j9ddr.util=ALL-UNNAMED" />
169
<jvmarg value="--add-exports=openj9.dtfj/com.ibm.j9ddr.view.dtfj.image=ALL-UNNAMED" />
170
<jvmarg value="--add-exports=openj9.dtfj/com.ibm.j9ddr.vm29.j9=ALL-UNNAMED" />
171
<jvmarg value="--add-exports=openj9.dtfj/com.ibm.j9ddr.vm29.j9.gc=ALL-UNNAMED" />
172
<jvmarg value="--add-exports=openj9.dtfj/com.ibm.j9ddr.vm29.j9.walkers=ALL-UNNAMED" />
173
<jvmarg value="--add-exports=openj9.dtfj/com.ibm.j9ddr.vm29.pointer=ALL-UNNAMED" />
174
<jvmarg value="--add-exports=openj9.dtfj/com.ibm.j9ddr.vm29.pointer.generated=ALL-UNNAMED" />
175
<jvmarg value="--add-exports=openj9.dtfj/com.ibm.j9ddr.vm29.pointer.helper=ALL-UNNAMED" />
176
<jvmarg value="--add-exports=openj9.dtfj/com.ibm.j9ddr.vm29.tools.ddrinteractive=ALL-UNNAMED" />
177
<jvmarg value="--add-exports=openj9.dtfj/com.ibm.j9ddr.vm29.types=ALL-UNNAMED" />
178
</modular-elements>
179
</java-wrapper>
180
</target>
181
182
<target name="TCK.initialize.cache" description="Destroy the old cache and create a new one">
183
<echo>Initializing cache</echo>
184
<!-- Initialize the cache so that addtestjithints option adds jithints to the shared cache in TCK.generate.dump-->
185
<echo>Running j9vm.test.corehelper.StackMapCoreGenerator to create a new cache</echo>
186
<echo>Using JVM : ${sdk.executable}${sdk.executable.ext}</echo>
187
<echo>classname = "j9vm.test.corehelper.StackMapCoreGenerator"</echo>
188
<echo>Java VM Args:</echo>
189
<echo> jvmarg = -Xshareclasses:name=ddrextjunitSCC,reset -Xitsn1000 -Xmx512M </echo>
190
<echo>
191
</echo>
192
<java fork="true" jvm="${JAVA_COMMAND}" classname="j9vm.test.corehelper.StackMapCoreGenerator" timeout="1200000" failonerror="true">
193
<jvmarg value="-Xshareclasses:name=ddrextjunitSCC,reset" />
194
<jvmarg value="-Xitsn1000" />
195
<jvmarg value="-Xmx512M" />
196
<classpath refid="tck.class.path" />
197
</java>
198
</target>
199
200
<target name="TCK.generate.dump" depends="TCK.initialize.cache">
201
<echo>Generate dump file</echo>
202
<echo>JAVA_COMMAND: ${JAVA_COMMAND}</echo>
203
<echo>DUMP_OPTION: ${DUMP_OPTION}</echo>
204
<echo>EXTRADUMPOPT: ${EXTRADUMPOPT}</echo>
205
<echo>COREGEN: ${COREGEN}</echo>
206
<echo>JVM_OPTIONS: ${JVM_OPTIONS}</echo>
207
<echo>TEST_NUM: ${TESTNUM}</echo>
208
<echo>os.name: ${os.name}</echo>
209
<echo>TEST_LIB_PATH_VAL: ${TEST_LIB_PATH_VAL}</echo>
210
211
<!-- We use the -Xint option to store the startup hint into the shared chache. -->
212
<exec executable="${JAVA_COMMAND}" failonerror="true">
213
<arg line="-Xscmx16m -Xshareclasses:name=ddrextjunitSCC -Xgcpolicy:gencon" />
214
<arg line="-Xint" />
215
<arg value="-cp" />
216
<arg value="${TEST_RESROOT}/DDR_Test.jar" />
217
<arg value="j9vm.test.corehelper.SCCTestHelper" />
218
</exec>
219
220
<exec executable="${JAVA_COMMAND}" failonerror="true">
221
<arg line="${DUMP_OPTION}" />
222
<arg line="-Xitsn1000" />
223
<arg line="${EXTRADUMPOPT}" />
224
<arg line="${JVM_OPTIONS}" />
225
<arg line="${TEST_LIB_PATH_VAL}" />
226
<arg value="-Xjit:{j9vm/test/corehelper/CoreGen.main*}(count=0)" />
227
<arg value="-cp" />
228
<arg value="${TEST_RESROOT}/DDR_Test.jar" />
229
<arg value="${COREGEN}" />
230
<arg value="${TESTNUM}" />
231
</exec>
232
233
<if>
234
<equals arg1="${OS}" arg2="os.zos" />
235
<then>
236
<antcall target="TCK.move.dump.ddrext" />
237
</then>
238
</if>
239
</target>
240
241
<target name="TCK.move.dump.ddrext" description="Move core file from MVS to HFS">
242
<echo>Moving core file from MVS [${dump.name}${zos.core.suffix}] to HFS [${system.dump}]</echo>
243
<exec executable="/bin/mv" failonerror="true">
244
<arg value="//${dump.name}${zos.core.suffix}" />
245
<arg value="${system.dump}" />
246
</exec>
247
</target>
248
249
<target name="clean" depends="TCK.run.tests.ddrext" description="clean">
250
<delete file="${system.dump}" />
251
</target>
252
253
<target name="ddrext.setup" description="Create the required directories">
254
<!-- do not invoke this target with antcall as the properties defined here need to be visible to all subsequent targets -->
255
<echo>Setting up TCK</echo>
256
<mkdir dir="${tck.output.dir}" />
257
<mkdir dir="${tck.output.dir}_${tck.type}" />
258
<echo>Recording Java version</echo>
259
<java fork="true" jvm="${sdk.executable}${sdk.executable.ext}" classname="com.ibm.dtfj.tck.harness.TCKLauncher"
260
failonerror="true" outputproperty="jvm.version" newenvironment="true">
261
<jvmarg value="-XshowSettings:properties" />
262
<jvmarg value="-version" />
263
</java>
264
<condition property="java.is64bit">
265
<matches pattern="sun\.arch\.data\.model = 64" string="${jvm.version}" multiline="true" />
266
</condition>
267
268
<!--real-time specific setup-->
269
<java fork="true" jvm="${sdk.executable}${sdk.executable.ext}" classname="com.ibm.dtfj.tck.harness.TCKLauncher"
270
failonerror="false" outputproperty="jvm.version.realtime" newenvironment="true">
271
<jvmarg value="-Xrealtime" />
272
<jvmarg value="-version" />
273
</java>
274
<condition property="env.isrealtime">
275
<matches pattern=" real-time" string="${jvm.version.realtime}" multiline="true" />
276
</condition>
277
278
<!-- z/OS specific setup -->
279
<condition property="tck.zos.core.suffix" value=".X001" else="">
280
<and>
281
<os family="z/os" />
282
<isset property="java.is64bit" />
283
</and>
284
</condition>
285
</target>
286
287
<target name="ddrext.setup.dump.dynamic" description="Create dump options for dynamic ddr ext test">
288
<!-- create dump options, different for z/OS -->
289
<condition property="system.dump" value="${user.name}.${tck.core.file.mvs}" else="${tck.core.file.ddrext}">
290
<os family="z/os" />
291
</condition>
292
293
<condition property="isWindows">
294
<os family="windows" />
295
</condition>
296
<condition property="isZOS">
297
<os family="z/os" />
298
</condition>
299
300
<if>
301
<isset property="isZOS" />
302
<then>
303
<property name="system.dump.location" value="${dump.name}${zos.core.suffix}" />
304
</then>
305
<else>
306
<property name="system.dump.location" location="${system.dump}" />
307
</else>
308
</if>
309
<property name="tck.config.dump.opt.1" value="-Xdump:system:defaults:label=${system.dump.location},request=exclusive+compact+prepwalk" />
310
311
<property name="tck.config.dump.opts" value="${tck.config.dump.opt.1} ${tck.config.dump.opt.2} ${tck.config.dump.opt.3} ${tck.config.dump.opt.4} ${tck.core.xmx} ${tck.config.dump.opt.extra}" />
312
</target>
313
314
</project>
315
316