|
From: Nicholas N. <nj...@cs...> - 2006-08-05 08:51:51
|
On Fri, 4 Aug 2006, Bryan Meredith wrote: > please check my small web page for the details: > http://www.brainmurders.eclipse.co.uk/covergrind.html > >> From the web page: > ------------------ > Covergrind is a code coverage tool for the excellent Valgrind framework. > Rather than having to link against strange libraries or compile in > various support, Covergrind uses run time instrumentation in order to > work out which parts of your source code are traversed. There have been > comments made about how trivial it would be to use the Valgrind > framework to construct such a tool but I wasn't able to find one so here > is mine to share. > ------------------ You don't explain how to use it -- what does the output look like? If you run a program multiple times, are the coverage results merged? Also, does it give percentage coverage? Those latter two things are the tricky part of writing a coverage tool with Valgrind. I wrote one a while ago ("vcov") which I never fully tested and released properly. I attach the code in case you find it useful. vcov does the merging from multiple runs ok. It also does the percentage coverage calculation, but it's not perfect -- because you have to know how many lines of executable code each file has, and that's only available from the debug info, and I found that some versions of GCC produced debug info that was unreliable. Benoit Peccatte wrote a similar tool ("cover"), I'm not sure how advanced it is, you can get it here http://b.peccatte.free.fr/cover-0.03.tgz. Nick |