buildframework/helium/sf/java/quality/tests/antunit/test_codescanner.ant.xml
changeset 587 85df38eb4012
child 645 b8d81fa19e7d
equal deleted inserted replaced
217:0f5e3a7fb6af 587:85df38eb4012
       
     1 <?xml version="1.0" encoding="UTF-8"?>
       
     2 <!-- 
       
     3 ============================================================================ 
       
     4 Name        : test_serializepath.ant.xml 
       
     5 Part of     : Helium AntLib
       
     6 
       
     7 Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     8 All rights reserved.
       
     9 This component and the accompanying materials are made available
       
    10 under the terms of the License "Eclipse Public License v1.0"
       
    11 which accompanies this distribution, and is available
       
    12 at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
    13 
       
    14 Initial Contributors:
       
    15 Nokia Corporation - initial contribution.
       
    16 
       
    17 Contributors:
       
    18 
       
    19 Description:
       
    20 
       
    21 ============================================================================
       
    22 -->
       
    23 <project name="test-quality" xmlns:au="antlib:org.apache.ant.antunit" xmlns:hlm="http://www.nokia.com/helium">
       
    24     <description>Helium antlib core serializepath tests.</description>
       
    25 
       
    26     <taskdef resource="com/nokia/helium/quality/ant/antlib.xml" uri="http://www.nokia.com/helium" />
       
    27     <property name="codescanner.output.dir" location="./cs"/>
       
    28     <property name="codescanner.output.type" value="html"  />
       
    29     <property name="codescanner.config" location="../data/codescanner_config.xml"  />
       
    30     <path id="src.path">
       
    31         <pathelement path="../data" />
       
    32     </path>
       
    33 
       
    34     <condition property="do.codescanner.test">
       
    35         <os family="windows" />
       
    36     </condition>
       
    37 
       
    38     <!-- is called prior to the test -->
       
    39     <target name="setUp">
       
    40         <delete dir="${codescanner.output.dir}" failonerror="false" />
       
    41         <mkdir dir="${codescanner.output.dir}" />
       
    42     </target>
       
    43 
       
    44     <!-- is called after the test, even if that caused an error -->
       
    45     <target name="tearDown">
       
    46         <delete dir="${codescanner.output.dir}" failonerror="false" />
       
    47     </target>
       
    48 
       
    49     <target name="test-codescanner-linux" unless="do.codescanner.test">
       
    50         <echo message="Codescanner supported only for windows" />
       
    51     </target>
       
    52 
       
    53     <!--
       
    54      **************************************************************
       
    55      ** test codescanner only for windows
       
    56      **************************************************************
       
    57     -->
       
    58 
       
    59     <target name="test-codescanner" if="do.codescanner.test">
       
    60         <hlm:codescanner dest="${codescanner.output.dir}"
       
    61             format="${codescanner.output.type}"
       
    62             configuration="${codescanner.config}">
       
    63             <path refid="src.path"/>
       
    64         </hlm:codescanner>
       
    65         <au:assertLogContains text="Successfully executed codescanner"/>
       
    66         <au:assertLogContains text="Output format: xml,html"/>
       
    67         <au:assertLogContains text="data\src\exclude.txt"/>
       
    68         <au:assertLogContains text="data\src2\exclude.txt"/>
       
    69         <au:assertFileExists file="${codescanner.output.dir}/problemIndex.xml"/>
       
    70     </target>
       
    71 
       
    72     <!--
       
    73      **************************************************************
       
    74      ** test noargs
       
    75      **************************************************************
       
    76     -->
       
    77     <target name="test-norargs" if="do.codescanner.test">
       
    78         <au:expectfailure expectedMessage="'dest' attribute must be defined">
       
    79             <hlm:codescanner/>
       
    80         </au:expectfailure>
       
    81     </target>
       
    82 
       
    83     <!--
       
    84      **************************************************************
       
    85      ** test noconf
       
    86      **************************************************************
       
    87     -->
       
    88     <target name="test-noconf" if="do.codescanner.test">
       
    89         <au:expectfailure expectedMessage="'configuration' attribute must be defined">
       
    90             <hlm:codescanner dest="${codescanner.output.dir}"/>
       
    91         </au:expectfailure>
       
    92     </target>
       
    93 
       
    94     
       
    95     <!--
       
    96      **************************************************************
       
    97      ** test noconf
       
    98      **************************************************************
       
    99     -->
       
   100     <target name="test-codescanner-two-inputs" if="do.codescanner.test">
       
   101         <path id="src.path.two.path">
       
   102             <pathelement path="../data/src" />
       
   103             <pathelement path="../data/src2" />
       
   104         </path>
       
   105         <hlm:codescanner dest="${codescanner.output.dir}"
       
   106             format="${codescanner.output.type}"
       
   107             configuration="${codescanner.config}">
       
   108             <path refid="src.path.two.path"/>
       
   109         </hlm:codescanner>
       
   110         <au:assertLogContains text="Successfully executed codescanner"/>
       
   111         <au:assertLogContains text="Output format: xml,html"/>
       
   112         <au:assertLogContains text="data\src\exclude.txt"/>
       
   113         <au:assertLogContains text="data\src2\exclude.txt"/>
       
   114         <au:assertFileExists file="${codescanner.output.dir}/problemIndex.xml"/>
       
   115     </target>
       
   116 </project>