views:

507

answers:

3

I would like to include some code coverage into our nightly build process. We're using CruiseControl, Ant, and Buckminster. Buckminster drives checkout from multiple repositories, and the PDE building and packaging of the product.

Has any one any experience integrating code coverage into an RCP headless build?

I have been looking at Cobertura, EMMA/EclEMMA, DbUnit though am very interested to hear of any experiences with these or any other tools.

+3  A: 

Cobertura seemed to be able to do the job for us.

Once the unit tests were running (a question all to itself), I was able to:

  • instrument the bundles as standalone Jars.
  • re-run the unit tests with a cobertura on the parent class loader class path.

The trick here is to use osgi.parentClassloader=app in the config.ini file used to run the unit test.

  • ext == Java extensions
  • boot == the boot class loader (default)
  • fwk == framework?
  • app == application, i.e. just like a normal application, with a classpath specified on the command line.

The instrumented code needed runtime access to the cobertura jar, so this last step was imperative.

jamesh
+1  A: 

Check out this article on rcpquickstart: http://rcpquickstart.com/2008/08/04/updated-pde-build-and-test-example/

It describes how to get Emma and Corbetura working.

Henrik
+1  A: 

EclEmma now has a additional component called "EclEmma Equinox Runtime" that provides headless code coverage analysis for any OSGi/Equinox application:

http://www.eclemma.org/devdoc/headless.html