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