I am using googletest to test my C project. Now, I added gcov to check the coverage of the unit tests. This all works fine.
When looking at the coverage of the Conditionals in my code, my coverage rate drops significantly. I analyzed the coverage results and found out, that all my assertions are marked as not covered in terms of conditionals, i.e. the assertion failures.
I figured, this might have to do with my death tests (ASSERT_DEATH()
). Since googletest spawns a new process for every death test, I assume that they are not "tracked" by gcov.
However, I would like to see in my coverage results, if my tests actually cover both conditions of my assertions. Is there a way, I can tell this to gcov or googletest?
I already tried setting googletest flags, such as --gtest_throw_on_failure
, but without success.