|
Clover 2.1 Documentation
|
Per-Test CoverageClover 2 introduces the ability to integrate Unit Test results and per-test coverage information into Coverage reports. This unique feature gives you a powerful insight into how well tested your covered code actually is, by showing you exactly which statements each of your tests cover.
Advanced Test Case DetectionIf you are using a testing framework which does not use Junit or TestNG conventions for determining test methods, the nested <testsources/> element of <clover-setup> and <clover-instr> will allow you to specify the convention used by your framework. The Instinct framework for example uses the following: <clover-setup> <testsources dir="tests"> <testclass> <testmethod annotation="Specification"/> <testmethod name="^should.*"/> <testmethod name="^must.*"/> </testclass> </testsources> </clover-setup> You can optionally group <testclass/> definitions in <or/> or <and/> elements. Each <testmethod/> element is automatically grouped by an OR. <clover-setup> <testsources dir="tests"> <or> <testclass name=".*Context"> <testmethod annotation="Specification"/> </testclass> <testclass name=".*Test"> <testmethod name="test.*"/> </testclass> </or> </testsources> </clover-setup> Advanced Test Result ConfigurationClover does its best to record your test results in the Clover database. In some instances however, Clover can not always do so. Currently unit tests using @Test (expected=Exception.class) annotations will be marked as failed when in fact the test passed. To integrate these test results into your Clover reports follow these steps:
e.g. <testresults dir="test-results" include="TEST-*.xml"/> LimitationsClover's per-test coverage collection does not support parallel test execution. |
