Hi There,

I am running  junit for two packages in parallel way using ant script.But 
when I am trying to merge both exec ,it doesn't give full report result.

Please find the ant script below.

<target name="test" description="Run unit tests" depends="compile">

<parallel threadCount="2">
<antcall inheritall="false" target="test1"/>
<antcall inheritall="false" target="test2"/> 

               </parallel>
 </target>



<target name="test1">
  <echo message="Running unit tests in pkg 1..."/>
     *<jacoco:coverage destfile="${unit.test.dir}/jacoco1.exec" >*
       <junit printsummary="false"   haltonfailure="off" fork="true"  
showoutput="yes" >
        <classpath>
          <pathelement location="${test.classes.dir}"/>  
          <path refid="classpath" />
        </classpath>
        <formatter type="xml"/>
        <batchtest fork="true" todir="${result.dir}">
          <fileset dir="${test.classes.dir}" casesensitive="yes">
          *<!-- All the classes pkg 2 will be excluded -->*
*            <exclude name="**/pkg2/**" />*
*              <include name="**/*Test*.class"/> *
          </fileset>
        </batchtest>
      </junit>
     </jacoco:coverage>
</target>

<target name="test2">
  <echo message="Running unit tests in pkg 2..."/>
    * <jacoco:coverage destfile="${unit.test.dir}/jacoco2.exec" >*
       <junit printsummary="false"   haltonfailure="off" fork="true"  
showoutput="yes" >
        <classpath>
          <pathelement location="${test.classes.dir}"/>  
          <path refid="classpath" />
        </classpath>
        <formatter type="xml"/>
        <batchtest fork="true" todir="${result.dir}">
          <fileset dir="${test.classes.dir}" casesensitive="yes">
          *<!-- All the classes pkg 1 will be excluded -->*
*            <exclude name="**/pkg1/**" />*
*               <include name="**/*Test*.class"/> *
          </fileset>
        </batchtest>
      </junit>
     </jacoco:coverage>
</target>




<!-- Report -->

<target name="test.report">

 * <jacoco:merge destfile="${unit.test.dir}/merged.exec">*
*    <fileset dir="${unit.test.dir}" includes="*.exec" />*
*  </jacoco:merge>*

 <jacoco:report>
      *<executiondata>*
*         <file file="${unit.test.dir}/merged.exec"/>*
*       </executiondata>*

    <structure name ="test">
     <classfiles>
       <fileset dir="${classes.dir}">
        <include name="**/impl/*.class"/>
      <exclude name="**/*Test*"/>
        </fileset>
    </classfiles>

    </structure>
    
    <html destdir="${dir.bld.sg.jacoco.report}"/>
    
  </jacoco:report>
  
</target>


I tried to use *same sessionID* for both jacoco coverage, but it also 
didn't work.

*Running all junits in sequential way generate report as expected.*


Please let me know what am I missing.

Thank you.
Giridhar

-- 
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/493522e3-8fd7-42e8-af47-697bac50e60e%40googlegroups.com.

Reply via email to