Hi,
I have a few different projects that i need to run code coverage on using cobertura. Im testing this on two projects at the moment. I have it so that there are different folders for each report but the problem is, the classes from both projects are appearing in both of the seperate reports.
Is there a way around this?
Thanks for the help
Dexter
I have a few different projects that i need to run code coverage on using cobertura. Im testing this on two projects at the moment. I have it so that there are different folders for each report but the problem is, the classes from both projects are appearing in both of the seperate reports.
Is there a way around this?
Thanks for the help
Dexter
Code:
<!-- ========================================================== -->
<!-- Cobetura Code Coverage -->
<!-- ========================================================== -->
<cobertura-instrument todir="${instrumented.classes.dir.OtherCar}">
<fileset dir="${build.src.classes.dir.OtherCar}">
<include name="**/*.class" />
<exclude name="**/*Test*.class"/>
</fileset>
</cobertura-instrument>
<cobertura-instrument todir="${instrumented.classes.dir.TestCar}">
<fileset dir="${build.src.classes.dir.TestCar}">
<include name="**/*.class" />
<exclude name="**/*Test*.class"/>
</fileset>
</cobertura-instrument>
Code:
<!-- ========================================================== -->
<!-- JUnit Reporting - OtherCar -->
<!-- ========================================================== -->
<delete file="${root.dir}/coberturaOtherCar.ser"/>
<target name="junit.OtherCar">
<junit fork="yes" printsummary="yes">
<sysproperty key="net.sourceforge.cobertura.datafile" file="${root.dir}/coberturaOtherCar.ser"/>
<classpath location="${instrumented.classes.dir.OtherCar}"/>
<classpath location="${build.test.classes.dir.OtherCar}"/>
<classpath refid="cobertura.classpath"/>
<classpath refid="test.classpath"/>
<formatter type="xml"/>
<batchtest fork="yes" todir="${test.reports.data.dir.OtherCar}">
<fileset dir="${build.test.classes.dir.OtherCar}" includes="**/*Test*.class"/>
</batchtest>
</junit>
<!--Create the JUnit Test Reports-->
<junitreport todir="${test.reports.data.dir.OtherCar}">
<fileset dir="${test.reports.data.dir.OtherCar}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${test.reports.dir.junit.OtherCar}"/>
</junitreport>
</target>
<!-- ========================================================== -->
<!-- Generating the Cobertura Test Report for OtherCar Module -->
<!-- ========================================================== -->
<cobertura-report format="html" destdir="${test.reports.dir.cobertura.OtherCar}" srcdir="${src.dir.OtherCar}"/>
<!-- ========================================================== -->
<!-- JUnit Reporting - TestCar -->
<!-- ========================================================== -->
<delete file="${root.dir}/coberturaTestCar.ser"/>
<target name="junit.TestCar">
<junit fork="yes" printsummary="yes">
<sysproperty key="net.sourceforge.cobertura.datafile" file="${root.dir.TestCar}/coberturaTestCar.ser"/>
<classpath location="${instrumented.classes.dir.TestCar}"/>
<classpath location="${build.test.classes.dir.TestCar}"/>
<classpath refid="cobertura.classpath"/>
<classpath refid="test.classpath"/>
<formatter type="xml"/>
<batchtest fork="yes" todir="${test.reports.data.dir.TestCar}">
<fileset dir="${build.test.classes.dir.TestCar}" includes="**/*Test*.class"/>
</batchtest>
</junit>
<!--Create the JUnit Test Reports-->
<junitreport todir="${test.reports.data.dir.TestCar}">
<fileset dir="${test.reports.data.dir.TestCar}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${test.reports.dir.junit.TestCar}"/>
</junitreport>
</target>
<!-- ========================================================== -->
<!-- Generating the Cobertura Test Report -->
<!-- ========================================================== -->
<cobertura-report format="html" destdir="${test.reports.dir.cobertura.TestCar}" srcdir="${src.dir.TestCar}"/>