This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In perlhacktips, suggest a shell loop to generate all .gcov files.
authorNicholas Clark <nick@ccl4.org>
Thu, 20 Jun 2013 14:46:05 +0000 (16:46 +0200)
committerNicholas Clark <nick@ccl4.org>
Mon, 1 Jul 2013 09:14:48 +0000 (11:14 +0200)
pod/perlhacktips.pod

index 1051a25..7851db9 100644 (file)
@@ -1180,7 +1180,12 @@ source code files, like this
 
 which will cause F<sv.c.gcov> to be created. The F<.gcov> files contain
 the source code annotated with relative frequencies of execution
-indicated by "#" markers.
+indicated by "#" markers. If you want to generate F<.gcov> files for
+all profiled object files, you can run something like this:
+
+    for file in `find . -name \*.gcno`
+    do sh -c "cd `dirname $file` && gcov `basename $file .gcno`"
+    done
 
 Useful options of F<gcov> include C<-b> which will summarise the basic
 block, branch, and function call coverage, and C<-c> which instead of