Hi, We have integrated jacoco with our ant project and code coverage report 
is not generated for the classes in which we have used 
@RunWith(PowerMockRunner.class) (Powermock-mockito-1.5-full.jar)

Request you to refer the below mentioned build.xml configuration details :

Please inform is there any changes which we need to do in build.xml file or 
need to do changes in our junit test files.

<!-- jacoco -->

<taskdef uri="org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">

        <classpath path=
"${basedir}/${ivy.lib}/jacoco-0.7.6/lib/jacocoant.jar"/>

  </taskdef>


<target name="unit_test" depends="unit_test_compile"

        description="Run junit tests">

    <jacoco:coverage destfile="${coverage.dir}/jacoco.exec" xmlns:jacoco=
"org.jacoco.ant">

<junit fork="yes" forkmode="perBatch" haltonfailure="yes" printsummary=
"true">

<classpath refid="unit.test.classpath" />  <!-- classpath contains nessary 
jar files for junit and powermockito -->

<formatter type="xml"/>

<batchtest fork="yes" todir="${unit.test.reports}">

<fileset dir="${unit.test.src}">

<include name="**/*Test*.java"/>

<exclude name="**/AllTests.java"/>

<exclude name="**/TestHelpers.java"/>

</fileset>

</batchtest>

</junit>

    </jacoco:coverage>

</target>

<target name="coverage-report" depends="unit_test">

<jacoco:report xmlns:jacoco="org.jacoco.ant">

        <executiondata>

            <file file="${coverage.dir}/jacoco.exec" />

        </executiondata>


        <structure name="Jacoco">

            <classfiles>

                <fileset dir="${bin}" />

            </classfiles>

            <sourcefiles encoding="UTF-8">

                <fileset dir="${src}" />

            </sourcefiles>

        </structure>


        <html destdir="${coverage.report.dir}" />

    </jacoco:report>

</target>

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jacoco+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/7d2e0d22-6be6-43d4-afe5-e8115d0ecc81%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to