On Thu, Oct 3, 2024 at 3:22 PM Marc Hoffmann <
hoff...@mountainminds.com> wrote:
> If you want to exclude classes from the report please configure the respective report generation tool accordingly.
Note the purpose of my project is to validate the code used in
theoretical CS research/experiments and thus for the experiments to be
valid the code needs to be trustworthy and 100% coverage is the
starting and not the ending point of this process.
Like I said the only report generating tools I have are what came with
jacoco... does this mean I have to generate CSV and finely comb it for
details when all I want is a report that says I get 100% coverage for
all non-excluded classes and methods when in fact I have 100%
coverage. Also if I understand right the above would mean that I
can't even get 100% coverage on a class that has an excluded method.
Also how do I exclude specific statements/brances such as the one this
comment relates to:
public Chunk consumeWhile(Class<?> klass)
{
SimpleChunkBuilder builder=new SimpleChunkBuilder();
// due the fact that all tape movements are managed
// by us it is impossible to contrive a trivial case
// where the false condition is covered in testing
// and the tape is completely encapsulated
// therefore Jacoco will always report a missed branch
while(pos<body.size()) {
Parseable p=peek();
if(!klass.isInstance(p))
break;
builder.add(consume());
}
return builder.toChunk();
}
Namely due to how the class is built the following will never be true
pos>=body.size() but we still need the guard condition because there
are always odd balls. So for example the coverage report for the
project says I have 100% statement coverage and 99% (1 branch missed
in 192 branches) and the offender being the above. Due to the
criticality of the app we have an iron clad rule tha all production
code needs 100% coverage of lines and branches unless there is a
comment explaining why that is not possible.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/jacoco/9C683BF3-9670-40CB-9C7C-57D037654883%40mountainminds.com.