Download & Extend

Generate Code Coverage for Test Cases without Web Calls

Project:Code coverage
Version:7.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review

Issue Summary

Not sure whether this a bug or just a feature that isn't implemented yet, or if I'm just doing something incorrectly, but currently I am not able to generate code coverage reports for test cases that don't make a web call. To reproduce, run unit test cases for a module, click on code coverage report, and view the Invalid coverage set message. I'm not sure how hard a feature this is to implement, but it seems like reporting coverage on unit tests and database tests is an important feature.

Comments

#1

Status:active» needs review

Code that is run within the test is currently not tracked.

The attached patch updates the patch that comes with the module to add code coverage for test methods (and everything that is executed by them), note that you will need to re-apply that patch after applying the attached patch :)

AttachmentSize
updated_code_coverage_patch.patch 1.77 KB

#2

Note that this means that the test execution time will increase quite a bit with this. And it's 30% slower (when limiting to a single module, probably much more when tracking everything) when also tracking the setUp() call, so I left that one out.

Please test.