Skip to content

Commit

Permalink
lcov
Browse files Browse the repository at this point in the history
- fixed a bug which would cause generation of incorrect line checksums
  when source code is not available while capturing coverage data
- changed default directory for temporary files from . to /tmp
  • Loading branch information
Peter Oberparleiter authored and oberpar committed Jun 10, 2014
1 parent 8ee3061 commit 5d10ca2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion bin/geninfo
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ sub process_dafile($)
# Need to rename empty data file to workaround
# gcov <= 3.2.x bug (Abort)
system_no_output(3, "mv", "$da_filename", "$da_filename.ori")
and die ("ERROR: cannot rename $da_filename");
and die ("ERROR: cannot rename $da_filename\n");
}

# Execute gcov command and suppress standard output
Expand Down Expand Up @@ -530,6 +530,15 @@ sub process_dafile($)
{
$source = solve_relative_path($object_dir, $source);
}

# gcov will happily create output even if there's no source code
# available - this interfers with checksum creation so we need
# to pull the emergency brake here.
if (! -r $source && ! $nochecksum)
{
die("ERROR: could not read source file $source\n");
}

@matches = match_filename(defined($source) ? $source :
$gcov_file, keys(%bb_content));

Expand Down
2 changes: 1 addition & 1 deletion bin/lcov
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ our $modprobe_tool = "/sbin/modprobe";
our $rmmod_tool = "/sbin/rmmod";

# Where to create temporary directories
our $tmp_dir = ".";
our $tmp_dir = "/tmp";

# How to prefix a temporary directory name
our $tmp_prefix = "tmpdir";
Expand Down

0 comments on commit 5d10ca2

Please sign in to comment.