Code Coverage Tool for Visual Studio TDD Project

My code is generated through Test Driven Development. My tools are Visual Studio 2010 express, Google Test, C ++ 98 and the latest version of boost. I am writing my own Mock and do not use Google Mock.

What open source tools would you recommend to me so that I can establish code coverage?

+7
source share
2 answers

I am using gcov.

Now my setup is quite complicated, and I need to think about its description:
I used the MinGW distribution by stl, available at nuwen.net for gcc (g ++) and gcov. This gives me some degree of portability.
I am building a test application using scons and a batch file to build and run it to see if it passes.

Then I commit the code for version control, and the Jenkins CI server running on my own machine picks it up and still uses scons, compiles it, but this time uses the --coverage flag. It launches a test application that this time outputs * .gc ?? files. Then I run gcov once, but tell it where all the files that create the many * .gcov files are located. In the past, I used the python script gcovr.py , but since then I wrote my own to scan all * .gcov files and print all lines that were not covered.

I am not sure about the open-source status of all these pieces, but I know that they are free.

+2
source

Take a look at Sonar with the C ++ plugin. This tool will not only help you look at the coverage of the code, but also at another analysis for duplication and code quality, design quality, etc.

http://www.sonarsource.org/ and plugin

+2
source

All Articles