Does your generated report show a column “Lines” like this report?

https://www.jacoco.org/jacoco/trunk/coverage/

If not there is no debug information in your class files.

If there is line counters in the tables double check the source location. If 
the source fileset is at ./ServerTests/manual this means your sources must be 
in directory

  ./ServerTests/manual/com/hp/ssmc/pianoui/..

Regards,
-marc





> On 29. Jun 2019, at 19:21, divyansh agrawal <[email protected]> 
> wrote:
> 
> I am not able to get Source file information while generating the report of 
> Jacoco code Coverage.I even tried  debug="on" while compiling the file and in 
> the tag <sourcefile>  and <classfile > i mentioned  the correct path of 
> source directory of java and class file respectively But then also it is 
> showing me the same error.Can someday help me to rectify this error? Here is 
> my code.
> 
> <target name="jacocoTests" depends="buildServerTests" description="run tests 
> with cobertura" >
>            <taskdef uri="antlib:org.jacoco.ant" 
> resource="org/jacoco/ant/antlib.xml">
>              <classpath path="lib/jacocoant.jar"/>
>          </taskdef>
>         <jacocoTestsParameterized 
> targetClassDir="${SELECTED_TEST_CLASS_DIRECTORY}" 
> classFilterInclude="${SELECTED_TEST_CLASS_NAME}" 
> classFilterExclude="${SELECTED_TEST_CLASS_EXCLUDE_NAME}" />
>     </target>
>       <macrodef name="jacocoTestsParameterized" description="execute Jacoco 
> with parameters" >
>               <attribute name="targetClassDir" default="ServerTests" 
> description="directory of classes for junit execution" />
>         <attribute name="classFilterInclude" default="**/*" 
> description="class filter for include" />
>         <attribute name="classFilterExclude" default="**/*$*class" 
> description="class filter for exclude" />
>               <sequential>
>                       <taskdef uri="antlib:org.jacoco.ant" 
> resource="org/jacoco/ant/antlib.xml">
>               <classpath path="lib/jacocoant.jar"/>
>             </taskdef>
>                       <jacoco:instrument 
> destdir="${result.classes.instr.dir}/${SELECTED_TEST_CLASS_DIRECTORY}">
>               <fileset dir="${SELECTED_TEST_CLASS_DIRECTORY}">
>                <filename regex=".class"/>
>               </fileset>
>             </jacoco:instrument>
>                       <path id="classpath">
>               <pathelement location="lib/junit-4.12.jar" />
>                         <pathelement location="lib/hamcrest-core-1.3.jar" />
>                         <pathelement location="lib/ant-junit4.jar"/>
>                          <pathelement 
> location="./${SELECTED_TEST_CLASS_DIRECTORY}/build/manual/classes"/>
>                          <fileset dir="./lib">
>                  <include name="**/*.jar" />
>                </fileset>
>             </path>
>               <property name="junitReports" value="target/reports"/>
>         <mkdir dir="${junitReports}"/>
>               <echo message="hello"/>
>               <delete dir="./target/reports"/>
>               <delete dir="./target/site/jacoco"/>
>               <mkdir dir="./target/reports"/>
>               <mkdir dir="./target/site/jacoco"/>
>            <jacoco:coverage destfile="${result.exec.file}">
>            <junit haltonfailure="false" showoutput="true" printsummary="yes" 
> fork="true" forkmode="once">
>                  <formatter type="xml"/>
>                        <classpath refid="classpath"/>
>                        <classpath refid="defaultTESTpath"/>
>                        <classpath 
> location="./ServerTests/build/manual/classes"/>
>               <test name="com.hp.ssmc.pianoui.RemoteCopy.VerifyTest" 
> todir="${testreport.dir}"/> 
>             </junit>
>             </jacoco:coverage>
>                       <junitreport todir="${testreport.dir}">
>             <fileset dir="${testreport.dir}">
>                 <include name="TEST-*.xml" />
>             </fileset>
>             <report todir="${testreport.dir}"/>
>         </junitreport>
>       <jacoco:report>
>         <executiondata>
>             <fileset file="${result.exec.file}" />
>         </executiondata>
> 
>         <structure name="com.hp.ssmc.pianoui.RemoteCopy.VerifyTest">
>             <classfiles>
>                 <fileset 
> dir="${SELECTED_TEST_CLASS_DIRECTORY}/build/manual/classes">
>                                 <include name="**/*.class"/>
>                               </fileset>
>                       </classfiles>
>                       <sourcefiles encoding="UTF-8">
>                <fileset dir="./ServerTests/manual">
>                           <include name="**/*.java"/>
>                               </fileset>
>             </sourcefiles>
>         </structure>
> 
>         <html destdir="${result.report.dir}/report.html"/>
>               <csv destfile="${result.report.dir}/report.csv"/>
>               <xml destfile="${result.report.dir}/report.xml"/>
>     </jacoco:report>
>               </sequential>
>       </macrodef>
> 
>  
> 
> -- 
> 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 [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jacoco/937bded7-ee7b-4966-b7a9-c877710b30b9%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/jacoco/937bded7-ee7b-4966-b7a9-c877710b30b9%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/64C8487B-415D-4345-884F-CA07D7EEB2CA%40mountainminds.com.

Reply via email to