Code coverage filter

I want to exclude the "test" and "mock" packages from being included in the code coverage results in IntelliJ 6.0.4. Is there a way I can achieve this?

Or Can I exclude some specific internal packages as for example:

I specify "Packages and classes to record coverage data" as:
com.companyname.projectname.*

And then exclude certain internal packages using the following:
com/companyname/projectname/*/test/ and
com/companyname/projectname/*/mock/

Any help on similar lines is welcome...

Thanks,
Rasesh

8 comments

Hello Rasesh,

Package exclusion on instrumentation level is not currently implemented. Sources that are marked as "test source" are not included in coverage report, so you could try to mark those packages as testsource.

Eugene.

0

Wow! That soution works like a charm.

But then I have to manually select all the "test" and "mock" packages as testsource. Can I do something like this while selecting testsources:

com/companyname/projectname/*/test/ and
com/companyname/projectname/*/mock/

And I don't understand exactly what the "p" (Select package prefix) does while specifying testsources. Can that be helpful here?

Thanks,
Rasesh

0

well you could adopt one of the widespread practice and 2 different source roots.
One for your actual sources (not test related), and another one for test related artefacts.

A la maven

0

I accept that is a very good suggestion but we have to conform to the standards followed by the company.

In fact one of the major disadvantage of doing what we do is not being able to test the methods with package level access.

But then advantage is that the tests are much closer to the source.

Thanks,
Rasesh

Message was edited by:
Rasesh

0

Are all the TDD (or agile) tools in IntelliJ 6.0 (code coverage and other "test" related settings and features) built taking this into consideration that all projects will have 2 separate source roots (one for actual source/production code and other for tests)?

-Rasesh

0

Yes, test sources are distinguished from ordinary sources by many of IDEA's innumerable subsystems.

0

I don't think that feature has been currently implemented


___________
agile software development

0

Please sign in to leave a comment.