blob: 8aad53d35fa1e4c4b4d548d6feea93557139bdfb [file] [log] [blame]
<?xml version="1.0"?>
<project name="API tests" basedir="." >
<property file="${testDir}/buildAll.properties"/>
<property file="${testDir}/build.cfg"/>
<property name="library-xml-file" value="${basedir}/plugins/org.eclipse.test_3.1.0/library.xml"/>
<import file="${library-xml-file}"/>
<target name="ui-test">
<antcall target="runPIAgent">
<param name="application" value="org.eclipse.test.uitestapplication"/>
</antcall>
</target>
<target name="core-test">
<antcall target="runPIAgent">
<param name="application" value="org.eclipse.test.coretestapplication"/>
</antcall>
</target>
<target name="init">
<property name="piagentDir" value="${testDir}/piagent"/>
<property name="component.core" value="releng.builder/tools/apitools/org.eclipse.wtp.releng.tools.component.core"/>
<condition property="piAgent.exists">
<or>
<available property="piAgent.dll.exists" file="${piagentDir}/piAgent.dll"/>
<available property="libpiAgent.so.exists" file="${piagentDir}/libpiAgent.so"/>
</or>
</condition>
<antcall target="init2"/>
</target>
<target name="init2" unless="piAgent.exists">
<mkdir dir="${piagentDir}"/>
<cvs
cvsRoot=":pserver:anonymous@dev.eclipse.org:/cvsroot/webtools"
package="${component.core}"
dest="${piagentDir}"
command="export"
tag="HEAD"
/>
<mkdir dir="${piagentDir}/${component.core}/bin"/>
<javac
srcdir="${piagentDir}/${component.core}/src"
destdir="${piagentDir}/${component.core}/bin"
fork="true">
<classpath>
<fileset dir="${baseLocation}/plugins">
<include name="**/*.jar" />
</fileset>
</classpath>
</javac>
<condition property="piAgentURL" value="${piAgentURL.linux}">
<equals arg1="${os}" arg2="linux" />
</condition>
<condition property="piAgentURL" value="${piAgentURL.win32}">
<equals arg1="${os}" arg2="win32" />
</condition>
<condition property="piAgentFile" value="${piAgentFile.linux}">
<equals arg1="${os}" arg2="linux" />
</condition>
<condition property="piAgentFile" value="${piAgentFile.win32}">
<equals arg1="${os}" arg2="win32" />
</condition>
<condition property="os.linux">
<equals arg1="${os}" arg2="linux" />
</condition>
<condition property="os.win32">
<equals arg1="${os}" arg2="win32" />
</condition>
<available file="${build.home}/${build.drivers}/${piAgentFile}" property="piAgent.exists"/>
<antcall target="getPIAgent"/>
<antcall target="setupPIAgentLinux"/>
<antcall target="setupPIAgentWin32"/>
</target>
<target name="getPIAgent" unless="piAgent.exists">
<get src="${piAgentURL}" dest="${build.home}/${build.drivers}/${piAgentFile}"/>
</target>
<target name="setupPIAgentLinux" if="os.linux">
<unzip dest="${piagentDir}" src="${build.home}/${build.drivers}/${piAgentFile}">
<patternset>
<include name="**/*.so"/>
</patternset>
</unzip>
<move todir="${piagentDir}" flatten="true">
<fileset dir="${piagentDir}/lib"/>
</move>
<copy file="${piagentDir}/${component.core}/apiagent/libpiAgent.so" tofile="${piagentDir}/libpiAgent.so" overwrite="true"/>
</target>
<target name="setupPIAgentWin32" if="os.win32">
<unzip dest="${piagentDir}" src="${build.home}/${build.drivers}/${piAgentFile}">
<patternset>
<include name="**/*.dll"/>
</patternset>
</unzip>
<move todir="${piagentDir}" flatten="true">
<fileset dir="${piagentDir}/bin"/>
</move>
<copy file="${piagentDir}/${component.core}/apiagent/piAgent.dll" tofile="${piagentDir}/piAgent.dll" overwrite="true"/>
</target>
<target name="runPIAgent" depends="init">
<property name="piagentDir" value="${testDir}/piagent"/>
<property name="component.core" value="org.eclipse.wtp.releng/apitools/org.eclipse.wtp.releng.tools.component.core"/>
<condition property="piAgent.exists">
<and>
<or>
<available property="piAgent.dll.exists" file="${piagentDir}/piAgent.dll"/>
<available property="libpiAgent.so.exists" file="${piagentDir}/libpiAgent.so"/>
</or>
<available property="buildDirectory.exists" file="${buildDirectory}"/>
<isset property="package.includes"/>
</and>
</condition>
<antcall target="runPIAgent2"/>
</target>
<target name="runPIAgent2" if="piAgent.exists">
<java classname="org.eclipse.wtp.releng.tools.component.piagent.PIAgentFiltersEmitter" fork="true" maxmemory="256m">
<arg line="-eclipseDirs ${buildDirectory}/plugins -compXMLDirs ${buildDirectory}/plugins -outputFile ${piagentDir}/piagent_filters.txt -includes ${package.includes}" />
<classpath>
<pathelement path="${piagentDir}/${component.core}/bin"/>
<fileset dir="${baseLocation}/plugins">
<include name="**/*.jar" />
</fileset>
</classpath>
</java>
<tstamp>
<format property="TIMENOW" pattern="HHmmssSSSS"/>
</tstamp>
<property name="vmargs" value=""/>
<property name="launcher" value="org.eclipse.core.launcher.Main"/>
<property name="formatter" value="org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter"/>
<property name="extraVMargs" value=""/>
<property name="plugin-path" value=""/>
<property name="timeout" value="7200000"/>
<property file="${testDir}/eclipse/configuration/config.ini"/>
<echo message="Running ${classname}"/>
<mkdir dir="${buildDirectory}/apitools/piagentoutput"/>
<delete file="${buildDirectory}/apitools/piagentoutput/${classname}.trcxml" failonerror="false"/>
<exec dir="${piagentDir}" executable="java" timeout="${timeout}">
<env key="LD_LIBRARY_PATH" value="${piagentDir}"/>
<env key="java.library.path" value="${piagentDir}"/>
<env key="PLUGIN_PATH" value="${plugin-path}"/>
<arg line="-cp ${testDir}/eclipse/startup.jar -XrunpiAgent:server=standalone,profile=${piagentDir}/${component.core}/apiagent/piagent_options.txt,filters=${piagentDir}/piagent_filters.txt,file=${buildDirectory}/apitools/piagentoutput/${plugin-name}-${classname}.trcxml -Xmx512M ${vmargs} ${extraVMargs} ${launcher} -application ${application} -dev bin -data ${data-dir} formatter=${formatter},${testDir}/eclipse/${classname}.xml -testPluginName ${plugin-name} -className ${classname} -os ${os} -ws ${ws} -arch ${arch} -consolelog"/>
</exec>
</target>
</project>