Welcome, Guest
Username Password: Remember me

Ant Example code for Emma Instrumentation and reports
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Ant Example code for Emma Instrumentation and reports

Ant Example code for Emma Instrumentation and reports 1 year, 1 month ago #624

  • rajeshkumar
  • OFFLINE
  • Moderator
  • I love software configuration management
  • Posts: 370
  • Points: 44591
  • Karma: 4
  • Honor Medal 2009
In-place instrument a certain subset of already compiled classes using overwrite mode and several coverage filters:
 
<emma enabled="${emma.enabled}" >
<instr instrpathref="${out.dir}/classes"
mode="overwrite"
>
<!-- always exclude every class with a "Test" in the name: -->
<filter excludes="*Test*" />
<!-- don't instrument everything in "${out.dir}/classes",
only the stuff I am working on now: -->
<filter file="myincludes.txt" />
<!-- additional ANT command line hook: -->
<filter value="${emma.filter}" />
</instr>
</emma>


Don't overwrite compiled classes that later need to go into official release jars (stay in copy mode). However, use incremental instrumentation for fast personal testing:

 
<emma enabled="${emma.enabled}" >
<instr instrpathref="${out.dir}/classes"
outdir="${out.dir}/classes-instrumented"
merge="yes"
filter="${emma.filter}"
/>
</emma>
 
 



Take all jars already produced by the product build and make test (coverage-enabled) copies of them:

 
<emma enabled="${emma.enabled}" >
<instr mode="fullcopy"
outdir="${out.instr.dir}"
merge="no"
filter="${emma.filter}"
>
<instrpath>
<fileset dir="${out.dir}" includes="**/*.jar" />
</instrpath>
</instr>
</emma>
 


 
<copy todir="${dist}">
<fileset dir="${src}"
includes="**/images/*"
excludes="**/*.gif"
/>
</copy>
 


 
<copy todir="${dist}">
<fileset dir="${src}">
<include name="**/images/*"/>
<exclude name="**/*.gif"/>
</fileset>
</copy>
 
 



Groups all files in directory ${server.src} that are Java source files and don't have the text Test in their name.

 
<fileset dir="${server.src}" casesensitive="yes">
<include name="**/*.java"/>
<exclude name="**/*Test*"/>
</fileset>
 


Groups the same files as the above example, but also establishes a PatternSet that can be referenced in other <fileset> elements, rooted at a different directory.

 
<fileset dir="${server.src}" casesensitive="yes">
<patternset id="non.test.sources">
<include name="**/*.java"/>
<exclude name="**/*Test*"/>
</patternset>
</fileset>
 
 



Groups all files in directory ${client.src}, using the same patterns as the above example.

 
<fileset dir="${client.src}" >
<patternset refid="non.test.sources"/>
</fileset>
 
 




Groups the same files as the top example, but using the <filename> selector.
 
<fileset dir="${server.src}" casesensitive="yes">
<filename name="**/*.java"/>
<filename name="**/*Test*" negate="true"/>
</fileset>
 


Groups the same files as the previous example using a combination of the <filename> selector and the <not> selector container.

 
<fileset dir="${server.src}" casesensitive="yes">
<filename name="**/*.java"/>
<not>
<filename name="**/*Test*"/>
</not>
</fileset>
 



Selects all files in src/main
 
<fileset dir="src" includes="main/" />
 
<emma enabled="${emma.enabled}" >
<instr mode="overwrite"
instrpath="${jar.location}"
destdir="${inst.jar.location}"
metadatafile="${inst.jar.location}/metadata.emma"
merge="no" >
<instrpath>
<fileset dir="${jar.location}" includes="elance-services.jar,web-classes.jar,applet.jar,application-ejb.jar" />
</instrpath>
 
</instr>
</emma>
 
 
<emma enabled="${emma.enabled}" >
<instr mode="fullcopy"
instrpath="${jar.location}"
outdir="${inst.jar.location}"
 
metadatafile="${inst.jar.location}/metadata.emma"
merge="no" >
<instrpath>
<fileset dir="${jar.location}" includes="elance-services.jar,web-classes.jar,applet.jar,application-ejb.jar" />
</instrpath>
 
</instr>
</emma>
 
 
Regards,
Rajesh Kumar
Build and Release Engineer
My Blog: community.scmgalaxy.com/pg/profile/rajeshkumar
  • Page:
  • 1
Time to create page: 1.63 seconds

     
    
Home Forum