buildframework/helium/sf/java/antlint/tests/antunit/test_antlint.ant.xml
author lorewang
Wed, 01 Dec 2010 16:05:36 +0800
changeset 715 e0739b8406dd
parent 645 b8d81fa19e7d
permissions -rw-r--r--
Specify extenal tool with path
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8"?>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     2
<!-- 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     3
============================================================================ 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     4
Name        : test_antlint.ant.xml 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     5
Part of     : Helium AntLib
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     6
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     7
Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     8
All rights reserved.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     9
This component and the accompanying materials are made available
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    10
under the terms of the License "Eclipse Public License v1.0"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    11
which accompanies this distribution, and is available
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    12
at the URL "http://www.eclipse.org/legal/epl-v10.html".
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    13
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    14
Initial Contributors:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    15
Nokia Corporation - initial contribution.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    16
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    17
Contributors:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    18
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    19
Description:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    20
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    21
============================================================================
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    22
-->
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    23
<project name="test-antlint" xmlns:au="antlib:org.apache.ant.antunit" xmlns:hlm="http://www.nokia.com/helium" xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    24
    <description>Helium Antlib AntLint unittests.</description>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    25
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    26
    <dirname property="antlint.test.dir" file="${ant.file.test-antlint}/.."/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    27
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    28
    <import file="${antlint.test.dir}/data/sample.ant.xml" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    29
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
    30
    <taskdef resource="com/nokia/helium/antlint/ant/antlib.xml" uri="http://www.nokia.com/helium"/>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
    31
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    32
    <property name="data.model.parsed" location="${antlint.test.dir}/data/datamodel.out"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    33
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    34
    <!-- is called prior to the test -->
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    35
    <target name="setUp">
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
    36
        <delete dir="${antlint.test.dir}/data/output" failonerror="false" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
    37
        <mkdir dir="${antlint.test.dir}/data/output" />
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    38
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    39
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    40
    <!-- is called after the test, even if that caused an error -->
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    41
    <target name="tearDown">
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
    42
        <delete dir="${antlint.test.dir}/data/output" failonerror="false" />
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    43
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    44
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    45
    <target name="test-check-antcall">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    46
        <hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    47
            <fileset id="antlint.files" dir="${antlint.test.dir}/data">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    48
                <include name="sample.ant.xml"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    49
            </fileset>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    50
            <hlm:checkAntCall severity="warning"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    51
        </hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    52
        <au:assertLogContains text="antcall> is used with no param elements and calls the target 'hello' that has no dependencies!" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    53
    </target>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    54
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    55
    <target name="test-check-description">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    56
        <hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    57
            <fileset id="antlint.files" dir="${antlint.test.dir}/data">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    58
                <include name="build.xml"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    59
            </fileset>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    60
            <hlm:checkDescription severity="warning"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    61
        </hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    62
        <au:assertLogContains text="WARNING: 23: Description not specified!" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    63
    </target>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    64
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    65
    <target name="test-check-duplicate-names">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    66
        <hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    67
            <fileset id="antlint.files" dir="${antlint.test.dir}/data">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    68
                <include name="*.xml"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    69
                <include name="*.ant.xml"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    70
                <include name="build.xml"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    71
                <include name="*.antlib.xml"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    72
            </fileset>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    73
            <hlm:checkDuplicateNames severity="warning"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    74
        </hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    75
        <au:assertLogContains text="WARNING: 101: Task 'antlint' and macro 'antlint' has duplicate name." level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    76
    </target>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    77
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    78
    <target name="test-check-filename">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    79
        <hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    80
            <fileset id="antlint.files" dir="${antlint.test.dir}/data">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    81
                <include name="invalid.build.xml"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    82
            </fileset>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    83
            <hlm:checkFileName severity="warning" regexp="^build.xml$|ant.xml$|antlib.xml$" />
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    84
        </hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    85
        <au:assertLogContains text="WARNING: Invalid file Name:" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    86
    </target>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    87
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    88
    <target name="test-check-script-size">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    89
        <hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    90
            <fileset id="antlint.files" dir="${antlint.test.dir}/data">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    91
                <include name="sample.ant.xml"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    92
            </fileset>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    93
            <hlm:checkScriptSize enabled="true" severity="warning"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    94
        </hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    95
        <au:assertLogContains text="WARNING: 77: Target check-script-size has a script with 1188 characters, code should be inside a python file" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    96
    </target>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    97
    
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    98
    <target name="test-check-presetdef-macrodef-name">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    99
        <hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   100
            <fileset id="antlint.files" dir="${antlint.test.dir}/data">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   101
                <include name="sample.antlib.xml"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   102
                <include name="sample.ant.xml"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   103
            </fileset>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   104
            <hlm:checkPresetDefMacroDefName severity="warning" regexp="([a-z0-9][a-zA-Z0-9]*)"/>       
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   105
        </hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   106
        <au:assertLogContains text="WARNING: 45: Invalid presetdef/macrodef name: check_PresetDef.Name" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   107
        <au:assertLogContains text="WARNING: 27: Invalid presetdef/macrodef name: foo_Macro" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   108
    </target>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   109
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   110
    <target name="test-check-runtarget">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   111
        <hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   112
            <fileset id="antlint.files" dir="${antlint.test.dir}/data">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   113
                <include name="sample.ant.xml"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   114
            </fileset>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   115
            <hlm:checkRunTarget enabled="true" severity="warning"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   116
        </hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   117
        <au:assertLogContains text="runtarget> calls the target smile that has dependencies!" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   118
    </target>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   119
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   120
    <target name="test-check-scriptdef-style">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   121
        <hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   122
            <fileset id="antlint.files" dir="${antlint.test.dir}/data">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   123
                <include name="sample.antlib.xml"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   124
            </fileset>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   125
            <hlm:checkScriptDefStyle severity="warning" />
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   126
        </hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   127
        <au:assertLogContains text="WARNING: 65: Scriptdef check-scriptdef-style doesn't reference attributes directly, poor style" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   128
    </target>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   129
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   130
    <target name="test-check-script-condition">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   131
        <hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   132
            <fileset id="antlint.files" dir="${antlint.test.dir}/data">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   133
                <include name="sample.ant.xml"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   134
                <include name="sample.antlib.xml"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   135
            </fileset>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   136
            <hlm:checkScriptCondition severity="warning"/> 
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   137
        </hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   138
        <au:assertLogContains text=" found in target_check-scriptcondition" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   139
    </target>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   140
    
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   141
    <target name="test-check-tab-character">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   142
        <hlm:antlint>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   143
            <fileset id="antlint.files" dir="${antlint.test.dir}/data">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   144
                <include name="build.xml"/>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   145
            </fileset>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   146
            <hlm:checkTabCharacter severity="warning" enabled="true"/>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   147
        </hlm:antlint>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   148
        <au:assertLogContains text="WARNING: 25: Tabs should not be used!" level="info"/>
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   149
        <au:assertLogContains text="WARNING: 31: Target test2 has a script with tabs" level="info"/>
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   150
    </target>
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   151
    
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   152
    <target name="test-check-property-name">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   153
        <hlm:antlint>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   154
            <fileset id="antlint.files" dir="${antlint.test.dir}/data">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   155
                <include name="sample.ant.xml"/>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   156
            </fileset>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   157
            <hlm:checkPropertyName severity="warning" enabled="true" regexp="([a-z0-9[\\d\\_\\.\\@\\{\\}\\$]]*)" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   158
        </hlm:antlint>
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   159
        <au:assertLogContains text="WARNING: 42: Invalid property name: check-property-name" level="info"/>
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   160
    </target>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   161
    
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   162
    <target name="test-check-target-name">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   163
        <hlm:antlint>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   164
            <fileset id="antlint.files" dir="${antlint.test.dir}/data">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   165
                <include name="sample.ant.xml"/>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   166
            </fileset>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   167
            <hlm:checkTargetName severity="warning" enabled="true" regexp="([a-z0-9[\\d\\-]]*)" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   168
        </hlm:antlint>
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   169
        <au:assertLogContains text="WARNING: 64: INVALID Target Name: Check_target.Name" level="info"/>
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   170
    </target>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   171
    
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   172
    <target name="test-check-use-of-equals-task">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   173
        <hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   174
            <fileset id="antlint.files" dir="${antlint.test.dir}/data">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   175
                <include name="sample.ant.xml"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   176
            </fileset>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   177
            <hlm:checkUseOfEqualsTask severity="warning" enabled="true"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   178
        </hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   179
        <au:assertLogContains text="WARNING: 209: test.boolean1 uses 'equals', should use 'istrue' task" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   180
        <au:assertLogContains text="WARNING: 210: test.boolean2 uses 'equals', should use 'istrue' task" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   181
    </target>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   182
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   183
    <target name="test-check-use-of-if-in-targets">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   184
        <hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   185
            <fileset id="antlint.files" dir="${antlint.test.dir}/data">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   186
                <include name="sample.ant.xml"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   187
            </fileset>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   188
            <hlm:checkUseOfIfInTargets enabled="true" severity="warning"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   189
        </hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   190
        <au:assertLogContains text="WARNING: 126: Target check-use-of-if-in-targets poor use of if statement, use" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   191
        <au:assertLogContains text="WARNING: 136: Target check-use-of-if-else-in-targets poor use of if-else-property statement, use condition task" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   192
        <au:assertLogContains text="WARNING: 151: Target check-use-of-if-then-in-targets poor use of if-then-property statement, use condition task" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   193
        <au:assertLogContains text="WARNING: 173: Target check-prop-in-scriptcondition poor use of if-else-property statement, use condition task" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   194
        <au:assertLogContains text="WARNING: 229: Target check-scriptcondition poor use of if-else-property statement, use condition task" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   195
    </target>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   196
    
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   197
    <target name="test-check-try-catch-block-with-empty-catch-block">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   198
        <hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   199
            <fileset file="${antlint.test.dir}/data/sample.ant.xml"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   200
            <hlm:checkTryCatchBlock severity="warning" />
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   201
        </hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   202
        <au:assertLogContains text="trycatch> block found without " level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   203
    </target>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   204
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   205
    <target name="test-check-try-catch-block-with-multiple-catch-block">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   206
        <hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   207
            <fileset file="${antlint.test.dir}/data/sample.ant.xml"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   208
            <hlm:checkTryCatchBlock severity="warning" />
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   209
        </hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   210
        <au:assertLogContains text="trycatch> block found with 2 " level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   211
    </target>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   212
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   213
    <target name="test-check-indentation">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   214
        <hlm:antlint>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   215
            <fileset id="antlint.files" dir="${antlint.test.dir}/data">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   216
                <include name="sample.ant.xml"/>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   217
            </fileset>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   218
            <hlm:checkIndentation severity="warning" enabled="true"/>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   219
        </hlm:antlint>
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   220
        <au:assertLogContains text="WARNING: 252: Bad indentation" level="info"/>
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   221
    </target>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   222
    
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   223
    <target name="test-check-project-name">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   224
        <hlm:antlint>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   225
            <fileset id="antlint.files" dir="${antlint.test.dir}/data">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   226
                <include name="sample.ant.xml"/>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   227
                <include name="invalid.build.xml"/>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   228
            </fileset>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   229
            <hlm:checkProjectName enabled="true" severity="warning" regexp="([a-z0-9[\\d\\.\\_\\-]]*)"/>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   230
        </hlm:antlint>
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   231
        <au:assertLogContains text="WARNING: 23: Invalid project name: Sample" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   232
        <au:assertLogContains text="WARNING: 23: Project name not specified!" level="info"/>
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   233
    </target>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   234
    
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   235
    <target name="test-antlint-failonerror-false">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   236
        <hlm:antlint failonerror="false">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   237
            <fileset id="antlint.files" dir="${antlint.test.dir}/data">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   238
                <include name="*.xml"/>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   239
                <include name="*.ant.xml"/>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   240
                <include name="build.xml"/>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   241
                <include name="*.antlib.xml"/>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   242
            </fileset>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   243
            <hlm:checkTabCharacter severity="error" enabled="true"/>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   244
            <hlm:checkProjectName enabled="true" severity="error" regexp="([a-z0-9[\\d\\.\\_\\-]]*)"/>
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   245
            <hlm:checkScriptDefAttributes severity="error" />
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   246
        </hlm:antlint>
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   247
        <au:assertLogContains text="ERROR: 80: Scriptdef check-scriptdef-attributes does not have attribute target" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   248
        <au:assertLogContains text="ERROR: 23: Project name not specified!" level="info"/>
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   249
    </target> 
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   250
    
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   251
    <target name="test-antlint-failonerror-true">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   252
        <au:expectfailure>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   253
            <hlm:antlint>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   254
                <fileset id="antlint.files" dir="${antlint.test.dir}/data">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   255
                    <include name="*.xml"/>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   256
                    <include name="*.ant.xml"/>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   257
                    <include name="build.xml"/>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   258
                    <include name="*.antlib.xml"/>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   259
                </fileset>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   260
                <hlm:checkTabCharacter severity="error" enabled="true"/>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   261
                <hlm:checkProjectName enabled="true" severity="error" regexp="([a-z0-9[\\d\\.\\_\\-]]*)"/>
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   262
                <hlm:checkScriptDefAttributes severity="error" />
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   263
            </hlm:antlint>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   264
        </au:expectfailure>
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   265
        <au:assertLogContains text="ERROR: 80: Scriptdef check-scriptdef-attributes does not have attribute target" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   266
        <au:assertLogContains text="ERROR: 23: Project name not specified!" level="info"/>
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   267
    </target>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   268
    
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   269
    <target name="test-antlint-console-and-xml-reporting">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   270
        <au:expectfailure>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   271
            <hlm:antlint>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   272
                <fileset id="antlint.files" dir="${antlint.test.dir}/data">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   273
                    <include name="*.xml"/>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   274
                    <include name="*.ant.xml"/>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   275
                    <include name="build.xml"/>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   276
                    <include name="*.antlib.xml"/>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   277
                </fileset>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   278
                <hlm:checkTabCharacter severity="error" enabled="true"/>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   279
                <hlm:checkProjectName enabled="true" severity="error" regexp="([a-z0-9[\\d\\.\\_\\-]]*)"/>
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   280
                <hlm:checkScriptDefAttributes severity="error" />
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   281
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   282
                <!-- reporters -->
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   283
                <hlm:antlintCheckstyleReporter file="${antlint.test.dir}/data/output/report.xml" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   284
                <hlm:antlintConsoleReporter />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   285
            </hlm:antlint>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   286
        </au:expectfailure>
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   287
        <au:assertLogContains text="ERROR: 80: Scriptdef check-scriptdef-attributes does not have attribute target" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   288
        <au:assertLogContains text="ERROR: 23: Project name not specified!" level="info"/>
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   289
        <au:assertFileExists file="${antlint.test.dir}/data/output/report.xml" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   290
        <loadfile property="report.xml" srcfile="${antlint.test.dir}/data/output/report.xml" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   291
        <echo>${report.xml}</echo>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   292
        <au:assertTrue>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   293
            <and>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   294
                <contains string="${report.xml}" substring="&lt;error" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   295
                <contains string="${report.xml}" substring="Scriptdef check-scriptdef-attributes does not have attribute target" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   296
                <contains string="${report.xml}" substring="Project name not specified!" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   297
            </and>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   298
        </au:assertTrue>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   299
    </target>
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   300
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   301
    <target name="test-antcontrib-var-type-value-unset-set-case">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   302
        <au:expectfailure>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   303
            <hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   304
                <fileset id="antlint.files" dir="${antlint.test.dir}/data">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   305
                    <include name="sample.ant.xml"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   306
                </fileset>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   307
                <hlm:checkVariableTask severity="error" />
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   308
            </hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   309
        </au:expectfailure>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   310
        <au:assertLogContains text="ERROR: 30: Variable 'var1' should not have 'value' attribute set when 'unset' is true." level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   311
    </target>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   312
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   313
    <target name="test-invalid-property-type-values">
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   314
        <au:expectfailure>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   315
            <hlm:antlint>
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   316
                <fileset id="antlint.files" dir="${antlint.test.dir}/data">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   317
                    <include name="sample.ant.xml"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   318
                </fileset>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   319
                <hlm:checkPropertyTypeAndValueMismatch severity="error" />
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   320
            </hlm:antlint>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   321
        </au:expectfailure>
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   322
        <au:assertLogContains text="ERROR: 324: Property 'test.prop.int.2' has invalid integer value set as '123abc'." level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   323
        <au:assertLogContains text="ERROR: 342: Property 'test.prop.bool.3' has invalid boolean value set as 't'. (Valid values: true|false)" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   324
        <au:assertLogContains text="ERROR: 348: Property 'test.prop.bool.4' has invalid boolean value set as 'f'. (Valid values: true|false)" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   325
        <au:assertLogContains text="ERROR: 354: Property 'test.prop.bool.5' has invalid boolean value set as 'yes'. (Valid values: true|false)" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   326
        <au:assertLogContains text="ERROR: 360: Property 'test.prop.bool.6' has invalid boolean value set as 'no'. (Valid values: true|false)" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   327
        <au:assertLogContains text="ERROR: 366: Property 'test.prop.bool.7' has invalid boolean value set as 'poo'. (Valid values: true|false)" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   328
        <au:assertLogContains text="ERROR: 393: Property 'test.prop.number.1' has invalid type as 'number'. (Valid types: boolean|float|integer|string)" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   329
        <au:assertLogContains text="ERROR: 399: Property 'test.prop.flag' has invalid type as 'flag'. (Valid types: boolean|float|integer|string)" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   330
        <au:assertLogContains text="ERROR: 411: Property 'test.prop.float.2' has invalid float value set as '1.5a'." level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   331
        <au:assertLogContains text="ERROR: 417: Property 'test.prop.int.3' has invalid integer value set as '1.8'." level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   332
    </target>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   333
        
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   334
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   335
    <target name="test-check-scriptdef-name">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   336
        <hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   337
            <fileset id="antlint.files" dir="${antlint.test.dir}/data">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   338
                <include name="sample.antlib.xml"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   339
            </fileset>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   340
            <hlm:checkScriptDefName severity="warning" regexp="([a-z0-9][a-zA-Z0-9]*)"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   341
        </hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   342
        <au:assertLogContains text="WARNING: 34: Invalid scriptdef name: check-prop-in-scriptdef" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   343
        <au:assertLogContains text="WARNING: 65: Invalid scriptdef name: check-scriptdef-style" level="info"/>
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   344
    </target>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   345
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   346
    <target name="test-check-scriptdef-attributes">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   347
        <hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   348
            <fileset id="antlint.files" dir="${antlint.test.dir}/data">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   349
                <include name="sample.antlib.xml"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   350
            </fileset>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   351
            <hlm:checkScriptDefAttributes severity="warning"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   352
        </hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   353
        <au:assertLogContains text="WARNING: 40: Scriptdef check-scriptdef does not use attr2" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   354
        <au:assertLogContains text="WARNING: 46: Scriptdef checkScriptdefBeanshell does not use attr2" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   355
        <au:assertLogContains text="WARNING: 80: Scriptdef check-scriptdef-attributes does not have attribute target" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   356
        <au:assertLogContains text="WARNING: 84: Scriptdef checkScriptdefAttributes does not have attribute attr0" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   357
    </target>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   358
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   359
    <target name="test-beanshell-script-dump-task">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   360
        <hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   361
            <fileset id="antlint.files" dir="${antlint.test.dir}/data">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   362
                <include name="sample.antlib.xml"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   363
            </fileset>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   364
            <hlm:checkstyleExecutor outputDir="${antlint.test.dir}/data/output/beanshell" config="${antlint.test.dir}/data/config/java_checkstyle_config.xml">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   365
                <formatter type="plain"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   366
            </hlm:checkstyleExecutor>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   367
        </hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   368
        <au:assertLogContains text="BeanshellcheckScriptdefAttributes.java:1: warning: Using the '.*' form of import should be avoided - java.io.*." level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   369
        <au:assertLogContains text="BeanshellcheckScriptdefBeanshell.java:1: warning: Using the '.*' form of import should be avoided - java.io.*." level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   370
    </target>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   371
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   372
    <target name="test-check-jython-script">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   373
        <hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   374
            <fileset id="antlint.files" dir="${antlint.test.dir}/data">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   375
                <include name="sample.ant.xml"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   376
                <include name="sample.antlib.xml"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   377
            </fileset>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   378
            <hlm:checkJythonScript severity="warning"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   379
        </hlm:antlint>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   380
        <au:assertLogContains text="found in target_check-jython-script" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   381
        <au:assertLogContains text="found in check-script" level="info"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   382
    </target>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   383
    
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   384
    <target name="test-python-script-dump-task">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   385
        <pathconvert pathsep="${path.separator}" property="python.tools.path">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   386
            <fileset dir="./../../../../../nokia_builder" includes="tools/pylint/**/*.egg" />
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   387
            <dirset dir="./../../../../../nokia_builder" includes="tools/pylint/**/*.egg" />
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   388
        </pathconvert>
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   389
        <au:expectfailure>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   390
            <hlm:antlint>
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   391
                <fileset id="antlint.files" dir="${antlint.test.dir}/data">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   392
                    <include name="*.xml"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   393
                    <include name="*.ant.xml"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   394
                    <include name="build.xml"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   395
                    <include name="*.antlib.xml"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   396
                </fileset>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   397
                <hlm:pylintExecutor outputDir="${antlint.test.dir}/data/output/python" >
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   398
                    <env key="PYTHONPATH" value="${python.tools.path}"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   399
                    <arg file="${antlint.test.dir}/data/config/pylint-script.py"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   400
                    <arg value="--output-format=parseable"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   401
                    <arg line="--rcfile=${antlint.test.dir}/data/config/pylintrc.txt"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   402
                </hlm:pylintExecutor>
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   403
            </hlm:antlint>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   404
        </au:expectfailure>
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   405
        <au:assertFileExists file="${antlint.test.dir}/data/output/python/python/target0_check-prop-in-pythontask.py"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   406
        <au:assertFileExists file="${antlint.test.dir}/data/output/python/python/target0_check-script-size.py"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   407
        <au:assertLogContains text="target0_check-prop-in-pythontask.py:3: [E0602, abc] Undefined variable 'abcd'" level="info"/>
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   408
    </target>
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   409
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   410
</project>