blob: 3fa7e54eb3de85c7a6620a102d85cc8d5f43dd1b [file] [log] [blame]
david_williams403beae2007-12-09 02:10:40 +00001<project
2 name="Build specific targets and properties"
3 default="runTest">
david_williams8e4dc9c2008-07-06 08:08:58 +00004 <!--
5 Note to be cross-platform, "environment variables" are only
6 appropriate for some variables, e.g. ones we set, since
7 properties are case sensitive, even if the environment variables
8 on your operating system are not, e.g. it will be ${env.Path}
9 not ${env.PATH} on Windows
10 -->
david_williamsad2097e2008-01-28 06:06:12 +000011 <property
david_williams8e4dc9c2008-07-06 08:08:58 +000012 environment="env"/>
david_williams2f43da22009-07-22 04:25:24 +000013 <fail
14 message="testRoot must be set for this task"
15 unless="testRoot"/>
16 <!-- required to get proper value of dropinsFolder -->
david_williams8e4dc9c2008-07-06 08:08:58 +000017 <property
18 name="keyCfgFile"
19 value="${env.PROJECT_BUILDERS}/${projectname}/${env.RELENG}/maps/build.cfg"/>
20 <echo
david_williams1543a9b2009-11-24 01:43:55 +000021 level="info"
david_williams8e4dc9c2008-07-06 08:08:58 +000022 message="keyCfgFile: ${keyCfgFile}"/>
23 <property
24 file="${keyCfgFile}"/>
david_williams2f43da22009-07-22 04:25:24 +000025 <!--
26 typcially already set, but in case of standalone tests, may not
27 be
28 -->
29 <property
30 name="buildLabel"
31 value="${buildType}-${buildId}-${timestamp}"/>
32
ndaib8cedc82005-09-13 18:00:32 +000033
david_williams43089362008-03-25 05:43:38 +000034 <!--
35 Steps to do after the build is done.
36 -->
david_williamsad2097e2008-01-28 06:06:12 +000037 <target
38 name="test">
david_williams403beae2007-12-09 02:10:40 +000039 <dirname
40 file="${ant.file}"
david_williams8e4dc9c2008-07-06 08:08:58 +000041 property="currentDirectory"/>
david_williams403beae2007-12-09 02:10:40 +000042 <ant
43 antfile="${ant.file}"
44 target="runTest"
david_williams8e4dc9c2008-07-06 08:08:58 +000045 dir="${currentDirectory}"/>
david_williams403beae2007-12-09 02:10:40 +000046 </target>
ndaib8cedc82005-09-13 18:00:32 +000047
david_williams43089362008-03-25 05:43:38 +000048 <!--
49 Steps to do to test the build results
50 -->
david_williamsad2097e2008-01-28 06:06:12 +000051 <target
52 name="runTest">
david_williams403beae2007-12-09 02:10:40 +000053 <dirname
54 file="${ant.file}"
david_williams8e4dc9c2008-07-06 08:08:58 +000055 property="test.component.dir"/>
david_williamsad2097e2008-01-28 06:06:12 +000056 <ant
david_williams8e4dc9c2008-07-06 08:08:58 +000057 antfile="${wtp.builder.home}/scripts/build/label.xml"/>
david_williamsad2097e2008-01-28 06:06:12 +000058 <property
david_williams8e4dc9c2008-07-06 08:08:58 +000059 file="${buildDirectory}/label.properties"/>
david_williamsad2097e2008-01-28 06:06:12 +000060 <property
david_williams8e4dc9c2008-07-06 08:08:58 +000061 file="${wtp.builder.home}/build.properties"/>
david_williams403beae2007-12-09 02:10:40 +000062 <fail
63 message="testRoot must be set for this task"
david_williams8e4dc9c2008-07-06 08:08:58 +000064 unless="testRoot"/>
david_williamsad2097e2008-01-28 06:06:12 +000065 <mkdir
david_williams8e4dc9c2008-07-06 08:08:58 +000066 dir="${testRoot}"/>
david_williamsf5f131a2007-03-17 06:12:13 +000067
david_williams403beae2007-12-09 02:10:40 +000068 <!-- if results already exist, delete them -->
69 <delete
70 dir="${testRoot}/results"
david_williams8e4dc9c2008-07-06 08:08:58 +000071 failOnError="false"/>
david_williamsad2097e2008-01-28 06:06:12 +000072 <mkdir
david_williams8e4dc9c2008-07-06 08:08:58 +000073 dir="${testRoot}/results"/>
david_williamsad2097e2008-01-28 06:06:12 +000074 <mkdir
david_williams8e4dc9c2008-07-06 08:08:58 +000075 dir="${testRoot}/results/consolelogs"/>
david_williams403beae2007-12-09 02:10:40 +000076 <copy
77 todir="${testRoot}"
78 overwrite="true">
david_williamsad2097e2008-01-28 06:06:12 +000079 <fileset
david_williams8e4dc9c2008-07-06 08:08:58 +000080 dir="${test.component.dir}/testScripts"/>
david_williams403beae2007-12-09 02:10:40 +000081 </copy>
david_williams403beae2007-12-09 02:10:40 +000082 <echo
david_williams8e4dc9c2008-07-06 08:08:58 +000083 message="BASEOS: ${env.BASEOS} BASEWS: ${env.BASEWS} BASEARCH: ${env.BASEARCH} "/>
david_williams508f8602009-08-04 06:31:37 +000084 <!--
85 for this distribution, dependencies come from releng. Assume
86 no subdirectory, if not otherwise set (bug 285383).
david_williams2f53d7b2009-08-03 05:48:34 +000087 -->
david_williams508f8602009-08-04 06:31:37 +000088 <property
89 name="env.DEP_DIR"
90 value=""/>
david_williams2f53d7b2009-08-03 05:48:34 +000091 <property
92 name="dependency.properties"
david_williams400ac772009-08-03 16:52:32 +000093 value="${buildDirectory}/maps/${env.RELENG}${env.DEP_DIR}/maps/dependencies.properties"/>
david_williams508f8602009-08-04 06:31:37 +000094 <available
95 file="${dependency.properties}"
96 property="dependency.properties.exists"/>
97 <fail
david_williamsc253e572009-08-04 07:09:44 +000098 message="dependency file not found: ${dependency.properties}"
david_williams508f8602009-08-04 06:31:37 +000099 unless="dependency.properties.exists"/>
100 <ant
101 antfile="${test.component.dir}/testdependency.xml"
102 target="get">
103 <property
david_williams403beae2007-12-09 02:10:40 +0000104 name="base.install.dir"
david_williams8e4dc9c2008-07-06 08:08:58 +0000105 value="${testRoot}"/>
david_williams403beae2007-12-09 02:10:40 +0000106 </ant>
david_williamsad2097e2008-01-28 06:06:12 +0000107 <antcall
david_williams8e4dc9c2008-07-06 08:08:58 +0000108 target="unzipTests"/>
david_williamsad2097e2008-01-28 06:06:12 +0000109 <antcall
110 target="runTestEclipse">
david_williamsfcdb6972009-11-19 07:25:49 +0000111 <param
112 name="testTarget"
113 value="all"/>
david_williams403beae2007-12-09 02:10:40 +0000114 </antcall>
david_williamsad2097e2008-01-28 06:06:12 +0000115 <antcall
116 target="postRunTestEclipse">
david_williamsfcdb6972009-11-19 07:25:49 +0000117 <param
118 name="testTarget"
119 value="all"/>
david_williams403beae2007-12-09 02:10:40 +0000120 </antcall>
david_williams403beae2007-12-09 02:10:40 +0000121 </target>
david_williamsad2097e2008-01-28 06:06:12 +0000122 <target
123 name="unzipTests">
david_williams8e4dc9c2008-07-06 08:08:58 +0000124 <!--
125 unzip the builds and junit tests we use 'unzip' here, so we
126 can continue on error, if desired. (such as if zip was not
127 created, due to other failures or options).
david_williams403beae2007-12-09 02:10:40 +0000128 -->
129 <exec
130 dir="${buildDirectory}/${buildLabel}"
131 executable="unzip"
david_williams904dc3f2009-11-24 13:41:49 +0000132 failonerror="true">
david_williamsad2097e2008-01-28 06:06:12 +0000133 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000134 line="-o -qq wtp-sdk-${buildLabel}.zip -d ${testRoot}${dropinsFolder}"/>
david_williams403beae2007-12-09 02:10:40 +0000135 </exec>
david_williams403beae2007-12-09 02:10:40 +0000136 <exec
137 dir="${buildDirectory}/${buildLabel}"
138 executable="unzip"
139 failonerror="false">
140 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000141 line="-o -qq wtp-wst-Automated-Tests-${buildLabel}.zip -d ${testRoot}${dropinsFolder}"/>
david_williams403beae2007-12-09 02:10:40 +0000142 </exec>
143 <exec
144 dir="${buildDirectory}/${buildLabel}"
145 executable="unzip"
146 failonerror="false">
147 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000148 line="-o -qq wtp-jst-Automated-Tests-${buildLabel}.zip -d ${testRoot}${dropinsFolder}"/>
david_williams403beae2007-12-09 02:10:40 +0000149 </exec>
david_williams403beae2007-12-09 02:10:40 +0000150 <exec
151 dir="${buildDirectory}/${buildLabel}"
152 executable="unzip"
153 failonerror="false">
154 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000155 line="-o -qq wtp-jpt-sdk-${buildLabel}.zip -d ${testRoot}${dropinsFolder}"/>
david_williams403beae2007-12-09 02:10:40 +0000156 </exec>
157 <exec
158 dir="${buildDirectory}/${buildLabel}"
159 executable="unzip"
david_williams904dc3f2009-11-24 13:41:49 +0000160 failonerror="true">
david_williams403beae2007-12-09 02:10:40 +0000161 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000162 line="-o -qq wtp-jpt-Automated-Tests-${buildLabel}.zip -d ${testRoot}${dropinsFolder}"/>
david_williams403beae2007-12-09 02:10:40 +0000163 </exec>
david_williams403beae2007-12-09 02:10:40 +0000164 </target>
david_williams8e4dc9c2008-07-06 08:08:58 +0000165 <!--
166 time out may need to be set/adjust for api or performance tests?
167 This testTimeLimit is the whole, overall limit on tests. There's
168 a shorter one for individual suites. some common values, of
david_williams722ec9d2009-11-20 05:24:42 +0000169 milliseconds to more recognizable units:
david_williams04661de2009-11-25 23:25:44 +0000170 18000000: 5 hours
david_williams722ec9d2009-11-20 05:24:42 +0000171 14400000: 4 hours
172 7200000: 2 hours
173 3600000: 1 hour
174 1800000: 30 minutes
175 600000: 10 minutes
david_williams403beae2007-12-09 02:10:40 +0000176 -->
david_williams403beae2007-12-09 02:10:40 +0000177 <property
178 name="testTimeLimit"
david_williams04661de2009-11-25 23:25:44 +0000179 value="18000000"/>
david_williams403beae2007-12-09 02:10:40 +0000180 <property
181 name="testFailOnError"
david_williams8e4dc9c2008-07-06 08:08:58 +0000182 value="false"/>
david_williams403beae2007-12-09 02:10:40 +0000183 <target
184 name="runTestEclipse"
185 description="Run our JUnit's within an instance of antRunner">
david_williams403beae2007-12-09 02:10:40 +0000186 <property
187 name="test-vm"
david_williamsdbd9d832009-01-13 06:37:49 +0000188 value="${env.JAVA_6_HOME}/bin/java"/>
david_williams36839e52009-11-23 02:33:12 +0000189 <!--
david_williams8e4dc9c2008-07-06 08:08:58 +0000190 set path to eclipse folder. If local folder, use '.';
191 otherwise, use c:\path\to\eclipse or /path/to/eclipse/
192 -->
david_williams403beae2007-12-09 02:10:40 +0000193 <property
194 name="eclipse.home"
david_williams8e4dc9c2008-07-06 08:08:58 +0000195 value="${testRoot}"/>
david_williamsad2097e2008-01-28 06:06:12 +0000196 <echo
david_williams2f43da22009-07-22 04:25:24 +0000197 message="testTarget: ${testTarget}"/>
david_williamsdb9eed92009-11-18 20:03:49 +0000198 <!--
199 can not pass in empty values in jvmargs so if not testBundle
200 specified, we'll pass a junk (unused) value
201 -->
202 <condition
203 property="testBundleParam"
204 value="-DtestBundle=${testBundle}"
205 else="-Dunused=nouse">
206 <isset
207 property="testBundle"/>
208 </condition>
david_williams2f43da22009-07-22 04:25:24 +0000209 <echo
david_williams8e4dc9c2008-07-06 08:08:58 +0000210 message="Running junits"/>
211 <!--
212 If there is not exactly one launcher in the stack, we'd best
213 fail fast, since we are not expecting that, and may indicate
214 an installation that would produce unpredictable results
david_williams403beae2007-12-09 02:10:40 +0000215 -->
david_williams8e4dc9c2008-07-06 08:08:58 +0000216 <!--
217 requires ant 1.7, and at this point, we're running 1.6 from
218 eclipse ... <condition property="expectedNumberOfLaunchers">
219 <resourcecount when="equal" count="1" > <fileset
220 dir="${testRoot}/eclipse/plugins"> <include
221 name="org.eclipse.equinox.launcher_*.jar" /> </fileset>
222 </resourcecount> </condition> <fail message="Did not find
223 expected number of launcher jars. Check installation."
224 unless="expectedNumberOfLaunchers" />
225 -->
226 <!--
david_williams904dc3f2009-11-24 13:41:49 +0000227 Remember: using dash 'debug' for org.eclipse.ant.core.antRunner
david_williams8e4dc9c2008-07-06 08:08:58 +0000228 produces ant debug info to be output ... which is a TON of
david_williams904dc3f2009-11-24 13:41:49 +0000229 stuff. Even 'verbose' is a bit too much.
david_williams403beae2007-12-09 02:10:40 +0000230 -->
david_williams082b91e2009-11-23 04:19:20 +0000231 <echo
232 message="eclipse.launcher: ${eclipse.launcher}"/>
david_williams403beae2007-12-09 02:10:40 +0000233 <java
234 taskname="unit-test-masterprocess"
235 fork="true"
236 resultProperty="wtpmasterjunitresult"
237 failonerror="false"
238 timeout="${testTimeLimit}"
239 dir="${testRoot}/eclipse"
david_williamsdbd9d832009-01-13 06:37:49 +0000240 jvm="${env.JAVA_6_HOME}/bin/java"
david_williams403beae2007-12-09 02:10:40 +0000241 classname="org.eclipse.equinox.launcher.Main">
242 <classpath>
david_williamsad2097e2008-01-28 06:06:12 +0000243 <fileset
244 dir="${testRoot}/eclipse/plugins">
245 <include
david_williams8e4dc9c2008-07-06 08:08:58 +0000246 name="org.eclipse.equinox.launcher_*.jar"/>
david_williams403beae2007-12-09 02:10:40 +0000247 </fileset>
248 </classpath>
david_williamsad2097e2008-01-28 06:06:12 +0000249 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000250 value="-Dosgi.ws=${env.BASEWS}"/>
david_williamsad2097e2008-01-28 06:06:12 +0000251 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000252 value="-Dosgi.os=${env.BASEOS}"/>
david_williamsad2097e2008-01-28 06:06:12 +0000253 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000254 value="-Dosgi.arch=${env.BASEARCH}"/>
david_williamsad2097e2008-01-28 06:06:12 +0000255 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000256 value="-Dws=${env.BASEWS}"/>
david_williamsad2097e2008-01-28 06:06:12 +0000257 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000258 value="-Dos=${env.BASEOS}"/>
david_williamsad2097e2008-01-28 06:06:12 +0000259 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000260 value="-Darch=${env.BASEARCH}"/>
david_williamsad2097e2008-01-28 06:06:12 +0000261 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000262 value="-DbuildBranch=${buildBranch}"/>
david_williamsad2097e2008-01-28 06:06:12 +0000263 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000264 value="-DbuildType=${buildType}"/>
david_williamsad2097e2008-01-28 06:06:12 +0000265 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000266 value="-DbuildId=${buildId}"/>
david_williams26f3a5f2008-03-07 22:56:23 +0000267 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000268 value="-Dprojectname=${projectname}"/>
david_williamscf432b52008-05-13 04:58:34 +0000269 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000270 value="-Djava.io.tmpdir=${env.RECOMMENDED_TMP_DIR}"/>
david_williamscc431c02009-11-16 20:28:50 +0000271 <jvmarg
david_williamsdb9eed92009-11-18 20:03:49 +0000272 value="${testBundleParam}"/>
david_williams2f43da22009-07-22 04:25:24 +0000273 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000274 value="-nosplash"/>
david_williamsad2097e2008-01-28 06:06:12 +0000275 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000276 value="-consolelog"/>
david_williamsad2097e2008-01-28 06:06:12 +0000277 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000278 value="-data"/>
david_williamsad2097e2008-01-28 06:06:12 +0000279 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000280 value="${testRoot}/overallTestWorkspace"/>
david_williamsad2097e2008-01-28 06:06:12 +0000281 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000282 value="-application"/>
david_williamsad2097e2008-01-28 06:06:12 +0000283 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000284 value="org.eclipse.ant.core.antRunner"/>
david_williamsad2097e2008-01-28 06:06:12 +0000285 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000286 value="-logger"/>
david_williamsad2097e2008-01-28 06:06:12 +0000287 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000288 value="org.apache.tools.ant.DefaultLogger"/>
david_williams2f43da22009-07-22 04:25:24 +0000289 <arg
290 value="-file"/>
291 <arg
292 value="${testRoot}/test.xml"/>
293 <arg
294 value="${testTarget}"/>
295
296 <!-- make sure our forked env has a DISPLAY -->
david_williams403beae2007-12-09 02:10:40 +0000297 <env
298 key="DISPLAY"
david_williams8e4dc9c2008-07-06 08:08:58 +0000299 value="${env.DISPLAY}"/>
david_williams403beae2007-12-09 02:10:40 +0000300 <redirector
301 output="${testRoot}/results/fullOutput.txt"
david_williams8e4dc9c2008-07-06 08:08:58 +0000302 error="${testRoot}/results/fullErrorLog.txt"/>
david_williams2f43da22009-07-22 04:25:24 +0000303 <jvmarg
304 value="-Dbuild.home=${env.BUILD_HOME}"/>
305 <jvmarg
306 value="-DbuildDirectory=${buildDirectory}"/>
307 <jvmarg
308 value="-DbuildLabel=${buildLabel}"/>
309 <jvmarg
310 value="-DbaseLocation=${baseLocation}"/>
311 <jvmarg
312 value="-DtestRoot=${testRoot}"/>
313 <jvmarg
314 value="-DtestDir=${testRoot}"/>
315 <jvmarg
david_williams2f43da22009-07-22 04:25:24 +0000316 value="-DeclipseBuilderDirectory=${pde.builder.path}"/>
david_williams508f8602009-08-04 06:31:37 +0000317 <!-- IBM_JAVA_OPTIONS contains JIT work arounds for bug 284441 -->
318 <env
319 key="IBM_JAVA_OPTIONS"
david_williamsa41839a2009-08-05 08:06:51 +0000320 value="-Xjit:{org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizer.primGetNextToken()Ljava/lang/String;}(disableLookahead),{org/eclipse/jst/jsp/core/internal/parser/internal/JSPTokenizer.primGetNextToken()Ljava/lang/String;}(disableLookahead)"/>
david_williams403beae2007-12-09 02:10:40 +0000321 </java>
david_williamsad2097e2008-01-28 06:06:12 +0000322 <echo
david_williams8e4dc9c2008-07-06 08:08:58 +0000323 message="wtpmasterjunitresult ${wtpmasterjunitresult}"/>
david_williams403beae2007-12-09 02:10:40 +0000324 </target>
david_williamsad2097e2008-01-28 06:06:12 +0000325 <target
326 name="postRunTestEclipse">
david_williams403beae2007-12-09 02:10:40 +0000327 <copy
328 todir="${buildDirectory}/${buildLabel}/testResults/consolelogs/testLogs"
329 overwrite="true"
330 failonerror="false">
david_williamsad2097e2008-01-28 06:06:12 +0000331 <fileset
332 dir="${testRoot}/results">
333 <include
david_williams8e4dc9c2008-07-06 08:08:58 +0000334 name="*output.txt"/>
david_williams403beae2007-12-09 02:10:40 +0000335 </fileset>
336 </copy>
337 <copy
338 todir="${buildDirectory}/${buildLabel}/testResults/consolelogs/testSysErrorLogs"
339 overwrite="true"
340 failonerror="false">
david_williamsad2097e2008-01-28 06:06:12 +0000341 <fileset
342 dir="${testRoot}/results">
343 <include
david_williams8e4dc9c2008-07-06 08:08:58 +0000344 name="*error.txt"/>
david_williams403beae2007-12-09 02:10:40 +0000345 </fileset>
346 </copy>
347 <copy
348 file="${testRoot}/results/fullOutput.txt"
349 toDir="${buildDirectory}/${buildLabel}/testResults/consolelogs/full"
350 overwrite="true"
351 failonerror="false">
352 </copy>
353 <copy
354 file="${testRoot}/results/fullErrorLog.txt"
355 toDir="${buildDirectory}/${buildLabel}/testResults/consolelogs/full"
356 overwrite="true"
357 failonerror="false">
358 </copy>
david_williams403beae2007-12-09 02:10:40 +0000359 <copy
360 todir="${buildDirectory}/${buildLabel}/testResults/xml"
361 overwrite="true"
362 failonerror="false">
david_williamsad2097e2008-01-28 06:06:12 +0000363 <fileset
364 dir="${testRoot}/results/xml">
365 <include
david_williams8e4dc9c2008-07-06 08:08:58 +0000366 name="*.xml"/>
david_williams403beae2007-12-09 02:10:40 +0000367 </fileset>
368 </copy>
369 <copy
370 todir="${buildDirectory}/${buildLabel}/testResults/html"
371 overwrite="true"
372 failonerror="false">
david_williamsad2097e2008-01-28 06:06:12 +0000373 <fileset
374 dir="${testRoot}/results/html">
375 <include
david_williams8e4dc9c2008-07-06 08:08:58 +0000376 name="*.html"/>
david_williams403beae2007-12-09 02:10:40 +0000377 </fileset>
378 </copy>
379 </target>
david_williamsad2097e2008-01-28 06:06:12 +0000380</project>