Branch coverage issue for SPDLOG in gcov
We are using spdlog in our code and generating coverage reports for our .cpp files. It appears that gcov is reporting some lines as partially covered:
Line 1: SPDLOG_INFO( "{} Config {}", std::string(20, '='), std::string(20, '=') ) shows branchesToCover="8" coveredBranches="4"
Line 2: SPDLOG_INFO( "Username: {}", username ) shows branchesToCover="4" coveredBranches="2"
We want to address these branch coverage issues without making significant changes to the codebase by using gcov exclude flags. Is there a way to configure gcov settings within spdlog to avoid these branch coverage issues?
Do you want coverage to be 100%? Some say that should not be the goal, but why would you want to do that?
I don't aim for 100% coverage. Since we're using the library, I want to ensure the coverage isn't negatively impacted by it.
I think PR is acceptable if it does not change the behavior of spdlog. Note that a PR that changes behavior for the motive of “for coverage” is unlikely to be acceptable.
FYI. due to the nature of the C++ language, coverage may not be high: c++ - constexpr constructor won't show coverage data - Stack Overflow