buildframework/helium/tools/testing/ats/ats.ant.xml
changeset 587 85df38eb4012
parent 217 0f5e3a7fb6af
child 588 c7c26511138f
child 618 df88fead2976
equal deleted inserted replaced
217:0f5e3a7fb6af 587:85df38eb4012
    81         <include name="**/*.fpsx" />
    81         <include name="**/*.fpsx" />
    82         <include name="**/*rnd.C00" />
    82         <include name="**/*rnd.C00" />
    83         <include name="**/*rnd.V01" />
    83         <include name="**/*rnd.V01" />
    84     </fileset>
    84     </fileset>
    85     
    85     
    86     <!-- Limit of minimum number of flash files to execute ats-test target, otherwise ATSDrop.zip will not be generated. Default value is "2" files.
    86     <!--* @property ats.flashfiles.minlimit
    87     @type string
    87     Limit of minimum number of flash files to execute ats-test target, otherwise ATSDrop.zip will not be generated. Default value is "2" files.
    88     @scope public
    88     @type string
    89     -->
    89     @scope public
    90     <property name="ats.flashfiles.minlimit" value="2" />
    90     -->
       
    91     <condition property="ats.flashfiles.minlimit" value="0" else="2">
       
    92         <istrue value="${ats.emulator.enable}" />
       
    93     </condition>
    91 
    94 
    92     <fileset id="reference.ats.sis.images" dir="${ats.sis.images.dir}">
    95     <fileset id="reference.ats.sis.images" dir="${ats.sis.images.dir}">
    93         <include name="**/*.sis" />
    96         <include name="**/*.sis" />
    94     </fileset>
    97     </fileset>
    95     <!-- Limit of minimum number of sis files to execute matti-test target, otherwise MATTI-drop.zip will not be generated. Default value is "1" files.
    98     <!-- Limit of minimum number of sis files to execute matti-test target, otherwise MATTI-drop.zip will not be generated. Default value is "1" files.
    98     -->
   101     -->
    99     <property name="ats.sisfiles.minlimit" value="1" />
   102     <property name="ats.sisfiles.minlimit" value="1" />
   100     
   103     
   101     <var name="drop.file.counter" value="0" />
   104     <var name="drop.file.counter" value="0" />
   102 
   105 
       
   106     <condition property="internal.enabled.ats">
       
   107         <istrue value="${enabled.ats}" />
       
   108     </condition>
       
   109 
   103     <!-- The target creates ATSDrop.zip file which also includes test.xml file; and sends the drop to ATS.
   110     <!-- The target creates ATSDrop.zip file which also includes test.xml file; and sends the drop to ATS.
   104 
       
   105     The layer definition, in system definition file, for tsrc directory should look like:
   111     The layer definition, in system definition file, for tsrc directory should look like:
   106     
       
   107     <pre>
   112     <pre>
   108     <layer name="name_test_layer">
   113     <layer name="name_test_layer">
   109         <module name="module_name">
   114         <module name="module_name">
   110             <unit id="unit_id" name="unti_name" bldFile="path_of_tsrc_folder_to_be_built" filter=""/>
   115             <unit id="unit_id" name="unti_name" bldFile="path_of_tsrc_folder_to_be_built" filter=""/>
   111         </module>
   116         </module>
   112     </layer>
   117     </layer>
   113     </pre>
   118     </pre>
   114     -->
   119     -->
   115     <target name="ats-test" if="enabled.ats">
   120     <target name="ats-test" if="internal.enabled.ats">
   116         <mkdir dir="${test.log.dir}"/>
   121         <mkdir dir="${test.log.dir}"/>
   117         <hlm:filterRecordStartMacro pattern="${ats.password}" category="ats"/>
   122         <hlm:filterRecordStartMacro pattern="${ats.password}" category="ats"/>
   118         <trycatch property="exception" reference="exception">
   123         <trycatch property="exception" reference="exception">
   119             <try>
   124             <try>
   120                 <runtarget target="ats-delta"/>
   125                 <runtarget target="ats-delta"/>
   207                     <equals arg1="${ats.script.type}" arg2="import" />
   212                     <equals arg1="${ats.script.type}" arg2="import" />
   208                 </condition>
   213                 </condition>
   209                 <condition property="ats4.libs" value="${helium.dir}/extensions/nokia/external/ats4" else="${helium.dir}/external/antlibs">
   214                 <condition property="ats4.libs" value="${helium.dir}/extensions/nokia/external/ats4" else="${helium.dir}/external/antlibs">
   210                     <available type="dir" file="${helium.dir}/extensions/nokia/external/ats4"/>
   215                     <available type="dir" file="${helium.dir}/extensions/nokia/external/ats4"/>
   211                 </condition>
   216                 </condition>
   212                 <java classname="com.nokia.ats.util.server.CommandLineClient" fork="true" maxmemory="512m">
   217                 <java classname="com.nokia.ats.util.server.CommandLineClient" fork="true" maxmemory="1024m" failonerror="true">
   213                     <classpath>
   218                     <classpath>
   214                         <pathelement path="${java.class.path}"/>
   219                         <pathelement path="${java.class.path}"/>
   215                         <fileset dir="${ats4.libs}" includes="*.jar"/>
   220                         <fileset dir="${ats4.libs}" includes="*.jar"/>
   216                     </classpath>
   221                     </classpath>
   217                     <arg line="-url http://${ats.server}/ServerService -path ${ats.drop.location.file} ${ats.import.arg}"/>
   222                     <arg line="-url http://${ats.server}/ServerService -path ${ats.drop.location.file} ${ats.import.arg}"/>
   218                 </java>
   223                 </java>
   219             </then>
   224             </then>
   220             <else>
   225             <else>
   221                 <condition property="ats.wsh.testrun.file" value="wshTestRunImport.vbs" else="wshTestRunX.vbs">
   226                 <if>
   222                     <equals arg1="${ats.script.type}" arg2="import" />
   227                     <and>
   223                 </condition>
   228                         <equals arg1="${ats.script.type}" arg2="import" />
   224                 <exec executable="cscript" dir="${build.drive}/" failonerror="false">
   229                         <available classname="com.nokia.taitei.util.TestDropImporter"/>
   225                     <env key="ats3.username" value="${ats.username}" />
   230                     </and>
   226                     <env key="ats3.password" value="${ats.password}" />
   231                     <then>
   227                     <env key="ats3.host" value="${ats.server}" />
   232                         <java classname="com.nokia.taitei.util.TestDropImporter" fork="true" maxmemory="1024m" failonerror="true">
   228                     <env key="ats3.pathToDrop" value="${ats.drop.location.file}"/>
   233                             <classpath>
   229                     <arg value="${helium.dir}/tools/testing/ats/${ats.wsh.testrun.file}" />
   234                                 <pathelement path="${java.class.path}"/>
   230                 </exec>
   235                             </classpath>
       
   236                             <arg line="${ats.server} ${ats.drop.location.file} ${ats.username} ${ats.password}"/>
       
   237                         </java>
       
   238                     </then>
       
   239                     <else>
       
   240                         <condition property="ats.wsh.testrun.file" value="wshTestRunImport.vbs" else="wshTestRunX.vbs">
       
   241                             <equals arg1="${ats.script.type}" arg2="import" />
       
   242                         </condition>
       
   243                         <exec executable="cscript" dir="${build.drive}/" failonerror="true">
       
   244                             <env key="ats3.username" value="${ats.username}" />
       
   245                             <env key="ats3.password" value="${ats.password}" />
       
   246                             <env key="ats3.host" value="${ats.server}" />
       
   247                             <env key="ats3.pathToDrop" value="${ats.drop.location.file}"/>
       
   248                             <arg value="${helium.dir}/tools/testing/ats/${ats.wsh.testrun.file}" />
       
   249                         </exec>
       
   250                     </else>
       
   251                 </if>             
   231             </else>
   252             </else>
   232         </if>
   253         </if>
   233     </target>
   254     </target>
   234 
   255 
   235     <!-- The target is dependent on "ats-test", should not be called independently. The target fetches flash files location -->
   256     <!-- The target is dependent on "ats-test", should not be called independently. The target fetches flash files location -->
   236     <target name="ats-set-flash-image-path">
   257     <target name="ats-set-flash-image-path" unless="ats.emulator.enable">
   237         <pathconvert pathsep="," property="ats.flash.images">
   258         <pathconvert pathsep="," property="ats.flash.images">
   238             <fileset refid="reference.ats.flash.images"/>
   259             <fileset refid="reference.ats.flash.images"/>
   239         </pathconvert>
   260         </pathconvert>
       
   261         <script language="jython" setbeans="false">
       
   262 if project.getProperty('ats.disable.iconfig') == None:
       
   263     import atsant
       
   264     ic = None
       
   265     try:
       
   266         ic = atsant.IConfigATS(project.getProperty('release.images.dir'))
       
   267     except Exception, ex:
       
   268         print ex
       
   269     if ic:
       
   270         project.setProperty('ats.flash.images', ic.findimages())
       
   271         </script>
   240         <hlm:python failonerror="true">
   272         <hlm:python failonerror="true">
   241 <![CDATA[
   273 <![CDATA[
   242 flashfilescount = len(r'${ats.flash.images}'.split(','))
   274 flashfilescount = len(r'${ats.flash.images}'.split(','))
   243 mincount = int(r'${ats.flashfiles.minlimit}')
   275 mincount = int(r'${ats.flashfiles.minlimit}')
   244 if flashfilescount < mincount:
   276 if flashfilescount < mincount:
   310         <condition property="ats.version" value="4" else="3">
   342         <condition property="ats.version" value="4" else="3">
   311             <istrue value="${ats4.enabled}" />
   343             <istrue value="${ats4.enabled}" />
   312         </condition>
   344         </condition>
   313         <var name="ats.drop.file" value="ATS${ats.version}Drop${drop.file.counter}.zip" />
   345         <var name="ats.drop.file" value="ATS${ats.version}Drop${drop.file.counter}.zip" />
   314         
   346         
   315         <!-- Sets target platform for compiling test components. Default value is "armv5 urel".
   347         <!--* @property ats.target.platform
   316         @type string
   348         Sets target platform for compiling test components. Default value is "armv5 urel".
   317         @scope public
   349         @type string
   318         -->
   350         @scope public
   319         <property name="ats.target.platform" value="armv5 urel" />
   351         -->
       
   352         <condition property="ats.target.platform" value="winscw urel" else="armv5 urel">
       
   353             <istrue value="${ats.emulator.enable}" />
       
   354         </condition>
   320         <!-- Should be "True" if tracing is needed during the tests running on ATS3. Default value is "False", the values are case-sensitive.
   355         <!-- Should be "True" if tracing is needed during the tests running on ATS3. Default value is "False", the values are case-sensitive.
   321         @type string
   356         @type string
   322         @scope public
   357         @scope public
   323         -->
   358         -->
   324         <property name="ats.trace.enabled" value="False" />
   359         <property name="ats.trace.enabled" value="False" />
   336         <!-- If the property is set to "True", then the only test components which will have PKG files, will be included into the test.xml as a test-set. Which means, even if there's a test component (executable) but there's no PKG file, it should not be considered as a test component and hence not included into the test.xml as a separate test. By default the property value is False.
   371         <!-- If the property is set to "True", then the only test components which will have PKG files, will be included into the test.xml as a test-set. Which means, even if there's a test component (executable) but there's no PKG file, it should not be considered as a test component and hence not included into the test.xml as a separate test. By default the property value is False.
   337         @type string
   372         @type string
   338         @scope public
   373         @scope public
   339         -->
   374         -->
   340         <property name="ats.obey.pkgfiles.rule" value="False" />
   375         <property name="ats.obey.pkgfiles.rule" value="False" />
       
   376         <fail unless="ats.product.name" message="ats.product.name property not defined" />
       
   377         <condition property="ats.hti" value="false" else="true">
       
   378             <istrue value="${ats.emulator.enable}" />
       
   379         </condition>
   341     </target>
   380     </target>
   342 
   381 
   343     <!-- Sets default values for the ASTE, this is a dependent target and shouldn't be used as an individual target -->
   382     <!-- Sets default values for the ASTE, this is a dependent target and shouldn't be used as an individual target -->
   344     <target name="ats-set-defaults-aste" depends="ats-common">
   383     <target name="ats-set-defaults-aste" depends="ats-common">
   345         <var name="ats.drop.file" value="ATSAsteDrop.zip" />
   384         <var name="ats.drop.file" value="ATSAsteDrop.zip" />
   394 project.setProperty(attributes.get('property'), ",".join(modules.keys()))
   433 project.setProperty(attributes.get('property'), ",".join(modules.keys()))
   395 project.setProperty('ats.drops.count', str(len(modules)))
   434 project.setProperty('ats.drops.count', str(len(modules)))
   396     </scriptdef>
   435     </scriptdef>
   397 
   436 
   398     <!-- The target is dependent on "ats-test", should not be called individually. The target creates the ATSdrop.zip file including test:xml file -->
   437     <!-- The target is dependent on "ats-test", should not be called individually. The target creates the ATSdrop.zip file including test:xml file -->
   399     <target name="ats-create-drop" depends="ats-set-flash-image-path">
   438     <target name="ats-create-drop" depends="ats-set-flash-image-path,ats-emulator-zip">
   400         <mkdir dir="${build.output.dir}/ats" />
   439         <mkdir dir="${build.output.dir}/ats" />
   401         <hlm:getModuleTsrcMacro property="module.list" prefix="module.tsrc" />
   440         <hlm:getModuleTsrcMacro property="module.list" prefix="module.tsrc" />
   402         <if>
   441         <if>
   403             <scriptcondition language="beanshell">
   442             <scriptcondition language="beanshell">
   404                 <![CDATA[
   443                 <![CDATA[
   448                             <arg value="--monsym-files=${ats.ctc.monsyms}" />
   487                             <arg value="--monsym-files=${ats.ctc.monsyms}" />
   449                             <arg value="--config=${ats.config.file}" />
   488                             <arg value="--config=${ats.config.file}" />
   450                             <arg value="--obey-pkgfiles=${ats.obey.pkgfiles.rule}" />
   489                             <arg value="--obey-pkgfiles=${ats.obey.pkgfiles.rule}" />
   451                             <arg value="--ats4-enabled=${ats4.enabled}" />
   490                             <arg value="--ats4-enabled=${ats4.enabled}" />
   452                             <arg value="--specific-pkg=${ats.specific.pkg}" />
   491                             <arg value="--specific-pkg=${ats.specific.pkg}" />
       
   492                             <arg value="--hti=${ats.hti}" />
   453                             <arg value="--verbose" />
   493                             <arg value="--verbose" />
   454                             <arg line="${module.tsrc.@{module}}" />
   494                             <arg line="${module.tsrc.@{module}}" />
   455                         </exec>
   495                         </exec>
   456                         <runtarget target="do-ats-test" />
   496                         <runtarget target="do-ats-test" />
   457                         <math result="drop.file.counter" operand1="1" operation="+" operand2="${drop.file.counter}" datatype="int" />
   497                         <math result="drop.file.counter" operand1="1" operation="+" operand2="${drop.file.counter}" datatype="int" />
   658         </script>
   698         </script>
   659     </target>
   699     </target>
   660     
   700     
   661     <!-- Common target to run ats, aste and matti -->
   701     <!-- Common target to run ats, aste and matti -->
   662     <target name="run-test" depends="ats-test,ats-aste,matti-test"/>
   702     <target name="run-test" depends="ats-test,ats-aste,matti-test"/>
       
   703     
       
   704     <!-- Zip build area for emulator -->
       
   705     <target name="ats-emulator-zip" if="ats.emulator.enable">
       
   706         <property name="zips.emulator_zip.spec.name" value="emulator_zip"/>
       
   707         <hlm:zipContentMacro type="emulator_zip" file="${helium.dir}\tools\testing\ats\emulator_zip.cfg.xml" />
       
   708 
       
   709         <if>
       
   710             <isset property="ats.drop.location" />
       
   711             <then>
       
   712                 <property name="ats.flash.images" value="${ats.drop.location}\${build.id}_emulator_urel.zip"/>
       
   713                 <copy file="${build.output.dir}/ats/${build.id}_emulator_urel.zip" tofile="${ats.flash.images}" />
       
   714             </then>
       
   715             <else>
       
   716                 <property name="ats.flash.images" value="${build.output.dir}/ats/${build.id}_emulator_urel.zip"/>
       
   717             </else>
       
   718         </if>        
       
   719     </target>
   663 </project>
   720 </project>