Ignore parts of code in coverage report

I'm evaluating IDEA 6 for possible upgrade from IDEA4.5

I LIKE the new code coverage feature.

But as far as I understand it's impossible to mark parts of code as 'ignored' for coverage report.

So I have a small feature request to add support for excluding parts of source from coverage report. For example, in my own Boost.Coverage system (coverage reports for C++ - http://scb.udsu.ru/~cyberax/cov_test/index_tz_database.html ) I use such syntax:

Comment actions Permalink

Hello, Alex,
Thank you for your feedback.
Indeed it is impossible now to exclude code from coverage reports. However, when thinking about how this feature should be implemented, I would rather choose excluding certain lines a posteriori with a dedicated action in the editor. Exculded lines would then be easily differentiated via special color for gutter marks, and at the same time no special code would be needed.

Comment actions Permalink

On the other hand, such marks can not be put into source code repository and shared with other developers. For example, we generate IDEA projects automatically using Maven and I know a lot of other projects which do not put project files in source control.

Probably, it would be better to implement both methods. For example, when one puts '@nc' in a comment the line is immediately highlighted as ignored, but it is also possible to do it without modifying source code (useful when you need to use other peoples' code).


Please sign in to leave a comment.