I have a C++ library with a set of unit tests that exercise the functions and classes in the library. I'm attempting to use codecov to give some feedback on the percentage of the library that is covered with the test cases. However, it looks as though codecov does not give results for inline functions unless they are instantiated and the compiler generates code for them.
Is this correct? If so, is there a good work around short of generating test cases for all of the inline functions, which soft of defeats the purpose of using codecov to view coverage results as test cases are added and the library evolves.
Tried a simple test case (as below) and one other as well. Compiling code as below shows both main and myfoo executed even though the compiler inlines myfoo. So, inlining should not affect codecov results as it's computed independent of inlining. IF you're using a template function and an inline member is never instantiated then it never becomes part of the application and so there isn't a reason for it to appear in the coverage report as well. So, a test case is warranted to find out what's going on.
static int myfoo(int a, int b)
return a + b;
extern int main(void)
return myfoo(23, 56);
%icc –prof-gen=srcpos sm.c
Simon, can you please attach a small test reproducer to this post so we can investigate? Thanks