blob: 6ae0d225e0e61c7c706da5853f480de883d27948 [file] [log] [blame]
rsrinivasan01cf8ac2006-04-10 19:37:11 +00001<?xml version="1.0"?>
2<project name="API tests" basedir="." >
3
4 <property file="${testDir}/buildAll.properties"/>
5 <property file="${testDir}/build.cfg"/>
6
7 <property name="library-xml-file" value="${basedir}/plugins/org.eclipse.test_3.1.0/library.xml"/>
8 <import file="${library-xml-file}"/>
9
10 <target name="ui-test">
11 <antcall target="runPIAgent">
12 <param name="application" value="org.eclipse.test.uitestapplication"/>
13 </antcall>
14 </target>
15
16 <target name="core-test">
17 <antcall target="runPIAgent">
18 <param name="application" value="org.eclipse.test.coretestapplication"/>
19 </antcall>
20 </target>
21
22 <target name="init">
23 <property name="piagentDir" value="${testDir}/piagent"/>
jlanutiac43c072007-04-18 19:58:40 +000024 <property name="component.core" value="releng.wtptools/api/org.eclipse.wtp.releng.tools.component.core"/>
rsrinivasan01cf8ac2006-04-10 19:37:11 +000025 <condition property="piAgent.exists">
26 <or>
27 <available property="piAgent.dll.exists" file="${piagentDir}/piAgent.dll"/>
28 <available property="libpiAgent.so.exists" file="${piagentDir}/libpiAgent.so"/>
29 </or>
30 </condition>
31 <antcall target="init2"/>
32 </target>
33
34 <target name="init2" unless="piAgent.exists">
35 <mkdir dir="${piagentDir}"/>
36 <cvs
37 cvsRoot=":pserver:anonymous@dev.eclipse.org:/cvsroot/webtools"
38 package="${component.core}"
39 dest="${piagentDir}"
40 command="export"
41 tag="HEAD"
42 />
43 <mkdir dir="${piagentDir}/${component.core}/bin"/>
44 <javac
45 srcdir="${piagentDir}/${component.core}/src"
46 destdir="${piagentDir}/${component.core}/bin"
47 fork="true">
48 <classpath>
49 <fileset dir="${baseLocation}/plugins">
50 <include name="**/*.jar" />
51 </fileset>
52 </classpath>
53 </javac>
54 <condition property="piAgentURL" value="${piAgentURL.linux}">
55 <equals arg1="${os}" arg2="linux" />
56 </condition>
57 <condition property="piAgentURL" value="${piAgentURL.win32}">
58 <equals arg1="${os}" arg2="win32" />
59 </condition>
60 <condition property="piAgentFile" value="${piAgentFile.linux}">
61 <equals arg1="${os}" arg2="linux" />
62 </condition>
63 <condition property="piAgentFile" value="${piAgentFile.win32}">
64 <equals arg1="${os}" arg2="win32" />
65 </condition>
66 <condition property="os.linux">
67 <equals arg1="${os}" arg2="linux" />
68 </condition>
69 <condition property="os.win32">
70 <equals arg1="${os}" arg2="win32" />
71 </condition>
david_williams42f9b242006-11-27 18:45:14 +000072 <available file="${env.LOCAL_PREREQS_CACHE}/${piAgentFile}" property="piAgent.exists"/>
rsrinivasan01cf8ac2006-04-10 19:37:11 +000073 <antcall target="getPIAgent"/>
74 <antcall target="setupPIAgentLinux"/>
75 <antcall target="setupPIAgentWin32"/>
76 </target>
77
78 <target name="getPIAgent" unless="piAgent.exists">
david_williams42f9b242006-11-27 18:45:14 +000079 <get src="${piAgentURL}" dest="${env.LOCAL_PREREQS_CACHE}/${piAgentFile}"/>
rsrinivasan01cf8ac2006-04-10 19:37:11 +000080 </target>
81
82 <target name="setupPIAgentLinux" if="os.linux">
david_williams42f9b242006-11-27 18:45:14 +000083 <unzip dest="${piagentDir}" src="${env.LOCAL_PREREQS_CACHE}/${piAgentFile}">
rsrinivasan01cf8ac2006-04-10 19:37:11 +000084 <patternset>
85 <include name="**/*.so"/>
86 </patternset>
87 </unzip>
88 <move todir="${piagentDir}" flatten="true">
89 <fileset dir="${piagentDir}/lib"/>
90 </move>
91 <copy file="${piagentDir}/${component.core}/apiagent/libpiAgent.so" tofile="${piagentDir}/libpiAgent.so" overwrite="true"/>
92 </target>
93
94 <target name="setupPIAgentWin32" if="os.win32">
david_williams42f9b242006-11-27 18:45:14 +000095 <unzip dest="${piagentDir}" src="${env.LOCAL_PREREQS_CACHE}/${piAgentFile}">
rsrinivasan01cf8ac2006-04-10 19:37:11 +000096 <patternset>
97 <include name="**/*.dll"/>
98 </patternset>
99 </unzip>
100 <move todir="${piagentDir}" flatten="true">
101 <fileset dir="${piagentDir}/bin"/>
102 </move>
103 <copy file="${piagentDir}/${component.core}/apiagent/piAgent.dll" tofile="${piagentDir}/piAgent.dll" overwrite="true"/>
104 </target>
105
106 <target name="runPIAgent" depends="init">
107 <property name="piagentDir" value="${testDir}/piagent"/>
jlanutiac43c072007-04-18 19:58:40 +0000108 <property name="component.core" value="releng.wtptools/api/org.eclipse.wtp.releng.tools.component.core"/>
rsrinivasan01cf8ac2006-04-10 19:37:11 +0000109 <condition property="piAgent.exists">
110 <and>
111 <or>
112 <available property="piAgent.dll.exists" file="${piagentDir}/piAgent.dll"/>
113 <available property="libpiAgent.so.exists" file="${piagentDir}/libpiAgent.so"/>
114 </or>
115 <available property="buildDirectory.exists" file="${buildDirectory}"/>
116 <isset property="package.includes"/>
117 </and>
118 </condition>
119 <antcall target="runPIAgent2"/>
120 </target>
121
122 <target name="runPIAgent2" if="piAgent.exists">
123 <java classname="org.eclipse.wtp.releng.tools.component.piagent.PIAgentFiltersEmitter" fork="true" maxmemory="256m">
124 <arg line="-eclipseDirs ${buildDirectory}/plugins -compXMLDirs ${buildDirectory}/plugins -outputFile ${piagentDir}/piagent_filters.txt -includes ${package.includes}" />
125 <classpath>
126 <pathelement path="${piagentDir}/${component.core}/bin"/>
127 <fileset dir="${baseLocation}/plugins">
128 <include name="**/*.jar" />
129 </fileset>
130 </classpath>
131 </java>
132 <tstamp>
133 <format property="TIMENOW" pattern="HHmmssSSSS"/>
134 </tstamp>
135 <property name="vmargs" value=""/>
136 <property name="launcher" value="org.eclipse.core.launcher.Main"/>
137 <property name="formatter" value="org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter"/>
138 <property name="extraVMargs" value=""/>
139 <property name="plugin-path" value=""/>
140 <property name="timeout" value="7200000"/>
141 <property file="${testDir}/eclipse/configuration/config.ini"/>
142 <echo message="Running ${classname}"/>
143 <mkdir dir="${buildDirectory}/apitools/piagentoutput"/>
144 <delete file="${buildDirectory}/apitools/piagentoutput/${classname}.trcxml" failonerror="false"/>
145 <exec dir="${piagentDir}" executable="java" timeout="${timeout}">
146 <env key="LD_LIBRARY_PATH" value="${piagentDir}"/>
147 <env key="java.library.path" value="${piagentDir}"/>
148 <env key="PLUGIN_PATH" value="${plugin-path}"/>
149 <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"/>
150 </exec>
151 </target>
152
153</project>