I'm having trouble getting a jacoco/junit ant target to exclude classes from coverage. I can get it to exclude packages though with something like this:
<jacoco:coverage destfile="${coverage.reports.dir.xml}/output.jacoco" excludes="foo.*:bar.fiz.*:my.long.package.name.*">
This doesn't exclude my test classes though because the test classes are in the same package as the classes they test. I've tired this to exclude the test classes with a regex, but it doesn't work.
<jacoco:coverage destfile="${coverage.reports.dir.xml}/output.jacoco" excludes="foo.*:bar.fiz.*:**/Test.*:**/Tests.*">
I also tried just including the classes I want in the report task, but since our test classes are in the same packages that doesn't work. Our build puts all the classes in the same directory, like buildRoot/classes/ProjectName. So buildRoot/classes/ProjectName/foo will contain the compiled classes for tests and non-test classes.
Any suggestions how how to get jacoco to exclude all tests in this setup?
thanks.