Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Valued Contributor II
16 Views

Meaning of colours in code coverage reports

Hello,

while studying the results of code coverage reports of some of our software, I came across code fragments like this:

    88)     summation = 0.0d0;
    89)     do i = 1, 10
    90)       summation = summation + __s(i) ** 2 / i
    91)     end do__

where the __ means the beginning/end of a light yellow background. I am wondering what is meant by this markup. Is it some implicit branch? I can imagine that with a plain allocate(..) statement, but is this meant to warn about the possibility of a division by zero?

 

0 Kudos
3 Replies
Highlighted
Black Belt Retired Employee
16 Views

The colors are discussed in the documentation, though, unhelpfully, they are given using hex constants.#FFFF99 is a pale yellow and this "Indicates the basic blocks that were not exercised by any of the tests. However, these blocks were within functions that were executed during the tests."

The code coverage tool doesn't warn you about possibilities - it just tells you which code was executed and which wasn't.

0 Kudos
Highlighted
Black Belt
16 Views

FWIW, I provide the -bcolor red option to the codecov tool when creating the html, because those are the blocks of code that I very much want to stand out when scanning the results, and pale yellow doesn't really do that for me.

The syntax highlighting ate your initial __, but it looks like it may have been before the second term of the summation.  I wonder if code has been generated to short circuit that loop in some circumstances.

0 Kudos
Highlighted
Valued Contributor II
16 Views

I should have pressed the small "?" icon - it clearly explains the meaning of the colours: this light-yellow colour is for partially covered code - "More than one basic block was generated for the code at this position. Some of the blocks were covered while some were not." So it is a warning of sorts ;).

Aside:

The (test) program that led me to this question uses a library of general interest to us and I did not see - I realised - the coverage for the relevant source files, only for the files making up the test program itself. But I solved that riddle: you can specify the "pgopti.spi" file for the library instead of the default file (in my case for the test program). I am just learning to use this tool.

0 Kudos