Changeset 10bf74e


Ignore:
Timestamp:
Jun 28, 2013 6:48:39 PM (7 years ago)
Author:
zab2 <zab2@…>
Branches:
master
Children:
14944982
Parents:
a9d9e6b
Message:

add streaming lib tests to the top-level ant targets

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • apps/ministreaming/java/build.xml

    ra9d9e6b r10bf74e  
    3030            <compilerarg line="${javac.compilerargs}" />
    3131        </javac>
     32    </target>
     33
     34    <target name="compileTest" depends="jar">
     35        <mkdir dir="./buildTest" />
     36        <mkdir dir="./buildTest/obj" />
     37        <javac
     38            srcdir="./test/junit"
     39            debug="true" deprecation="on" source="1.5" target="1.5"
     40            includeAntRuntime="false"
     41            destdir="./buildTest/obj"
     42            classpath="../../../core/java/build/i2p.jar:./build/mstreaming.jar" >
     43            <compilerarg line="${javac.compilerargs}" />
     44        </javac>
     45    </target>
     46
     47    <target name="jarTest" depends="jar, compileTest">
     48        <jar destfile="./build/mstreamingTest.jar" basedir="./buildTest/obj" includes="**/*.class" update="true" />
    3249    </target>
    3350
     
    86103    <target name="clean">
    87104        <delete dir="./build" />
     105        <delete dir="./buildTest" />
    88106    </target>
    89107    <target name="cleandep" depends="clean">
  • apps/streaming/java/build.xml

    ra9d9e6b r10bf74e  
    3434        </javac>
    3535    </target>
    36     <target name="compileTest" depends="compile">
     36    <target name="builddeptest">
     37        <ant dir="../../../core/java" target="jar" />
     38        <ant dir="../../../apps/ministreaming/java/" target="jarTest" />
     39    </target>
     40    <target name="junit.compileTest" depends="builddeptest, compile">
    3741        <javac
    3842            srcdir="./test/junit"
    3943            debug="true" deprecation="on" source="1.5" target="1.5"
    4044            includeAntRuntime="false"
    41             destdir="./build/obj"
    42             classpath="../../../core/java/build/i2p.jar:../../ministreaming/java/build/mstreaming.jar" >
     45            destdir="./build/obj" >
     46           <classpath>
     47                <pathelement location="../../../core/java/build/i2p.jar" />
     48                <pathelement location="../../ministreaming/java/build/mstreaming.jar" />
     49                <pathelement location="../../ministreaming/java/build/mstreamingTest.jar" />
     50                <pathelement location="${ant.home}/lib/junit4.jar" />
     51           </classpath>
    4352            <compilerarg line="${javac.compilerargs}" />
    4453        </javac>
    4554    </target>
     55
     56    <!-- preparation of code coverage tool of choice -->
     57    <target name="prepareClover" depends="compile" if="with.clover">
     58        <taskdef resource="clovertasks"/>
     59        <mkdir dir="../../../reports/streaming/clover" />
     60        <clover-setup initString="../../../reports/streaming/clover/coverage.db"/>
     61    </target>
     62    <target name="prepareCobertura" depends="compile" if="with.cobertura">
     63        <taskdef classpath="${with.cobertura}" resource="tasks.properties" onerror="report" />
     64        <mkdir dir="./build/obj_cobertura" />
     65        <delete file="./cobertura.ser" />
     66        <cobertura-instrument todir="./build/obj_cobertura">
     67            <fileset dir="./build/obj">
     68                <include name="**/*.class"/>
     69                <!-- exclude Test classes -->
     70                <exclude name="**/*Test.class" />
     71                <!-- exclude anything not in net.i2p.* -->
     72                <exclude name="org/cybergarage/**/*.class" />
     73                <exclude name="org/freenetproject/**/*.class" />
     74                <exclude name="org/xlattice/**/*.class" />
     75            </fileset>
     76        </cobertura-instrument>
     77    </target>
     78
     79    <target name="prepareTest" depends="prepareClover, prepareCobertura" />
     80
     81    <target name="junit.test" depends="clean, junit.compileTest, prepareTest">
     82        <mkdir dir="../../../reports/streaming/junit/" />
     83        <delete>
     84            <fileset dir="../../../reports/streaming/junit">
     85                <include name="TEST-*.xml"/>
     86            </fileset>
     87        </delete>
     88
     89        <property name="junit.home" value="${ant.home}/lib" />
     90        <property name="hamcrest.home" value="${ant.home}/lib" />
     91
     92        <junit printsummary="withOutAndErr" fork="yes" showoutput="yes" >
     93            <sysproperty key="net.sourceforge.cobertura.datafile" file="./cobertura.ser" />
     94            <classpath>
     95                <pathelement path="${javac.classpath}" />
     96                <pathelement location="${hamcrest.home}/hamcrest-core.jar" />
     97                <pathelement location="${hamcrest.home}/hamcrest-library.jar" />
     98                <pathelement location="${hamcrest.home}/hamcrest-integration.jar" />
     99                <pathelement location="${junit.home}/junit4.jar" />
     100                <pathelement location="./build/obj_cobertura" />
     101                <pathelement location="./build/obj" />
     102                <pathelement location="../../../core/java/build/i2ptest.jar" />
     103                <pathelement location="../../../core/java/build/i2p.jar" />
     104                <pathelement location="../../ministreaming/java/build/mstreaming.jar" />
     105                <pathelement location="../../ministreaming/java/build/mstreamingTest.jar" />
     106                <pathelement location="../../build/jbigi.jar" />
     107                <pathelement location="${with.clover}" />
     108                <pathelement location="${with.cobertura}" />
     109            </classpath>
     110            <batchtest todir="../../../reports/streaming/junit/">
     111                <fileset dir="./test/junit">
     112                    <include name="**/*Test.java" />
     113                </fileset>
     114            </batchtest>
     115            <formatter type="xml"/>
     116        </junit>
     117        <!-- set if unset -->
     118        <property name="host.fakename" value="i2ptester" />
     119        <!-- replace hostname that junit inserts into reports with fake one -->
     120        <replaceregexp byline="true"
     121            match="(hostname=)&quot;[^&quot;]+&quot;"
     122            replace="\1&quot;${host.fakename}&quot;">
     123            <fileset dir="../../../reports/streaming/junit/" />
     124        </replaceregexp>
     125    </target>
     126    <target name="test" depends="junit.test"/>
     127    <!-- test reports -->
     128    <target name="junit.report">
     129        <junitreport todir="../../../reports/streaming/junit">
     130            <fileset dir="../../../reports/streaming/junit">
     131                <include name="TEST-*.xml"/>
     132            </fileset>
     133            <report format="frames" todir="../../../reports/streaming/html/junit"/>
     134        </junitreport>
     135    </target>
     136    <target name="clover.report" depends="test" if="with.clover">
     137        <clover-report>
     138            <current outfile="../../../reports/streaming/html/clover">
     139                <format type="html"/>
     140            </current>
     141        </clover-report>
     142    </target>
     143    <target name="cobertura.report" depends="test" if="with.cobertura">
     144        <mkdir dir="../../../reports/streaming/cobertura" />
     145        <cobertura-report format="xml" srcdir="./src" destdir="../../../reports/streaming/cobertura" />
     146        <mkdir dir="../../../reports/streaming/html/cobertura" />
     147        <cobertura-report format="html" srcdir="./src" destdir="../../../reports/streaming/html/cobertura" />
     148        <delete file="./cobertura.ser" />
     149    </target>
     150    <target name="test.report" depends="junit.report, clover.report, cobertura.report"/>
     151    <!-- end test reports -->
     152    <target name="fulltest" depends="cleandep, test, test.report" />
     153    <!-- end unit tests -->
    46154
    47155    <target name="listChangedFiles" depends="jarUpToDate" if="shouldListChanges" >
     
    87195    </target>
    88196
    89     <target name="jarTest" depends="jar, compileTest">
     197    <target name="jarTest" depends="jar, junit.compileTest">
    90198        <jar destfile="./build/streaming.jar" basedir="./build/obj" includes="**/*Test*.class" update="true" />
    91199    </target>
  • build.xml

    ra9d9e6b r10bf74e  
    13011301        <ant dir="core/java/" target="junit.test" />
    13021302        <ant dir="router/java/" target="junit.test" />
     1303        <ant dir="apps/streaming/java/" target="junit.test" />
    13031304    </target>
    13041305    <target name="scalatest.test" depends="buildProperties, jbigi" >
     
    13091310        <ant dir="core/java/" target="test" />
    13101311        <ant dir="router/java/" target="test" />
     1312        <ant dir="apps/streaming/java/" target="test" />
    13111313    </target>
    13121314    <target name="scalatest.report" depends="buildProperties" >
     
    13171319        <ant dir="core/java/" target="junit.report" />
    13181320        <ant dir="router/java/" target="junit.report" />
     1321        <ant dir="apps/streaming/java/" target="junit.report" />
    13191322    </target>
    13201323    <target name="clover.report" depends="buildProperties" if="with.clover">
    13211324        <ant dir="core/java/" target="clover.report" />
    13221325        <ant dir="router/java/" target="clover.report" />
     1326        <ant dir="apps/streaming/java" target="clover.report" />
    13231327    </target>
    13241328    <target name="cobertura.report" depends="buildProperties" if="with.cobertura">
    13251329        <ant dir="core/java/" target="cobertura.report" />
    13261330        <ant dir="router/java/" target="cobertura.report" />
     1331        <ant dir="apps/streaming/java" target="cobertura.report" />
    13271332    </target>
    13281333    <target name="test.report" depends="junit.report, scalatest.report, clover.report, cobertura.report"/>
     
    13301335        <ant dir="core/java/" target="fulltest" />
    13311336        <ant dir="router/java/" target="fulltest" />
     1337        <ant dir="apps/streaming/java" target="fulltest" />
    13321338    </target>
    13331339    <target name="jenkins.cobertura.report" depends="cobertura.report">
     
    13441350        <replaceregexp byline="true" file="reports/router/cobertura/coverage.xml"
    13451351            match="&lt;source&gt;./src" replace="&lt;source&gt;router/java/src"/>
     1352        <replaceregexp byline="true" file="reports/streaming/cobertura/coverage.xml"
     1353            match='filename="net' replace='filename="streaming/java/src/net'/>
     1354        <replaceregexp byline="true" file="reports/streaming/cobertura/coverage.xml"
     1355            match="&lt;source&gt;./src" replace="&lt;source&gt;streaming/java/src"/>
    13461356    </target>
    13471357    <!-- end unit tests -->
Note: See TracChangeset for help on using the changeset viewer.