0

Recently, I was using a new benchmark: Dacapo(Here is the website:http://dacapobench.org/).

My teacher told me to use the Cobertura to test the branch coverage of 11 benchmarks in Dacapo. Meanwhile, I was learning Cobertura. I found that Cobertura instruments .class file and then running them to get some reports. While Dacapo is a .jar file combines many files in it. I just do not know how to test them with Cobertura.

It will appreciated if you can provide some useful advice. Thanks!

Robby Cornelissen
  • 91,784
  • 22
  • 134
  • 156
Mr.Zha
  • 1
  • 2

1 Answers1

0

Cobertura can instrument jar files if you use ant:

You can also pass in jar files to be instrumented using standard ant filesets. Cobertura will extract each class from the jar and instrument it. If 'todir' was not specified then the original jar will be overwritten with an instrumented version. Otherwise a new jar will be written to the output directory.

<cobertura-instrument todir="${instrumented.dir}">
    <fileset dir="${jars.dir}">
        <include name="my-simple-plugin.jar" />
    </fileset>
</cobertura-instrument>
oers
  • 18,436
  • 13
  • 66
  • 75
  • well, thanks for your reply. My testing .jar file is avrora-cvs-20091224.jar. While there is no .java file in it. How can I write a test or report task corresponding to this .jar file? It will be appreciated if you can provide a general build.xml file. Thanks~ – Mr.Zha Dec 16 '11 at 11:41