lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Grant Ingersoll (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-721) Code coverage reports
Date Sat, 09 Dec 2006 15:16:22 GMT
    [ http://issues.apache.org/jira/browse/LUCENE-721?page=comments#action_12457080 ] 
            
Grant Ingersoll commented on LUCENE-721:
----------------------------------------

I'm not familiar w/ clover, but here's what I did, when trying out your patch (which works):

1. applied the patch :-)
2. Put clover.jar and clover.license (retrieved from the committers private repository into
my ANT lib)
3. Ran "ant clover"  -- this passed and said clover is enabled
4.  Ran "ant test" 
5. ant generate-clover-reports
6. View the reports!  They look good and I think will prove to be useful, especially for people
who are looking for how they can help make Lucene better.

Is there anyway to turn off clover other than removing the jar?  It seems like it takes quite
a bit longer to run the tests and I was thinking I may just want to enable it when running
nightly, but that most people wouldn't want it on by default even though they may have clover
in there ANT lib.  
I wanted to do something like adding a property named run.clover (off by default) that could
then be overridden by -Drun.clover=true on the command line, but I admit I don't see in ANT
how to AND together the clover.present attribute with this new property.  The CONDITION and
AVAILABLE tasks in ANT don't seem to allow for ANDing two existing properties, or perhaps
I am missing something.  I admit, though, my ANT knowledge isn't what it used to be since
I moved to Maven a long time ago, so if someone can chime in here it would be appreciated.

Otherwise, the patch looks good and I will commit it once we figure out whether being able
to turn it off is important to people and how to do it.

> 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: Grant Ingersoll
>            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: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message