Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Meaning of colours in code coverage reports

Arjen_Markus
Honored Contributor I
339 Views

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
Steve_Lionel
Honored Contributor III
339 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
IanH
Honored Contributor II
339 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
Arjen_Markus
Honored Contributor I
339 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
Reply