buildframework/helium/sf/java/sbs/sbscoverity.rst
author kelvzhu
Tue, 27 Jul 2010 13:00:43 +0800
changeset 621 96fee2635b19
parent 587 85df38eb4012
permissions -rw-r--r--
Fixed Bug 2413 for evalid
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     1
.. index::
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     2
  module: Configuring Coverity Prevent Tool with SBS
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     3
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     4
==========================================
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     5
Configuring Coverity Prevent Tool with SBS
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     6
==========================================
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     7
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     8
.. contents::
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     9
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    10
This document describes requirements and how to run coverity prevent tool with sbs builds using helium. 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    11
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    12
Requirements
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    13
-----------------
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    14
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    15
Please go through "Configuring Raptor (SBS)" before proceeding into this document.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    16
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    17
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    18
Implementation
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    19
-----------------
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    20
- Coverity prevent tool commands are integrated with SBS task. 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    21
- Before starting the build we need to setup the property enabled.coverity=true to enable the coverity prevent tool with build.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    22
- Coverity task extends the "sbstask", so what ever the arguments we pass for sbstask will remain same for coverity tool also.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    23
- For example 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    24
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    25
.. code-block:: xml
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    26
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    27
        <hlm:coveritybuild  sbsinput="@{sbs.input}" 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    28
                            sysdeffile="${build.drive}/output/build/canonical_system_definition_${sysdef.configuration}.xml"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    29
                            layerpatternsetref="${sbs.patternset}" 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    30
                            workingdir="${build.drive}/" 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    31
                            execute="true"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    32
                            failonerror="false"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    33
                            outputlog="${sbs.log.file}" 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    34
                            cleanlog = "${sbs.clean.log}"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    35
                            erroroutput="${sbs.log.file}.sbs_error.log"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    36
                            statslog="${sbs.log.file}.info.xml">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    37
                <hlm:coverityoptions refid="coverity.build.options"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    38
        </hlm:coveritybuild>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    39
     
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    40
- In above example coverity prevent tool is integrated with sbs using task "coveritybuild".
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    41
- This task is slightly difference from sbstask as it accepts the coverity tool parameters required while running coverity tool.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    42
- In the above example we have mentioned "coverity.build.options" which are required for cov-build command.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    43
- coverityoptions datatype will follow below syntax.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    44
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    45
.. code-block:: xml
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    46
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    47
        <hlm:coverityoptions id="coverity.build.options">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    48
            <arg name="--config" value="${coverity.config.dir}/coverity_config.xml"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    49
            <arg name="--dir" value="${coverity.inter.dir}"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    50
            <arg name="--auto-diff" value=""/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    51
            <arg name="--preprocess-first" value=""/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    52
            <arg name="--record-only" value=""/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    53
        </hlm:coverityoptions>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    54
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    55
- Internally "coveritybuild" task will run the "cov-build" with parameters passed with "<hlm:coverityoptions>" datatype and sbs commands.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    56
- Above arguments are passed by default in helium. If it is required to remove/change the default parameters (by helium)into cov-build, we need to override the datatype "coverityoptions".
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    57
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    58
- Command resulted for above example is shown below with "@{sbs.input} = dfs_build_input_armv5".
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    59
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    60
    | cov-build.exe --auto-diff  --record-only  --config Y:/output/coverity/config/coverity_config.xml 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    61
    | --preprocess-first  --dir Y:/output/coverity/intermidiate sbs -s Y:/output/build/canonical_system_definition_dfs_build.xml 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    62
    | -c armv5 --filters=FilterMetadataLog -k --logfile Y:/output/logs/compile/ido_helloworld_tb92_blr_ci_9.2.30_armv5_dfs_build.log 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    63
    | --makefile=Y:/output/logs/compile/ido_helloworld_tb92_blr_ci_9.2.30_armv5_dfs_build
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    64
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    65
Note: 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    66
--------------------
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    67
- Helium also supports other coverity tool commands. Please refer to section to "Coverity Prevent Tool" section.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    68
- Coverity tool prevent tool can't run with emake. emake options are disabled with <hlm:coveritybuild> task if "build.system=sbs-ec".
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    69
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    70