3 # $Id: gcov_resultcompare.pl,v 1.2 2004-03-19 14:46:51 obo Exp $
8 # Helper, to compare two different results
18 our $version_info = 'gcov_resultcompare $Revision: 1.2 $ ';
20 our $help; # Help option flag
21 our $version; # Version option flag
29 sub read_gcov_function_file
($);
31 # Parse command line options
36 "version" => \
$version
43 # Check for help option
50 # Check for version option
53 print("$version_info\n");
57 # check if enough parameters
60 # print("No input filenames specified\n");
61 # print_usage(*STDERR);
76 # ------------------------------------------------------------------------------
78 my %origlist = read_gcov_function_file
($orig);
79 my %cmplist = read_gcov_function_file
($compare);
84 while (($key, $value) = each %origlist)
86 my $cmpvalue = $cmplist{$key};
88 if ($cmpvalue != 0.00)
92 if ($cmpvalue > $value && $value < 90.0)
94 print "$key, $value, CMP:$cmpvalue\n";
100 # --------------------------------------------------------------------------------
101 # Read the gcov function (gcov -f) file
102 # and compare line by line with the export function list
103 # so we get a list of functions, which are only exported, and not all stuff.
105 sub read_gcov_function_file
($)
112 open(INPUT_HANDLE
, $file)
113 or die("ERROR: cannot open $file!\n");
115 while ($line = <INPUT_HANDLE
>)
118 # sample line (for reg exp:)
119 # 100.00 rtl_ustr_toDouble
120 if ($line =~ /^(.{6}) (\w+)$/ )
125 $list{$value} = $percent;
132 # ----------------------------------------------------------------------------
135 local *HANDLE
= $_[0];
136 my $tool_name = basename
($0);
138 print(HANDLE
<<END_OF_USAGE);
140 Usage: $tool_name [OPTIONS] INPUTFILE
142 -o Original File, which gives the main values
143 if here a value is smaller than in compare, the found value is a candidate for better check.
146 -h, --help Print this help, then exit
147 -v, --version Print version number, then exit