8

Has anyone ever used gtest with visual studio? if so, how did you get code coverage reports? I'd like to configure my project to produce coverage data, but it seems like nobody else uses gtest/visual studio with gcov or any other code coverage.

Jose Villalta
  • 1,457
  • 1
  • 12
  • 20

1 Answers1

7

I asked around the office, and someone suggested this tool: https://github.com/OpenCppCoverage/OpenCppCoverage

I will give it a try. I will come back and report the results.

tinman
  • 6,348
  • 1
  • 30
  • 43
Jose Villalta
  • 1,457
  • 1
  • 12
  • 20
  • I ran this against code built with Visual Studio 2015, Enterprise and the results were nice. It's similar to the HTML output that `govr.py` generates but with some pretty pie graphs included. My unit tests were built with MS' profiling turned on so I did not verify the output works as advertised if you do no have that enabled. – dwj Jan 12 '16 at 17:35
  • @dwj, it also generates Cobertura reports, which apparently can be ingested by Microsoft VSTS and TFS. – Prof. Falken Apr 06 '18 at 13:40