buildframework/helium/tools/compile/coverity.ant.xml
author Bob Rosenberg <bob.rosenberg@nokia.com>
Wed, 28 Jul 2010 13:20:46 +0100
changeset 624 f70b728ea30c
parent 587 85df38eb4012
child 628 7c4a911dc066
permissions -rw-r--r--
Move sysdeftools from buildtools package into build package
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
217
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8"?>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
     2
<!-- 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
     3
============================================================================ 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
     4
Name        : coverity.ant.xml 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
     5
Part of     : Helium 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
     6
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
     7
Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
     8
All rights reserved.
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
     9
This component and the accompanying materials are made available
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    10
under the terms of the License "Eclipse Public License v1.0"
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    11
which accompanies this distribution, and is available
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    12
at the URL "http://www.eclipse.org/legal/epl-v10.html".
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    13
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    14
Initial Contributors:
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    15
Nokia Corporation - initial contribution.
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    16
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    17
Contributors:
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    18
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    19
Description:
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    20
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    21
============================================================================
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    22
-->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    23
<project name="compile.coverity" xmlns:hlm="http://www.nokia.com/helium">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    24
    <description>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    25
        code-coverity measure.
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    26
    </description>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    27
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    28
    <!-- Coverity property declaration and types defination-->
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    29
    <!--* @property enabled.coverity
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    30
    Value must be set to execute coverity targets.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    31
    @type boolean
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    32
    @editable required
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    33
    @scope public
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    34
    -->
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    35
    <!--* @property run.coverity
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    36
    Value will be set to if enabled.coverity set tot true.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    37
    @type string
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    38
    @scope private
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    39
    -->
217
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    40
    <!-- coverity output directory location
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    41
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    42
    @scope private
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    43
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    44
    <property name="coverity.output.dir" location="${build.output.dir}/coverity"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    45
    <!-- coverity log directory location
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    46
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    47
    @scope private
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    48
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    49
    <property name="coverity.log.dir" location="${build.log.dir}/coverity"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    50
    <!-- coverity link directory location
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    51
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    52
    @scope private
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    53
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    54
    <property name="coverity.link.dir" value="${coverity.output.dir}/coveritylink"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    55
    <!-- coverity config directory location
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    56
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    57
    @scope private
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    58
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    59
    <property name="coverity.config.dir" value="${coverity.output.dir}/config"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    60
    <!-- coverity analyze directory location
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    61
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    62
    @scope private
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    63
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    64
    <property name="coverity.analyze.dir" value="${coverity.link.dir}/analyze"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    65
    <!-- coverity intermidiate directory location
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    66
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    67
    @scope private
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    68
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    69
    <property name="coverity.inter.dir" value="${coverity.output.dir}/intermidiate"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    70
    <!-- coverity report directory location
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    71
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    72
    @scope private
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    73
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    74
    <property name="coverity.report.dir" value="${coverity.output.dir}/coverity_report_${build.id}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    75
    <!-- coverity report file name
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    76
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    77
    @scope private
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    78
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    79
    <property name="coverity.report.file" value="${build.id}_coverity_build_report.html"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    80
    <!-- coverity summary XML file name
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    81
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    82
    @scope private
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    83
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    84
    <property name="coverity.summary.xml.file" value="${temp.build.dir}/${build.id}_coverity_build_summary.xml"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    85
    <!-- coverity checkers XML file name
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    86
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    87
    @scope private
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    88
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    89
    <property name="coverity.checkers.xml.file" value="${temp.build.dir}/${build.id}_coverity_build_checkers.xml"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    90
    <!-- diamonds coverity report file name
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    91
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    92
    @scope private
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    93
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    94
    <property name="diamonds.coverity.report.file" value="${temp.build.dir}/${build.id}_coverity_build_report.xml"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    95
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    96
    <if>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    97
        <isset property="env.NUMBER_OF_PROCESSORS"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    98
        <then>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    99
            <math result="coverity.no.thread" operand1="${env.NUMBER_OF_PROCESSORS}" operation="*" operand2="2" datatype="int"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   100
        </then>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   101
        <else>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   102
            <!-- Number of parallel coverity emit threads can run.
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   103
            @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   104
            @scope private
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   105
            -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   106
            <property name="coverity.no.thread" value="2"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   107
        </else>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   108
    </if>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   109
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   110
    <!-- set property if coverity is enabled -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   111
    <condition property="run.coverity">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   112
        <istrue value="${enabled.coverity}" />
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   113
    </condition>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   114
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   115
    <!-- cov-build command options -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   116
    <hlm:coverityoptions id="coverity.build.options">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   117
        <arg name="--config" value="${coverity.config.dir}/coverity_config.xml"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   118
        <arg name="--dir" value="${coverity.inter.dir}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   119
        <arg name="--auto-diff" value=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   120
        <arg name="--preprocess-first" value=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   121
        <arg name="--record-only" value=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   122
    </hlm:coverityoptions>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   123
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   124
    <!-- cov-build emit command options -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   125
    <hlm:coverityoptions id="coverity.emit.options">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   126
        <arg name="--config" value="${coverity.config.dir}/coverity_config.xml"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   127
        <arg name="--dir" value="${coverity.inter.dir}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   128
        <arg name="--replay" value=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   129
        <arg name="--replay-processes" value="${coverity.no.thread}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   130
    </hlm:coverityoptions>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   131
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   132
    <!-- cov-config command options -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   133
    <hlm:coverityoptions id="coverity.config.options">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   134
        <hlm:arg name="--config" value="${coverity.config.dir}/coverity_config.xml"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   135
        <hlm:arg name="--template" value=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   136
        <hlm:arg name="--comptype" value="armcc"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   137
        <hlm:arg name="--compiler" value="armcc.exe"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   138
    </hlm:coverityoptions>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   139
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   140
    <!-- cov-analyze command options -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   141
    <hlm:coverityoptions id="coverity.analyze.options">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   142
        <hlm:arg name="--dir" value="${coverity.analyze.dir}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   143
        <hlm:arg name="--all" value=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   144
        <hlm:arg name="--symbian" value=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   145
        <hlm:arg name="--append" value=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   146
        <hlm:arg name="--enable-callgraph-metrics" value=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   147
    </hlm:coverityoptions>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   148
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   149
    <!-- To run post coverity steps -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   150
    <target name="post-coverity" if="run.coverity">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   151
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   152
        <!-- To emit the file into defect database -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   153
        <antcall target="run-coverity-emit"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   154
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   155
        <!-- To analyze the sources file -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   156
        <antcall target="run-coverity-analyze"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   157
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   158
        <!-- To generate the HTML error pages -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   159
        <antcall target="gen-coverity-report"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   160
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   161
    </target>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   162
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   163
    <!-- Run coverity configure if the enabled.coverity is set to true -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   164
    <target name="run-coverity-configure" if="run.coverity">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   165
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   166
        <hlm:coverity command="cov-configure" dir="${build.drive}/">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   167
            <hlm:coverityoptions refid="coverity.config.options"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   168
        </hlm:coverity >
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   169
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   170
    </target>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   171
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   172
    <!-- Run coverity build with emit options if the enabled.coverity is set to true 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   173
     re-running the cov-build with replay option will reduce the build time by ~ 20% 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   174
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   175
    <target name="run-coverity-emit" >
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   176
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   177
        <hlm:coverity command="cov-build" dir="${build.drive}/">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   178
            <hlm:coverityoptions refid="coverity.emit.options"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   179
        </hlm:coverity >
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   180
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   181
    </target>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   182
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   183
    <!-- Run coverity-analyze if the enabled.coverity is set to true 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   184
     Sometimes the same file is compiled several times with different command-line options. 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   185
     Due to the inherent difficulty of tracking linkage information, the cov-analyze command cannot automatically determine which files are linked together. 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   186
     To avoid errors in function call resolution (especially in C code, which doesn't have any name mangling), use the cov-link command to get this information. 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   187
     
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   188
     and also
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   189
     
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   190
     working with link files is faster than collecting data from the intermediate directory multiple times
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   191
     
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   192
     So run the cov-link commands and analyze the database using cov-analyze command.
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   193
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   194
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   195
    <target name="run-coverity-analyze" >
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   196
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   197
        <mkdir dir="${coverity.link.dir}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   198
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   199
        <hlm:coverity command="cov-link" dir="${build.drive}/">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   200
            <hlm:arg name="--dir" value="${coverity.inter.dir}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   201
            <hlm:arg name="--collect" value=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   202
            <hlm:arg name="-of" value="${coverity.link.dir}/all.link"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   203
        </hlm:coverity >
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   204
                
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   205
        <hlm:coverity command="cov-link" dir="${build.drive}/">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   206
            <hlm:arg name="--dir" value="${coverity.inter.dir}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   207
            <hlm:arg name="--compile-arg" value="armv5"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   208
            <hlm:arg name="-of" value="${coverity.link.dir}/armv5.link"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   209
            <hlm:arg name="${coverity.link.dir}/all.link" value=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   210
        </hlm:coverity >
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   211
             
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   212
        <hlm:coverity command="cov-link" dir="${build.drive}/">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   213
            <hlm:arg name="--dir" value="${coverity.inter.dir}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   214
            <hlm:arg name="--output-dir" value="${coverity.analyze.dir}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   215
            <hlm:arg name="${coverity.link.dir}/armv5.link" value=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   216
        </hlm:coverity >
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   217
                
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   218
        <hlm:coverity command="cov-analyze" dir="${build.drive}/">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   219
            <hlm:coverityoptions refid="coverity.analyze.options"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   220
        </hlm:coverity >
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   221
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   222
    </target>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   223
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   224
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   225
    <!-- Generate coverity report -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   226
    <target name="gen-coverity-report">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   227
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   228
        <!-- Read the summary file generated by cov-analyze and generate html file -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   229
        <fmpp sourceFile="${helium.dir}/tools/common/templates/coverity/coverity.summary.html.ftl"
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   230
              outputFile="${temp.build.dir}/${build.id}_coverity_build_summary.html">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   231
            <data   expandProperties="yes">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   232
                    ant: antProperties()
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   233
                    covsummary: slicedText (${coverity.analyze.dir}/c/output/summary.txt)
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   234
            </data>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   235
        </fmpp>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   236
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   237
        <!-- To generate summary file for diamonds -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   238
        <fmpp sourceFile="${helium.dir}/tools/common/templates/coverity/coverity.summary.xml.ftl"
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   239
              outputFile="${coverity.summary.xml.file}">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   240
            <data   expandProperties="yes">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   241
                    ant: antProperties()
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   242
                    covsummary: slicedText (${coverity.analyze.dir}/c/output/summary.txt)
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   243
            </data>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   244
        </fmpp>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   245
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   246
        <!-- Run this to get the static html pages -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   247
        <hlm:coverity command="cov-format-errors" dir="${build.drive}/">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   248
            <hlm:arg name="--dir" value="${coverity.analyze.dir}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   249
            <hlm:arg name="--filesort" value=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   250
            <hlm:arg name="--functionsort" value=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   251
        </hlm:coverity >
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   252
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   253
        <!-- Copy the summary file to resolve the xml load error -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   254
        <copy file="${coverity.analyze.dir}/c/output/errors/summary.xml" tofile="${coverity.checkers.xml.file}" overwrite="true" failonerror="false">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   255
            <filterchain>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   256
                <linecontains negate="true">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   257
                    <contains value="config.dtd"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   258
                </linecontains>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   259
            </filterchain>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   260
        </copy>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   261
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   262
        <!-- Insert summary tags into checkers file -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   263
        <xmltask source="${coverity.checkers.xml.file}"  dest="${diamonds.coverity.report.file}" report="false">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   264
            <insert path="/coverity" file="${coverity.summary.xml.file}"/> 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   265
        </xmltask>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   266
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   267
        <!-- collect all the html files into folder -->        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   268
        <copy todir="${coverity.report.dir}" overwrite="true" failonerror="false">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   269
            <fileset dir="${coverity.analyze.dir}/c/output/errors">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   270
                <exclude name="index.html"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   271
                <exclude name="**/*.xml"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   272
                <exclude name="summary.html"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   273
            </fileset>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   274
        </copy>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   275
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   276
        <!-- Concatinate all the html pages to get the final error report page -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   277
        <concat destfile="${coverity.report.dir}/${coverity.report.file}">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   278
            <fileset dir="${temp.build.dir}" includes="${build.id}_coverity_build_summary.html"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   279
            <fileset dir="${coverity.analyze.dir}/c/output/errors" includes="index.html"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   280
        </concat>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   281
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   282
    </target>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   283
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   284
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   285
    <!-- To get the SBS variable value -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   286
    <macrodef name="getSBSVariableValue" uri="http://www.nokia.com/helium">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   287
        <attribute name="variablename"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   288
        <attribute name="outputvar"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   289
        <attribute name="sbsinput"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   290
        <sequential>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   291
            <var name="output.var" unset="true"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   292
            <hlm:getVariableValue name="@{variablename}" property="output.var">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   293
                <hlm:sbsinput refid="@{sbsinput}" />
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   294
            </hlm:getVariableValue>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   295
            <if>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   296
                <and>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   297
                    <isset property="output.var"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   298
                    <matches string="${output.var}" pattern="arm.*"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   299
                </and>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   300
                <then>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   301
                    <antcall target="set-arm-version"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   302
                </then>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   303
            </if>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   304
            <script language="beanshell"> <![CDATA[
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   305
                curVal=project.getProperty("output.var"); 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   306
                project.setProperty("@{outputvar}",curVal);
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   307
                ]]>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   308
            </script> 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   309
        </sequential>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   310
    </macrodef>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   311
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   312
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   313
</project>