blob: 44110f39953d45bb251bca1ab30d305d2ab5e31c [file] [log] [blame]
david_williams53a2f7b2008-01-08 06:11:49 +00001<project
2 name="Build specific targets and properties"
3 default="runTest">
4
david_williams90efb982008-01-10 23:54:08 +00005 <!-- Note to be cross-platform, "environment variables" are only appropriate for
david_williams53a2f7b2008-01-08 06:11:49 +00006 some variables, e.g. ones we set, since properties are case sensitive, even if
7 the environment variables on your operating system are not, e.g. it will
8 be ${env.Path} not ${env.PATH} on Windows -->
david_williams90efb982008-01-10 23:54:08 +00009 <property
10 environment="env" />
david_williams53a2f7b2008-01-08 06:11:49 +000011 <fail
12 message="testRoot must be set for this task"
13 unless="testRoot" />
david_williamscfd9a4a2008-03-27 16:35:01 +000014 <!-- required to get proper value of dropinsFolder -->
15 <property name="keyCfgFile" value="${env.PROJECT_BUILDERS}/${projectname}/${env.RELENG}/maps/build.cfg" />
16 <echo message="keyCfgFile: ${keyCfgFile}" />
17 <property file="${keyCfgFile}" />
18
david_williams53a2f7b2008-01-08 06:11:49 +000019
david_williams43089362008-03-25 05:43:38 +000020 <!--
21 Steps to do after the build is done.
22 -->
david_williams90efb982008-01-10 23:54:08 +000023 <target
24 name="test">
david_williams53a2f7b2008-01-08 06:11:49 +000025 <dirname
26 file="${ant.file}"
27 property="currentDirectory" />
28 <ant
29 antfile="${ant.file}"
30 target="runTest"
31 dir="${currentDirectory}" />
32 </target>
33
david_williams43089362008-03-25 05:43:38 +000034 <!--
35 Steps to do to test the build results
36 -->
david_williams90efb982008-01-10 23:54:08 +000037 <target
38 name="runTest">
david_williams53a2f7b2008-01-08 06:11:49 +000039 <dirname
40 file="${ant.file}"
41 property="test.component.dir" />
david_williams90efb982008-01-10 23:54:08 +000042 <ant
43 antfile="${wtp.builder.home}/scripts/build/label.xml" />
44 <property
45 file="${buildDirectory}/label.properties" />
46 <property
47 file="${wtp.builder.home}/build.properties" />
david_williams53a2f7b2008-01-08 06:11:49 +000048 <fail
49 message="testRoot must be set for this task"
50 unless="testRoot" />
david_williams90efb982008-01-10 23:54:08 +000051 <mkdir
52 dir="${testRoot}" />
david_williams53a2f7b2008-01-08 06:11:49 +000053
david_williams90efb982008-01-10 23:54:08 +000054 <!-- if results already exist, delete them -->
david_williams53a2f7b2008-01-08 06:11:49 +000055 <delete
56 dir="${testRoot}/results"
57 failOnError="false" />
david_williams90efb982008-01-10 23:54:08 +000058 <mkdir
59 dir="${testRoot}/results" />
60 <mkdir
61 dir="${testRoot}/results/consolelogs" />
62 <mkdir
63 dir="${testRoot}/results/consolelogs/metadata-logs" />
64 <mkdir
65 dir="${testRoot}/results/consolelogs/configuration-logs" />
david_williams53a2f7b2008-01-08 06:11:49 +000066 <copy
67 todir="${testRoot}"
68 overwrite="true">
david_williams90efb982008-01-10 23:54:08 +000069 <fileset
david_williams43089362008-03-25 05:43:38 +000070 dir="${test.component.dir}/testScripts" />
david_williams53a2f7b2008-01-08 06:11:49 +000071 </copy>
david_williams53a2f7b2008-01-08 06:11:49 +000072 <echo
73 message="BASEOS: ${env.BASEOS} BASEWS: ${env.BASEWS} BASEARCH: ${env.BASEARCH} " />
david_williams53a2f7b2008-01-08 06:11:49 +000074 <ant
75 antfile="${test.component.dir}/testdependency.xml"
76 target="get">
77 <property
78 name="dependency.properties"
79 value="${buildDirectory}/maps/${env.RELENG}/maps/dependencies.properties" />
80 <property
81 name="base.install.dir"
82 value="${testRoot}" />
83 </ant>
david_williams90efb982008-01-10 23:54:08 +000084 <antcall
85 target="unzipTests" />
86 <antcall
87 target="runTestEclipse">
david_williams53a2f7b2008-01-08 06:11:49 +000088 <param
89 name="testTarget"
90 value="all" />
91 </antcall>
david_williams90efb982008-01-10 23:54:08 +000092 <antcall
93 target="postRunTestEclipse">
david_williams53a2f7b2008-01-08 06:11:49 +000094 <param
95 name="testTarget"
96 value="all" />
97 </antcall>
98 </target>
david_williams90efb982008-01-10 23:54:08 +000099 <target
100 name="unzipTests">
david_williams53a2f7b2008-01-08 06:11:49 +0000101
david_williams90efb982008-01-10 23:54:08 +0000102 <!--unzip the builds and junit tests
103 we use 'unzip' here, so we can continue on error, if desired.
david_williams53a2f7b2008-01-08 06:11:49 +0000104 (such as if zip was not created, due to other failures or options).
105 -->
david_williams90efb982008-01-10 23:54:08 +0000106 <echo
107 message="installing xsl sdk" />
david_williams53a2f7b2008-01-08 06:11:49 +0000108 <exec
109 dir="${buildDirectory}/${buildLabel}"
110 executable="unzip"
david_williams90efb982008-01-10 23:54:08 +0000111 failonerror="true">
112 <arg
david_williamsb064ea62008-03-28 00:41:31 +0000113 line="-o -qq wtp-incubator-xsl_sdk-${buildLabel}.zip -d ${testRoot}/eclipse/dropins" />
david_williams90efb982008-01-10 23:54:08 +0000114 </exec>
115 <echo
116 message="installing xsl tests" />
117 <exec
118 dir="${buildDirectory}/${buildLabel}"
119 executable="unzip"
120 failonerror="true">
david_williams53a2f7b2008-01-08 06:11:49 +0000121 <arg
david_williamsb064ea62008-03-28 00:41:31 +0000122 line="-o -qq wtp-incubator-xsl-tests-${buildLabel}.zip -d ${testRoot}/eclipse/dropins" />
david_williams53a2f7b2008-01-08 06:11:49 +0000123 </exec>
david_williams53a2f7b2008-01-08 06:11:49 +0000124 </target>
125
david_williams90efb982008-01-10 23:54:08 +0000126 <!-- time out may need to be set/adjust for api or performance tests?
david_williams53a2f7b2008-01-08 06:11:49 +0000127 This testTimeLimit is the whole, overall limit on tests. There's a shorter
128 one for individual suites.
129
130 some common values, of milliseconds to more recognizable units:
131 7200000: 2 hours
132 3600000: 1 hour
133 1800000: 30 minutes
134 600000: 10 minutes
135 -->
david_williams53a2f7b2008-01-08 06:11:49 +0000136 <property
137 name="testTimeLimit"
138 value="7200000" />
139 <property
140 name="testFailOnError"
141 value="false" />
david_williams53a2f7b2008-01-08 06:11:49 +0000142 <target
143 name="runTestEclipse"
144 description="Run our JUnit's within an instance of antRunner">
david_williams53a2f7b2008-01-08 06:11:49 +0000145 <property
146 name="test-vm"
147 value="${env.JAVA_5_HOME}/bin/java" />
148 <property
149 name="plugin-path"
david_williamsb064ea62008-03-28 00:41:31 +0000150 value="${testRoot}/eclipse/dropins/eclipse/plugins" />
david_williams53a2f7b2008-01-08 06:11:49 +0000151 <property
152 name="vmargs"
david_williams8f4d7732008-03-27 23:08:26 +0000153 value="-Xms256m -Xmx512m -Dosgi.ws=${env.BASEWS} -Dosgi.os=${env.BASEOS} -Dosgi.arch=${env.BASEARCH} -Dws=${env.BASEWS} -Dos=${env.BASEOS} -Darch=${env.BASEARCH} -Dnoclean=true -DbuildBranch=${buildBranch} -DbuildType=${buildType} -DbuildId=${buildId} -DtestRoot=${testRoot} -DtestDir=${testRoot} -DbuildDirectory=${buildDirectory} -Dbuild.home=${env.BUILD_HOME} -DeclipseBuilderDirectory=${pde.builder.path} -DbuildLabel=${buildLabel} -Dtest-vm=${test-vm} -Dperf.buildId=${buildType}${date}-${time}" />
david_williams53a2f7b2008-01-08 06:11:49 +0000154
155
david_williams90efb982008-01-10 23:54:08 +0000156 <!-- set path to eclipse folder. If local folder, use '.'; otherwise, use c:\path\to\eclipse or /path/to/eclipse/ -->
david_williams53a2f7b2008-01-08 06:11:49 +0000157 <property
158 name="eclipse.home"
159 value="${testRoot}" />
david_williams90efb982008-01-10 23:54:08 +0000160 <echo
161 message="Running junits" />
david_williams53a2f7b2008-01-08 06:11:49 +0000162
david_williams90efb982008-01-10 23:54:08 +0000163 <!--
david_williams53a2f7b2008-01-08 06:11:49 +0000164 Remember: using -debug for org.eclipse.ant.core.antRunner
165 produces ant debug info to be output ... which is a TON of stuff
166 -->
david_williams90efb982008-01-10 23:54:08 +0000167 <echo
168 message="eclipse.launcher: ${eclipse.launcher}" />
david_williams53a2f7b2008-01-08 06:11:49 +0000169 <java
david_williams53a2f7b2008-01-08 06:11:49 +0000170 taskname="unit-test-masterprocess"
171 fork="true"
172 resultProperty="wtpmasterjunitresult"
173 failonerror="false"
174 timeout="${testTimeLimit}"
175 dir="${testRoot}/eclipse"
david_williams4987b102008-01-11 01:14:17 +0000176 jvm="${env.JAVA_5_HOME}/bin/java"
177 classname="org.eclipse.equinox.launcher.Main">
178 <classpath>
david_williams43089362008-03-25 05:43:38 +0000179 <fileset
180 dir="${testRoot}/eclipse/plugins">
181 <include
182 name="org.eclipse.equinox.launcher_*.jar" />
david_williams4987b102008-01-11 01:14:17 +0000183 </fileset>
184 </classpath>
david_williams43089362008-03-25 05:43:38 +0000185 <jvmarg
186 value="-Xms256m" />
187 <jvmarg
188 value="-Xmx512m" />
189 <jvmarg
190 value="-Dosgi.ws=${env.BASEWS}" />
191 <jvmarg
192 value="-Dosgi.os=${env.BASEOS}" />
193 <jvmarg
194 value="-Dosgi.arch=${env.BASEARCH}" />
195 <jvmarg
196 value="-Dws=${env.BASEWS}" />
197 <jvmarg
198 value="-Dos=${env.BASEOS}" />
199 <jvmarg
200 value="-Darch=${env.BASEARCH}" />
david_williams8f4d7732008-03-27 23:08:26 +0000201
david_williams43089362008-03-25 05:43:38 +0000202 <jvmarg
203 value="-Dnoclean=true" />
204 <jvmarg
205 value="-DbuildBranch=${buildBranch}" />
206 <jvmarg
207 value="-DbuildType=${buildType}" />
208 <jvmarg
209 value="-DbuildId=${buildId}" />
210 <jvmarg
211 value="-Djava.io.tmpdir=${env.RECOMMENDED_TMP_DIR}" />
212 <arg
213 value="-nosplash" />
214 <arg
215 value="-consolelog" />
216 <arg
217 value="-data" />
218 <arg
219 value="${testRoot}/overallTestWorkspace" />
220 <arg
221 value="-application" />
222 <arg
223 value="org.eclipse.ant.core.antRunner" />
224 <arg
225 value="-file" />
226 <arg
227 value="${testRoot}/test.xml" />
228 <arg
229 value="-logger" />
230 <arg
231 value="org.apache.tools.ant.DefaultLogger" />
david_williams53a2f7b2008-01-08 06:11:49 +0000232 <env
233 key="DISPLAY"
234 value="${env.DISPLAY}" />
235 <redirector
236 output="${testRoot}/results/fullOutput.txt"
237 error="${testRoot}/results/fullErrorLog.txt" />
238 <sysproperty
239 key="build.home"
240 value="${env.BUILD_HOME}" />
241 <sysproperty
242 key="buildDirectory"
243 value="${buildDirectory}" />
244 <sysproperty
245 key="buildLabel"
246 value="${buildLabel}" />
247 <sysproperty
248 key="baseLocation"
249 value="${baseLocation}" />
250 <sysproperty
251 key="testRoot"
252 value="${testRoot}" />
253 <sysproperty
254 key="testDir"
255 value="${testRoot}" />
256 <sysproperty
257 key="perf.buildId"
258 value="${buildType}${date}-${time}" />
259 <sysproperty
260 key="eclipseBuilderDirectory"
261 value="${pde.builder.path}" />
262 <sysproperty
263 key="buildLabel"
264 value="${buildLabel}" />
265 </java>
david_williams90efb982008-01-10 23:54:08 +0000266 <echo
267 message="wtpmasterjunitresult ${wtpmasterjunitresult}" />
david_williams53a2f7b2008-01-08 06:11:49 +0000268 </target>
david_williams90efb982008-01-10 23:54:08 +0000269 <target
270 name="postRunTestEclipse">
david_williams53a2f7b2008-01-08 06:11:49 +0000271 <copy
272 todir="${buildDirectory}/${buildLabel}/testResults/consolelogs/testLogs"
273 overwrite="true"
274 failonerror="false">
david_williams90efb982008-01-10 23:54:08 +0000275 <fileset
276 dir="${testRoot}/results">
277 <include
278 name="*output.txt" />
david_williams53a2f7b2008-01-08 06:11:49 +0000279 </fileset>
280 </copy>
281 <copy
282 todir="${buildDirectory}/${buildLabel}/testResults/consolelogs/testSysErrorLogs"
283 overwrite="true"
284 failonerror="false">
david_williams90efb982008-01-10 23:54:08 +0000285 <fileset
286 dir="${testRoot}/results">
287 <include
288 name="*error.txt" />
david_williams53a2f7b2008-01-08 06:11:49 +0000289 </fileset>
290 </copy>
291 <copy
292 file="${testRoot}/results/fullOutput.txt"
293 toDir="${buildDirectory}/${buildLabel}/testResults/consolelogs/full"
294 overwrite="true"
295 failonerror="false">
296 </copy>
297 <copy
298 file="${testRoot}/results/fullErrorLog.txt"
299 toDir="${buildDirectory}/${buildLabel}/testResults/consolelogs/full"
300 overwrite="true"
301 failonerror="false">
302 </copy>
david_williams53a2f7b2008-01-08 06:11:49 +0000303 <copy
304 todir="${buildDirectory}/${buildLabel}/testResults/xml"
305 overwrite="true"
306 failonerror="false">
david_williams90efb982008-01-10 23:54:08 +0000307 <fileset
308 dir="${testRoot}/results/xml">
309 <include
310 name="*.xml" />
david_williams53a2f7b2008-01-08 06:11:49 +0000311 </fileset>
312 </copy>
313 <copy
314 todir="${buildDirectory}/${buildLabel}/testResults/html"
315 overwrite="true"
316 failonerror="false">
david_williams90efb982008-01-10 23:54:08 +0000317 <fileset
318 dir="${testRoot}/results/html">
319 <include
320 name="*.html" />
david_williams53a2f7b2008-01-08 06:11:49 +0000321 </fileset>
322 </copy>
323 </target>
david_williams90efb982008-01-10 23:54:08 +0000324</project>