BullseyeCoverage Up Contents Search

Measurements Show 0% Coverage for Inline Functions

SYMPTOMS

BullseyeCoverage shows 0% function coverage for some or all inline (and template) functions, even though some or all of the inline functions were called. Measurements for non-inline functions are correct.

CAUSE

You built some of your source files with coverage build disabled or with some sources excluded. The compiler is not expanding some or all inline functions. They are compiled only once, when coverage build is disabled. Subsequently the compiler uses a function call to the previously compiled code, ignoring the code instrumented by BullseyeCoverage.

RESOLUTION

Rebuild with coverage build enabled and all inline functions instrumented. If you cannot instrument all inline functions, you may get better results by setting compiler optimizations to favor inline function expansion.

MORE INFORMATION

With Microsoft C++, BullseyeCoverage attempts to alleviate this problem by enabling inline function expansion.

With GCC compiler, BullseyeCoverage attempts to alleviate this problem by suppressing compiler options that disable inline function expansion.

WIth IAR C/C++, BullseyeCoverage attempts to alleviate this problem by suppressing the compiler option --no_inline.

Updated: 14 Jul 2020