build.xml (96b3c68e) build.xml (e90ed1f0)
1<?xml version="1.0"?>
2<!--***********************************************************
3 *
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the

--- 130 unchanged lines hidden (view full) ---

139 <target name="dist">
140 <tstamp />
141 <property name="dist.archive" value="aoo_test_${DSTAMP}.zip" />
142 <zip destfile="${dist}/${dist.archive}" basedir="." update="true" includes="testcommon/**,testgui/**,testuno/**,build.xml,build.example.properties,external/**,reportstyle/**" excludes="**/bin/**">
143 </zip>
144 </target>
145
146 <target name="check.build" description="Check the build context">
1<?xml version="1.0"?>
2<!--***********************************************************
3 *
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the

--- 130 unchanged lines hidden (view full) ---

139 <target name="dist">
140 <tstamp />
141 <property name="dist.archive" value="aoo_test_${DSTAMP}.zip" />
142 <zip destfile="${dist}/${dist.archive}" basedir="." update="true" includes="testcommon/**,testgui/**,testuno/**,build.xml,build.example.properties,external/**,reportstyle/**" excludes="**/bin/**">
143 </zip>
144 </target>
145
146 <target name="check.build" description="Check the build context">
147 <condition property="openoffice.archive.dir" value="${env.SRC_ROOT}/instsetoo_native/${env.INPATH}/OpenOffice/archive/install/en-US">
147 <condition property="openoffice.pack.dir" value="${env.SRC_ROOT}/instsetoo_native/${env.INPATH}/OpenOffice/archive/install/en-US">
148 <isset property="env.SRC_ROOT" />
149 </condition>
148 <isset property="env.SRC_ROOT" />
149 </condition>
150 <condition property="openoffice.build" value="localbuild">
151 <isset property="openoffice.archive.dir" />
152 </condition>
153 <condition property="find.build.skip">
154 <or>
150 <condition property="find.build.skip">
151 <or>
155 <isset property="openoffice.build" />
156 <isset property="openoffice.archive.url" />
157 <isset property="openoffice.archive.dir" />
152 <isset property="openoffice.pack.url" />
153 <isset property="openoffice.pack.dir" />
158 <isset property="openoffice.home" />
159 </or>
160 </condition>
161 <condition property="download.build.skip">
162 <or>
154 <isset property="openoffice.home" />
155 </or>
156 </condition>
157 <condition property="download.build.skip">
158 <or>
163 <isset property="openoffice.archive.dir" />
159 <isset property="openoffice.pack.dir" />
164 <isset property="openoffice.home" />
165 </or>
166 </condition>
167 <condition property="install.build.skip">
160 <isset property="openoffice.home" />
161 </or>
162 </condition>
163 <condition property="install.build.skip">
168 <or>
169 <isset property="openoffice.home" />
170 <not>
171 <isset property="openoffice.archive.dir" />
172 </not>
173 </or>
164 <isset property="openoffice.home" />
174 </condition>
175 </target>
176
177 <target name="find.build" unless="find.build.skip" description="Find the newest build on the remote server">
178 <loadresource property="openoffice.build">
179 <url url="${openoffice.build.url}" />
180 <filterchain>
181 <deletecharacters chars=" \t\r\n" />
182 </filterchain>
183 </loadresource>
165 </condition>
166 </target>
167
168 <target name="find.build" unless="find.build.skip" description="Find the newest build on the remote server">
169 <loadresource property="openoffice.build">
170 <url url="${openoffice.build.url}" />
171 <filterchain>
172 <deletecharacters chars=" \t\r\n" />
173 </filterchain>
174 </loadresource>
184 <echo>Latest build: ${openoffice.build}</echo>
175
176 <echo message="openoffice.pack.url=${openoffice.archive.url}" file="${testspace}/.temp.properties" />
177 <property file="${testspace}/.temp.properties"/>
178 <property name="openoffice.build.name" value="${openoffice.build}" />
179 <echo>#OpenOffice Build Name: ${openoffice.build.name}</echo>
180 <echo>#OpenOffice Package URL: ${openoffice.pack.url}</echo>
185 </target>
186
181 </target>
182
183 <target name="download" unless="${skip}">
184 <delete dir="${dest}" />
185 <mkdir dir="${dest}" />
186 <get src="${src}" dest="${dest}" verbose="false" usetimestamp="true" skipexisting="true" />
187 </target>
188
187 <target name="download.build" unless="download.build.skip" description="Download the specified build from the remote server">
189 <target name="download.build" unless="download.build.skip" description="Download the specified build from the remote server">
188 <echo message="openoffice.archive.url.resolved=${openoffice.archive.url}" file="${testspace}/.temp.properties" />
189 <property file="${testspace}/.temp.properties"/>
190 <echo>Archive address: ${openoffice.archive.url.resolved}</echo>
191 <property name="openoffice.archive.dir" value="${testspace}/download/${openoffice.build}" />
192 <mkdir dir="${openoffice.archive.dir}" />
193 <get src="${openoffice.archive.url.resolved}" dest="${openoffice.archive.dir}" verbose="false" usetimestamp="true" skipexisting="true" />
190 <property name="openoffice.pack.dir" value="${testspace}/download" />
191 <property name="openoffice.pack.download.mark" value="${testspace}/download/url.txt"/>
192 <loadfile property="openoffice.pack.download.url" srcFile="${openoffice.pack.download.mark}" quiet="true" failonerror="false"/>
193 <condition property="download.build.skip" value="true" else="false">
194 <equals arg1="${openoffice.pack.download.url}" arg2="${openoffice.pack.url}"/>
195 </condition>
196
197 <echo>#Build is Downloaded: ${download.build.skip}</echo>
198 <antcall target="download" inheritAll="false">
199 <param name="skip" value="${download.build.skip}"/>
200 <param name="src" value="${openoffice.pack.url}"/>
201 <param name="dest" value="${openoffice.pack.dir}"/>
202 </antcall>
203 <!--
204 <get src="${openoffice.pack.url}" dest="${openoffice.pack.dir}" verbose="false" usetimestamp="true" skipexisting="true" />
205 -->
206 <echo message="${openoffice.pack.url}" file="${openoffice.pack.download.mark}" />
207 <echo>#OpenOffice Package Dir: ${openoffice.pack.dir}</echo>
194 </target>
195
196 <target name="install.build" unless="install.build.skip" description="Install the build to the local">
208 </target>
209
210 <target name="install.build" unless="install.build.skip" description="Install the build to the local">
197 <property name="openoffice.installation.dir" value="${testspace}/install/${openoffice.build}" />
198 <property name="openoffice.installation.dest" value="${testspace}/install/dest" />
199 <delete dir="${openoffice.installation.dest}"/>
200 <mkdir dir="${openoffice.installation.dest}" />
201 <unzip dest="${openoffice.installation.dest}">
202 <fileset dir="${openoffice.archive.dir}">
211 <property name="openoffice.install.dir" value="${testspace}/install/aoo" />
212 <property name="openoffice.install.temp" value="${testspace}/install/temp" />
213 <delete dir="${openoffice.install.temp}"/>
214 <mkdir dir="${openoffice.install.temp}" />
215 <unzip dest="${openoffice.install.temp}">
216 <fileset dir="${openoffice.pack.dir}">
203 <include name="**/Apache_OpenOffice*.zip" />
204 </fileset>
205 </unzip>
206 <pathconvert property="gz.files" pathsep=" " setonempty="false">
207 <path>
217 <include name="**/Apache_OpenOffice*.zip" />
218 </fileset>
219 </unzip>
220 <pathconvert property="gz.files" pathsep=" " setonempty="false">
221 <path>
208 <fileset dir="${openoffice.archive.dir}" includes="Apache_OpenOffice*.gz" />
222 <fileset dir="${openoffice.pack.dir}" includes="Apache_OpenOffice*.gz" />
209 </path>
210 </pathconvert>
223 </path>
224 </pathconvert>
211 <exec dir="${openoffice.installation.dest}" executable="tar" failifexecutionfails="false">
225 <exec dir="${openoffice.install.temp}" executable="tar" failifexecutionfails="false">
212 <arg line="-zxpf ${gz.files}" />
213 </exec>
226 <arg line="-zxpf ${gz.files}" />
227 </exec>
214
215 <pathconvert property="openoffice.12.dir" pathsep=" " setonempty="false">
228 <pathconvert property="openoffice.root.dir" pathsep=" " setonempty="false">
216 <path>
229 <path>
217 <dirset dir="${openoffice.installation.dest}">
230 <dirset dir="${openoffice.install.temp}">
218 <include name="*"/>
219 </dirset>
220 </path>
221 </pathconvert>
231 <include name="*"/>
232 </dirset>
233 </path>
234 </pathconvert>
222
223 <move file="${openoffice.12.dir}" tofile="${openoffice.installation.dir}"/>
224 <delete dir="${openoffice.installation.dest}"/>
225
235 <delete dir="${openoffice.install.dir}"/>
236 <move file="${openoffice.root.dir}" tofile="${openoffice.install.dir}"/>
237 <delete dir="${openoffice.install.temp}"/>
226 <pathconvert property="openoffice.bin" pathsep=" " setonempty="false">
227 <path>
238 <pathconvert property="openoffice.bin" pathsep=" " setonempty="false">
239 <path>
228 <fileset dir="${openoffice.installation.dir}" includes="**/*/soffice.bin" followsymlinks="false" />
240 <fileset dir="${openoffice.install.dir}" includes="**/*/soffice.bin" followsymlinks="false" />
229 </path>
230 </pathconvert>
231 <dirname property="openoffice.bin.parent" file="${openoffice.bin}" />
232 <property name="openoffice.home" location="${openoffice.bin.parent}/../" />
233 <fail unless="openoffice.home" />
241 </path>
242 </pathconvert>
243 <dirname property="openoffice.bin.parent" file="${openoffice.bin}" />
244 <property name="openoffice.home" location="${openoffice.bin.parent}/../" />
245 <fail unless="openoffice.home" />
234 <echo>Openoffice is installed to ${openoffice.home}</echo>
246 <echo>#Openoffice Home: ${openoffice.home}</echo>
235 </target>
236
247 </target>
248
237 <target name="run.test" depends="compile" description="Run junit">
249 <target name="run.test" depends="compile, detect.testenv" description="Run junit">
238 <tstamp>
239 <format property="output.stamp" pattern="yyMMdd.hhmm" />
240 </tstamp>
241
242 <move file="${test.output}" tofile="${test.output}.${output.stamp}" failonerror="false" />
243 <mkdir dir="${test.result}" />
244 <mkdir dir="${test.report}" />
245 <mkdir dir="${test.output}/temp" />

--- 11 unchanged lines hidden (view full) ---

257
258 <formatter type="xml" />
259 <classpath>
260 <pathelement location="${classes}" />
261 <path refid="junit.classpath"/>
262 <path refid="uno.classpath"/>
263 </classpath>
264 </junit>
250 <tstamp>
251 <format property="output.stamp" pattern="yyMMdd.hhmm" />
252 </tstamp>
253
254 <move file="${test.output}" tofile="${test.output}.${output.stamp}" failonerror="false" />
255 <mkdir dir="${test.result}" />
256 <mkdir dir="${test.report}" />
257 <mkdir dir="${test.output}/temp" />

--- 11 unchanged lines hidden (view full) ---

269
270 <formatter type="xml" />
271 <classpath>
272 <pathelement location="${classes}" />
273 <path refid="junit.classpath"/>
274 <path refid="uno.classpath"/>
275 </classpath>
276 </junit>
265 <property file="${openoffice.home}/program/versionrc" prefix="openoffice"/>
266 <property file="${openoffice.home}/program/version.ini" prefix="openoffice"/>
277
267 <junitreport todir="${test.report}">
268 <fileset dir="${test.result}">
269 <include name="TEST-*.xml" />
270 </fileset>
271 <report format="frames" styledir="${junit.style.dir}" todir="${test.report}">
278 <junitreport todir="${test.report}">
279 <fileset dir="${test.result}">
280 <include name="TEST-*.xml" />
281 </fileset>
282 <report format="frames" styledir="${junit.style.dir}" todir="${test.report}">
272 <param name="TITLE" expression="Test Build: AOO${openoffice.buildid}.r${openoffice.Revision}, OS: ${os.name}-${os.version}-${os.arch}"/>
283 <param name="TITLE" expression="${test.name}: ${openoffice.build.name}, ${test.os.name}-${test.os.version}-${test.os.arch}"/>
273 </report>
274 </junitreport>
275 <property name="test.report.index" location="${test.report}/index.html" />
276 <echo>Open ${test.report.index} in browser to view the test report.</echo>
277 </target>
278
279 <target name="test" depends="check.build,find.build,download.build,install.build,run.test" description="Run testing on the specified build. The build is automatically downloaded and installed according to the context.">
280 <fail message="Test Failed" if="test.failed" />
281 </target>
284 </report>
285 </junitreport>
286 <property name="test.report.index" location="${test.report}/index.html" />
287 <echo>Open ${test.report.index} in browser to view the test report.</echo>
288 </target>
289
290 <target name="test" depends="check.build,find.build,download.build,install.build,run.test" description="Run testing on the specified build. The build is automatically downloaded and installed according to the context.">
291 <fail message="Test Failed" if="test.failed" />
292 </target>
282
283 <target name="detect.testenv" unless="report.test.skip">
293
294 <target name="detect.testenv">
284 <exec outputproperty="test.os.name" executable="lsb_release" failifexecutionfails="false" os="Linux">
285 <arg line="-is" />
286 </exec>
287 <exec outputproperty="test.os.version" executable="lsb_release" failifexecutionfails="false" os="Linux">
288 <arg line="-rs" />
289 </exec>
290 <property name="test.os.name" value="${os.name}" />
291 <property name="test.os.version" value="${os.version}" />
292 <property name="test.os.arch" value="${os.arch}" />
293 <echo>${test.os.name}-${test.os.version}-${test.os.arch}</echo>
295 <exec outputproperty="test.os.name" executable="lsb_release" failifexecutionfails="false" os="Linux">
296 <arg line="-is" />
297 </exec>
298 <exec outputproperty="test.os.version" executable="lsb_release" failifexecutionfails="false" os="Linux">
299 <arg line="-rs" />
300 </exec>
301 <property name="test.os.name" value="${os.name}" />
302 <property name="test.os.version" value="${os.version}" />
303 <property name="test.os.arch" value="${os.arch}" />
304 <echo>${test.os.name}-${test.os.version}-${test.os.arch}</echo>
305 <property file="${openoffice.home}/program/versionrc" prefix="openoffice"/>
306 <property file="${openoffice.home}/program/version.ini" prefix="openoffice"/>
307 <property name="openoffice.build.name" value=""/>
294 </target>
295
296
297 <target name="report.test" unless="report.test.skip" description="Upload the testing result to report repository." depends="detect.testenv">
308 </target>
309
310
311 <target name="report.test" unless="report.test.skip" description="Upload the testing result to report repository." depends="detect.testenv">
298 <property name="report.to" value="r${openoffice.Revision}/${test.name}/${test.os.name}-${test.os.version}-${test.os.arch}" />
312 <property name="report.to" value="${openoffice.build.name}/${test.name}/${test.os.name}-${test.os.version}-${test.os.arch}" />
299 <echo>Uploading report to ${report.repos}/${report.to}</echo>
300 <property name="report.to.temp" location="${testspace}/.temp.ouput"/>
301 <delete dir="${report.to.temp}" deleteonexit="true"/>
302 <copy todir="${report.to.temp}/${report.to}">
303 <fileset dir="${test.output}" />
304 </copy>
305 <scp todir="${report.repos}" trust="true">
306 <fileset dir="${report.to.temp}"/>

--- 20 unchanged lines hidden ---
313 <echo>Uploading report to ${report.repos}/${report.to}</echo>
314 <property name="report.to.temp" location="${testspace}/.temp.ouput"/>
315 <delete dir="${report.to.temp}" deleteonexit="true"/>
316 <copy todir="${report.to.temp}/${report.to}">
317 <fileset dir="${test.output}" />
318 </copy>
319 <scp todir="${report.repos}" trust="true">
320 <fileset dir="${report.to.temp}"/>

--- 20 unchanged lines hidden ---