c++unit-testingcode-coveragegoogletest

How to get code coverage for google-test unit tests


Is it possible to get code coverage done by tests using google test (GTest) framework?


Solution

  • Yes, I've successfully used both free (gcov) and commercial (CTC++) tools. No special steps are needed, just follow the documentation.

    More details can be found in this blog http://googletesting.blogspot.dk/2014/07/measuring-coverage-at-google.html