On a related note, I would like to exclude my test-only code from the coverage analysis. My test code is in the same package as my prod code, (but in a different source tree,) so filtering by package at the report generation stage won't work. Filtering by class name is very unwieldy, as we have a huge amount of test setup code and we couldn't effectively maintain the list of ignored classes. Additionally, we commonly generate stub classes from WSDL to test web services, however we only use a fraction of the code in the stub - meaning that the unused code falsely drives down our coverage score.
Ideally, what I would like to do is to specify, for a given invocation of javac, whether the classes should be instrumented or not - perhaps by setting an ant property. However, according to the TeamCity 5 docs, ALL invocations of javac are intercepted for instrumentation purposes.
Note: we use ant for scripting our builds and the TeamCity/Emma coverage analysis feature.
Message was edited by: Yegor Yarko
Branched from http://devnet.jetbrains.net/message/5273421