blob: d9af8825898b9f46a41643c3b485e4ca4e084aea [file] [log] [blame]
<project
name="Build specific targets and properties"
default="test">
<!-- Note to be cross-platform, "environment variables" are only appropriate for
some variables, e.g. ones we set, since properties are case sensitive, even if
the environment variables on your operating system are not, e.g. it will
be ${env.Path} not ${env.PATH} on Windows -->
<property environment="env" />
<!-- ===================================================================== -->
<!-- Steps to do after the build is done. -->
<!-- ===================================================================== -->
<target name="test">
<antcall target="runTest" />
</target>
<!-- ===================================================================== -->
<!-- Steps to do to test the build results -->
<!-- ===================================================================== -->
<target name="runTest">
<dirname
file="${ant.file}"
property="test.component.dir" />
<ant antfile="${wtp.builder.home}/scripts/build/label.xml" />
<property file="${buildDirectory}/label.properties" />
<property file="${wtp.builder.home}/build.properties" />
<mkdir dir="${testRoot}" />
<mkdir dir="${testRoot}/results" />
<mkdir dir="${testRoot}/results/consolelogs" />
<copy
todir="${testRoot}"
overwrite="true">
<fileset dir="${test.component.dir}/testScripts"></fileset>
</copy>
<echo message="BASEOS: ${env.BASEOS} BASEWS: ${env.BASEWS} BASEARCH: ${env.BASEARCH} " />
<ant
antfile="${test.component.dir}/testdependency.xml"
target="get">
<property
name="dependency.properties"
value="${buildDirectory}/maps/releng/maps/dependencies.properties" />
<property
name="base.install.dir"
value="${testRoot}" />
</ant>
<antcall target="unzipTests" />
<antcall target="runTestEclipse">
<param
name="testTarget"
value="all" />
</antcall>
<antcall target="postRunTestEclipse">
<param
name="testTarget"
value="all" />
</antcall>
</target>
<target name="unzipTests">
<!--unzip the builds and junit tests
we use 'unzip' here, so we can continue on error
(such as if zip was not created, due to other failures or options).
-->
<exec
dir="${buildDirectory}/${buildLabel}"
executable="unzip"
failonerror="false">
<arg line="-o -qq wtp-sdk-${buildLabel}.zip -d ${testRoot}" />
</exec>
<exec
dir="${buildDirectory}/${buildLabel}"
executable="unzip"
failonerror="false">
<arg line="-o -qq wtp-wst-Automated-Tests-${buildLabel}.zip -d ${testRoot}" />
</exec>
<exec
dir="${buildDirectory}/${buildLabel}"
executable="unzip"
failonerror="false">
<arg line="-o -qq wtp-jst-Automated-Tests-${buildLabel}.zip -d ${testRoot}" />
</exec>
<exec
dir="${buildDirectory}/${buildLabel}"
executable="unzip"
failonerror="false">
<arg line="-o -qq wtp-jsf-sdk-${buildLabel}.zip -d ${testRoot}" />
</exec>
<exec
dir="${buildDirectory}/${buildLabel}"
executable="unzip"
failonerror="false">
<arg line="-o -qq wtp-jsf-Automated-Tests-${buildLabel}.zip -d ${testRoot}" />
</exec>
<exec
dir="${buildDirectory}/${buildLabel}"
executable="unzip"
failonerror="false">
<arg line="-o -qq wtp-jpa-${buildLabel}.zip -d ${testRoot}" />
</exec>
<exec
dir="${buildDirectory}/${buildLabel}"
executable="unzip"
failonerror="false">
<arg line="-o -qq wtp-jpa-Automated-Tests-${buildLabel}.zip -d ${testRoot}" />
</exec>
</target>
<!-- time out may need to be set/adjust for api or performance tests?
some common values:
7200000: 2 hours
3600000: 1 hour
1800000: 30 minutes
600000: 10 minutes
-->
<property
name="testTimeLimit"
value="1800000" />
<property
name="testFailOnError"
value="false" />
<target name="runTestEclipse">
<java
taskname="test-wtp-${testTarget}"
fork="true"
failonerror="${testFailOnError}"
timeout="${testTimeLimit}"
output="${testRoot}/results/consolelogs/wtptestlog.txt"
dir="${testRoot}"
jvm="${env.JAVA_5_HOME}/bin/java"
classname="org.eclipse.core.launcher.Main" >
<classpath>
<fileset dir="${testRoot}/eclipse/plugins">
<include name="org.eclipse.equinox.launcher_*.jar"/>
</fileset>
</classpath>
<jvmarg value="-Dosgi.ws=${env.BASEWS}" />
<jvmarg value="-Dosgi.os=${env.BASEOS}" />
<jvmarg value="-Dosgi.arch=${env.BASEARCH}" />
<jvmarg value="-Dws=${env.BASEWS}" />
<jvmarg value="-Dos=${env.BASEOS}" />
<jvmarg value="-Darch=${env.BASEARCH}" />
<jvmarg value="-Dosgi.clean=true" />
<jvmarg value="-Dnoclean=true" />
<jvmarg value="-DbuildBranch=${buildBranch}" />
<jvmarg value="-DbuildType=${buildType}" />
<jvmarg value="-DbuildId=${buildId}" />
<arg value="-propertyfile" />
<arg value="test.properties" />
<arg value="-application" />
<arg value="org.eclipse.ant.core.antRunner" />
<arg value="-file" />
<arg value="test.xml" />
<arg value="-logger" />
<arg value="org.apache.tools.ant.DefaultLogger" />
<arg value="${testTarget}" />
<sysproperty
key="build.home"
value="${build.home}" />
<sysproperty
key="buildDirectory"
value="${buildDirectory}" />
<sysproperty
key="baseLocation"
value="${baseLocation}" />
<sysproperty
key="testDir"
value="${testRoot}" />
<sysproperty
key="perf.buildId"
value="${buildType}${date}-${time}" />
<sysproperty
key="eclipseBuilderDirectory"
value="${pde.builder.path}" />
<sysproperty
key="buildLabel"
value="${buildLabel}" />
</java>
</target>
<target name="postRunTestEclipse">
<copy
todir="${buildDirectory}/${buildLabel}/testResults"
overwrite="true">
<fileset dir="${testRoot}/results">
<include name="**/*.*" />
</fileset>
</copy>
</target>
</project>