Issue Details (XML | Word | Printable)

Key: LUCENE-721
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Grant Ingersoll
Reporter: Michael Busch
Votes: 1
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Lucene - Java

Code coverage reports

Created: 21/Nov/06 06:59 AM   Updated: 16/Dec/06 08:27 PM
Return to search
Component/s: Other
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works clover.patch 2006-11-26 03:33 AM Michael Busch 2 kB
Text File Licensed for inclusion in ASF works code_coverage.patch 2006-11-21 07:00 AM Michael Busch 4 kB
Zip Archive Licensed for inclusion in ASF works emma_report.zip 2006-11-21 07:10 AM Michael Busch 847 kB

Lucene Fields: New
Resolution Date: 16/Dec/06 08:27 PM


 Description  « Hide
Hi all,

We should be able to measure the code coverage of our unit testcases. I believe it would be very helpful for the committers, if they could verify before committing a patch if it does not reduce the coverage.

Furthermore people could take a look in the code coverage reports to figure out where work needs to be done, i. e. where additional testcases are neccessary. It would be nice if we could add a page to the Lucene website showing the report, generated by the nightly build. Maybe you could add that to your preview page (LUCENE-707), Grant?

I attach a patch here that uses the tool EMMA to generate the code coverage reports. EMMA is a very nice open-source tool released under the CPL (same license as junit). The patch adds three targets to common-build.xml:

  • emma-check: verifys if both emma.jar and emma_ant.jar are in the ant classpath
  • emma-instrument: instruments the compiled code
  • generate-emma-report: generates an html code coverage report

The following steps are neccessary in order to generate a code coverage report:

  • add emma.jar and emma_ant.jar to your ant classpath (download emma from http://emma.sourceforge.net/)
  • execute ant target 'emma-instrument' (depends on compile-test, so it will compile all core and test classes)
  • execute ant target 'test' to run the unit tests
  • execute ant target 'generate-emma-report'

To view the emma report open build/test/emma/index.html



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Michael Busch made changes - 21/Nov/06 07:00 AM
Field Original Value New Value
Attachment code_coverage.patch [ 12345396 ]
Michael Busch made changes - 21/Nov/06 07:10 AM
Attachment emma_report.zip [ 12345397 ]
Michael Busch made changes - 25/Nov/06 03:34 AM
Assignee Michael Busch [ michaelbusch ]
Michael Busch made changes - 25/Nov/06 03:36 AM
Status Open [ 1 ] In Progress [ 3 ]
Michael Busch made changes - 26/Nov/06 03:33 AM
Attachment clover.patch [ 12345662 ]
Grant Ingersoll made changes - 27/Nov/06 12:07 AM
Assignee Michael Busch [ michaelbusch ] Grant Ingersoll [ gsingers ]
Grant Ingersoll made changes - 16/Dec/06 08:27 PM
Status In Progress [ 3 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]