Code coverage tool for Visual Studio TDD Project

My code is produced via Test Driven Development. My tools are Visual Studio 2010 express, Google Test, C++98 and the latest version of boost. I write my own Mock and am not using Google Mock.

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


I'm using gcov.

My setup is fairly complicated now that I'm having to think about describing it:
I've used the MinGW distro by stl, available at nuwen.net for gcc (g++) and gcov. This gives me some degree of portability.
I build my test application using scons and a batch file to build and run it to check it passes.

Then I commit code to version control and a Jenkins CI server running on my own machine picks it up, and still using scons, compiles it, but this time using the --coverage flag. It runs the test app, which this time outputs the *.gc?? files. Then I run gcov once, but telling it where all the files are, which produces loads of *.gcov files. I have in the past used the python script gcovr.py , but I've since written my own to scan all the *.gcov files and print all the lines not covered.

I'm not sure of the open-source status of all those pieces, but I know they are free.


Have a look to Sonar with c++ Plugin. This tool not only helps you to look at code coverage but also other analysis for duplication and code quality, design quality etc.

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

链接地址: http://www.djcxy.com/p/66470.html

上一篇: Qt5使用QUrl / QNetworkRequest将数据发布到服务器

下一篇: Visual Studio TDD项目的代码覆盖工具