build-coverage.emma.xml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <project name="build-emma" basedir="." default="...">
  2. <!-- directory that contains emma.jar and emma_ant.jar: -->
  3. <property name="emma.output.dir" location="emma" />
  4. <property name="emma.instrumented.classes.dir" location="${emma.output.dir}/classes-instrumented" />
  5. <path id="emma.lib" >
  6. <pathelement location="${emma.home}/lib/emma.jar" />
  7. <pathelement location="${emma.home}/lib/emma_ant.jar" />
  8. </path>
  9. <taskdef resource="emma_ant.properties" classpathref="emma.lib" />
  10. <target name="tests.before">
  11. <emma>
  12. <instr
  13. outdir="${emma.instrumented.classes.dir}"
  14. instrpath="${dest.dir}"
  15. metadatafile="${emma.output.dir}/coverage.em"
  16. merge="no">
  17. </instr>
  18. </emma>
  19. </target>
  20. <target name="init.emma">
  21. <mkdir dir="${emma.output.dir}"/>
  22. </target>
  23. <target name="clean.emma">
  24. <delete dir="${emma.output.dir}"/>
  25. </target>
  26. <path id="tests.run.classpath">
  27. <pathelement location="${emma.instrumented.classes.dir}"/>
  28. <path refid="tests.run.classpath.base"/>
  29. <path refid="emma.lib"/>
  30. </path>
  31. <target name="emma">
  32. <property name="tests.run.classpath.ref" value="tests.run.classpath.emma"/>
  33. </target>
  34. <target name="tests.after">
  35. <emma>
  36. <report sourcepath="${src.main.java.dir}"
  37. sort="+block,+name,+method,+class"
  38. metrics="method:70,block:80,line:80,class:100"
  39. >
  40. <infileset dir="${emma.output.dir}" includes="*.em, *.ec" />
  41. <html outfile="${emma.output.dir}/report/index.html" encoding="UTF-8"/>
  42. </report>
  43. </emma>
  44. </target>
  45. <target name="emma.do" depends="emma,tests.run"/>
  46. <presetdef name="junit.orion">
  47. <junit>
  48. <sysproperty key="emma.coverage.out.file" value="${emma.output.dir}/coverage.ec"/>
  49. </junit>
  50. </presetdef>
  51. </project>