Hi, as written on the forum Emma works on all my
classes but doesn't seem to work with my HUGE class
(more than 20000 lines). This is weird since all my
test cases pass by this class.
I see the class as being instrumented and the tests
pass. In the HTML report I see all the lines as red
(not covered) which is not possible really.
I have attached the .class file as requested and here
is the build I use:
<!--
******************************************************************
-->
<!-- TEST TASKS
-->
<!--
******************************************************************
-->
<target name="junit.cmd.all"
description="Running all junit tests on
command line"
depends="test.compile, prepare.config.for.files">
<mkdir dir="${CodeCoverageInstrDir}" />
<mkdir dir="${JunitTestsDir}"/>
<junit
printsummary="withOutAndErr"
fork="true"
haltonerror="no"
failureproperty="test.failure"
errorproperty="test.failure">
<classpath>
<pathelement
location="${CodeCoverageInstrDir}"/>
<path refid="test.run.classpath"/>
<path refid="codecoverage.classpath"/>
</classpath>
<formatter type="xml"/>
<batchtest todir="${JunitTestsDir}">
<fileset refId="test.cases"/>
</batchtest>
<jvmarg
value="-Demma.coverage.out.file=${CodeCoverageDir}/coverage.emma"
/>
<jvmarg
value="-Demma.coverage.out.merge=false" />
</junit>
<junitreport todir="${JunitTestsDir}">
<report format="frames"
todir="${JunitTestsDir}"/>
<fileset dir="${JunitTestsDir}">
<include name="TEST-*.xml"/>
</fileset>
</junitreport>
<echo message="The report has been generated
the following directory ${JunitTestsDir}/html."/>
</target>
<!--
******************************************************************
-->
<!-- CODE COVERAGE TASKS
-->
<!--
******************************************************************
-->
<taskdef resource="emma_ant.properties"
classpathref="codecoverage.classpath" />
<target name="codecoverage.instrument.classes">
<mkdir dir="${CodeCoverageDir}" />
<mkdir dir="${CodeCoverageInstrDir}" />
<emma enabled="true" >
<instr instrpathref="classes.classpath"
destdir="${CodeCoverageInstrDir}"
metadatafile="${CodeCoverageDir}/metadata.emma"
merge="true"
verbosity="info"/>
</emma>
</target>
<target name="codecoverage.report">
<mkdir dir="${CodeCoverageDir}" />
<emma enabled="true" >
<report sourcepath="${SrcDir}"
verbosity="info">
<fileset dir="${CodeCoverageDir}" >
<include name="*.emma" />
</fileset>
<html
outfile="${CodeCoverageDir}/coverage.html" />
<xml
outfile="${CodeCoverageDir}/coverage.xml" />
</report>
</emma>
</target>
<target name="codecoverage"
description="Generate code coverage reports
for the project"
depends="codecoverage.instrument.classes,
junit.cmd.all, codecoverage.report">
</target>
If you need anything else to help you debug this, let
me know
Huge Class Before Instrumentation
Huge Class After Instrumentation