Changeset a2217b2


Ignore:
Timestamp:
Feb 20, 2012 3:44:23 AM (8 years ago)
Author:
str4d <str4d@…>
Branches:
master
Children:
849c407
Parents:
c7d473a
Message:

Fiddle with cobertura definitions a bit in core build.xml

To run with cobertura, execute the following in "core/java/":
ant -Dwith.cobertura=/usr/share/java/cobertura.jar cobertura.report

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/build.xml

    rc7d473a ra2217b2  
    8282        <jar destfile="./build/i2ptest.jar" basedir="./build/obj" includes="**/*.class" />
    8383    </target>
    84     <target name="prepareTest" depends="compileTest" if="with.cobertura">
     84    <!-- preparation of code coverage tool of choice -->
     85    <target name="prepareCobertura" depends="compileTest" if="with.cobertura">
    8586        <taskdef classpath="${with.cobertura}" resource="tasks.properties" onerror="report" />
    86         <mkdir dir="./build/obj_test" />
    87         <cobertura-instrument todir="./build/obj_test">
     87        <mkdir dir="./build/obj_cobertura" />
     88        <delete file="./cobertura.ser" />
     89        <cobertura-instrument todir="./build/obj_cobertura">
    8890            <fileset dir="./build/obj">
    8991                <include name="**/*.class"/>
     
    9294        </cobertura-instrument>
    9395    </target>
     96    <target name="prepareTest" depends="prepareCobertura" />
     97    <!-- end preparation of code coverage tool -->
    9498    <target name="test" depends="clean, compileTest, prepareTest">
    9599        <mkdir dir="../../reports/core/junit/" />
     
    103107            <classpath>
    104108                <pathelement path="${classpath}" />
    105                 <pathelement location="./build/obj_test" />
     109                <pathelement location="./build/obj_cobertura" />
    106110                <pathelement location="./build/obj" />
    107111                <pathelement location="../../build/jbigi.jar" />
     
    118122        </junit>
    119123    </target>
    120     <target name="cobertura" depends="test" if="with.cobertura">
    121         <mkdir dir="../../reports/core/cobertura" />
    122         <cobertura-report format="xml" srcdir="./src" destdir="../../reports/core/cobertura" />
    123         <delete file="./cobertura.ser" />
    124     </target>
     124    <!-- test reports -->
    125125    <target name="junit.report">
    126126        <junitreport todir="../../reports/core/junit">
     
    131131        </junitreport>
    132132    </target>
    133     <target name="test.report" depends="junit.report"/>
     133    <target name="cobertura.report" depends="test" if="with.cobertura">
     134        <mkdir dir="../../reports/core/cobertura" />
     135        <cobertura-report format="xml" srcdir="./src" destdir="../../reports/core/cobertura" />
     136        <mkdir dir="../../reports/core/html/cobertura" />
     137        <cobertura-report format="html" srcdir="./src" destdir="../../reports/core/html/cobertura" />
     138        <delete file="./cobertura.ser" />
     139    </target>
     140    <target name="test.report" depends="junit.report, cobertura.report"/>
     141    <!-- end test reports -->
    134142    <target name="fulltest" depends="test, junit.report" />
    135143    <!-- end unit tests -->
Note: See TracChangeset for help on using the changeset viewer.