Changeset 9501 in josm for trunk/build.xml


Ignore:
Timestamp:
2016-01-17T15:06:09+01:00 (3 years ago)
Author:
Don-vip
Message:

make the distinction between unit tests (*Test.java) and integration tests (*TestIT.java)

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1010taginfo-img
        1111build2
         12junit*.properties
         13foobar
  • trunk/build.xml

    r9357 r9501  
    321321        <init-test-preferences testfamily="functional"/>
    322322        <init-test-preferences testfamily="performance"/>
     323        <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" classpath="tools/jacocoant.jar" />
    323324    </target>
    324325    <target name="test-clean">
     
    326327        <delete dir="${test.dir}/report"/>
    327328        <delete file="${test.dir}/jacoco.exec" />
     329        <delete file="${test.dir}/jacocoIT.exec" />
    328330        <delete file="${test.dir}/config/unit-josm.home/preferences.xml" />
    329331        <delete file="${test.dir}/config/functional-josm.home/preferences.xml" />
     
    370372    <macrodef name="call-junit">
    371373        <attribute name="testfamily"/>
     374        <attribute name="testITsuffix" default=""/>
    372375        <sequential>
    373             <echo message="Running @{testfamily} tests with JUnit"/>
    374             <jacoco:coverage destfile="${test.dir}/jacoco.exec">
     376            <echo message="Running @{testfamily}@{testITsuffix} tests with JUnit"/>
     377            <jacoco:coverage destfile="${test.dir}/jacoco@{testITsuffix}.exec">
    375378                <junit printsummary="yes" fork="true" forkmode="once">
    376379                    <jvmarg value="-Dfile.encoding=UTF-8"/>
     
    388391                    <formatter type="xml"/>
    389392                    <batchtest fork="yes" todir="${test.dir}/report">
    390                         <fileset dir="${test.dir}/build/@{testfamily}" includes="**/*Test.class"/>
     393                        <fileset dir="${test.dir}/build/@{testfamily}" includes="**/*Test@{testITsuffix}.class"/>
    391394                    </batchtest>
    392395                </junit>
     
    394397        </sequential>
    395398    </macrodef>
    396     <target name="test" depends="test-compile"
     399    <target name="test" depends="test-compile" unless="test.notRequired"
    397400        description="Run unit, functional and performance tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
    398         <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" classpath="tools/jacocoant.jar" />
    399401        <call-junit testfamily="unit"/>
    400402        <call-junit testfamily="functional"/>
    401403        <call-junit testfamily="performance"/>
    402404    </target>
    403     <target name="test-html" depends="test" description="Generate HTML test reports">
     405    <target name="test-it" depends="test-compile" unless="test-it.notRequired"
     406        description="Run integration tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
     407        <call-junit testfamily="unit" testITsuffix="IT"/>
     408        <call-junit testfamily="functional" testITsuffix="IT"/>
     409        <call-junit testfamily="performance" testITsuffix="IT"/>
     410    </target>
     411    <target name="test-html" depends="test, test-it" description="Generate HTML test reports">
    404412        <!-- May require additional ant dependencies like ant-trax package -->
    405413        <junitreport todir="${test.dir}/report">
     
    412420            <executiondata>
    413421                <file file="${test.dir}/jacoco.exec"/>
     422                <file file="${test.dir}/jacocoIT.exec"/>
    414423            </executiondata>
    415424            <structure name="JOSM Test Coverage">
Note: See TracChangeset for help on using the changeset viewer.