73 @type string |
73 @type string |
74 @editable required |
74 @editable required |
75 @scope public |
75 @scope public |
76 --> |
76 --> |
77 |
77 |
|
78 <!--* @property ats.create.singledrop.file |
|
79 defined as true if single drop file is required. Define as false or not present for multiple drop files. |
|
80 @type boolean |
|
81 @editable required |
|
82 @scope public |
|
83 --> |
78 |
84 |
79 <!-- --> |
85 <!-- --> |
80 <fileset id="reference.ats.flash.images" dir="${release.images.dir}"> |
86 <fileset id="reference.ats.flash.images" dir="${release.images.dir}"> |
81 <include name="**/*.fpsx" /> |
87 <include name="**/*.fpsx" /> |
82 <include name="**/*rnd.C00" /> |
88 <include name="**/*rnd.C00" /> |
83 <include name="**/*rnd.V01" /> |
89 <include name="**/*rnd.V01" /> |
84 </fileset> |
90 </fileset> |
85 |
91 |
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. |
92 <!--* @property ats.flashfiles.minlimit |
87 @type string |
93 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 |
94 @type string |
89 --> |
95 @scope public |
90 <property name="ats.flashfiles.minlimit" value="2" /> |
96 --> |
|
97 <condition property="ats.flashfiles.minlimit" value="0" else="2"> |
|
98 <istrue value="${ats.emulator.enable}" /> |
|
99 </condition> |
91 |
100 |
92 <fileset id="reference.ats.sis.images" dir="${ats.sis.images.dir}"> |
101 <fileset id="reference.ats.sis.images" dir="${ats.sis.images.dir}"> |
93 <include name="**/*.sis" /> |
102 <include name="**/*.sis" /> |
94 </fileset> |
103 </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. |
104 <!-- 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 --> |
107 --> |
99 <property name="ats.sisfiles.minlimit" value="1" /> |
108 <property name="ats.sisfiles.minlimit" value="1" /> |
100 |
109 |
101 <var name="drop.file.counter" value="0" /> |
110 <var name="drop.file.counter" value="0" /> |
102 |
111 |
|
112 <condition property="internal.enabled.ats"> |
|
113 <istrue value="${enabled.ats}" /> |
|
114 </condition> |
|
115 |
103 <!-- The target creates ATSDrop.zip file which also includes test.xml file; and sends the drop to ATS. |
116 <!-- The target creates ATSDrop.zip file which also includes test.xml file; and sends the drop to ATS. |
104 |
117 |
105 The layer definition, in system definition file, for tsrc directory should look like: |
118 The layer definition, in system definition file, for tsrc directory should look like: |
106 |
119 |
107 <pre> |
120 <layer name="name_test_layer"> |
108 <layer name="name_test_layer"> |
121 <module name="module_name"> |
109 <module name="module_name"> |
122 <unit id="unit_id" name="unti_name" bldFile="path_of_tsrc_folder_to_be_built" filter=""/> |
110 <unit id="unit_id" name="unti_name" bldFile="path_of_tsrc_folder_to_be_built" filter=""/> |
123 </module> |
111 </module> |
124 </layer> |
112 </layer> |
125 --> |
113 </pre> |
126 <target name="ats-test" if="internal.enabled.ats"> |
114 --> |
|
115 <target name="ats-test" if="enabled.ats"> |
|
116 <mkdir dir="${test.log.dir}"/> |
127 <mkdir dir="${test.log.dir}"/> |
117 <hlm:filterRecordStartMacro pattern="${ats.password}" category="ats"/> |
128 <hlm:filterRecordStartMacro pattern="${ats.password}" category="ats"/> |
118 <trycatch property="exception" reference="exception"> |
129 <trycatch property="exception" reference="exception"> |
119 <try> |
130 <try> |
120 <runtarget target="ats-delta"/> |
131 <runtarget target="ats-delta"/> |
192 <else> |
203 <else> |
193 <property name="ats.drop.location.file" location="${build.output.dir}/ats/${ats.drop.file}" /> |
204 <property name="ats.drop.location.file" location="${build.output.dir}/ats/${ats.drop.file}" /> |
194 </else> |
205 </else> |
195 </if> |
206 </if> |
196 |
207 |
197 <!-- Notify ATS about the drop. --> |
208 <trycatch property="exception"> |
198 <if> |
209 <try> |
199 <istrue value="${ats4.enabled}" /> |
210 <!-- Notify ATS about the drop. --> |
200 <then> |
211 <if> |
201 <hlm:python failonerror="true"> |
212 <istrue value="${ats4.enabled}" /> |
|
213 <then> |
|
214 <hlm:python failonerror="true"> |
202 version = r'${java.version}' |
215 version = r'${java.version}' |
203 if '1.6.0' in version: |
216 if '1.6.0' in version: |
204 assert int(version.split('_')[1]) > 6, 'Java 6 u7 required' |
217 assert int(version.split('_')[1]) > 6, 'Java 6 u7 required' |
205 </hlm:python> |
218 </hlm:python> |
206 <condition property="ats.import.arg" value="-import" else=""> |
219 <condition property="ats.import.arg" value="-import" else=""> |
207 <equals arg1="${ats.script.type}" arg2="import" /> |
220 <equals arg1="${ats.script.type}" arg2="import" /> |
208 </condition> |
221 </condition> |
209 <condition property="ats4.libs" value="${helium.dir}/extensions/nokia/external/ats4" else="${helium.dir}/external/antlibs"> |
222 <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"/> |
223 <available type="dir" file="${helium.dir}/extensions/nokia/external/ats4"/> |
211 </condition> |
224 </condition> |
212 <java classname="com.nokia.ats.util.server.CommandLineClient" fork="true" maxmemory="512m"> |
225 <java classname="com.nokia.ats.util.server.CommandLineClient" fork="true" maxmemory="1024m" failonerror="true"> |
213 <classpath> |
226 <classpath> |
214 <pathelement path="${java.class.path}"/> |
227 <pathelement path="${java.class.path}"/> |
215 <fileset dir="${ats4.libs}" includes="*.jar"/> |
228 <fileset dir="${ats4.libs}" includes="*.jar"/> |
216 </classpath> |
229 </classpath> |
217 <arg line="-url http://${ats.server}/ServerService -path ${ats.drop.location.file} ${ats.import.arg}"/> |
230 <arg line="-url http://${ats.server}/ServerService -path ${ats.drop.location.file} ${ats.import.arg}"/> |
218 </java> |
231 </java> |
219 </then> |
232 </then> |
220 <else> |
233 <else> |
221 <condition property="ats.wsh.testrun.file" value="wshTestRunImport.vbs" else="wshTestRunX.vbs"> |
234 <if> |
222 <equals arg1="${ats.script.type}" arg2="import" /> |
235 <and> |
223 </condition> |
236 <equals arg1="${ats.script.type}" arg2="import" /> |
224 <exec executable="cscript" dir="${build.drive}/" failonerror="false"> |
237 <available classname="com.nokia.taitei.util.TestDropImporter"/> |
225 <env key="ats3.username" value="${ats.username}" /> |
238 <not> |
226 <env key="ats3.password" value="${ats.password}" /> |
239 <istrue value="${ats.disable.java.importer}" /> |
227 <env key="ats3.host" value="${ats.server}" /> |
240 </not> |
228 <env key="ats3.pathToDrop" value="${ats.drop.location.file}"/> |
241 </and> |
229 <arg value="${helium.dir}/tools/testing/ats/${ats.wsh.testrun.file}" /> |
242 <then> |
230 </exec> |
243 <java classname="com.nokia.taitei.util.TestDropImporter" fork="true" maxmemory="1024m" failonerror="true"> |
231 </else> |
244 <classpath> |
232 </if> |
245 <pathelement path="${java.class.path}"/> |
|
246 </classpath> |
|
247 <arg line="${ats.server} ${ats.drop.location.file} ${ats.username} ${ats.password}"/> |
|
248 </java> |
|
249 </then> |
|
250 <else> |
|
251 <condition property="ats.wsh.testrun.file" value="wshTestRunImport.vbs" else="wshTestRunX.vbs"> |
|
252 <equals arg1="${ats.script.type}" arg2="import" /> |
|
253 </condition> |
|
254 <exec executable="cscript" dir="${build.drive}/" failonerror="true"> |
|
255 <env key="ats3.username" value="${ats.username}" /> |
|
256 <env key="ats3.password" value="${ats.password}" /> |
|
257 <env key="ats3.host" value="${ats.server}" /> |
|
258 <env key="ats3.pathToDrop" value="${ats.drop.location.file}"/> |
|
259 <arg value="${helium.dir}/tools/testing/ats/${ats.wsh.testrun.file}" /> |
|
260 </exec> |
|
261 </else> |
|
262 </if> |
|
263 </else> |
|
264 </if> |
|
265 </try> |
|
266 <catch> |
|
267 <echo message="Error: ${exception}"/> |
|
268 </catch> |
|
269 </trycatch> |
233 </target> |
270 </target> |
234 |
271 |
235 <!-- The target is dependent on "ats-test", should not be called independently. The target fetches flash files location --> |
272 <!-- 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"> |
273 <target name="ats-set-flash-image-path" unless="ats.emulator.enable"> |
237 <pathconvert pathsep="," property="ats.flash.images"> |
274 <pathconvert pathsep="," property="ats.flash.images"> |
238 <fileset refid="reference.ats.flash.images"/> |
275 <fileset refid="reference.ats.flash.images"/> |
239 </pathconvert> |
276 </pathconvert> |
|
277 <script language="jython" setbeans="false"> |
|
278 if project.getProperty('ats.disable.iconfig') == None: |
|
279 import atsant |
|
280 ic = None |
|
281 try: |
|
282 ic = atsant.IConfigATS(project.getProperty('release.images.dir'), project.getProperty('ats.product.name')) |
|
283 except Exception, ex: |
|
284 print ex |
|
285 if ic: |
|
286 project.setProperty('ats.flash.images', ic.findimages()) |
|
287 </script> |
240 <hlm:python failonerror="true"> |
288 <hlm:python failonerror="true"> |
241 <![CDATA[ |
289 <![CDATA[ |
242 flashfilescount = len(r'${ats.flash.images}'.split(',')) |
290 flashfilescount = len(r'${ats.flash.images}'.split(',')) |
243 mincount = int(r'${ats.flashfiles.minlimit}') |
291 mincount = int(r'${ats.flashfiles.minlimit}') |
|
292 if mincount > 0: |
|
293 assert r'${ats.flash.images}' != '', 'No images found in ' + r'${release.images.dir}' |
244 if flashfilescount < mincount: |
294 if flashfilescount < mincount: |
245 raise Exception('Not enough flash files, check reference.ats.flash.images and build.id, found: ' + r'${ats.flash.images}' + ', looking in: ' + r'${release.images.dir}') |
295 raise Exception('Not enough flash files, check reference.ats.flash.images and build.id, found: ' + r'${ats.flash.images}' + ', looking in: ' + r'${release.images.dir}') |
246 ]]> |
296 ]]> |
247 </hlm:python> |
297 </hlm:python> |
248 </target> |
298 </target> |
310 <condition property="ats.version" value="4" else="3"> |
365 <condition property="ats.version" value="4" else="3"> |
311 <istrue value="${ats4.enabled}" /> |
366 <istrue value="${ats4.enabled}" /> |
312 </condition> |
367 </condition> |
313 <var name="ats.drop.file" value="ATS${ats.version}Drop${drop.file.counter}.zip" /> |
368 <var name="ats.drop.file" value="ATS${ats.version}Drop${drop.file.counter}.zip" /> |
314 |
369 |
315 <!-- Sets target platform for compiling test components. Default value is "armv5 urel". |
370 <!--* @property ats.target.platform |
316 @type string |
371 Sets target platform for compiling test components. Default value is "armv5 urel". |
317 @scope public |
372 @type string |
318 --> |
373 @scope public |
319 <property name="ats.target.platform" value="armv5 urel" /> |
374 --> |
|
375 <condition property="ats.target.platform" value="winscw urel" else="armv5 urel"> |
|
376 <istrue value="${ats.emulator.enable}" /> |
|
377 </condition> |
320 <!-- Should be "True" if tracing is needed during the tests running on ATS3. Default value is "False", the values are case-sensitive. |
378 <!-- 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 |
379 @type string |
322 @scope public |
380 @scope public |
323 --> |
381 --> |
324 <property name="ats.trace.enabled" value="False" /> |
382 <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. |
394 <!-- 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 |
395 @type string |
338 @scope public |
396 @scope public |
339 --> |
397 --> |
340 <property name="ats.obey.pkgfiles.rule" value="False" /> |
398 <property name="ats.obey.pkgfiles.rule" value="False" /> |
|
399 <fail unless="ats.product.name" message="ats.product.name property not defined" /> |
|
400 <condition property="ats.hti" value="false" else="true"> |
|
401 <istrue value="${ats.emulator.enable}" /> |
|
402 </condition> |
341 </target> |
403 </target> |
342 |
404 |
343 <!-- Sets default values for the ASTE, this is a dependent target and shouldn't be used as an individual target --> |
405 <!-- 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"> |
406 <target name="ats-set-defaults-aste" depends="ats-common"> |
345 <var name="ats.drop.file" value="ATSAsteDrop.zip" /> |
407 <var name="ats.drop.file" value="ATSAsteDrop.zip" /> |
363 @scope public |
425 @scope public |
364 --> |
426 --> |
365 <property name="ats.aste.email.list" value="" /> |
427 <property name="ats.aste.email.list" value="" /> |
366 </target> |
428 </target> |
367 |
429 |
368 <!-- This macro fetches the tsrc paths from system definition file (layers.sysdef.xml), layer defintion should look like |
430 <!-- This macro fetches the tsrc paths from system definition file (layers.sysdef.xml). |
369 <pre> |
431 |
370 <layer name="name_test_layer"> |
432 The layer defintion should look like: |
371 <module name="module_name"> |
433 |
372 <unit id="unit_id" name="unti_name" bldFile="path_of_tsrc_folder_to_be_built" filter="" /> |
434 <layer name="name_test_layer"> |
373 </module> |
435 <module name="module_name"> |
374 </layer> |
436 <unit id="unit_id" name="unti_name" bldFile="path_of_tsrc_folder_to_be_built" filter="" /> |
375 </pre> |
437 </module> |
|
438 </layer> |
376 --> |
439 --> |
377 <scriptdef name="getModuleTsrcMacro" language="jython" uri="http://www.nokia.com/helium"> |
440 <scriptdef name="getModuleTsrcMacro" language="jython" uri="http://www.nokia.com/helium"> |
378 <attribute name="property" /> |
441 <attribute name="property" /> |
379 <attribute name="prefix"/> |
442 <attribute name="prefix"/> |
380 import traceback |
443 import traceback |
381 import os |
444 import os |
382 import atsant |
445 import atsant |
383 from com.nokia.ant.util import Helper |
446 from com.nokia.ant.util import Helper |
384 |
447 |
385 canonicalsysdeffile = Helper.getProperty(project, 'canonical.sysdef.file') |
448 canonicalsysdeffile = Helper.getProperty(project, 'canonical.sysdef.file') |
386 modules = atsant.files_to_test(canonicalsysdeffile, project.getProperty('exclude.test.layers'), project.getProperty('ido.build.filter'), project.getProperty('build.drive')) |
449 createsingledropfile = project.getProperty('ats.create.singledrop.file') |
|
450 modules = atsant.files_to_test(canonicalsysdeffile, project.getProperty('exclude.test.layers'), project.getProperty('ido.build.filter'), project.getProperty('build.drive'), createsingledropfile) |
387 |
451 |
388 for name in modules.keys(): |
452 for name in modules.keys(): |
389 if modules[name] == []: |
453 if modules[name] == []: |
390 del modules[name] |
454 del modules[name] |
391 else: |
455 else: |
394 project.setProperty(attributes.get('property'), ",".join(modules.keys())) |
458 project.setProperty(attributes.get('property'), ",".join(modules.keys())) |
395 project.setProperty('ats.drops.count', str(len(modules))) |
459 project.setProperty('ats.drops.count', str(len(modules))) |
396 </scriptdef> |
460 </scriptdef> |
397 |
461 |
398 <!-- The target is dependent on "ats-test", should not be called individually. The target creates the ATSdrop.zip file including test:xml file --> |
462 <!-- 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"> |
463 <target name="ats-create-drop" depends="ats-set-flash-image-path,ats-emulator-zip"> |
400 <mkdir dir="${build.output.dir}/ats" /> |
464 <mkdir dir="${build.output.dir}/ats" /> |
401 <hlm:getModuleTsrcMacro property="module.list" prefix="module.tsrc" /> |
465 <hlm:getModuleTsrcMacro property="module.list" prefix="module.tsrc" /> |
402 <if> |
466 <if> |
403 <scriptcondition language="beanshell"> |
467 <scriptcondition language="beanshell"> |
404 <![CDATA[ |
468 <![CDATA[ |
429 <arg value="--device-type=${ats.product.name}" /> |
493 <arg value="--device-type=${ats.product.name}" /> |
430 <arg value="--device-hwid=${ats.product.hwid}" /> |
494 <arg value="--device-hwid=${ats.product.hwid}" /> |
431 <arg value="${internal.ats.diamonds.arg}" /> |
495 <arg value="${internal.ats.diamonds.arg}" /> |
432 <arg value="--drop-file=${build.output.dir}/ats/${ats.drop.file}" /> |
496 <arg value="--drop-file=${build.output.dir}/ats/${ats.drop.file}" /> |
433 <arg value="--report-email=${ats.email.list}" /> |
497 <arg value="--report-email=${ats.email.list}" /> |
|
498 <arg value="--report-type=${ats.report.type}" /> |
434 <arg value="--plan-name=${ats.plan.name}" /> |
499 <arg value="--plan-name=${ats.plan.name}" /> |
435 <arg value="--testrun-name=${ats.testrun.name}_@{module}" /> |
500 <arg value="--testrun-name=${ats.testrun.name}_@{module}" /> |
436 <arg value="--flash-images=${ats.flash.images}" /> |
501 <arg value="--flash-images=${ats.flash.images}" /> |
437 <arg value="--minimum-flash-images=${ats.flashfiles.minlimit}" /> |
502 <arg value="--minimum-flash-images=${ats.flashfiles.minlimit}" /> |
438 <arg value="--target-platform=${ats.target.platform}" /> |
503 <arg value="--target-platform=${ats.target.platform}" /> |
448 <arg value="--monsym-files=${ats.ctc.monsyms}" /> |
513 <arg value="--monsym-files=${ats.ctc.monsyms}" /> |
449 <arg value="--config=${ats.config.file}" /> |
514 <arg value="--config=${ats.config.file}" /> |
450 <arg value="--obey-pkgfiles=${ats.obey.pkgfiles.rule}" /> |
515 <arg value="--obey-pkgfiles=${ats.obey.pkgfiles.rule}" /> |
451 <arg value="--ats4-enabled=${ats4.enabled}" /> |
516 <arg value="--ats4-enabled=${ats4.enabled}" /> |
452 <arg value="--specific-pkg=${ats.specific.pkg}" /> |
517 <arg value="--specific-pkg=${ats.specific.pkg}" /> |
|
518 <arg value="--hti=${ats.hti}" /> |
453 <arg value="--verbose" /> |
519 <arg value="--verbose" /> |
454 <arg line="${module.tsrc.@{module}}" /> |
520 <arg line="${module.tsrc.@{module}}" /> |
455 </exec> |
521 </exec> |
456 <runtarget target="do-ats-test" /> |
522 <antcall target="do-ats-test" /> |
457 <math result="drop.file.counter" operand1="1" operation="+" operand2="${drop.file.counter}" datatype="int" /> |
523 <math result="drop.file.counter" operand1="1" operation="+" operand2="${drop.file.counter}" datatype="int" /> |
458 </sequential> |
524 </sequential> |
459 </for> |
525 </for> |
460 </else> |
526 </else> |
461 </if> |
527 </if> |
658 </script> |
724 </script> |
659 </target> |
725 </target> |
660 |
726 |
661 <!-- Common target to run ats, aste and matti --> |
727 <!-- Common target to run ats, aste and matti --> |
662 <target name="run-test" depends="ats-test,ats-aste,matti-test"/> |
728 <target name="run-test" depends="ats-test,ats-aste,matti-test"/> |
|
729 |
|
730 <!-- Zip build area for emulator --> |
|
731 <target name="ats-emulator-zip" if="ats.emulator.enable"> |
|
732 <property name="zips.emulator_zip.spec.name" value="emulator_zip"/> |
|
733 <hlm:zipContentMacro type="emulator_zip" file="${helium.dir}/tools/testing/ats/emulator_zip.cfg.xml" /> |
|
734 |
|
735 <if> |
|
736 <isset property="ats.drop.location" /> |
|
737 <then> |
|
738 <property name="ats.flash.images" value="${ats.drop.location}\${build.id}_emulator_urel.zip"/> |
|
739 <copy file="${build.output.dir}/ats/${build.id}_emulator_urel.zip" tofile="${ats.flash.images}" /> |
|
740 </then> |
|
741 <else> |
|
742 <property name="ats.flash.images" value="${build.output.dir}/ats/${build.id}_emulator_urel.zip"/> |
|
743 </else> |
|
744 </if> |
|
745 </target> |
|
746 |
|
747 <!-- Generate and upload drop using custom template --> |
|
748 <target name="ats-custom-drop"> |
|
749 <mkdir dir="${build.output.dir}/ats" /> |
|
750 <runtarget target="ats-set-flash-image-path" /> |
|
751 <runtarget target="ats-set-defaults-stifeunit" /> |
|
752 <property name="ats.custom.template" value="${helium.dir}/tools/testing/ats/templates/ats4_naviengine_template.xml"/> |
|
753 <exec executable="python"> |
|
754 <arg line="-Wignore -m ats3.custom" /> |
|
755 <arg value="--custom-template=${ats.custom.template}" /> |
|
756 <arg value="--device-type=${ats.product.name}" /> |
|
757 <arg value="${internal.ats.diamonds.arg}" /> |
|
758 <arg value="--drop-file=${build.output.dir}/ats/${ats.drop.file}" /> |
|
759 <arg value="--report-email=${ats.email.list}" /> |
|
760 <arg value="--testrun-name=${ats.testrun.name}" /> |
|
761 <arg value="--flash-images=${ats.flash.images}" /> |
|
762 <arg value="--test-timeout=${ats.test.timeout}" /> |
|
763 <arg value="--test-type=${ats.custom.test.type}" /> |
|
764 </exec> |
|
765 <runtarget target="do-ats-test" /> |
|
766 </target> |
|
767 |
663 </project> |
768 </project> |