Custom Search

Thursday, October 2, 2008

Why do I get 0% coverage when I run my tests and then a reporter from the same instance of Ant?

This occurs because Clover hasn't had a chance to flush coverage data out to disk. By default Clover flushes coverage data only at JVM shutdown or when explicitly directed to (using a inline directive). The simplest thing to do is to use the fork="true" attribute when running your tests. The tests will be then run in their own JVM, and the coverage data will be flushed when the that JVM exits. Alternatively, you can use interval-based flushing by changing the Flush Policy.

No comments: