#At file:///home/horst/bzr/internals/ based on revid:jonathan.perkin@stripped
379 Horst.Hunger 2011-06-23
BUG#12632009: The script is now running with "new" directories containg the
gcov data files, e.g. "sql/CMakeFiles/sql.dir".
I also removed the perl code calling gcov. As now the gcov data files are the
full source name (e.g.item_inetfunc.cc) including the suffix with an appended
gcov suffix (e.g.item_inetfunc.cc.gcno) gcov is not more able to work with it.
Gcov expectes e.g. item_inetfunc.gcno.
I also have some daubts if the code makes sense in the script, at all.
modified:
dev/dgcov/dgcov.pl
=== modified file 'dev/dgcov/dgcov.pl'
--- a/dev/dgcov/dgcov.pl 2009-03-09 17:29:41 +0000
+++ b/dev/dgcov/dgcov.pl 2011-06-23 06:52:07 +0000
@@ -20,6 +20,9 @@
#
# ToDo: Avoid shell quoting issues by using open(F, "-|") and multi-arg exec()
# instead of open(F, ".... |").
+# 2011-06-20 HHunger BUG 12632009
+# Changed code to recognize the gcov data files in case of using cmake.
+# See line 196 ff.
use strict;
use warnings;
@@ -115,7 +118,7 @@ for my $cs (@revisions) {
print STDERR "Running: $cmd\n";
} else {
local $|= 1;
- print ".";
+ #print ".";
}
open PIPE, "$cmd |"
@@ -182,6 +185,7 @@ for my $file (sort keys %$filemap) {
next unless @$lines;
my $gcov_file= "$file.gcov";
+ # Seperate dir and filename.
my ($dir, $fname);
if($file =~ m|^(.*)/([^/]+)$|) {
($dir, $fname)= ($1, $2);
@@ -189,33 +193,19 @@ for my $file (sort keys %$filemap) {
($dir, $fname) = ('.', $file);
}
# Handle the case where the source file was compiled in the parent directory.
- my $stem= $fname;
- $stem =~ s/$file_regexp//;
- my $parent= $dir;
- $parent =~ s|/[^/]+$||;
- if(! (-e "$dir/$stem.gcno" || -e "$dir/$stem.bb" || -e "$dir/$stem.bbg") &&
- (-e "$parent/$stem.gcno" || -e "$parent/$stem.bb" || -e "$parent/$stem.bbg")) {
+ # BUG 12632009:
+ my $parent= "$dir/CMakeFiles/$dir.dir";
+ if(-e "$parent/$fname.gcno" || -e "$parent/$fname.bb" || -e "$parent/$fname.bbg") {
$dir= $parent;
$gcov_file= "$parent/$fname.gcov";
}
- $cmd= "cd '$dir' && gcov '$fname'";
- print STDERR "Running: $cmd\n"
- if $verbose;
- my $res= system "$cmd > /dev/null";
- if($res) {
- warn "Failed to spawn 'gcov $fname': $res: $!: $?\n".
- "The gcov report may be incomplete.\n";
- $missing_files++;
- next;
- }
-
# Remember previous N lines to be able to print context.
my @prev= ( );
# Print N more lines of context.
my $pending= 0;
- $res= open FH, '<', $gcov_file;
+ my $res= open FH, '<', $gcov_file;
if(!$res) {
warn "Failed to open gcov output file '$gcov_file'\n".
"The gcov report may be incomplete.\n";
Attachment: [text/bzr-bundle] bzr/horst.hunger@sun.com-20110623065207-08n0ntq1lgxd2gzi.bundle
| Thread |
|---|
| • bzr commit into internals branch (horst.hunger:379) Bug#12632009 | Horst.Hunger | 23 Jun |