16eae50cca
Add basic capabilities for running jtreg tests from the IDE using a custom ant target Reviewed-by: chegar
174 lines
6.7 KiB
XML
174 lines
6.7 KiB
XML
<!-- importing.xml -->
|
|
<project name="jdk" basedir="..">
|
|
|
|
<script language="javascript" classpath=".idea/classes">
|
|
var JdkLogger = Java.type("idea.JdkIdeaAntLogger");
|
|
new JdkLogger(project)
|
|
</script>
|
|
|
|
<!-- java.marker is set to a marker file to check for within a Java install dir.
|
|
The best file to check for across Solaris/Linux/Windows/MacOS is one of the
|
|
executables; regrettably, that is OS-specific. -->
|
|
<condition property="java.marker" value="bin/java">
|
|
<os family="unix"/>
|
|
</condition>
|
|
<condition property="java.marker" value="bin/java.exe">
|
|
<os family="windows"/>
|
|
</condition>
|
|
|
|
<target name="-check-jtreg.home" depends="-def-check">
|
|
<check name="jtreg" property="jtreg.home" marker="lib/jtreg.jar"/>
|
|
</target>
|
|
|
|
<property name="test.dir" value="${basedir}/jdk/test"/>
|
|
|
|
<macrodef name="call-make">
|
|
<attribute name="dir"/>
|
|
<attribute name="args"/>
|
|
<sequential>
|
|
<exec executable="make" dir="@{dir}" failonerror="true">
|
|
<arg line="@{args}"/>
|
|
<env key="CLASSPATH" value = ""/>
|
|
</exec>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
<target name="post-make" depends="build-module"/>
|
|
|
|
<!--
|
|
**** Global JDK Build Targets
|
|
-->
|
|
|
|
<target name="clean" depends="-do-configure">
|
|
<echo message="base = ${basedir}"/>
|
|
<call-make dir = "${build.target.dir}" args = "clean"/>
|
|
</target>
|
|
|
|
<target name="-do-configure">
|
|
<echo message="base = ${basedir}"/>
|
|
<fail message="Not part of a full JDK forest">
|
|
<condition>
|
|
<not>
|
|
<available file="${basedir}/configure" />
|
|
</not>
|
|
</condition>
|
|
</fail>
|
|
<exec executable="sh" dir="${basedir}" failonerror="true">
|
|
<arg line="configure --with-boot-jdk=${boot.java.home}"/>
|
|
</exec>
|
|
</target>
|
|
|
|
<target name="images">
|
|
<call-make dir = "${build.target.dir}" args = "images"/>
|
|
</target>
|
|
|
|
<target name="jimages">
|
|
<call-make dir = "${build.target.dir}" args = "jimages"/>
|
|
</target>
|
|
|
|
<target name="check-env">
|
|
<exec executable="env" dir="${basedir}"/>
|
|
</target>
|
|
|
|
<target name="build-module">
|
|
<call-make dir = "${build.target.dir}" args = "${module.name}"/>
|
|
</target>
|
|
|
|
<target name="-check-boot.java.home" depends="-def-check">
|
|
<check name="bootstrap java" property="boot.java.home" marker="${java.marker}"/>
|
|
</target>
|
|
|
|
<target name="-def-check">
|
|
<macrodef name="check">
|
|
<attribute name="name"/>
|
|
<attribute name="property"/>
|
|
<attribute name="marker" default=""/>
|
|
<sequential>
|
|
<fail message="Cannot locate @{name}: please set @{property} to its location">
|
|
<condition>
|
|
<not>
|
|
<isset property="@{property}"/>
|
|
</not>
|
|
</condition>
|
|
</fail>
|
|
<fail message="@{name} is not installed in ${@{property}}">
|
|
<condition>
|
|
<and>
|
|
<not>
|
|
<equals arg1="@{marker}" arg2=""/>
|
|
</not>
|
|
<not>
|
|
<available file="${@{property}}/@{marker}"/>
|
|
</not>
|
|
</and>
|
|
</condition>
|
|
</fail>
|
|
</sequential>
|
|
</macrodef>
|
|
</target>
|
|
|
|
<macrodef name="exec-target">
|
|
<attribute name="antfile" default="${ant.file}" />
|
|
<attribute name="target" />
|
|
<sequential>
|
|
<java classname="org.apache.tools.ant.Main" fork="true" spawn="true">
|
|
<arg value="-f"/>
|
|
<arg value="@{antfile}"/>
|
|
<arg value="-Dbuild.target.dir=${build.target.dir}"/>
|
|
<arg value="-Djtreg.home=${jtreg.home}"/>
|
|
<arg value="-Djtreg.tests=${jtreg.tests}"/>
|
|
<arg value="-Djtreg.jpda.jvmargs=${jtreg.jpda.jvmargs}"/>
|
|
<arg value="@{target}"/>
|
|
<classpath>
|
|
<pathelement path="${java.class.path}"/>
|
|
</classpath>
|
|
</java>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
<target name="jtreg" depends="images,-def-jtreg">
|
|
<jtreg-tool name="all" tests="${jtreg.tests}"/>
|
|
</target>
|
|
|
|
<target name="-def-jtreg" unless="jtreg.defined" depends="-check-jtreg.home">
|
|
<taskdef name="jtreg" classname="com.sun.javatest.regtest.Main$$Ant">
|
|
<classpath>
|
|
<pathelement location="${jtreg.home}/lib/jtreg.jar"/>
|
|
<pathelement location="${jtreg.home}/lib/javatest.jar"/>
|
|
</classpath>
|
|
</taskdef>
|
|
<macrodef name="jtreg-tool">
|
|
<attribute name="name"/>
|
|
<attribute name="tests"/>
|
|
<attribute name="jdk" default="${build.target.dir}/images/jdk"/>
|
|
<attribute name="agentvm" default="true"/>
|
|
<attribute name="verbose" default="${default.jtreg.verbose}"/>
|
|
<attribute name="options" default="${other.jtreg.options}"/>
|
|
<attribute name="keywords" default="-keywords:!ignore"/>
|
|
<attribute name="jpda.jvmargs" default=""/>
|
|
<attribute name="extra.jvmargs" default=""/>
|
|
<attribute name="build.modules" default="${build.modules}"/>
|
|
<sequential>
|
|
<property name="coverage.options" value=""/> <!-- default -->
|
|
<property name="coverage.classpath" value=""/> <!-- default -->
|
|
<property name="default.jtreg.verbose" value="summary"/> <!-- default -->
|
|
<property name="other.jtreg.options" value=""/> <!-- default -->
|
|
<property name="jtreg.classfiles.to.modules" value="@{agentvm}"/>
|
|
<jtreg
|
|
dir="${test.dir}"
|
|
workDir="${build.target.dir}/idea/@{name}/work"
|
|
reportDir="${build.target.dir}/idea/@{name}/report"
|
|
jdk="@{jdk}"
|
|
agentvm="@{agentvm}" verbose="@{verbose}"
|
|
failonerror="false" resultproperty="jtreg.@{name}.result">
|
|
<arg value="-debug:@{jpda.jvmargs}"/>
|
|
<arg line="@{keywords}"/>
|
|
<arg line="@{options}"/>
|
|
<arg line="@{tests}"/>
|
|
</jtreg>
|
|
</sequential>
|
|
</macrodef>
|
|
<property name="jtreg.defined" value="true"/>
|
|
</target>
|
|
</project>
|