Changeset 6133 in josm


Ignore:
Timestamp:
2013-08-10T18:20:16+02:00 (11 years ago)
Author:
Don-vip
Message:

update build.xml / test environment:

  • cleanup of build.xml
  • update junit 4.6 to junit 4.11
  • update unitils 3.1 to 3.3
  • remove old junit 4.4 from unitils cots
  • add jacoco 0.6.4
  • test target now produces test coverage data to test/jacoco.exec, can be used by sonar
  • test-html now produces test coverage report to test/report/html/jacoco
Location:
trunk
Files:
4 added
5 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/.classpath

    r4745 r6133  
    1919        <classpathentry kind="lib" path="test/lib/unitils-core/commons-lang-2.3.jar"/>
    2020        <classpathentry kind="lib" path="test/lib/unitils-core/commons-logging-1.1.jar"/>
    21         <classpathentry kind="lib" path="test/lib/unitils-core/junit-4.4.jar"/>
    2221        <classpathentry kind="lib" path="test/lib/unitils-core/ognl-2.6.9.jar"/>
    23         <classpathentry kind="lib" path="test/lib/unitils-core/unitils-core-3.1.jar"/>
     22        <classpathentry kind="lib" path="test/lib/unitils-core/unitils-core-3.3.jar"/>
    2423        <classpathentry kind="lib" path="test/lib/fest/debug-1.0.jar"/>
    2524        <classpathentry kind="output" path="bin"/>
  • trunk/build.xml

    r6121 r6133  
    88**   https://josm.openstreetmap.de/wiki/CreateBuild
    99**
    10 **
    1110-->
    12 <project xmlns:as="antlib:org.codehaus.mojo.animal_sniffer" name="josm" default="dist" basedir=".">
     11<project xmlns:as="antlib:org.codehaus.mojo.animal_sniffer" name="josm" default="dist" basedir="." xmlns:jacoco="antlib:org.jacoco.ant">
    1312    <property name="test.dir" location="test"/>
    1413    <property name="src.dir" location="src"/>
     
    3029
    3130    <!--
    32           ** Used by Eclipse ant builder for updating
    33           ** the REVISION file used by JOSM
    34         -->
     31      ** Used by Eclipse ant builder for updating
     32      ** the REVISION file used by JOSM
     33    -->
    3534    <target name="create-revision-eclipse">
    3635        <property name="revision.dir" value="bin"/>
     
    3837    </target>
    3938    <!--
    40           ** Creates the REVISION file to be included in the distribution
    41           -->
     39      ** Creates the REVISION file to be included in the distribution
     40    -->
    4241    <target name="create-revision">
    4342        <property name="revision.dir" value="${build.dir}"/>
     
    169168        <delete dir="${test.dir}/build"/>
    170169        <delete dir="${test.dir}/report"/>
     170        <delete file="${test.dir}/jacoco.exec" />
    171171    </target>
    172172    <target name="test-compile" depends="test-init,dist">
     
    181181    </target>
    182182    <target name="test" depends="test-compile">
    183         <junit printsummary="yes">
    184             <sysproperty key="josm.home" value="${test.dir}/config/unit-josm.home"/>
    185             <sysproperty key="java.awt.headless" value="true"/>
    186             <sysproperty key="suppressPermanentFailure" value="${suppressPermanentFailure}"/>
    187             <classpath>
    188                 <path refid="test.classpath"/>
    189                 <pathelement path="${test.dir}/build"/>
    190                 <pathelement path="${test.dir}/config"/>
    191             </classpath>
    192             <formatter type="plain"/>
    193             <formatter type="xml"/>
    194             <batchtest fork="yes" todir="${test.dir}/report">
    195                 <fileset dir="${test.dir}/unit" includes="**/*.java"/>
    196             </batchtest>
    197         </junit>
     183        <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" classpath="tools/jacocoant.jar" />
     184        <jacoco:coverage destfile="${test.dir}/jacoco.exec">
     185            <junit printsummary="yes" fork="true" forkmode="once">
     186                <sysproperty key="josm.home" value="${test.dir}/config/unit-josm.home"/>
     187                <sysproperty key="java.awt.headless" value="true"/>
     188            <sysproperty key="suppressPermanentFailure" value="${suppressPermanentFailure}"/>
     189                <classpath>
     190                    <path refid="test.classpath"/>
     191                    <pathelement path="${test.dir}/build"/>
     192                    <pathelement path="${test.dir}/config"/>
     193                </classpath>
     194                <formatter type="plain"/>
     195                <formatter type="xml"/>
     196                <batchtest fork="yes" todir="${test.dir}/report">
     197                    <fileset dir="${test.dir}/unit" includes="**/*.java"/>
     198                </batchtest>
     199            </junit>
     200        </jacoco:coverage>
    198201    </target>
    199202    <target name="test-html" depends="test" description="Generate HTML test reports">
     
    205208            <report todir="${test.dir}/report/html"/>
    206209        </junitreport>
     210        <jacoco:report>
     211            <executiondata>
     212                <file file="${test.dir}/jacoco.exec"/>
     213            </executiondata>
     214            <structure name="JOSM Test Coverage">
     215                <classfiles>
     216                    <fileset dir="${build.dir}" includes="org/openstreetmap/"/>
     217                </classfiles>
     218                <sourcefiles encoding="UTF-8">
     219                    <fileset dir="${src.dir}" includes="org/openstreetmap/"/>
     220                </sourcefiles>
     221            </structure>
     222            <!--<xml destfile="${test.dir}/report/jacoco.xml"/>-->
     223                <html destdir="${test.dir}/report/jacoco"/>
     224        </jacoco:report>
    207225    </target>
    208226    <target name="dist-optimized" depends="dist">
     
    245263                # Disable annoying [proguard] Note: the configuration keeps the entry point '...', but not the descriptor class '...'. This notes should not be a problem as we don't use obfuscation
    246264                -dontnote
    247                 </proguard>
     265        </proguard>
    248266    </target>
    249267    <target name="check-plugins" depends="dist-optimized">
     
    285303                </tokenfilter>
    286304            </filterchain>
    287         </loadresource> 
    288         <!-- Delete files that are not in plugin list (like old plugins) -->
    289         <loadresource property="file-list">
    290           <propertyresource name="plugins"/>
    291           <filterchain>
    292             <tokenfilter>
    293               <replaceregex pattern="^.*/(.*)$" replace="\1\|" flags=""/>
    294             </tokenfilter>
    295             <striplinebreaks/>
    296             <tokenfilter>
    297               <replaceregex pattern="\|$" replace="" flags="gi"/>
    298             </tokenfilter>         
    299           </filterchain>
    300         </loadresource>
    301         <delete>
    302           <restrict>
    303             <fileset dir="${dir}"/>
    304             <not>
    305               <name regex="${file-list}"/>
    306             </not>
    307           </restrict>
    308         </delete>
    309         <!-- Download plugins -->
     305        </loadresource>
     306        <!-- Delete files that are not in plugin list (like old plugins) -->
     307        <loadresource property="file-list">
     308            <propertyresource name="plugins"/>
     309            <filterchain>
     310                <tokenfilter>
     311                    <replaceregex pattern="^.*/(.*)$" replace="\1\|" flags=""/>
     312                </tokenfilter>
     313                <striplinebreaks/>
     314                <tokenfilter>
     315                    <replaceregex pattern="\|$" replace="" flags="gi"/>
     316                </tokenfilter>   
     317            </filterchain>
     318        </loadresource>
     319        <delete>
     320            <restrict>
     321                <fileset dir="${dir}"/>
     322                <not>
     323                    <name regex="${file-list}"/>
     324                </not>
     325            </restrict>
     326        </delete>
     327        <!-- Download plugins -->
    310328        <copy todir="${dir}" flatten="true">
    311329            <resourcelist>
     
    320338                <fileset file="${java.home}/lib/jce.jar"/>
    321339            </path>
    322         </as:build-signatures> 
     340        </as:build-signatures>
    323341        <as:check-signature signature="${dir}/api.sig">
    324342            <ignore classname="org.jgraph.*"/>
     
    337355
    338356    <target name="findbugs" depends="dist">
    339         <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpath="tools/findbugs/findbugs-ant.jar"/>
     357        <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpath="tools/findbugs/findbugs-ant.jar"/>
    340358        <path id="findbugs-classpath">
    341359            <fileset dir="tools/findbugs/">
     
    343361            </fileset>
    344362        </path>
    345         <property name="findbugs-classpath" refid="findbugs-classpath"/>
    346       <findbugs output="xml"
     363        <property name="findbugs-classpath" refid="findbugs-classpath"/>
     364        <findbugs output="xml"
    347365                outputFile="findbugs-josm.xml"
    348                 classpath="${findbugs-classpath}"
    349                 pluginList=""
    350                 excludeFilter="tools/findbugs/josm-filter.xml"
    351                 effort="max"
    352                 >
    353         <sourcePath path="${basedir}/src" />
    354         <class location="${basedir}/dist/josm-custom.jar" />
    355       </findbugs>
     366                classpath="${findbugs-classpath}"
     367                pluginList=""
     368                excludeFilter="tools/findbugs/josm-filter.xml"
     369                effort="max"
     370                >
     371            <sourcePath path="${basedir}/src" />
     372            <class location="${basedir}/dist/josm-custom.jar" />
     373        </findbugs>
    356374    </target>
    357375    <target name="run" depends="dist">
  • trunk/test

    • Property svn:ignore
      •  

        old new  
        11build
        2 
        32report
         3jacoco.exec
Note: See TracChangeset for help on using the changeset viewer.