From: Peter O. <obe...@us...> - 2010-07-28 14:18:09
|
Update of /cvsroot/ltp/utils/analysis/lcov/bin In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv12750 Modified Files: geninfo Log Message: geninfo: remove incorrect overall coverage rate calculation geninfo output showing the overall coverage rate of its current operation is incorrect since it may count lines, functions and branches for included files multiple times. Remove the output and associated code until a fixed version is available. Index: geninfo =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/geninfo,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** geninfo 19 Jul 2010 15:50:02 -0000 1.77 --- geninfo 28 Jul 2010 14:17:59 -0000 1.78 *************** *** 437,473 **** # Do something ! { ! my $total_ln_found = 0; ! my $total_ln_hit = 0; ! my $total_fn_found = 0; ! my $total_fn_hit = 0; ! my $total_br_found = 0; ! my $total_br_hit = 0; ! my $entry; ! ! foreach $entry (@data_directory) { ! my $ln_found; ! my $ln_hit; ! my $fn_found; ! my $fn_hit; ! my $br_found; ! my $br_hit; ! ! # Process files ! ($ln_found, $ln_hit, $fn_found, $fn_hit, $br_found, $br_hit) = ! gen_info($entry); ! # Add data ! $total_ln_found += $ln_found; ! $total_ln_hit += $ln_hit; ! $total_fn_found += $fn_found; ! $total_fn_hit += $fn_hit; ! $total_br_found += $br_found; ! $total_br_hit += $br_hit; ! } ! info("Finished .info-file creation\n"); ! print_overall_rate(1, $total_ln_found, $total_ln_hit, ! 1, $total_fn_found, $total_fn_hit, ! 1, $total_br_found, $total_br_hit); } exit(0); --- 437,444 ---- # Do something ! foreach my $entry (@data_directory) { ! gen_info($entry); } + info("Finished .info-file creation\n"); exit(0); *************** *** 588,597 **** my $file; my $prefix; - my $total_ln_found = 0; - my $total_ln_hit = 0; - my $total_fn_found = 0; - my $total_fn_hit = 0; - my $total_br_found = 0; - my $total_br_hit = 0; my $type; my $ext; --- 559,562 ---- *************** *** 625,653 **** # Process all files in list foreach $file (@file_list) { - my $ln_found; - my $ln_hit; - my $fn_found; - my $fn_hit; - my $br_found; - my $br_hit; - # Process file if ($initial) { ! ($ln_found, $ln_hit, $fn_found, $fn_hit, ! $br_found, $br_hit) = ! process_graphfile($file, $prefix); } else { ! ($ln_found, $ln_hit, $fn_found, $fn_hit, ! $br_found, $br_hit) = ! process_dafile($file, $prefix); } - - # Add data - $total_ln_found += $ln_found; - $total_ln_hit += $ln_hit; - $total_fn_found += $fn_found; - $total_fn_hit += $fn_hit; - $total_br_found += $br_found; - $total_br_hit += $br_hit; } --- 590,599 ---- # Process all files in list foreach $file (@file_list) { # Process file if ($initial) { ! process_graphfile($file, $prefix); } else { ! process_dafile($file, $prefix); } } *************** *** 656,662 **** "data\n"); } - - return ($total_ln_found, $total_ln_hit, $total_fn_found, $total_fn_hit, - $total_br_found, $total_br_hit); } --- 602,605 ---- *************** *** 784,797 **** my $lines_hit; # Number of instrumented lines hit my $lines_found; # Number of instrumented lines found - my $total_ln_found = 0; - my $total_ln_hit = 0; my $funcs_hit; # Number of instrumented functions hit my $funcs_found; # Number of instrumented functions found - my $total_fn_found = 0; - my $total_fn_hit = 0; my $br_hit; my $br_found; - my $total_br_found = 0; - my $total_br_hit = 0; my $source; # gcov source header information my $object; # gcov object header information --- 727,734 ---- *************** *** 1140,1147 **** } - # Add to totals - $total_fn_found += $funcs_found; - $total_fn_hit += $funcs_hit; - # Write coverage information for each instrumented branch: # --- 1077,1080 ---- *************** *** 1167,1174 **** } - # Add to totals - $total_br_found += $br_found; - $total_br_hit += $br_hit; - # Reset line counters $line_number = 0; --- 1100,1103 ---- *************** *** 1206,1213 **** print(INFO_HANDLE "end_of_record\n"); - # Add to totals - $total_ln_found += $lines_found; - $total_ln_hit += $lines_hit; - # Remove .gcov file after processing unlink($gcov_file); --- 1135,1138 ---- *************** *** 1231,1237 **** # Change back to initial directory chdir($cwd); - - return ($total_ln_found, $total_ln_hit, $total_fn_found, $total_fn_hit, - $total_br_found, $total_br_hit); } --- 1156,1159 ---- *************** *** 2091,2098 **** my $instr; my $filename; - my $ln_found = 0; - my $total_ln_found = 0; - my $fn_found = 0; - my $total_fn_found = 0; local *INFO_HANDLE; --- 2013,2016 ---- *************** *** 2196,2205 **** } # Print function summary ! $fn_found = scalar(@functions); ! print(INFO_HANDLE "FNF:$fn_found\n"); print(INFO_HANDLE "FNH:0\n"); - - # Add to totals - $total_fn_found += $fn_found; } # Print zero line coverage data --- 2114,2119 ---- } # Print function summary ! print(INFO_HANDLE "FNF:".scalar(@functions)."\n"); print(INFO_HANDLE "FNH:0\n"); } # Print zero line coverage data *************** *** 2208,2219 **** } # Print line summary ! $ln_found = scalar(@{$instr->{$filename}}); ! print(INFO_HANDLE "LF:$ln_found\n"); print(INFO_HANDLE "LH:0\n"); print(INFO_HANDLE "end_of_record\n"); - - # Add to totals - $total_ln_found += $ln_found; } if (!($output_filename && ($output_filename eq "-"))) --- 2122,2129 ---- } # Print line summary ! print(INFO_HANDLE "LF:".scalar(@{$instr->{$filename}})."\n"); print(INFO_HANDLE "LH:0\n"); print(INFO_HANDLE "end_of_record\n"); } if (!($output_filename && ($output_filename eq "-"))) *************** *** 2221,2226 **** close(INFO_HANDLE); } - - return ($ln_found, 0, $fn_found, 0, 0, 0); } --- 2131,2134 ---- |