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

Intel code coverage tool and preprocessing code setions

DataScientist
Valued Contributor I
291 Views

Does the Intel code coverage tool exclude the irrelevant preprocessing sections of a Fortran code from the final computation of the coverage percentage?

My feeling is that it apparently does not exclude the irrelevant sections from the current preprocessing compilation settings. If so, the coverage stats will falsely indicate a lack of coverage, while the code might be 100% covered for that particular preprocessing settings.

0 Kudos
1 Solution
Steve_Lionel
Black Belt Retired Employee
267 Views

I misunderstood your saying "preprocessing". Code coverage is based on generated code from the compilation phase. Preprocessing just modifies the source that the compiler sees. 

Information on excluding sections from coverage is here.

View solution in original post

3 Replies
Steve_Lionel
Black Belt Retired Employee
286 Views

The code coverage tool has no idea what is "irrelevant". But I would expect that entry and exit code would always be executed. There is the ability to exclude selected portions of your code from analysis.

DataScientist
Valued Contributor I
280 Views

Thanks Steve. My impression was that the tool would be able to infer the relevant parts of a file that requires preprocessing. and in my mind, that would be done by preprocessing the file first and then passing it to the code coverage tool for analysis. I am not sure if this is really being done by the Intel codecov.

Regarding your response, could provide some keyword hints on how to exclude certain parts of the code?

Steve_Lionel
Black Belt Retired Employee
268 Views

I misunderstood your saying "preprocessing". Code coverage is based on generated code from the compilation phase. Preprocessing just modifies the source that the compiler sees. 

Information on excluding sections from coverage is here.

Reply