views:

178

answers:

3

I would to know if there is a tool in C++ that gives you a report where it displays the following:

  1. The source code of the whole project. Usually one HTML page per source file.
  2. Beside the source code, there are line numbers, for readability purposes of course.
  3. And for each line, at the left of the line number, there is a value displayed for how many times that line is executed.

Of course, you need to execute a script that runs say unit tests and from there generate a report.

If you are familiar with code coverage tool Cobertura for Java and NCover for C# that's one of its important features.

+1  A: 

Have a look at that list of Code Coverage Tools for C and C++.

schnaader
+1  A: 

When you use gcc as you compiler you can generate gcov output. Use gcov to create an executable that generates profiling output and then use lcov to generate nice HTML output for your code.

lothar
A: 

See SD Profiler. It produces an output just as you like, but as a GUI rather than HTML.

Ira Baxter