--- a/buildframework/helium/tools/testing/ats/ats.ant.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/tools/testing/ats/ats.ant.xml Thu Jul 22 17:08:43 2010 +0300
@@ -199,58 +199,68 @@
</else>
</if>
- <!-- Notify ATS about the drop. -->
- <if>
- <istrue value="${ats4.enabled}" />
- <then>
- <hlm:python failonerror="true">
+ <trycatch property="exception">
+ <try>
+ <!-- Notify ATS about the drop. -->
+ <if>
+ <istrue value="${ats4.enabled}" />
+ <then>
+ <hlm:python failonerror="true">
version = r'${java.version}'
if '1.6.0' in version:
assert int(version.split('_')[1]) > 6, 'Java 6 u7 required'
- </hlm:python>
- <condition property="ats.import.arg" value="-import" else="">
- <equals arg1="${ats.script.type}" arg2="import" />
- </condition>
- <condition property="ats4.libs" value="${helium.dir}/extensions/nokia/external/ats4" else="${helium.dir}/external/antlibs">
- <available type="dir" file="${helium.dir}/extensions/nokia/external/ats4"/>
- </condition>
- <java classname="com.nokia.ats.util.server.CommandLineClient" fork="true" maxmemory="1024m" failonerror="true">
- <classpath>
- <pathelement path="${java.class.path}"/>
- <fileset dir="${ats4.libs}" includes="*.jar"/>
- </classpath>
- <arg line="-url http://${ats.server}/ServerService -path ${ats.drop.location.file} ${ats.import.arg}"/>
- </java>
- </then>
- <else>
- <if>
- <and>
- <equals arg1="${ats.script.type}" arg2="import" />
- <available classname="com.nokia.taitei.util.TestDropImporter"/>
- </and>
- <then>
- <java classname="com.nokia.taitei.util.TestDropImporter" fork="true" maxmemory="1024m" failonerror="true">
+ </hlm:python>
+ <condition property="ats.import.arg" value="-import" else="">
+ <equals arg1="${ats.script.type}" arg2="import" />
+ </condition>
+ <condition property="ats4.libs" value="${helium.dir}/extensions/nokia/external/ats4" else="${helium.dir}/external/antlibs">
+ <available type="dir" file="${helium.dir}/extensions/nokia/external/ats4"/>
+ </condition>
+ <java classname="com.nokia.ats.util.server.CommandLineClient" fork="true" maxmemory="1024m" failonerror="true">
<classpath>
<pathelement path="${java.class.path}"/>
+ <fileset dir="${ats4.libs}" includes="*.jar"/>
</classpath>
- <arg line="${ats.server} ${ats.drop.location.file} ${ats.username} ${ats.password}"/>
+ <arg line="-url http://${ats.server}/ServerService -path ${ats.drop.location.file} ${ats.import.arg}"/>
</java>
</then>
<else>
- <condition property="ats.wsh.testrun.file" value="wshTestRunImport.vbs" else="wshTestRunX.vbs">
- <equals arg1="${ats.script.type}" arg2="import" />
- </condition>
- <exec executable="cscript" dir="${build.drive}/" failonerror="true">
- <env key="ats3.username" value="${ats.username}" />
- <env key="ats3.password" value="${ats.password}" />
- <env key="ats3.host" value="${ats.server}" />
- <env key="ats3.pathToDrop" value="${ats.drop.location.file}"/>
- <arg value="${helium.dir}/tools/testing/ats/${ats.wsh.testrun.file}" />
- </exec>
+ <if>
+ <and>
+ <equals arg1="${ats.script.type}" arg2="import" />
+ <available classname="com.nokia.taitei.util.TestDropImporter"/>
+ <not>
+ <istrue value="${ats.disable.java.importer}" />
+ </not>
+ </and>
+ <then>
+ <java classname="com.nokia.taitei.util.TestDropImporter" fork="true" maxmemory="1024m" failonerror="true">
+ <classpath>
+ <pathelement path="${java.class.path}"/>
+ </classpath>
+ <arg line="${ats.server} ${ats.drop.location.file} ${ats.username} ${ats.password}"/>
+ </java>
+ </then>
+ <else>
+ <condition property="ats.wsh.testrun.file" value="wshTestRunImport.vbs" else="wshTestRunX.vbs">
+ <equals arg1="${ats.script.type}" arg2="import" />
+ </condition>
+ <exec executable="cscript" dir="${build.drive}/" failonerror="true">
+ <env key="ats3.username" value="${ats.username}" />
+ <env key="ats3.password" value="${ats.password}" />
+ <env key="ats3.host" value="${ats.server}" />
+ <env key="ats3.pathToDrop" value="${ats.drop.location.file}"/>
+ <arg value="${helium.dir}/tools/testing/ats/${ats.wsh.testrun.file}" />
+ </exec>
+ </else>
+ </if>
</else>
- </if>
- </else>
- </if>
+ </if>
+ </try>
+ <catch>
+ <echo message="Error: ${exception}"/>
+ </catch>
+ </trycatch>
</target>
<!-- The target is dependent on "ats-test", should not be called independently. The target fetches flash files location -->
@@ -263,7 +273,7 @@
import atsant
ic = None
try:
- ic = atsant.IConfigATS(project.getProperty('release.images.dir'))
+ ic = atsant.IConfigATS(project.getProperty('release.images.dir'), project.getProperty('ats.product.name'))
except Exception, ex:
print ex
if ic:
@@ -493,7 +503,7 @@
<arg value="--verbose" />
<arg line="${module.tsrc.@{module}}" />
</exec>
- <runtarget target="do-ats-test" />
+ <antcall target="do-ats-test" />
<math result="drop.file.counter" operand1="1" operation="+" operand2="${drop.file.counter}" datatype="int" />
</sequential>
</for>
@@ -717,4 +727,26 @@
</else>
</if>
</target>
+
+ <!-- Generate and upload drop using custom template -->
+ <target name="ats-custom-drop">
+ <mkdir dir="${build.output.dir}/ats" />
+ <runtarget target="ats-set-flash-image-path" />
+ <runtarget target="ats-set-defaults-stifeunit" />
+ <property name="ats.custom.template" value="${helium.dir}/tools/testing/ats/templates/ats4_naviengine_template.xml"/>
+ <exec executable="python">
+ <arg line="-Wignore -m ats3.custom" />
+ <arg value="--custom-template=${ats.custom.template}" />
+ <arg value="--device-type=${ats.product.name}" />
+ <arg value="${internal.ats.diamonds.arg}" />
+ <arg value="--drop-file=${build.output.dir}/ats/${ats.drop.file}" />
+ <arg value="--report-email=${ats.email.list}" />
+ <arg value="--testrun-name=${ats.testrun.name}" />
+ <arg value="--flash-images=${ats.flash.images}" />
+ <arg value="--test-timeout=${ats.test.timeout}" />
+ <arg value="--test-type=${ats.custom.test.type}" />
+ </exec>
+ <runtarget target="do-ats-test" />
+ </target>
+
</project>