buildframework/helium/tools/testing/ats/ats.ant.xml
changeset 587 85df38eb4012
parent 217 0f5e3a7fb6af
child 588 c7c26511138f
child 618 df88fead2976
--- a/buildframework/helium/tools/testing/ats/ats.ant.xml	Thu Mar 04 15:10:37 2010 +0200
+++ b/buildframework/helium/tools/testing/ats/ats.ant.xml	Tue Apr 27 08:33:08 2010 +0300
@@ -83,11 +83,14 @@
         <include name="**/*rnd.V01" />
     </fileset>
     
-    <!-- Limit of minimum number of flash files to execute ats-test target, otherwise ATSDrop.zip will not be generated. Default value is "2" files.
+    <!--* @property ats.flashfiles.minlimit
+    Limit of minimum number of flash files to execute ats-test target, otherwise ATSDrop.zip will not be generated. Default value is "2" files.
     @type string
     @scope public
     -->
-    <property name="ats.flashfiles.minlimit" value="2" />
+    <condition property="ats.flashfiles.minlimit" value="0" else="2">
+        <istrue value="${ats.emulator.enable}" />
+    </condition>
 
     <fileset id="reference.ats.sis.images" dir="${ats.sis.images.dir}">
         <include name="**/*.sis" />
@@ -100,10 +103,12 @@
     
     <var name="drop.file.counter" value="0" />
 
-    <!-- The target creates ATSDrop.zip file which also includes test.xml file; and sends the drop to ATS.
+    <condition property="internal.enabled.ats">
+        <istrue value="${enabled.ats}" />
+    </condition>
 
+    <!-- The target creates ATSDrop.zip file which also includes test.xml file; and sends the drop to ATS.
     The layer definition, in system definition file, for tsrc directory should look like:
-    
     <pre>
     <layer name="name_test_layer">
         <module name="module_name">
@@ -112,7 +117,7 @@
     </layer>
     </pre>
     -->
-    <target name="ats-test" if="enabled.ats">
+    <target name="ats-test" if="internal.enabled.ats">
         <mkdir dir="${test.log.dir}"/>
         <hlm:filterRecordStartMacro pattern="${ats.password}" category="ats"/>
         <trycatch property="exception" reference="exception">
@@ -209,7 +214,7 @@
                 <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="512m">
+                <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"/>
@@ -218,25 +223,52 @@
                 </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="false">
-                    <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"/>
+                    </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>
     </target>
 
     <!-- The target is dependent on "ats-test", should not be called independently. The target fetches flash files location -->
-    <target name="ats-set-flash-image-path">
+    <target name="ats-set-flash-image-path" unless="ats.emulator.enable">
         <pathconvert pathsep="," property="ats.flash.images">
             <fileset refid="reference.ats.flash.images"/>
         </pathconvert>
+        <script language="jython" setbeans="false">
+if project.getProperty('ats.disable.iconfig') == None:
+    import atsant
+    ic = None
+    try:
+        ic = atsant.IConfigATS(project.getProperty('release.images.dir'))
+    except Exception, ex:
+        print ex
+    if ic:
+        project.setProperty('ats.flash.images', ic.findimages())
+        </script>
         <hlm:python failonerror="true">
 <![CDATA[
 flashfilescount = len(r'${ats.flash.images}'.split(','))
@@ -312,11 +344,14 @@
         </condition>
         <var name="ats.drop.file" value="ATS${ats.version}Drop${drop.file.counter}.zip" />
         
-        <!-- Sets target platform for compiling test components. Default value is "armv5 urel".
+        <!--* @property ats.target.platform
+        Sets target platform for compiling test components. Default value is "armv5 urel".
         @type string
         @scope public
         -->
-        <property name="ats.target.platform" value="armv5 urel" />
+        <condition property="ats.target.platform" value="winscw urel" else="armv5 urel">
+            <istrue value="${ats.emulator.enable}" />
+        </condition>
         <!-- Should be "True" if tracing is needed during the tests running on ATS3. Default value is "False", the values are case-sensitive.
         @type string
         @scope public
@@ -338,6 +373,10 @@
         @scope public
         -->
         <property name="ats.obey.pkgfiles.rule" value="False" />
+        <fail unless="ats.product.name" message="ats.product.name property not defined" />
+        <condition property="ats.hti" value="false" else="true">
+            <istrue value="${ats.emulator.enable}" />
+        </condition>
     </target>
 
     <!-- Sets default values for the ASTE, this is a dependent target and shouldn't be used as an individual target -->
@@ -396,7 +435,7 @@
     </scriptdef>
 
     <!-- The target is dependent on "ats-test", should not be called individually. The target creates the ATSdrop.zip file including test:xml file -->
-    <target name="ats-create-drop" depends="ats-set-flash-image-path">
+    <target name="ats-create-drop" depends="ats-set-flash-image-path,ats-emulator-zip">
         <mkdir dir="${build.output.dir}/ats" />
         <hlm:getModuleTsrcMacro property="module.list" prefix="module.tsrc" />
         <if>
@@ -450,6 +489,7 @@
                             <arg value="--obey-pkgfiles=${ats.obey.pkgfiles.rule}" />
                             <arg value="--ats4-enabled=${ats4.enabled}" />
                             <arg value="--specific-pkg=${ats.specific.pkg}" />
+                            <arg value="--hti=${ats.hti}" />
                             <arg value="--verbose" />
                             <arg line="${module.tsrc.@{module}}" />
                         </exec>
@@ -660,4 +700,21 @@
     
     <!-- Common target to run ats, aste and matti -->
     <target name="run-test" depends="ats-test,ats-aste,matti-test"/>
+    
+    <!-- Zip build area for emulator -->
+    <target name="ats-emulator-zip" if="ats.emulator.enable">
+        <property name="zips.emulator_zip.spec.name" value="emulator_zip"/>
+        <hlm:zipContentMacro type="emulator_zip" file="${helium.dir}\tools\testing\ats\emulator_zip.cfg.xml" />
+
+        <if>
+            <isset property="ats.drop.location" />
+            <then>
+                <property name="ats.flash.images" value="${ats.drop.location}\${build.id}_emulator_urel.zip"/>
+                <copy file="${build.output.dir}/ats/${build.id}_emulator_urel.zip" tofile="${ats.flash.images}" />
+            </then>
+            <else>
+                <property name="ats.flash.images" value="${build.output.dir}/ats/${build.id}_emulator_urel.zip"/>
+            </else>
+        </if>        
+    </target>
 </project>