Changeset 6a26c0b


Ignore:
Timestamp:
Feb 25, 2012 1:43:15 AM (8 years ago)
Author:
str4d <str4d@…>
Branches:
master
Children:
204440b
Parents:
c955adf
Message:

Edited router build.xml to match core build.xml (inc. clover, cobertura stuff)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • router/java/build.xml

    rc955adf r6a26c0b  
    101101        <jar destfile="./build/routertest.jar" basedir="./build/obj" includes="**/*.class" />
    102102    </target>
     103    <!-- preparation of code coverage tool of choice -->
     104    <target name="prepareClover" depends="compileTest" if="with.clover">
     105        <taskdef resource="clovertasks"/>
     106        <mkdir dir="../../reports/router/clover" />
     107        <clover-setup initString="../../reports/router/clover/coverage.db"/>
     108    </target>
     109    <target name="prepareCobertura" depends="compileTest" if="with.cobertura">
     110        <taskdef classpath="${with.cobertura}" resource="tasks.properties" onerror="report" />
     111        <mkdir dir="./build/obj_cobertura" />
     112        <delete file="./cobertura.ser" />
     113        <cobertura-instrument todir="./build/obj_cobertura">
     114            <fileset dir="./build/obj">
     115                <include name="**/*.class"/>
     116                <exclude name="**/*Test.class" />
     117            </fileset>
     118        </cobertura-instrument>
     119    </target>
     120    <target name="prepareTest" depends="prepareClover, prepareCobertura" />
     121    <!-- end preparation of code coverage tool -->
    103122    <target name="test" depends="compileTest">
    104123        <mkdir dir="../../reports/router/junit/" />
     
    109128        </delete>
    110129        <junit printsummary="on" fork="yes">
     130            <sysproperty key="net.sourceforge.cobertura.datafile" file="./cobertura.ser" />
    111131            <classpath>
    112132                <pathelement path="${classpath}" />
     133                <pathelement location="./build/obj_cobertura" />
    113134                <pathelement location="./build/obj" />
    114135                <pathelement location="../../core/java/build/i2ptest.jar" />
    115136                <pathelement location="../../build/jbigi.jar" />
    116                 <pathelement path="${ant.home}/lib/clover.jar"/>
     137                <pathelement location="${with.clover}" />
     138                <pathelement location="${with.cobertura}" />
    117139            </classpath>
    118140            <batchtest todir="../../reports/router/junit/">
     
    124146        </junit>
    125147    </target>
     148    <!-- test reports -->
    126149    <target name="junit.report">
    127150        <junitreport todir="../../reports/router/junit">
     
    132155        </junitreport>
    133156    </target>
    134     <target name="clover.report">
    135         <taskdef resource="clovertasks"/>
    136         <mkdir dir="../../reports/" />
    137         <mkdir dir="../../reports/router" />
    138         <mkdir dir="../../reports/router/clover" />
    139         <clover-setup initString="../../reports/router/clover/coverage.db"/>
     157    <target name="clover.report" depends="test" if="with.clover">
    140158        <clover-report>
    141159            <current outfile="../../reports/router/html/clover">
     
    144162        </clover-report>
    145163    </target>
    146     <target name="test.report" depends="junit.report, clover.report"/>
    147     <target name="useclover">
    148         <taskdef resource="clovertasks"/>
    149         <mkdir dir="../../reports/" />
    150         <mkdir dir="../../reports/router/" />
    151         <mkdir dir="../../reports/router/clover" />
    152         <clover-setup initString="../../reports/router/clover/coverage.db"/>
     164    <target name="cobertura.report" depends="test" if="with.cobertura">
     165        <mkdir dir="../../reports/router/cobertura" />
     166        <cobertura-report format="xml" srcdir="./src" destdir="../../reports/router/cobertura" />
     167        <mkdir dir="../../reports/router/html/cobertura" />
     168        <cobertura-report format="html" srcdir="./src" destdir="../../reports/router/html/cobertura" />
     169        <delete file="./cobertura.ser" />
    153170    </target>
     171    <target name="test.report" depends="junit.report, clover.report, cobertura.report"/>
     172    <!-- end test reports -->
    154173    <target name="fulltest" depends="cleandep, builddeptest, jarTest, test, junit.report" />
    155     <target name="fullclovertest" depends="cleandep, builddeptest, useclover, jarTest, test, test.report" />
    156174    <!-- end unit tests -->
    157175
Note: See TracChangeset for help on using the changeset viewer.