-
Type:
Suggestion
-
Resolution: Won't Fix
-
Component/s: None
-
None
@covers for Clover will take advantage of Clover's per-test coverage in the following ways:
- a test method A with an @covers("com.moneybags.sample.Money") will only provide coverage for the Money class and the test itself.
- if test A also covers the MoneyBag class, then this coverage will still be collected, but filtered at report time.
- a test method with an @covers("com.moneybags.sample") will only provide coverage for the com.moneybags.sample package.
- a test method with no @covers annotation will have none of its coverage filtered
- if a test method A has an @covers annotation, and provides no coverage to the class or package defined in the annotation value, then a warning will be displayed next to that test in the HTML report - and possibly also printed to stdout
- the clover-check task will also have a new sub-element <cheeck-covers/> that will fail the build if any test does not cover a class/package that it says it will
PHPUnit do something similar: http://eng.genius.com/blog/2009/08/18/phpunit-annotations/#covers