buildframework/helium/tools/testing/ats/ats.ant.xml
author Shabe Razvi <shaber@symbian.org>
Tue, 13 Jul 2010 18:36:46 +0100
branchhelium-7.0.x
changeset 615 23ca302eb377
parent 593 4367a1b2db65
permissions -rw-r--r--
Add prebuilt jar for changes in Bug 3222
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8"?>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     2
<!-- 
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     3
============================================================================ 
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     4
Name        : ats.ant.xml 
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     5
Part of     : Helium 
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     6
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     7
Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     8
All rights reserved.
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     9
This component and the accompanying materials are made available
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    10
under the terms of the License "Eclipse Public License v1.0"
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    11
which accompanies this distribution, and is available
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    12
at the URL "http://www.eclipse.org/legal/epl-v10.html".
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    13
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    14
Initial Contributors:
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    15
Nokia Corporation - initial contribution.
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    16
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    17
Contributors:
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    18
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    19
Description:
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    20
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    21
============================================================================
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    22
-->
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    23
<project name="_testing.ats" xmlns:hlm="http://www.nokia.com/helium">
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    24
    <description>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    25
        ATS testing targets.
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    26
    </description>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    27
    <!-- -->
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    28
    <fileset id="reference.ats.flash.images" dir="${release.images.dir}">
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    29
        <include name="**/${build.id}*.core.fpsx" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    30
        <include name="**/${build.id}*.rofs2.fpsx" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    31
        <include name="**/${build.id}*.rofs3.fpsx" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    32
        <include name="**/*rnd.C00" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    33
        <include name="**/*rnd.V01" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    34
        <include name="**/*.fpsx" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    35
        <include name="**/*_rnd.fpsx" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    36
    </fileset>
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    37
    
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    38
    <property name="ats.flashfiles.minlimit" value="2" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    39
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    40
    <fileset id="reference.ats.sis.images" dir="${ats.sis.images.dir}">
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    41
        <include name="**/*.sis" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    42
    </fileset>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    43
    <property name="ats.sisfiles.minlimit" value="1" />
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    44
    
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    45
    <var name="drop.file.counter" value="0" />
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    46
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    47
    <!-- 
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    48
    The target creates ATSDrop.zip file which also includes test.xml file; and sends the drop to ATS. 
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    49
    The layer definition, in system definition file, for tsrc directory should look like:
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    50
    <pre>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    51
    <layer name="name_test_layer">
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    52
        <module name="module_name">
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    53
            <unit id="unit_id" name="unti_name" bldFile="path_of_tsrc_folder_to_be_built" filter=""/>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    54
        </module>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    55
    </layer>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    56
    </pre>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    57
    -->
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    58
    <target name="ats-test" if="enabled.ats">
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    59
        <mkdir dir="${test.log.dir}"/>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    60
        <hlm:filterRecordStartMacro pattern="${ats.password}" category="ats"/>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    61
        <trycatch property="exception" reference="exception">
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    62
            <try>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    63
                <runtarget target="ats-delta"/>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    64
                <antcall target="create-canonical-sysdef-file" inheritRefs="true">
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    65
                    <reference refid="ats.system.definition.files" torefid="system.definition.files" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    66
                </antcall>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    67
                <runtarget target="copy-mon-sym" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    68
                <runtarget target="ats-create-drop" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    69
            </try>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    70
            <catch>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    71
                <if>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    72
                    <istrue value="${ats.delta.enabled}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    73
                    <then>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    74
                        <echo message="${exception}"/>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    75
                    </then>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    76
                    <else>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    77
                        <throw refid="exception"/>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    78
                    </else>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    79
                </if>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    80
            </catch>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    81
        </trycatch>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    82
        <hlm:filterRecordStopMacro log="${test.log.dir}/${build.id}_ats.log" append="false"/>
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    83
        <hlm:metadatarecord database="${metadata.dbfile}">
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    84
            <hlm:textmetadatainput>
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    85
                <fileset casesensitive="false" file="${test.log.dir}/${build.id}_ats.log" />
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    86
                <metadatafilterset refid="filterset.ats" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    87
            </hlm:textmetadatainput>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    88
        </hlm:metadatarecord>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    89
        <hlm:generateBuildStatus file="${build.id}_ats.log" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    90
    </target>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    91
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    92
    <!-- The target creates the ATSdrop.zip file including test.xml for ATS ASTE tests. This target is executable.-->
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    93
    <target name="ats-aste" if="enabled.aste">
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    94
        <mkdir dir="${test.log.dir}"/>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    95
        <hlm:filterRecordStartMacro pattern="${ats.password}" category="ats"/>
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    96
        <runtarget target="do-ats-aste" />
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    97
        <hlm:filterRecordStopMacro log="${test.log.dir}/${build.id}_aste.log" append="false"/>
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    98
        <hlm:metadatarecord database="${metadata.dbfile}">
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    99
            <hlm:textmetadatainput>
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   100
                <fileset casesensitive="false" file="${test.log.dir}/${build.id}_aste.log" />
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   101
                <metadatafilterset refid="filterset.aste" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   102
            </hlm:textmetadatainput>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   103
        </hlm:metadatarecord>
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   104
        <hlm:generateBuildStatus file="${build.id}_aste.log" />
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   105
    </target>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   106
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   107
    <!-- The target creates the MATTI_drop.zip file including test.xml for MATTI tests. This target is executable.-->
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   108
    <target name="matti-test" if="enabled.matti">
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   109
        <mkdir dir="${test.log.dir}"/>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   110
        <hlm:filterRecordStartMacro pattern="${ats.password}" category="ats"/>
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   111
        <runtarget target="do-ats-matti" />
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   112
        <hlm:filterRecordStopMacro log="${test.log.dir}/${build.id}_matti.log" append="false"/>
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   113
        <hlm:metadatarecord database="${metadata.dbfile}">
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   114
            <hlm:textmetadatainput>
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   115
                <fileset casesensitive="false" file="${test.log.dir}/${build.id}_matti.log" />
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   116
                <metadatafilterset refid="filterset.matti" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   117
            </hlm:textmetadatainput>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   118
        </hlm:metadatarecord>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   119
        <hlm:generateBuildStatus file="${build.id}_matti.log" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   120
    </target>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   121
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   122
    <!-- Sends drop file to ATS/ASTE. Please see `ats-test` for description. -->
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   123
    <target name="do-ats-test" depends="ats-username, ats-password" unless="skip.ats.sending">
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   124
        <property name="ats.sending" value="true" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   125
        <!-- Make the drop file visible to ATS. -->
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   126
        
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   127
        <var name="ats.drop.location.file" unset="true"/>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   128
        <if>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   129
            <isset property="ats.drop.location" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   130
            <then>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   131
                <mkdir dir="${ats.drop.location}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   132
                <property name="ats.drop.location.file" location="${ats.drop.location}/${ats.drop.file}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   133
                <copy file="${build.output.dir}/ats/${ats.drop.file}" tofile="${ats.drop.location.file}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   134
            </then>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   135
            <else>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   136
                <property name="ats.drop.location.file" location="${build.output.dir}/ats/${ats.drop.file}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   137
            </else>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   138
        </if>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   139
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   140
        <!-- Notify ATS about the drop. -->
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   141
        <if>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   142
            <istrue value="${ats4.enabled}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   143
            <then>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   144
                <hlm:python failonerror="true">
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   145
version = r'${java.version}'
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   146
if '1.6.0' in version:
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   147
    assert int(version.split('_')[1]) > 6, 'Java 6 u7 required'
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   148
                </hlm:python>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   149
                <condition property="ats.import.arg" value="-import" else="">
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   150
                    <equals arg1="${ats.script.type}" arg2="import" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   151
                </condition>
593
4367a1b2db65 helium_7.0.x-r16015
wbernard
parents: 179
diff changeset
   152
                <condition property="ats4.libs" value="${helium.dir}/extensions/nokia/external/ats4" else="${helium.dir}/external/antlibs">
4367a1b2db65 helium_7.0.x-r16015
wbernard
parents: 179
diff changeset
   153
                    <available type="dir" file="${helium.dir}/extensions/nokia/external/ats4"/>
4367a1b2db65 helium_7.0.x-r16015
wbernard
parents: 179
diff changeset
   154
                </condition>
4367a1b2db65 helium_7.0.x-r16015
wbernard
parents: 179
diff changeset
   155
                <java classname="com.nokia.ats.util.server.CommandLineClient" fork="true" maxmemory="512m">
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   156
                    <classpath>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   157
                        <pathelement path="${java.class.path}"/>
593
4367a1b2db65 helium_7.0.x-r16015
wbernard
parents: 179
diff changeset
   158
                        <fileset dir="${ats4.libs}" includes="*.jar"/>
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   159
                    </classpath>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   160
                    <arg line="-url http://${ats.server}/ServerService -path ${ats.drop.location.file} ${ats.import.arg}"/>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   161
                </java>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   162
            </then>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   163
            <else>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   164
                <condition property="ats.wsh.testrun.file" value="wshTestRunImport.vbs" else="wshTestRunX.vbs">
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   165
                    <equals arg1="${ats.script.type}" arg2="import" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   166
                </condition>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   167
                <exec executable="cscript" dir="${build.drive}/" failonerror="false">
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   168
                    <env key="ats3.username" value="${ats.username}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   169
                    <env key="ats3.password" value="${ats.password}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   170
                    <env key="ats3.host" value="${ats.server}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   171
                    <env key="ats3.pathToDrop" value="${ats.drop.location.file}"/>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   172
                    <arg value="${helium.dir}/tools/testing/ats/${ats.wsh.testrun.file}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   173
                </exec>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   174
            </else>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   175
        </if>
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   176
    </target>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   177
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   178
    <!-- The target is dependent on "ats-test", should not be called independently. The target fetches flash files location -->
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   179
    <target name="ats-set-flash-image-path">
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   180
        <pathconvert pathsep="," property="ats.flash.images">
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   181
            <fileset refid="reference.ats.flash.images"/>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   182
        </pathconvert>
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   183
        <hlm:python failonerror="true">
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   184
<![CDATA[
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   185
flashfilescount = len(r'${ats.flash.images}'.split(','))
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   186
mincount = int(r'${ats.flashfiles.minlimit}')
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   187
if flashfilescount < mincount:
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   188
    raise Exception('Not enough flash files, check reference.ats.flash.images')
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   189
]]>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   190
        </hlm:python>
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   191
    </target>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   192
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   193
    <!-- The target is dependent on "ats-test", should not be called independently. The target fetches flash files location -->
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   194
    <target name="ats-set-sis-flash-image-path">
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   195
        <pathconvert pathsep="," property="ats.sis.images">
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   196
            <fileset refid="reference.ats.sis.images"/>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   197
        </pathconvert>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   198
    </target>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   199
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   200
    <!-- Sets values common for ATS, this is a dependent target and shouldn't be used as an individual target -->
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   201
    <target name="ats-common">
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   202
        <property name="ats.config.file" value="" />
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   203
        <property name="ats4.enabled" value="False" />
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   204
        <property name="ats.product.hwid" value="" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   205
        <property name="ats.test.timeout" value="60" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   206
        <property name="ats.report.location" value="${publish.dir}/${publish.subdir}" />
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   207
        <condition property="internal.ats.diamonds.arg" value="--diamonds-build-url=http://${diamonds.host}${diamonds.build.id}" else="">
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   208
            <isset property="diamonds.build.url" />
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   209
        </condition>
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   210
    </target>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   211
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   212
    <!-- Sets default values for the ATS (STIF and EUnit), this is a dependent target and shouldn't be used as an individual target -->
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   213
    <target name="ats-set-defaults-stifeunit" depends="ats-common,lookup-email">
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   214
        <!-- Default values for the properties -->
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   215
        <property name="ats.email.list" value="${email.from}" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   216
        <property name="tsrc.data.dir" value="data" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   217
        <property name="ats.plan.name" value="plan" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   218
        <property name="ats.testrun.name" value="${build.id}_${ats.product.name}" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   219
        <property name="ats.ctc.host" value="" />
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   220
        <condition property="ats.version" value="4" else="3">
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   221
            <istrue value="${ats4.enabled}" />
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   222
        </condition>
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   223
        <var name="ats.drop.file" value="ATS${ats.version}Drop${drop.file.counter}.zip" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   224
        
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   225
        <property name="ats.target.platform" value="armv5 urel" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   226
        <property name="ats.trace.enabled" value="False" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   227
        <property name="ats.ctc.enabled" value="False" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   228
        <property name="ats.multiset.enabled" value="False" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   229
        <property name="eunitexerunner.flags" value="/E S60AppEnv /R Off" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   230
        <property name="ats.obey.pkgfiles.rule" value="False" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   231
    </target>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   232
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   233
    <!-- Sets default values for the ASTE, this is a dependent target and shouldn't be used as an individual target -->
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   234
    <target name="ats-set-defaults-aste" depends="ats-common">
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   235
        <var name="ats.drop.file" value="ATSAsteDrop.zip" />
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   236
        <property name="ats.aste.test.type" value="smoke" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   237
        <property name="ats.aste.testasset.caseids" value="100,101,102,103,105,106,107,108,109,110,111,112,113,114,115" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   238
        <property name="ats.aste.software.version" value="${build.id}" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   239
        <property name="ats.aste.language" value="English" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   240
        <property name="ats.aste.software.release" value="${build.name}" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   241
        <property name="ats.aste.plan.name" value="plan" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   242
        <property name="ats.aste.testrun.name" value="${build.id}_${ats.product.name}_${major.version}.${minor.version}" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   243
        <property name="ats.aste.email.list" value="" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   244
    </target>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   245
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   246
    <!-- This macro fetches the tsrc paths from system definition file (layers.sysdef.xml), layer defintion should look like
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   247
    <pre>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   248
    <layer name="name_test_layer">
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   249
        <module name="module_name">
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   250
            <unit id="unit_id" name="unti_name" bldFile="path_of_tsrc_folder_to_be_built" filter="" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   251
        </module>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   252
    </layer>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   253
    </pre>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   254
    -->
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   255
    <scriptdef name="getModuleTsrcMacro" language="jython" uri="http://www.nokia.com/helium">
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   256
        <attribute name="property" />
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   257
        <attribute name="prefix"/>        
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   258
import traceback
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   259
import os
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   260
import atsant
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   261
from com.nokia.ant.util import Helper
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   262
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   263
canonicalsysdeffile = Helper.getProperty(project, 'canonical.sysdef.file')
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   264
modules = atsant.files_to_test(canonicalsysdeffile, project.getProperty('exclude.test.layers'), project.getProperty('ido.build.filter'), project.getProperty('build.drive'))
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   265
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   266
for name in modules.keys():    
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   267
    if modules[name] == []:
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   268
        del modules[name]
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   269
    else:
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   270
        project.setProperty("%s.%s" % (attributes.get('prefix'), name), " ".join(modules[name]))
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   271
        
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   272
project.setProperty(attributes.get('property'), ",".join(modules.keys()))
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   273
project.setProperty('ats.drops.count', str(len(modules)))
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   274
    </scriptdef>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   275
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   276
    <!-- The target is dependent on "ats-test", should not be called individually. The target creates the ATSdrop.zip file including test:xml file -->
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   277
    <target name="ats-create-drop" depends="ats-set-flash-image-path">
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   278
        <mkdir dir="${build.output.dir}/ats" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   279
        <hlm:getModuleTsrcMacro property="module.list" prefix="module.tsrc" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   280
        <if>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   281
            <scriptcondition language="beanshell">
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   282
                <![CDATA[
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   283
                    String value = project.getProperty("module.list");
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   284
                    if (value != null) {
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   285
                        String[] out = value.split(",");
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   286
                        if ((out == null) || (out.length == 0) || ((out.length == 1) && (out[0].length()==0))) {
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   287
                                    self.setValue(true);
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   288
                            } else {
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   289
                                    self.setValue(false);
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   290
                            }
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   291
                        } else {
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   292
                            self.log("Error: module.list not defined.");
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   293
                            self.setValue(true);
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   294
                        }
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   295
                            ]]>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   296
            </scriptcondition>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   297
            <then>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   298
                <echo message="Error: No test modules found!" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   299
            </then>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   300
            <else>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   301
                <for list="${module.list}" delimiter="," param="module">
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   302
                    <sequential>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   303
                        <runtarget target="ats-set-defaults-stifeunit" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   304
                        <echo>${ats.drop.file}</echo>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   305
                        <exec executable="python">
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   306
                            <arg value="${helium.dir}/tools/common/python/lib/ats3/__init__.py" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   307
                            <arg value="--device-type=${ats.product.name}" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   308
                            <arg value="--device-hwid=${ats.product.hwid}" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   309
                            <arg value="${internal.ats.diamonds.arg}" />
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   310
                            <arg value="--drop-file=${build.output.dir}/ats/${ats.drop.file}" />
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   311
                            <arg value="--report-email=${ats.email.list}" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   312
                            <arg value="--plan-name=${ats.plan.name}" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   313
                            <arg value="--testrun-name=${ats.testrun.name}_@{module}" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   314
                            <arg value="--flash-images=${ats.flash.images}" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   315
                            <arg value="--minimum-flash-images=${ats.flashfiles.minlimit}" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   316
                            <arg value="--target-platform=${ats.target.platform}" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   317
                            <arg value="--data-dir=${tsrc.data.dir}" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   318
                            <arg value="--test-timeout=${ats.test.timeout}" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   319
                            <arg value="--build-drive=${build.drive}" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   320
                            <arg value="--trace-enabled=${ats.trace.enabled}" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   321
                            <arg value="--ctc-enabled=${ats.ctc.enabled}" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   322
                            <arg value="--multiset-enabled=${ats.multiset.enabled}" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   323
                            <arg value="--file-store=${ats.report.location}" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   324
                            <arg value="--eunitexerunner-flags=${eunitexerunner.flags}" />
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   325
                            <arg value="--ctc-run-process-params=${ats.ctc.host}#${ats.drop.file}#${ats.drops.count}" /> <!-- Three differnt value are combined with '#' character which is later parsed inside the script -->
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   326
                            <arg value="--monsym-files=${ats.ctc.monsyms}" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   327
                            <arg value="--config=${ats.config.file}" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   328
                            <arg value="--obey-pkgfiles=${ats.obey.pkgfiles.rule}" />
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   329
                            <arg value="--ats4-enabled=${ats4.enabled}" />
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   330
                            <arg value="--verbose" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   331
                            <arg line="${module.tsrc.@{module}}" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   332
                        </exec>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   333
                        <runtarget target="do-ats-test" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   334
                        <math result="drop.file.counter" operand1="1" operation="+" operand2="${drop.file.counter}" datatype="int" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   335
                    </sequential>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   336
                </for>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   337
            </else>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   338
        </if>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   339
    </target>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   340
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   341
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   342
    <!-- Please see ats-aste for description.-->
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   343
    <target name="do-ats-aste" depends="ats-set-flash-image-path, ats-set-defaults-aste" if="enabled.aste">
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   344
        <mkdir dir="${build.output.dir}/ats" />
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   345
        <exec executable="python">
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   346
            <arg value="${helium.dir}/tools/common/python/lib/ats3/aste.py" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   347
            <arg value="--report-email=${ats.aste.email.list}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   348
            <arg value="--device-type=${ats.product.name}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   349
            <arg value="--flash-images=${ats.flash.images}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   350
            <arg value="--minimum-flash-images=${ats.flashfiles.minlimit}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   351
            <arg value="--plan-name=${ats.aste.plan.name}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   352
            <arg value="--testrun-name=${ats.aste.testrun.name}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   353
            <arg value="--device-hwid=${ats.product.hwid}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   354
            <arg value="--test-timeout=${ats.test.timeout}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   355
            <arg value="--build-drive=${build.drive}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   356
            <arg value="${internal.ats.diamonds.arg}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   357
            <arg value="--drop-file=${build.output.dir}/ats/${ats.drop.file}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   358
            <arg value="--test-type=${ats.aste.test.type}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   359
            <arg value="--testasset-location=${ats.aste.testasset.location}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   360
            <arg value="--testasset-caseids=${ats.aste.testasset.caseids}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   361
            <arg value="--software-version=${ats.aste.software.version}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   362
            <arg value="--device-language=${ats.aste.language}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   363
            <arg value="--software-release=${ats.aste.software.release}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   364
            <arg value="--ats4-enabled=${ats4.enabled}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   365
            <arg value="--verbose" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   366
        </exec>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   367
        <runtarget target="do-ats-test" />
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   368
    </target>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   369
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   370
    <!--
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   371
        This target search the mon.sym files using unit information from the canonical sysdef file.
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   372
        Then it copies the discovered files under the ftp server defined by ats.ctc.host.
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   373
        The target url is: ftp ://[server]/ctc_helium/[diamonds_id]/mon_syms/[id]/mon.sym 
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   374
    -->
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   375
    <target name="copy-mon-sym">
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   376
        <if>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   377
            <istrue value="${ats.ctc.enabled}"/>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   378
            <then>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   379
                <fmpp sourceFile="${helium.dir}/tools/testing/ats/templates/monsym-file-list.txt.ftl"
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   380
                    outputFile="${temp.build.dir}/monsym-file-list.txt">
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   381
                    <data expandProperties="yes">
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   382
                        data: xml(${canonical.sysdef.file})
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   383
                        ant: antProperties()
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   384
                    </data>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   385
                </fmpp>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   386
                <hlm:path2file reference="mon.sym.list" file="${temp.build.dir}/monsym-file-list.txt" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   387
                <script language="jython">
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   388
import os
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   389
import ctc
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   390
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   391
if not project.getProperty('ats.ctc.host'):
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   392
    raise Exception('ats.ctc.host property is not defined.')
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   393
if not project.getProperty('diamonds.build.id'):
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   394
    raise Exception('diamonds.build.id property is not defined.')
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   395
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   396
server = project.getProperty('ats.ctc.host')
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   397
diamondsid = os.path.basename(os.path.dirname(project.getProperty('diamonds.build.id')))
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   398
path = project.getReference('mon.sym.list')
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   399
if not path:
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   400
    raise Exception('mon.sym.list reference has not been set')
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   401
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   402
uploader = ctc.MonSymFTPUploader(server, path.list(), diamondsid)
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   403
monsyms = uploader.upload()
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   404
            
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   405
# Using ; to separate the path because the target script is running on windows
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   406
project.setNewProperty('ats.ctc.monsyms', ';'.join([ "//%s/%s" % (server, x) for x in monsyms]))
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   407
                </script>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   408
                <echo>ats.ctc.monsyms: ${ats.ctc.monsyms}</echo>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   409
            </then>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   410
        </if>
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   411
    </target>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   412
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   413
    <!-- a dependant target please do not call directly use matti-test,
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   414
    target calls the MATTI script that creates the MATTI_drop.zip file and runs the tests
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   415
    listed in test.rb.  ats-set-flash-image-path and ats-set-sis-flash-image-path look for lists of files-->
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   416
    <target name="do-ats-matti" depends="ats-set-flash-image-path, ats-set-sis-flash-image-path" >
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   417
        <runtarget target="ats-set-defaults-stifeunit" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   418
        <!--need to set theseup for use by do-ats-test target-->
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   419
        <mkdir dir="${build.output.dir}/ats" />
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   420
        <var name="ats.drop.file" value="ATSMattiDrop.zip" />
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   421
        <if>
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   422
            <!-- get the list of .sis files in the defined folder to pass as a list to the python script-->
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   423
            <scriptcondition language="beanshell">
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   424
                <![CDATA[
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   425
                    String sisfiles = project.getProperty("ats.sis.images");
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   426
                    String value = project.getProperty("ats.sisfiles.minlimit");
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   427
                    if (sisfiles != null && value != null) {
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   428
                        int cond = Integer.valueOf(value).intValue();
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   429
                        String[] out = sisfiles.split(",");
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   430
                        if (out.length < cond ) {
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   431
                            self.setValue(true);
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   432
                        } else {
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   433
                            self.setValue(false);
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   434
                        }
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   435
                    } else {
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   436
                        self.log("Error: reference.ats.sis.images not defined.");
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   437
                        self.setValue(true);
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   438
                    }
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   439
                        ]]>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   440
            </scriptcondition>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   441
            <then>
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   442
                <echo message="Error: Not enough sis files check reference.ats.sis.images" />
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   443
            </then>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   444
            <else>
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   445
                <!-- execute the MattiDrops.py script with parameters-->
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   446
                <exec executable="python" resultproperty="script.response">
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   447
                    <arg value="${helium.dir}/tools/common/python/lib/ats3/matti/MattiDrops.py" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   448
                    <arg value="--build-drive=${build.drive}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   449
                    <arg value="--matti-scripts=${matti.scripts}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   450
                    <arg value="--flash-images=${ats.flash.images}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   451
                    <arg value="--harness=STIF" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   452
                    <arg value="--file-store=${ats.output.dir}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   453
                    <arg value="--testrun-name=${ats.testrun.name}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   454
                    <arg value="--device-type=${ats.product.name}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   455
                    <arg value="--device-hwid=${ats.product.hwid}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   456
                    <arg value="--diamonds-build-url=${internal.ats.diamonds.arg}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   457
                    <arg value="--drop-file=${build.output.dir}/ats/${ats.drop.file}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   458
                    <arg value="--minimum-flash-images=${ats.flashfiles.minlimit}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   459
                    <arg value="--plan-name=${ats.plan.name}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   460
                    <arg value="--sis-files=${ats.sis.images}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   461
                    <arg value="--template-loc=${template.file}" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   462
                </exec>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   463
                <if> 
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   464
                    <not>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   465
                        <!-- if the response is not 0 then need to create the skip.ats.sending
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   466
                         flag so that do-ats-test is not run-->
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   467
                        <equals arg1="${script.response}" arg2="0" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   468
                    </not>
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   469
                    <then>
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   470
                        <property name="skip.ats.sending" value="1" />
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   471
                    </then>
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   472
                </if>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   473
                <runtarget target="do-ats-test" />
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   474
            </else>
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   475
        </if>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   476
    </target>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   477
    
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   478
    <property name="ats.evalid.pre" value="${temp.build.dir}/${build.id}_atsevalidpre" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   479
    <property name="ats.evalid.post" value="${temp.build.dir}/${build.id}_atsevalidpost" />
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   480
    
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   481
    <!-- Call before preperation -->
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   482
    <target name="find-files-pre" if="ats.delta.enabled">
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   483
        <hlm:evalidMacro dir="${ats.evalid.pre}"/>
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   484
    </target>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   485
    
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   486
    <!-- Call after preperation -->
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   487
    <target name="find-files-post" if="ats.delta.enabled">
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   488
        <hlm:evalidMacro dir="${ats.evalid.post}"/>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   489
    </target>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   490
    
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   491
    <!-- Run evalid on ido directories -->
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   492
    <macrodef name="evalidMacro" uri="http://www.nokia.com/helium">
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   493
        <attribute name="dir"/>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   494
        <sequential>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   495
            <runtarget target="ido-create-ado-mapping"/>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   496
            <hlm:python>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   497
import delta_zip
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   498
delta_zip.evalidAdomapping(r'${build.drive}', r'@{dir}', r'${ado.mapping.file}')
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   499
            </hlm:python>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   500
        </sequential>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   501
    </macrodef>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   502
    
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   503
    <!-- Generate sysdef fileset based on evalid data -->
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   504
    <target name="ats-delta" if="ats.delta.enabled">
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   505
        <script language="jython">
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   506
import ido
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   507
from com.nokia.ant.util import Helper
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   508
import delta_zip
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   509
import os
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   510
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   511
atspath = project.createDataType("path")
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   512
i = project.getReference('system.definition.files').iterator()
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   513
changedfiles = delta_zip.changedFiles(Helper.getProperty(project, 'ats.evalid.pre'), Helper.getProperty(project, 'ats.evalid.post'))
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   514
while i.hasNext():
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   515
    path = i.next().toString()
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   516
    sysdefpath = os.path.abspath(os.path.join(project.getProperty('build.drive') + os.sep, ido.get_sysdef_location(path)))
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   517
    for f in changedfiles:
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   518
        if sysdefpath.lower() in os.path.abspath(f).lower():
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   519
            pe = atspath.createPathElement()
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   520
            pe.setPath(path)
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   521
            break
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   522
project.addReference('ats.system.definition.files', atspath)
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   523
        </script>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   524
    </target>
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   525
    
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   526
    <!-- Common target to run ats, aste and matti -->
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
   527
    <target name="run-test" depends="ats-test,ats-aste,matti-test"/>
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   528
</project>