Re: [jira] Updated: (LUCENE-721) Code coverage reports

2006-11-28 Thread Michael Busch

Chris Hostetter wrote:

: Here it is, Grant. This new patch uses Clover to generate code coverage
: reports. Simply add clover.jar to the ant classpath, do a clean and
: run the target test. During compiling Clover will automatically
: instrument all classes under src/java.

haven't had a chance to look at the patch, but i have two questions baout
this:

1) is there any way to explicitly disable the instumentation (ie: with a
system property set in the build.properties, or on the command line) in
case people get into a situation where they are suspicious of hte
instrumentation and what to run the test without it?

  
Good point, I can easily add a property to switch on/off 
instrumentation. Currently it's always enabled if clover.jar can be 
found in the classpath.



2) what is the beahvior of the report generatation after a test failure?
DOes Clover know baout Ant failures?  would the report reflect the fact
that the tests failed in it's summary info?


  
No, clover has no information about failed tests. It shows the recorded 
coverage since the last compile/instrumentation and if some tests failed 
the coverage will probably be lower. We could show information about 
failed tests in the title of the code coverage report. But I will read a 
bit more in the clover manual to figure out if there are other 
possibilities to show those information.


- Michael

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [jira] Updated: (LUCENE-721) Code coverage reports

2006-11-26 Thread Chris Hostetter

: Here it is, Grant. This new patch uses Clover to generate code coverage
: reports. Simply add clover.jar to the ant classpath, do a clean and
: run the target test. During compiling Clover will automatically
: instrument all classes under src/java.

haven't had a chance to look at the patch, but i have two questions baout
this:

1) is there any way to explicitly disable the instumentation (ie: with a
system property set in the build.properties, or on the command line) in
case people get into a situation where they are suspicious of hte
instrumentation and what to run the test without it?

2) what is the beahvior of the report generatation after a test failure?
DOes Clover know baout Ant failures?  would the report reflect the fact
that the tests failed in it's summary info?




-Hoss


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[jira] Updated: (LUCENE-721) Code coverage reports

2006-11-25 Thread Michael Busch (JIRA)
 [ http://issues.apache.org/jira/browse/LUCENE-721?page=all ]

Michael Busch updated LUCENE-721:
-

Attachment: clover.patch

Here it is, Grant. This new patch uses Clover to generate code coverage 
reports. Simply add clover.jar to the ant classpath, do a clean and run the 
target test. During compiling Clover will automatically instrument all 
classes under src/java. 

After the junit tests are done, execute the new target 
generate-clover-reports. Clover will generate the html report in 
build/test/clover/reports. 

Note: If clover.jar can not be found in the ant classpath then test will 
simply print an info message, saying that code coverage reports are disabled, 
and exeute the junit tests like it did before this patch.

 Code coverage reports
 -

 Key: LUCENE-721
 URL: http://issues.apache.org/jira/browse/LUCENE-721
 Project: Lucene - Java
  Issue Type: New Feature
  Components: Other
Reporter: Michael Busch
 Assigned To: Michael Busch
Priority: Minor
 Attachments: clover.patch, code_coverage.patch, emma_report.zip


 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

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]