<p>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.</p>

<p><strong>Has any one any experience integrating code coverage into an RCP headless build?</strong></p>

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

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.