On Monday 27 July 2009, He fei wrote: > Hi All, > My current project works on a unit testing with Valgrind. In order to better > test the code, a code coverage output with Valgrind is desired. > I've looked into Cachegrind and Callgrind and I believe callgrind is more > close to what I need. > > But after running callgrind, I was dissapointted as it doesn't provide a > general code percentile summary (like how many lines have been covered), but > rather how many instruction covered.
Because Cachegrind/Callgrind never touches code which was not executed, you can not calculate a percentile summary of covered code. There needs to be a detection phase of what source code lines exist even if no code was executed from them. This could then be combined with Callgrinds/Cachegrinds data to provide the summary you want. > I googled online and found no clue info regarding this. The most possible > approach will be http://www.brainmurders.eclipse.co.uk/covergrind.html, > which will require extra effort in compiling and add-on. In Covergrind, I only see the metric "LinesTouched". No idea if it provides "LinesNotTouched" which would be required. Josef > > I wonder if there's option or combined method within current Valgrind > framework that this can be done. > > Best regards, > ------------------------------------------------------------------------------ _______________________________________________ Valgrind-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/valgrind-users
