1faa4b864SLei De Bin<?xml version="1.0"?> 27acce70dSLiu Zhe<!--*********************************************************** 37acce70dSLiu Zhe * 47acce70dSLiu Zhe * Licensed to the Apache Software Foundation (ASF) under one 57acce70dSLiu Zhe * or more contributor license agreements. See the NOTICE file 67acce70dSLiu Zhe * distributed with this work for additional information 77acce70dSLiu Zhe * regarding copyright ownership. The ASF licenses this file 87acce70dSLiu Zhe * to you under the Apache License, Version 2.0 (the 97acce70dSLiu Zhe * "License"); you may not use this file except in compliance 107acce70dSLiu Zhe * with the License. You may obtain a copy of the License at 117acce70dSLiu Zhe * 127acce70dSLiu Zhe * http://www.apache.org/licenses/LICENSE-2.0 137acce70dSLiu Zhe * 147acce70dSLiu Zhe * Unless required by applicable law or agreed to in writing, 157acce70dSLiu Zhe * software distributed under the License is distributed on an 167acce70dSLiu Zhe * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 177acce70dSLiu Zhe * KIND, either express or implied. See the License for the 187acce70dSLiu Zhe * specific language governing permissions and limitations 197acce70dSLiu Zhe * under the License. 207acce70dSLiu Zhe * 217acce70dSLiu Zhe ***********************************************************--> 22b164ae3eSLei De Bin 23b164ae3eSLei De Bin 24faa4b864SLei De Bin 25faa4b864SLei De Bin<project basedir="." default="test"> 2609c344eeSLiu Zhe <property environment="env" /> 2709c344eeSLiu Zhe <property file="build.properties" /> 2809c344eeSLiu Zhe <property name="env.DISPLAY" value=":0.0"/> 29*b4d2d410SLiu Zhe <property name="env.TESTSPACE" value="testspace" /> 3009c344eeSLiu Zhe <property name="env.JUNIT_HOME" value="external/junit" /> 31faa4b864SLei De Bin <property name="junit.home" value="${env.JUNIT_HOME}" /> 32faa4b864SLei De Bin <property name="testspace" value="${env.TESTSPACE}" /> 3309c344eeSLiu Zhe <property name="classes" value="${testspace}/class" /> 34*b4d2d410SLiu Zhe <property name="dist" value="${testspace}" /> 35d7740c70SLiu Zhe <property name="test.name" value="BVT" /> 36de586eddSLiu Zhe <property name="test.classes" value="testcase/gui/bvt/*.class" /> 37faa4b864SLei De Bin <property name="test.output" value="${testspace}/output" /> 38faa4b864SLei De Bin <property name="test.result" value="${test.output}/result" /> 39faa4b864SLei De Bin <property name="test.report" value="${test.output}/report" /> 400e2e75f4SLiu Zhe <property name="junit.style.dir" value="reportstyle" /> 417dd2b5bbSLiu Zhe 420e2e75f4SLiu Zhe <path id="junit.classpath"> 43faa4b864SLei De Bin <fileset dir="${junit.home}" erroronmissingdir="false"> 44faa4b864SLei De Bin <include name="*.jar" /> 45faa4b864SLei De Bin </fileset> 46faa4b864SLei De Bin </path> 47*b4d2d410SLiu Zhe 48*b4d2d410SLiu Zhe <target name="upgrade"> 49*b4d2d410SLiu Zhe <property name="upgrade.script" location="${java.io.tmpdir}/aoo_test_upgrade.xml"/> 50*b4d2d410SLiu Zhe <property name="upgrade.to" location="."/> 51*b4d2d410SLiu Zhe <copy file="build.xml" tofile="${upgrade.script}"/> 52*b4d2d410SLiu Zhe <condition property="ant.executable" value="ant.bat"> 53*b4d2d410SLiu Zhe <os family="windows" /> 54*b4d2d410SLiu Zhe </condition> 55*b4d2d410SLiu Zhe <property name="ant.executable" value="ant"/> 56*b4d2d410SLiu Zhe <exec executable="${ant.executable}" spawn="true"> 57*b4d2d410SLiu Zhe <arg value="-Dupgrade.to=${upgrade.to}"/> 58*b4d2d410SLiu Zhe <arg value="-f"/> 59*b4d2d410SLiu Zhe <arg value="${upgrade.script}"/> 60*b4d2d410SLiu Zhe <arg value="upgrade.run"/> 61*b4d2d410SLiu Zhe </exec> 62*b4d2d410SLiu Zhe </target> 63faa4b864SLei De Bin 64*b4d2d410SLiu Zhe <target name="upgrade.run"> 65*b4d2d410SLiu Zhe <property name="testpack.url" value="http://9.123.117.85/testpack/trunk/aoo_test.zip"/> 66*b4d2d410SLiu Zhe <property name="testack.temp" location="${java.io.tmpdir}/aoo_test.zip"/> 67*b4d2d410SLiu Zhe <get src="${testpack.url}" dest="${testack.temp}"/> 68*b4d2d410SLiu Zhe <delete dir="${upgrade.to}" failonerror="false"/> 69*b4d2d410SLiu Zhe <mkdir dir="${upgrade.to}"/> 70*b4d2d410SLiu Zhe <unzip src="${testack.temp}" dest="${upgrade.to}"/> 71*b4d2d410SLiu Zhe </target> 72*b4d2d410SLiu Zhe 73*b4d2d410SLiu Zhe <target name="testcommon.init"> 74faa4b864SLei De Bin <mkdir dir="${classes}" /> 75faa4b864SLei De Bin <copy includeemptydirs="false" todir="${classes}"> 760e2e75f4SLiu Zhe <fileset dir="testcommon/source"> 77faa4b864SLei De Bin <exclude name="**/*.java" /> 78faa4b864SLei De Bin </fileset> 79faa4b864SLei De Bin </copy> 80faa4b864SLei De Bin </target> 81faa4b864SLei De Bin 8222a14f28SLiu Zhe <target name="testcommon.compile" depends="testcommon.init, prepare.junit"> 836b55ece7SLiu Zhe <javac destdir="${classes}" debug="on" source="1.6" encoding="utf-8" includeantruntime="false"> 840e2e75f4SLiu Zhe <src path="testcommon/source"/> 8522a14f28SLiu Zhe <classpath> 8622a14f28SLiu Zhe <path refid="junit.classpath"/> 8722a14f28SLiu Zhe </classpath> 880e2e75f4SLiu Zhe </javac> 89faa4b864SLei De Bin </target> 90faa4b864SLei De Bin 910e2e75f4SLiu Zhe <target name="testgui.init"> 920e2e75f4SLiu Zhe <mkdir dir="${classes}" /> 930e2e75f4SLiu Zhe <copy includeemptydirs="false" todir="${classes}"> 940e2e75f4SLiu Zhe <fileset dir="testgui/source"> 950e2e75f4SLiu Zhe <exclude name="**/*.java" /> 960e2e75f4SLiu Zhe </fileset> 970e2e75f4SLiu Zhe </copy> 98faa4b864SLei De Bin </target> 99faa4b864SLei De Bin 1000e2e75f4SLiu Zhe <target name="testgui.compile" depends="testgui.init, prepare.junit"> 1016b55ece7SLiu Zhe <javac destdir="${classes}" debug="on" source="1.6" encoding="utf-8" includeantruntime="false"> 1020e2e75f4SLiu Zhe <src path="testgui/source"/> 1037acce70dSLiu Zhe <classpath> 1047acce70dSLiu Zhe <pathelement location="${classes}" /> 1057acce70dSLiu Zhe <path refid="junit.classpath"/> 1067acce70dSLiu Zhe </classpath> 1070e2e75f4SLiu Zhe </javac> 108faa4b864SLei De Bin </target> 109faa4b864SLei De Bin 1100e2e75f4SLiu Zhe <target name="testuno.init"> 1110e2e75f4SLiu Zhe <mkdir dir="${classes}" /> 1120e2e75f4SLiu Zhe <copy includeemptydirs="false" todir="${classes}"> 1130e2e75f4SLiu Zhe <fileset dir="testuno/source"> 1140e2e75f4SLiu Zhe <exclude name="**/*.java" /> 1150e2e75f4SLiu Zhe </fileset> 1160e2e75f4SLiu Zhe </copy> 117faa4b864SLei De Bin </target> 118faa4b864SLei De Bin 11922a14f28SLiu Zhe <target name="testuno.compile" depends="testuno.init"> 1207acce70dSLiu Zhe <path id="uno.classpath"> 1212d64174bSLiu Zhe <fileset dir="${openoffice.home}" erroronmissingdir="false"> 1227acce70dSLiu Zhe <include name="**/juh.jar" /> 1237acce70dSLiu Zhe <include name="**/unoil.jar" /> 1247acce70dSLiu Zhe <include name="**/ridl.jar" /> 1257acce70dSLiu Zhe <include name="**/jurt.jar" /> 1267acce70dSLiu Zhe </fileset> 1277acce70dSLiu Zhe </path> 1286b55ece7SLiu Zhe <javac destdir="${classes}" debug="on" source="1.6" encoding="utf-8" includeantruntime="false"> 1290e2e75f4SLiu Zhe <src path="testuno/source"/> 1307acce70dSLiu Zhe <classpath> 1317acce70dSLiu Zhe <pathelement location="${classes}" /> 1327acce70dSLiu Zhe <path refid="junit.classpath"/> 1337acce70dSLiu Zhe <path refid="uno.classpath"/> 1347acce70dSLiu Zhe </classpath> 1350e2e75f4SLiu Zhe </javac> 136faa4b864SLei De Bin </target> 137faa4b864SLei De Bin 1380e2e75f4SLiu Zhe <target name="clean" description="Clean all output"> 13909c344eeSLiu Zhe <delete dir="${testspace}" /> 1400e2e75f4SLiu Zhe </target> 1410e2e75f4SLiu Zhe 1420e2e75f4SLiu Zhe <target name="check.junit"> 1430e2e75f4SLiu Zhe <available file="junit.jar" property="junit.jar.exists"> 1440e2e75f4SLiu Zhe <filepath refid="junit.classpath" /> 1450e2e75f4SLiu Zhe </available> 1460e2e75f4SLiu Zhe </target> 1470e2e75f4SLiu Zhe 1480e2e75f4SLiu Zhe <target name="prepare.junit" depends="check.junit" unless="junit.jar.exists"> 1490e2e75f4SLiu Zhe <property name="junit.jar.repos" value="http://repo1.maven.org/maven2/junit/junit/4.10/junit-4.10.jar" /> 1500e2e75f4SLiu Zhe <mkdir dir="${junit.home}" /> 1510e2e75f4SLiu Zhe <get src="${junit.jar.repos}" dest="${junit.home}/junit.jar" skipexisting="true" /> 1520e2e75f4SLiu Zhe </target> 1530e2e75f4SLiu Zhe 1540e2e75f4SLiu Zhe <target name="compile" depends="testcommon.init, testcommon.compile, testgui.init, testgui.compile, testuno.init, testuno.compile" description="Compile source code"> 155faa4b864SLei De Bin </target> 156faa4b864SLei De Bin 15722a14f28SLiu Zhe <target name="dist"> 158faa4b864SLei De Bin <tstamp /> 159*b4d2d410SLiu Zhe <tstamp> 160*b4d2d410SLiu Zhe <format property="testpack.version" pattern="yyyyMMddhhmmss"/> 161*b4d2d410SLiu Zhe </tstamp> 162*b4d2d410SLiu Zhe <property name="dist.archive" value="aoo_test_${DSTAMP}.zip" /> 163*b4d2d410SLiu Zhe <echo file="${testpack.version}">${testpack.version}</echo> 164*b4d2d410SLiu Zhe <zip destfile="${dist}/${dist.archive}" basedir="." update="false" excludes="testspace/**,testassistant/**,testassistant.feature/**,**/bin/**"> 16522a14f28SLiu Zhe </zip> 166*b4d2d410SLiu Zhe <delete file="${testpack.version}"/> 167faa4b864SLei De Bin </target> 168faa4b864SLei De Bin 169faa4b864SLei De Bin <target name="check.build" description="Check the build context"> 170e90ed1f0SLiu Zhe <condition property="openoffice.pack.dir" value="${env.SRC_ROOT}/instsetoo_native/${env.INPATH}/OpenOffice/archive/install/en-US"> 1717acce70dSLiu Zhe <isset property="env.SRC_ROOT" /> 172faa4b864SLei De Bin </condition> 173faa4b864SLei De Bin <condition property="find.build.skip"> 174faa4b864SLei De Bin <or> 175e90ed1f0SLiu Zhe <isset property="openoffice.pack.url" /> 176e90ed1f0SLiu Zhe <isset property="openoffice.pack.dir" /> 177faa4b864SLei De Bin <isset property="openoffice.home" /> 178faa4b864SLei De Bin </or> 179faa4b864SLei De Bin </condition> 180faa4b864SLei De Bin <condition property="download.build.skip"> 181faa4b864SLei De Bin <or> 182e90ed1f0SLiu Zhe <isset property="openoffice.pack.dir" /> 183faa4b864SLei De Bin <isset property="openoffice.home" /> 184faa4b864SLei De Bin </or> 185faa4b864SLei De Bin </condition> 186faa4b864SLei De Bin <condition property="install.build.skip"> 187e90ed1f0SLiu Zhe <isset property="openoffice.home" /> 188faa4b864SLei De Bin </condition> 189faa4b864SLei De Bin </target> 190faa4b864SLei De Bin 191faa4b864SLei De Bin <target name="find.build" unless="find.build.skip" description="Find the newest build on the remote server"> 192faa4b864SLei De Bin <loadresource property="openoffice.build"> 193faa4b864SLei De Bin <url url="${openoffice.build.url}" /> 194faa4b864SLei De Bin <filterchain> 195faa4b864SLei De Bin <deletecharacters chars=" \t\r\n" /> 196faa4b864SLei De Bin </filterchain> 197faa4b864SLei De Bin </loadresource> 198e90ed1f0SLiu Zhe 199e90ed1f0SLiu Zhe <echo message="openoffice.pack.url=${openoffice.archive.url}" file="${testspace}/.temp.properties" /> 200e90ed1f0SLiu Zhe <property file="${testspace}/.temp.properties"/> 201e90ed1f0SLiu Zhe <property name="openoffice.build.name" value="${openoffice.build}" /> 202e90ed1f0SLiu Zhe <echo>#OpenOffice Build Name: ${openoffice.build.name}</echo> 203e90ed1f0SLiu Zhe <echo>#OpenOffice Package URL: ${openoffice.pack.url}</echo> 204faa4b864SLei De Bin </target> 205faa4b864SLei De Bin 206e90ed1f0SLiu Zhe <target name="download" unless="${skip}"> 207e90ed1f0SLiu Zhe <delete dir="${dest}" /> 208e90ed1f0SLiu Zhe <mkdir dir="${dest}" /> 209e90ed1f0SLiu Zhe <get src="${src}" dest="${dest}" verbose="false" usetimestamp="true" skipexisting="true" /> 210e90ed1f0SLiu Zhe </target> 211e90ed1f0SLiu Zhe 212faa4b864SLei De Bin <target name="download.build" unless="download.build.skip" description="Download the specified build from the remote server"> 213e90ed1f0SLiu Zhe <property name="openoffice.pack.dir" value="${testspace}/download" /> 214e90ed1f0SLiu Zhe <property name="openoffice.pack.download.mark" value="${testspace}/download/url.txt"/> 215e90ed1f0SLiu Zhe <loadfile property="openoffice.pack.download.url" srcFile="${openoffice.pack.download.mark}" quiet="true" failonerror="false"/> 216e90ed1f0SLiu Zhe <condition property="download.build.skip" value="true" else="false"> 217e90ed1f0SLiu Zhe <equals arg1="${openoffice.pack.download.url}" arg2="${openoffice.pack.url}"/> 218e90ed1f0SLiu Zhe </condition> 219e90ed1f0SLiu Zhe 220e90ed1f0SLiu Zhe <echo>#Build is Downloaded: ${download.build.skip}</echo> 221e90ed1f0SLiu Zhe <antcall target="download" inheritAll="false"> 222e90ed1f0SLiu Zhe <param name="skip" value="${download.build.skip}"/> 223e90ed1f0SLiu Zhe <param name="src" value="${openoffice.pack.url}"/> 224e90ed1f0SLiu Zhe <param name="dest" value="${openoffice.pack.dir}"/> 225e90ed1f0SLiu Zhe </antcall> 226e90ed1f0SLiu Zhe <!-- 227e90ed1f0SLiu Zhe <get src="${openoffice.pack.url}" dest="${openoffice.pack.dir}" verbose="false" usetimestamp="true" skipexisting="true" /> 228e90ed1f0SLiu Zhe --> 229e90ed1f0SLiu Zhe <echo message="${openoffice.pack.url}" file="${openoffice.pack.download.mark}" /> 230e90ed1f0SLiu Zhe <echo>#OpenOffice Package Dir: ${openoffice.pack.dir}</echo> 231faa4b864SLei De Bin </target> 232faa4b864SLei De Bin 233faa4b864SLei De Bin <target name="install.build" unless="install.build.skip" description="Install the build to the local"> 234e90ed1f0SLiu Zhe <property name="openoffice.install.dir" value="${testspace}/install/aoo" /> 235e90ed1f0SLiu Zhe <property name="openoffice.install.temp" value="${testspace}/install/temp" /> 236e90ed1f0SLiu Zhe <delete dir="${openoffice.install.temp}"/> 237e90ed1f0SLiu Zhe <mkdir dir="${openoffice.install.temp}" /> 238e90ed1f0SLiu Zhe <unzip dest="${openoffice.install.temp}"> 239e90ed1f0SLiu Zhe <fileset dir="${openoffice.pack.dir}"> 2407acce70dSLiu Zhe <include name="**/Apache_OpenOffice*.zip" /> 241faa4b864SLei De Bin </fileset> 242faa4b864SLei De Bin </unzip> 243faa4b864SLei De Bin <pathconvert property="gz.files" pathsep=" " setonempty="false"> 244faa4b864SLei De Bin <path> 245e90ed1f0SLiu Zhe <fileset dir="${openoffice.pack.dir}" includes="Apache_OpenOffice*.gz" /> 246faa4b864SLei De Bin </path> 247faa4b864SLei De Bin </pathconvert> 248e90ed1f0SLiu Zhe <exec dir="${openoffice.install.temp}" executable="tar" failifexecutionfails="false"> 249d7740c70SLiu Zhe <arg line="-zxpf ${gz.files}" /> 250faa4b864SLei De Bin </exec> 251e90ed1f0SLiu Zhe <pathconvert property="openoffice.root.dir" pathsep=" " setonempty="false"> 25209c344eeSLiu Zhe <path> 253e90ed1f0SLiu Zhe <dirset dir="${openoffice.install.temp}"> 25409c344eeSLiu Zhe <include name="*"/> 25509c344eeSLiu Zhe </dirset> 25609c344eeSLiu Zhe </path> 25709c344eeSLiu Zhe </pathconvert> 258e90ed1f0SLiu Zhe <delete dir="${openoffice.install.dir}"/> 259e90ed1f0SLiu Zhe <move file="${openoffice.root.dir}" tofile="${openoffice.install.dir}"/> 260e90ed1f0SLiu Zhe <delete dir="${openoffice.install.temp}"/> 261faa4b864SLei De Bin <pathconvert property="openoffice.bin" pathsep=" " setonempty="false"> 262faa4b864SLei De Bin <path> 263e90ed1f0SLiu Zhe <fileset dir="${openoffice.install.dir}" includes="**/*/soffice.bin" followsymlinks="false" /> 264faa4b864SLei De Bin </path> 265faa4b864SLei De Bin </pathconvert> 2662d64174bSLiu Zhe <dirname property="openoffice.bin.parent" file="${openoffice.bin}" /> 2672d64174bSLiu Zhe <property name="openoffice.home" location="${openoffice.bin.parent}/../" /> 268faa4b864SLei De Bin <fail unless="openoffice.home" /> 269e90ed1f0SLiu Zhe <echo>#Openoffice Home: ${openoffice.home}</echo> 270faa4b864SLei De Bin </target> 271faa4b864SLei De Bin 272e90ed1f0SLiu Zhe <target name="run.test" depends="compile, detect.testenv" description="Run junit"> 273faa4b864SLei De Bin <tstamp> 274faa4b864SLei De Bin <format property="output.stamp" pattern="yyMMdd.hhmm" /> 275faa4b864SLei De Bin </tstamp> 276faa4b864SLei De Bin 277faa4b864SLei De Bin <move file="${test.output}" tofile="${test.output}.${output.stamp}" failonerror="false" /> 278faa4b864SLei De Bin <mkdir dir="${test.result}" /> 279faa4b864SLei De Bin <mkdir dir="${test.report}" /> 280faa4b864SLei De Bin <mkdir dir="${test.output}/temp" /> 2812d64174bSLiu Zhe 282faa4b864SLei De Bin <junit fork="yes" forkmode="once" tempdir="${test.output}/temp" printsummary="yes" showoutput="false" errorProperty="test.failed" failureProperty="test.failed" dir="."> 28309c344eeSLiu Zhe <env key="DISPLAY" value="${env.DISPLAY}"/> 28409c344eeSLiu Zhe <sysproperty key="openoffice.home" value="${openoffice.home}" /> 285faa4b864SLei De Bin <sysproperty key="testspace" value="${testspace}" /> 286faa4b864SLei De Bin <syspropertyset> 287faa4b864SLei De Bin <propertyref builtin="commandline" /> 288faa4b864SLei De Bin </syspropertyset> 289faa4b864SLei De Bin <batchtest todir="${test.result}"> 290faa4b864SLei De Bin <fileset dir="${classes}" includes="${test.classes}" /> 291faa4b864SLei De Bin </batchtest> 292faa4b864SLei De Bin 293faa4b864SLei De Bin <formatter type="xml" /> 2947acce70dSLiu Zhe <classpath> 2957acce70dSLiu Zhe <pathelement location="${classes}" /> 2966b55ece7SLiu Zhe <pathelement location="testgui/data" /> 2976b55ece7SLiu Zhe <pathelement location="testuno/data" /> 2987acce70dSLiu Zhe <path refid="junit.classpath"/> 2997acce70dSLiu Zhe <path refid="uno.classpath"/> 3007acce70dSLiu Zhe </classpath> 301faa4b864SLei De Bin </junit> 302e90ed1f0SLiu Zhe 303faa4b864SLei De Bin <junitreport todir="${test.report}"> 304faa4b864SLei De Bin <fileset dir="${test.result}"> 305faa4b864SLei De Bin <include name="TEST-*.xml" /> 306faa4b864SLei De Bin </fileset> 307faa4b864SLei De Bin <report format="frames" styledir="${junit.style.dir}" todir="${test.report}"> 308e90ed1f0SLiu Zhe <param name="TITLE" expression="${test.name}: ${openoffice.build.name}, ${test.os.name}-${test.os.version}-${test.os.arch}"/> 309faa4b864SLei De Bin </report> 310faa4b864SLei De Bin </junitreport> 3117acce70dSLiu Zhe <property name="test.report.index" location="${test.report}/index.html" /> 3127acce70dSLiu Zhe <echo>Open ${test.report.index} in browser to view the test report.</echo> 313faa4b864SLei De Bin </target> 314faa4b864SLei De Bin 3150e2e75f4SLiu Zhe <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."> 316faa4b864SLei De Bin <fail message="Test Failed" if="test.failed" /> 317faa4b864SLei De Bin </target> 318e90ed1f0SLiu Zhe 319e90ed1f0SLiu Zhe <target name="detect.testenv"> 32096b3c68eSLiu Zhe <exec outputproperty="test.os.name" executable="lsb_release" failifexecutionfails="false" os="Linux"> 321d7740c70SLiu Zhe <arg line="-is" /> 322d7740c70SLiu Zhe </exec> 32396b3c68eSLiu Zhe <exec outputproperty="test.os.version" executable="lsb_release" failifexecutionfails="false" os="Linux"> 324d7740c70SLiu Zhe <arg line="-rs" /> 325d7740c70SLiu Zhe </exec> 326d7740c70SLiu Zhe <property name="test.os.name" value="${os.name}" /> 327d7740c70SLiu Zhe <property name="test.os.version" value="${os.version}" /> 328d7740c70SLiu Zhe <property name="test.os.arch" value="${os.arch}" /> 329d7740c70SLiu Zhe <echo>${test.os.name}-${test.os.version}-${test.os.arch}</echo> 330e90ed1f0SLiu Zhe <property file="${openoffice.home}/program/versionrc" prefix="openoffice"/> 331e90ed1f0SLiu Zhe <property file="${openoffice.home}/program/version.ini" prefix="openoffice"/> 332e90ed1f0SLiu Zhe <property name="openoffice.build.name" value=""/> 333d7740c70SLiu Zhe </target> 334d7740c70SLiu Zhe 335faa4b864SLei De Bin 336d7740c70SLiu Zhe <target name="report.test" unless="report.test.skip" description="Upload the testing result to report repository." depends="detect.testenv"> 337*b4d2d410SLiu Zhe <property name="report.to" value="${openoffice.build.name}-${test.name}/${test.os.name}-${test.os.version}-${test.os.arch}" /> 3387dd2b5bbSLiu Zhe <echo>Uploading report to ${report.repos}/${report.to}</echo> 33909c344eeSLiu Zhe <property name="report.to.temp" location="${testspace}/.temp.ouput"/> 34009c344eeSLiu Zhe <delete dir="${report.to.temp}" deleteonexit="true"/> 3417dd2b5bbSLiu Zhe <copy todir="${report.to.temp}/${report.to}"> 3427dd2b5bbSLiu Zhe <fileset dir="${test.output}" /> 3437dd2b5bbSLiu Zhe </copy> 34409c344eeSLiu Zhe <scp todir="${report.repos}" trust="true"> 3457dd2b5bbSLiu Zhe <fileset dir="${report.to.temp}"/> 3467dd2b5bbSLiu Zhe </scp> 34709c344eeSLiu Zhe <delete dir="${report.to.temp}" deleteonexit="true"/> 348faa4b864SLei De Bin </target> 349faa4b864SLei De Bin 350faa4b864SLei De Bin <target name="detect.build" depends="find.build" description="Check if new build is available. If no new build is available, the target will be failed."> 351d7740c70SLiu Zhe <property name="test.mark.file" location="${testspace}/${test.name}.build"/> 352d7740c70SLiu Zhe <loadfile property="local.build" srcFile="${test.mark.file}" quiet="true" failonerror="false" /> 353faa4b864SLei De Bin <fail message="The build has been tested! We don't want to test it twice."> 354faa4b864SLei De Bin <condition> 355faa4b864SLei De Bin <equals arg1="${openoffice.build}" arg2="${local.build}" trim="true" /> 356faa4b864SLei De Bin </condition> 357faa4b864SLei De Bin </fail> 358faa4b864SLei De Bin <mkdir dir="${testspace}" /> 359d7740c70SLiu Zhe <echo file="${test.mark.file}">${openoffice.build}</echo> 360faa4b864SLei De Bin </target> 361faa4b864SLei De Bin 3620e2e75f4SLiu Zhe <target name="routine.test" depends="detect.build,download.build,install.build,run.test,report.test" description="Periodically run testing."> 363faa4b864SLei De Bin <fail message="Test Failed" if="test.failed" /> 364faa4b864SLei De Bin </target> 365faa4b864SLei De Bin</project> 366