views:

87

answers:

3

I am using CuTest for unit testing and would like to get information about code coverage. Are there any code coverage tools available for C?

Thanks

+4  A: 

If you're using gcc, there is gcov. Compile your code with the -ftest-coverage -fprofile-arcs options, and without optomization. Then invoke gcov for each source source file. This will generate a .gcov file which contains the source code with the number of times each was executed.

philippe
Did you mean `gcov`? http://www.manpagez.com/man/1/gcov/
Nikolai N Fetissov
yes ... fortunately the week-end is coming. Fixed, thanks.
philippe
A: 

GCC provides coverage functionality.

Blank Xavier
A: 

Our Test Coverage tools handles not only C in general but a variety of C dialects including GCC2/3/4, MS C in its many dialects, etc., as well as a number of other languages.

For C, it is often important that the tool be able to operate in embedded contexts with extermely low overhead. These tools do.

Ira Baxter