forked from I2P_Developers/i2p.i2p
add streaming lib tests to the top-level ant targets
This commit is contained in:
@@ -31,6 +31,23 @@
|
||||
</javac>
|
||||
</target>
|
||||
|
||||
<target name="compileTest" depends="jar">
|
||||
<mkdir dir="./buildTest" />
|
||||
<mkdir dir="./buildTest/obj" />
|
||||
<javac
|
||||
srcdir="./test/junit"
|
||||
debug="true" deprecation="on" source="1.5" target="1.5"
|
||||
includeAntRuntime="false"
|
||||
destdir="./buildTest/obj"
|
||||
classpath="../../../core/java/build/i2p.jar:./build/mstreaming.jar" >
|
||||
<compilerarg line="${javac.compilerargs}" />
|
||||
</javac>
|
||||
</target>
|
||||
|
||||
<target name="jarTest" depends="jar, compileTest">
|
||||
<jar destfile="./build/mstreamingTest.jar" basedir="./buildTest/obj" includes="**/*.class" update="true" />
|
||||
</target>
|
||||
|
||||
<target name="listChangedFiles" depends="jarUpToDate" if="shouldListChanges" >
|
||||
<exec executable="mtn" outputproperty="workspace.changes" errorproperty="mtn.error2" failifexecutionfails="false" >
|
||||
<arg value="list" />
|
||||
@@ -85,6 +102,7 @@
|
||||
</target>
|
||||
<target name="clean">
|
||||
<delete dir="./build" />
|
||||
<delete dir="./buildTest" />
|
||||
</target>
|
||||
<target name="cleandep" depends="clean">
|
||||
</target>
|
||||
|
@@ -33,17 +33,125 @@
|
||||
<compilerarg line="${javac.compilerargs}" />
|
||||
</javac>
|
||||
</target>
|
||||
<target name="compileTest" depends="compile">
|
||||
<target name="builddeptest">
|
||||
<ant dir="../../../core/java" target="jar" />
|
||||
<ant dir="../../../apps/ministreaming/java/" target="jarTest" />
|
||||
</target>
|
||||
<target name="junit.compileTest" depends="builddeptest, compile">
|
||||
<javac
|
||||
srcdir="./test/junit"
|
||||
debug="true" deprecation="on" source="1.5" target="1.5"
|
||||
includeAntRuntime="false"
|
||||
destdir="./build/obj"
|
||||
classpath="../../../core/java/build/i2p.jar:../../ministreaming/java/build/mstreaming.jar" >
|
||||
destdir="./build/obj" >
|
||||
<classpath>
|
||||
<pathelement location="../../../core/java/build/i2p.jar" />
|
||||
<pathelement location="../../ministreaming/java/build/mstreaming.jar" />
|
||||
<pathelement location="../../ministreaming/java/build/mstreamingTest.jar" />
|
||||
<pathelement location="${ant.home}/lib/junit4.jar" />
|
||||
</classpath>
|
||||
<compilerarg line="${javac.compilerargs}" />
|
||||
</javac>
|
||||
</target>
|
||||
|
||||
<!-- preparation of code coverage tool of choice -->
|
||||
<target name="prepareClover" depends="compile" if="with.clover">
|
||||
<taskdef resource="clovertasks"/>
|
||||
<mkdir dir="../../../reports/streaming/clover" />
|
||||
<clover-setup initString="../../../reports/streaming/clover/coverage.db"/>
|
||||
</target>
|
||||
<target name="prepareCobertura" depends="compile" if="with.cobertura">
|
||||
<taskdef classpath="${with.cobertura}" resource="tasks.properties" onerror="report" />
|
||||
<mkdir dir="./build/obj_cobertura" />
|
||||
<delete file="./cobertura.ser" />
|
||||
<cobertura-instrument todir="./build/obj_cobertura">
|
||||
<fileset dir="./build/obj">
|
||||
<include name="**/*.class"/>
|
||||
<!-- exclude Test classes -->
|
||||
<exclude name="**/*Test.class" />
|
||||
<!-- exclude anything not in net.i2p.* -->
|
||||
<exclude name="org/cybergarage/**/*.class" />
|
||||
<exclude name="org/freenetproject/**/*.class" />
|
||||
<exclude name="org/xlattice/**/*.class" />
|
||||
</fileset>
|
||||
</cobertura-instrument>
|
||||
</target>
|
||||
|
||||
<target name="prepareTest" depends="prepareClover, prepareCobertura" />
|
||||
|
||||
<target name="junit.test" depends="clean, junit.compileTest, prepareTest">
|
||||
<mkdir dir="../../../reports/streaming/junit/" />
|
||||
<delete>
|
||||
<fileset dir="../../../reports/streaming/junit">
|
||||
<include name="TEST-*.xml"/>
|
||||
</fileset>
|
||||
</delete>
|
||||
|
||||
<property name="junit.home" value="${ant.home}/lib" />
|
||||
<property name="hamcrest.home" value="${ant.home}/lib" />
|
||||
|
||||
<junit printsummary="withOutAndErr" fork="yes" showoutput="yes" >
|
||||
<sysproperty key="net.sourceforge.cobertura.datafile" file="./cobertura.ser" />
|
||||
<classpath>
|
||||
<pathelement path="${javac.classpath}" />
|
||||
<pathelement location="${hamcrest.home}/hamcrest-core.jar" />
|
||||
<pathelement location="${hamcrest.home}/hamcrest-library.jar" />
|
||||
<pathelement location="${hamcrest.home}/hamcrest-integration.jar" />
|
||||
<pathelement location="${junit.home}/junit4.jar" />
|
||||
<pathelement location="./build/obj_cobertura" />
|
||||
<pathelement location="./build/obj" />
|
||||
<pathelement location="../../../core/java/build/i2ptest.jar" />
|
||||
<pathelement location="../../../core/java/build/i2p.jar" />
|
||||
<pathelement location="../../ministreaming/java/build/mstreaming.jar" />
|
||||
<pathelement location="../../ministreaming/java/build/mstreamingTest.jar" />
|
||||
<pathelement location="../../build/jbigi.jar" />
|
||||
<pathelement location="${with.clover}" />
|
||||
<pathelement location="${with.cobertura}" />
|
||||
</classpath>
|
||||
<batchtest todir="../../../reports/streaming/junit/">
|
||||
<fileset dir="./test/junit">
|
||||
<include name="**/*Test.java" />
|
||||
</fileset>
|
||||
</batchtest>
|
||||
<formatter type="xml"/>
|
||||
</junit>
|
||||
<!-- set if unset -->
|
||||
<property name="host.fakename" value="i2ptester" />
|
||||
<!-- replace hostname that junit inserts into reports with fake one -->
|
||||
<replaceregexp byline="true"
|
||||
match="(hostname=)"[^"]+""
|
||||
replace="\1"${host.fakename}"">
|
||||
<fileset dir="../../../reports/streaming/junit/" />
|
||||
</replaceregexp>
|
||||
</target>
|
||||
<target name="test" depends="junit.test"/>
|
||||
<!-- test reports -->
|
||||
<target name="junit.report">
|
||||
<junitreport todir="../../../reports/streaming/junit">
|
||||
<fileset dir="../../../reports/streaming/junit">
|
||||
<include name="TEST-*.xml"/>
|
||||
</fileset>
|
||||
<report format="frames" todir="../../../reports/streaming/html/junit"/>
|
||||
</junitreport>
|
||||
</target>
|
||||
<target name="clover.report" depends="test" if="with.clover">
|
||||
<clover-report>
|
||||
<current outfile="../../../reports/streaming/html/clover">
|
||||
<format type="html"/>
|
||||
</current>
|
||||
</clover-report>
|
||||
</target>
|
||||
<target name="cobertura.report" depends="test" if="with.cobertura">
|
||||
<mkdir dir="../../../reports/streaming/cobertura" />
|
||||
<cobertura-report format="xml" srcdir="./src" destdir="../../../reports/streaming/cobertura" />
|
||||
<mkdir dir="../../../reports/streaming/html/cobertura" />
|
||||
<cobertura-report format="html" srcdir="./src" destdir="../../../reports/streaming/html/cobertura" />
|
||||
<delete file="./cobertura.ser" />
|
||||
</target>
|
||||
<target name="test.report" depends="junit.report, clover.report, cobertura.report"/>
|
||||
<!-- end test reports -->
|
||||
<target name="fulltest" depends="cleandep, test, test.report" />
|
||||
<!-- end unit tests -->
|
||||
|
||||
<target name="listChangedFiles" depends="jarUpToDate" if="shouldListChanges" >
|
||||
<exec executable="mtn" outputproperty="workspace.changes" errorproperty="mtn.error2" failifexecutionfails="false" >
|
||||
<arg value="list" />
|
||||
@@ -86,7 +194,7 @@
|
||||
</condition>
|
||||
</target>
|
||||
|
||||
<target name="jarTest" depends="jar, compileTest">
|
||||
<target name="jarTest" depends="jar, junit.compileTest">
|
||||
<jar destfile="./build/streaming.jar" basedir="./build/obj" includes="**/*Test*.class" update="true" />
|
||||
</target>
|
||||
<target name="javadoc">
|
||||
|
10
build.xml
10
build.xml
@@ -1300,6 +1300,7 @@
|
||||
<target name="junit.test" depends="buildProperties, jbigi" >
|
||||
<ant dir="core/java/" target="junit.test" />
|
||||
<ant dir="router/java/" target="junit.test" />
|
||||
<ant dir="apps/streaming/java/" target="junit.test" />
|
||||
</target>
|
||||
<target name="scalatest.test" depends="buildProperties, jbigi" >
|
||||
<ant dir="core/java/" target="scalatest.test" />
|
||||
@@ -1308,6 +1309,7 @@
|
||||
<target name="test" depends="buildProperties, jbigi" >
|
||||
<ant dir="core/java/" target="test" />
|
||||
<ant dir="router/java/" target="test" />
|
||||
<ant dir="apps/streaming/java/" target="test" />
|
||||
</target>
|
||||
<target name="scalatest.report" depends="buildProperties" >
|
||||
<ant dir="core/java/" target="scalatest.report" />
|
||||
@@ -1316,19 +1318,23 @@
|
||||
<target name="junit.report" depends="buildProperties" >
|
||||
<ant dir="core/java/" target="junit.report" />
|
||||
<ant dir="router/java/" target="junit.report" />
|
||||
<ant dir="apps/streaming/java/" target="junit.report" />
|
||||
</target>
|
||||
<target name="clover.report" depends="buildProperties" if="with.clover">
|
||||
<ant dir="core/java/" target="clover.report" />
|
||||
<ant dir="router/java/" target="clover.report" />
|
||||
<ant dir="apps/streaming/java" target="clover.report" />
|
||||
</target>
|
||||
<target name="cobertura.report" depends="buildProperties" if="with.cobertura">
|
||||
<ant dir="core/java/" target="cobertura.report" />
|
||||
<ant dir="router/java/" target="cobertura.report" />
|
||||
<ant dir="apps/streaming/java" target="cobertura.report" />
|
||||
</target>
|
||||
<target name="test.report" depends="junit.report, scalatest.report, clover.report, cobertura.report"/>
|
||||
<target name="fulltest" depends="buildProperties, jbigi" >
|
||||
<ant dir="core/java/" target="fulltest" />
|
||||
<ant dir="router/java/" target="fulltest" />
|
||||
<ant dir="apps/streaming/java" target="fulltest" />
|
||||
</target>
|
||||
<target name="jenkins.cobertura.report" depends="cobertura.report">
|
||||
<!--
|
||||
@@ -1343,6 +1349,10 @@
|
||||
match='filename="net' replace='filename="router/java/src/net'/>
|
||||
<replaceregexp byline="true" file="reports/router/cobertura/coverage.xml"
|
||||
match="<source>./src" replace="<source>router/java/src"/>
|
||||
<replaceregexp byline="true" file="reports/streaming/cobertura/coverage.xml"
|
||||
match='filename="net' replace='filename="streaming/java/src/net'/>
|
||||
<replaceregexp byline="true" file="reports/streaming/cobertura/coverage.xml"
|
||||
match="<source>./src" replace="<source>streaming/java/src"/>
|
||||
</target>
|
||||
<!-- end unit tests -->
|
||||
|
||||
|
Reference in New Issue
Block a user