forked from I2P_Developers/i2p.i2p
Add build harness for ministreaming tests
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="src" path="test/junit"/>
|
||||
<classpathentry kind="src" path="demo"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/i2p_sdk"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
|
@@ -138,6 +138,135 @@
|
||||
splitindex="true"
|
||||
windowtitle="I2P ministreaming library" />
|
||||
</target>
|
||||
|
||||
<target name="builddeptest">
|
||||
<ant dir="../../../core/java" target="jar" />
|
||||
</target>
|
||||
<target name="junit.compileTest" depends="builddeptest, compile">
|
||||
|
||||
<echo message="[DEBUG] ant home is ${ant.home}" />
|
||||
<echo message="[DEBUG] junit home before override is ${junit.home}" />
|
||||
<echo message="[DEBUG] hamcrest home before override is ${hamcrest.home}" />
|
||||
|
||||
<property name="junit.home" value="${ant.home}/lib" />
|
||||
<property name="hamcrest.home" value="${ant.home}/lib" />
|
||||
|
||||
<echo message="[DEBUG] junit home after override is ${junit.home}" />
|
||||
<echo message="[DEBUG] hamcrest home after override is ${hamcrest.home}" />
|
||||
|
||||
<javac
|
||||
srcdir="./test/junit"
|
||||
debug="true" deprecation="on" source="${javac.version}" target="${javac.version}"
|
||||
includeAntRuntime="false"
|
||||
destdir="./build/obj" >
|
||||
<classpath>
|
||||
<pathelement location="../../../core/java/build/i2p.jar" />
|
||||
<pathelement location="${junit.home}/junit4.jar" />
|
||||
<pathelement location="${hamcrest.home}/hamcrest.jar" />
|
||||
<pathelement location="${hamcrest.home}/hamcrest-all.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/ministreaming/clover" />
|
||||
<clover-setup initString="../../../reports/ministreaming/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/ministreaming/junit/" />
|
||||
<delete>
|
||||
<fileset dir="../../../reports/ministreaming/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="${hamcrest.home}/hamcrest-all.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="../../build/jbigi.jar" />
|
||||
<pathelement location="${with.clover}" />
|
||||
<pathelement location="${with.cobertura}" />
|
||||
</classpath>
|
||||
<batchtest todir="../../../reports/ministreaming/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/ministreaming/junit/" />
|
||||
</replaceregexp>
|
||||
</target>
|
||||
<target name="test" depends="junit.test"/>
|
||||
<!-- test reports -->
|
||||
<target name="junit.report">
|
||||
<junitreport todir="../../../reports/ministreaming/junit">
|
||||
<fileset dir="../../../reports/ministreaming/junit">
|
||||
<include name="TEST-*.xml"/>
|
||||
</fileset>
|
||||
<report format="frames" todir="../../../reports/ministreaming/html/junit"/>
|
||||
</junitreport>
|
||||
</target>
|
||||
<target name="clover.report" depends="test" if="with.clover">
|
||||
<clover-report>
|
||||
<current outfile="../../../reports/ministreaming/html/clover">
|
||||
<format type="html"/>
|
||||
</current>
|
||||
</clover-report>
|
||||
</target>
|
||||
<target name="cobertura.report" depends="test" if="with.cobertura">
|
||||
<mkdir dir="../../../reports/ministreaming/cobertura" />
|
||||
<cobertura-report format="xml" srcdir="./src" destdir="../../../reports/ministreaming/cobertura" />
|
||||
<mkdir dir="../../../reports/ministreaming/html/cobertura" />
|
||||
<cobertura-report format="html" srcdir="./src" destdir="../../../reports/ministreaming/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="clean">
|
||||
<delete dir="./build" />
|
||||
<delete dir="./buildDemo" />
|
||||
|
11
build.xml
11
build.xml
@@ -1607,6 +1607,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/ministreaming/java/" target="junit.test" />
|
||||
<ant dir="apps/streaming/java/" target="junit.test" />
|
||||
</target>
|
||||
<target name="scalatest.test" depends="buildProperties, jbigi" >
|
||||
@@ -1618,6 +1619,7 @@
|
||||
<!-- both junit and scala -->
|
||||
<ant dir="core/java/" target="test" />
|
||||
<ant dir="router/java/" target="test" />
|
||||
<ant dir="apps/ministreaming/java/" target="test" />
|
||||
<ant dir="apps/streaming/java/" target="test" />
|
||||
</target>
|
||||
<target name="scalatest.report" depends="buildProperties" >
|
||||
@@ -1627,22 +1629,26 @@
|
||||
<target name="junit.report" depends="buildProperties" >
|
||||
<ant dir="core/java/" target="junit.report" />
|
||||
<ant dir="router/java/" target="junit.report" />
|
||||
<ant dir="apps/ministreaming/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/ministreaming/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/ministreaming/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/ministreaming/java" target="fulltest" />
|
||||
<ant dir="apps/streaming/java" target="fulltest" />
|
||||
</target>
|
||||
<target name="jenkins.cobertura.report" depends="cobertura.report">
|
||||
@@ -1659,6 +1665,11 @@
|
||||
<replaceregexp byline="true" file="reports/router/cobertura/coverage.xml"
|
||||
match="<source>./src" replace="<source>router/java/src"/>
|
||||
|
||||
<replaceregexp byline="true" file="reports/ministreaming/cobertura/coverage.xml"
|
||||
match='filename="net' replace='filename="apps/ministreaming/java/src/net'/>
|
||||
<replaceregexp byline="true" file="reports/ministreaming/cobertura/coverage.xml"
|
||||
match="<source>./src" replace="<source>apps/ministreaming/java/src"/>
|
||||
|
||||
<replaceregexp byline="true" file="reports/streaming/cobertura/coverage.xml"
|
||||
match='filename="net' replace='filename="apps/streaming/java/src/net'/>
|
||||
<replaceregexp byline="true" file="reports/streaming/cobertura/coverage.xml"
|
||||
|
Reference in New Issue
Block a user