Regarding limitation in jacoco tool

33 views
Skip to first unread message

RK

unread,
Jan 25, 2024, 4:22:15 AMJan 25
to JaCoCo and EclEmma Users
I am new to jacoco and its group.  Not sure whether i can post this query here. Kindly let me know if any.

I found that there are some limitations in jacoco like  throw exception line will always be in red.

Sample code  : 

boolean value=true;
if(value){
 throw new IOException("exeception");  
}



Like this , is there any other limitations in jacoco? 

if there is any document or thread which discuss this kind of limitations , kindly share some info on this.

I have seen the FAQ but still i am not understand clearly . Going through the previous conversations. Help is much appreciated

Thanks in advance.

Marc Hoffmann

unread,
Jan 25, 2024, 5:19:21 AMJan 25
to JaCoCo and EclEmma Users
Hi,

explicitly thrown Exceptions like 
    
    throw new Exception();

should be marked as covered. We have an integration test for this.

Only lines with implicitly thown exception like

    methodThatThrowsAnException();

are not marked as covered due to a technical limitation. This is documented in the FAQ:

Source code lines with exceptions show no coverage. Why?

JaCoCo determines code execution with so called probes. Probes are inserted into the control flow at certain positions. Code is considered as executed when a subsequent probe has been executed. In case of exceptions such a sequence of instructions is aborted somewhere in the middle and the corresponding lines of source code are not marked as covered. 

Best regards,
-marc


 

--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/68313ee5-eb54-441e-80ee-184e7f786958n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages