I need to skip specific methods or code segments from the toolkit and code coverage. This led me to exclude methods from code coverage using Cobertura .
Then the cobertura ant page
http://cobertura.sourceforge.net/anttaskreference.html said ... You can tell Cobertura to ignore specific classes by switching to "ignore" regular expressions. The ignore pattern can be any valid perl 5 regular expression. This ignores any calls to any method that matches the ignore regular expression. He will not skip these classes during the toolkit. To exclude classes from tools, either exclude them from the set of files , or use the alternative method below and specify the excludeClasses template. ....
From source code net.sourceforge.cobertura.ant.InstrumentTask.java
for (int i = 0; i < ignoreBranchesRegexs.size(); i++) {
IgnoreBranches ignoreBranchesRegex = (IgnoreBranches)ignoreBranchesRegexs.get(i);
builder.addArg("--ignoreBranches", ignoreBranchesRegex.getRegex());
}
What does "--ignoreBranches" do? What is the model? I am going to try this. If you used the above option, share your "command line"
Jayan source
share