views:

381

answers:

2

I use code coverage tool for writing unit testing cases. I have a code coverage tool but only have to do everything through its GUI interface. Ideally I'd like to get a tool that is able to produce a text output (.diff is the best) on individual .cpp files. Does such a tool exist?

+4  A: 

gcov can and does produce text output. Make sure you use a recent gcc to get coverage of shared libraries.

I'm not sure how you can have diff output of coverage though?

Douglas Leeder
If you combine gcov with lcov, you can create some excellent graphical views of the results in HTML.
Richard Corden
A: 

The C++ test coverage tool from Semantic Designs produces coverage data as a text file. You can process that data yourself (its a little arcane, but it is documented), or use the command-line version of the tool to produce a text-based coverage report (or an XML file with the same data). Yes, it also has a GUI for displaying the results, but you don't have to use it.

http://www.semanticdesigns.com/Products/TestCoverage/CppTestCoverage.html

Ira Baxter