# HG changeset patch # User maciejs # Date 1271069743 -3600 # Node ID 74890d706f0c396f759ec1a73471a0c62e07d08b # Parent cf1d34408de3d0f33d58e3a623bc0ae4619054fd Added tools for filtering bc reports and updating known issues file diff -r cf1d34408de3 -r 74890d706f0c bc_tools/BBCResults.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bc_tools/BBCResults.xsl Mon Apr 12 11:55:43 2010 +0100 @@ -0,0 +1,2376 @@ + + + + + + + + + + 1 + 0 + + + + + api + nonode + + + api + nonode + + + + shortname + name + nonode + + + + + okRepBlock + repBlock + + + + + + + + + + + HDR + LIB + NON + + + + +Binary Compatibility Report :: + <xsl:choose> + <xsl:when test="$reporttype='HDR'">Headerfiles</xsl:when> + <xsl:otherwise>Libraries</xsl:otherwise> + </xsl:choose> + + + + + + + + +
+ + + + + + + + +
+ + + Report Information

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
type + + Headerfiles + Libraries + +
creation date + -- + at :. +
baseline version
current version
known issues list
known issue platform versions
-_
software version + + +
report format version
+ +

+ Command-Line Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ +

+ Compatibility Issues
+ +
+ + + + + +
Sort by + +
Issue Type +
+
+ display:none + Expand All +
+
+
+ + + + + + + There are no issues.
+
+ + + + +
+ + + There are no issues.
+
+ + + + +
+ +
+ + + + + + There are no issues.
+
+ + + + + + + + + + issGrp + + + dtl + + + +
toggleIWView('');return false; + + #+
+ + + + + + +
+ +
+
+
+ + + + + There are no issues.
+
+ + + + + + + + + + issGrp + + + dtl + + + +
toggleIWView('');return false; + + #+
+ + + + +
+ +
+
+
+
+ + + + + + + There are no issues.
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ BBC Break
+ FC Break
+ SC Break
+ Possible BBC Break
+ Possible FC Break
+ Possible SC Break
+ BC Informative
+ SC Informative
+
+
+ +
+ + + + There are no issues.
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ BBC Break
+ FC Break
+ SC Break
+ Possible BBC Break
+ Possible FC Break
+ Possible SC Break
+ BC Informative
+ SC Informative
+
+
+
+
+
+ +

+View OK Issues

+ + + + +
+ + + + +
+ + + + +
+ + + + + + + + + + + +
+ + + + +
+ + + + + : + + + + +
+
+ + + javascript:showFile( '', null ); + + baseline + + baseline + + . + + + + javascript:showFile( null, '' ); + + current + + + current + + . + + + + + + javascript:showDiff( '', '', '' ); + + diff + + + + diff + + + +
+ +
+ + + + + #a8d098 + #d0c8c0 + + + + +
+ + This header contains changes that cause incompatibility. It must be fixed. + This header contains changes that cannot be verified automatically; they must be investigated manually. + This header is known to be ok. + This issue is known to be ok. But the header contains other unrelated changes. + This header contains changes that may cause incompatibility. It must be analysed by an expert. + + + + +
+
+
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Problem descriptionCause + display:none + BC Severity + display:none + SC Severity
+
+
+
+
+ + + + + + + + #ffb880 + #ffffa0 + White + + + + + #ffb880 + #ffffa0 + White + + + + + + + + #ffb880 + #ffffa0 + White + + + + + + Not specified + + + + + + + + + + + + + + + + err + + + +
+ + tip + +
+ + + # + popUp(event,'') + popUp(event,'') + return false + Compilation Error + + +
+ + + + + + +
+ + + display:none + + + + display:none + + + +
+ + +
+ + + + + + +
+ + + + + + + + + + + +
+ + + + +
+ + + + + : + + + + +
+
+ + + javascript:showFile( '', null ); + + baseline + + + baseline + + . + + + + javascript:showFile( null, '' ); + + current + + + current + + . + + + + + + javascript:showDiff( '', '', '' ); + + diff + + + + diff + + + +
+ +
+ + + + + #a8d098 + #d0c8c0 + + + + +
+ + This header contains changes that cause incompatibility. It must be fixed. + This header contains changes that cannot be verified automatically; they must be investigated manually. + This header is known to be ok. + This issue is known to be ok. But the header contains other unrelated changes. + This header contains changes that may cause incompatibility. It must be analysed by an expert. + + + + +
+
+
+
+ +
+ +
+ + + + + + + + + + + + + + Not specified + + + + + + + + + + + + + + + + err + + + + + + + + + + + + + + + + + + +
Problem descriptionCauseBC SeveritySC Severity
+
+ + tip + +
+ + # + popUp(event,'') + popUp(event,'') + return false + Compilation Error + +
+
+
+
+
+ + + + + + + + + true + false + + +
+ + + + +
+ + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + : + + + + +
+
+ + + javascript:openPath( '' ); + + baseline + + baseline + . + + + + javascript:openPath( '' ); + + current + + + current + . + +
+ + + + + + + + + + + +
+ + base platform: + base platform: Unknown + + + + + current platform: + current platform: Unknown + +
+ + +
+ + + + + #a8d098 + #d0c8c0 + + + + +
+ + This library contains changes that cause incompatibility. It must be fixed. + This library contains changes that may cause incompatibility. It must be analysed by an expert. + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ChangePosDetailsHeader reference + display:none + BC Severity + display:none + SC Severity
+
+
+
+ +
+ + + + + + + + + + + #ffb880 + #ffffa0 + White + + + + + + + + #ffb880 + #ffffa0 + White + + + + + Informative + BBC Break + Informative + Possible BBC Break + + + + + #6611ff + Black + + + + + + + removed + - + Library is no longer available + + + moved + => + + + + deleted + + + + + inserted + + + + + modified + + was
+ now
+
+ + added + + + + + modified + - + + + + modified + - + + + + modified + - + + + + modified + - + + + + modified + - + + + + removed + - + + + + not available + - + + +
+ + + + + + + + + + + + display:none + + + display:none + + + + +
+
+ + + + + + true + false + + +
+ + + + + + +
+ + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + : + + + + +
+
+ + + javascript:openPath( '' ); + + baseline + + baseline + . + + + + javascript:openPath( '' ); + + current + + + current + . +
+ + + + + + + + + + + +
+ + base platform: + base platform: Unknown + + + + + current platform: + current platform: Unknown + +
+ + +
+ + + + + #a8d098 + #a8d098 + + + + +
+ This library is known to be ok. +
+
+ +
+ + + + + + + + + + + + + + + + + + + #ffffff + #ffffff + #ffb880 + #ffffff + #ffffa0 + + + + + Informative + Informative + BBC Break + Informative + Possible BBC Break + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ChangePosDetailsHeader referenceBC SeveritySC Severity
removed-Library is no longer availablemoved => deletedinsertedmodifiedwas
+ now
addedmodified-modified-modified-modified-modified-removed-not available-
+
+
+
+
+
diff -r cf1d34408de3 -r 74890d706f0c bc_tools/ha_filter.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bc_tools/ha_filter.pl Mon Apr 12 11:55:43 2010 +0100 @@ -0,0 +1,287 @@ +#!/usr/bin/perl + +# Copyright (c) 2009 Symbian Foundation Ltd +# This component and the accompanying materials are made available +# under the terms of the License "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Symbian Foundation Ltd - initial contribution. +# Maciej Seroka, maciejs@symbian.org +# +# Description: +# This is a tool for filtering static BC header reports. +# + +use strict; +use XML::Simple; +use File::Copy; +use Tie::File; +use Data::Dumper; + +my $report; +my $header_list; +my $destfile; +my $pkg_destfile; +my $del_ok_issues = 1; # This variable determines whether to delete OK issues first. +my $del_comp_issues = 0; # This variable determines whether to delete Compilation errors. +my $del_boost_issues = 1; # This variable determines whether to delete issues for Boost API headers. +my $tsv_file; +my $sub_reports = 0; # This variable determines whether to generate sub-reports per package. +my $n; +my $m; +my $p; +my $file_name; +my $delete_node; +my @lines; +my $line; +my @pkgs; +my $nopkg; +my $pkgs_num; +my $hdr_to_pkg; +my $package; +my $pkg_found; +my $add_pkg; +my $temp_report; +my $current_pkg; + +if ($ARGV[1]) { + $report = $ARGV[0]; + $header_list = $ARGV[1]; + $destfile = "filtered_" . $report; +} else { + die "Missing parameter(s). For example: ha_filter.pl headers_report.xml public_headers.txt"; +} + +if ($ARGV[2]) { + $tsv_file = $ARGV[2]; + $sub_reports = 1; +} + +# Parse the input XML into hashrefs. +print "Parsing " . $report . "... "; +my $current_report = XMLin("./$report", keeproot => 1, + forcearray => [ 'header', 'baselineversion', 'currentversion', 'timestamp', 'day', 'month', 'year', 'hour', 'minute', 'second', # + 'haversion', 'formatversion', 'cmdlineparms', 'parm', 'pname', 'pvalue', 'knownissuesversion', 'os', 'version', 'buildweek', 'issuelist',# + 'headerfile', 'filename', 'comparefilename', 'status', 'comment', 'issue', 'checksum', 'shortname', 'issueid', 'typeid', 'identityid', # + 'identitydescription', 'typestring', 'cause', 'documentation', 'ignoreinformation', 'linenumber', 'severity', 'scseverity'], keyattr => [] ); +print "complete \n"; + +# Get number of header files. +my $header_num = @{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}}; +print "Number of all header files with issues: $header_num \n"; + +# Delete known issues. +if ($del_ok_issues) { + $n = 0; + while ($n < $header_num) { + $file_name = $current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}->[$n]->{'shortname'}->[0]; + # Delete the node if known issue. + if ($current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}->[$n]->{'status'}->[0] eq "OK") { + print "Known issue: $file_name ...deleted\n"; + splice(@{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}},$n, 1); + $header_num--; + } else { +# print "Unknown issue: $file_name \n"; + $n++; + } + } + # Get number of header files again. + $header_num = @{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}}; + print "Number of remaining header files with issues: $header_num \n"; +} + +# Delete compilation issues. +# Assumption: Compilation issue is always the top issue (and probably the only one) +if ($del_comp_issues) { + $n = 0; + while ($n < $header_num) { + $file_name = $current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}->[$n]->{'shortname'}->[0]; + if (($current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}->[$n]->{'issue'}->[0]->{'typestring'}->[0] eq "has compilation errors") && # + ($current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}->[$n]->{'status'}->[0] ne "OK")) { # Delete the node if compilation error. + print "$file_name has compilation errors \n"; + splice(@{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}},$n, 1); + $header_num--; + } else { + $n++; + } + } + # Get number of header files again + $header_num = @{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}}; + print "Number of header files with non-compilation issues: $header_num \n"; +} + +# Delete Boost API related issues (Boost API headers are not present in any of the Public SDK!). +if ($del_boost_issues) { + $n = 0; + while ($n < $header_num) { + $file_name = $current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}->[$n]->{'shortname'}->[0]; + # Delete the node if Boost API header. + if ($file_name =~ m/\\boost/) { + print "Boost API: $file_name \n"; + splice(@{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}},$n, 1); + $header_num--; + } else { + $n++; + } + } + # Get number of header files again. + $header_num = @{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}}; + print "Number of non-Boost API header files: $header_num \n"; +} + +# Delete non-public API issues. +$n = 0; +while ($n < $header_num) { + $file_name = $current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}->[$n]->{'shortname'}->[0]; + $delete_node = 1; + # Load Public API definitions. + open FILE, "<$header_list" or print "Failed to read $header_list: $!\n" and return; + while ($line = ) { # Check against header list. + chomp $line; + if (lc($file_name) eq lc($line)) { # Mark the node to NOT be deleted. + $delete_node = 0; + last; + } + } + # Close Public API definition file. + close FILE; + # Delete the node if non-public issue. + if ($delete_node) { + print "Header file: $file_name not found in Public API definition file... deleted\n"; + splice(@{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}},$n, 1); + $header_num--; + } else { + $n++; + } +} + +# Get number of header files again. +$header_num = @{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}}; +print "Final number of header files with issues: $header_num \n"; + +# Write new XML to dest file. +open OUT,">$destfile" or die("Cannot open file \"$destfile\" for writing. $!\n"); +print OUT XMLout($current_report, keeproot => 1); +close OUT; + +# Insert: +# +tie @lines, 'Tie::File', $destfile or die ("Cannot tie file \"$destfile\". $!\n"); +unshift @lines, ""; +unshift @lines, ""; +untie @lines; + +if ($sub_reports) { # Generate sub-reports per package. + # Create the list of packages that link to remaining header files and generate sub-report for Removed header files. + $nopkg = 0; + $n = 0; + while ($n < $header_num) { + $file_name = $current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}->[$n]->{'shortname'}->[0]; + $pkg_found = 0; + open FILE, "<$tsv_file" or print "Failed to read $tsv_file: $!\n" and return; + while ($line = ) + { + chomp $line; + ($hdr_to_pkg,$package) = split /\t/,$line; + $hdr_to_pkg =~ s/\//\\/g; + $hdr_to_pkg =~ s/\\epoc32\\include\\//; + if (lc($file_name) eq lc($hdr_to_pkg)) { + print "Package found: $package for header file: $file_name \n"; + $pkg_found = 1; + $pkgs_num = @pkgs; + if ($pkgs_num == 0) { # Add the first package name by default. + push @pkgs, $package; + } else { + $add_pkg = 1; + $p = 0; + while ($p < $pkgs_num) { + if ($package eq @pkgs[$p]) { # Do not add a new package name. + $add_pkg = 0; + } + $p++; + } + if ($add_pkg) { # Add the new package name. + push @pkgs, $package; + } + } + last; + } + } + close FILE; + if ($pkg_found == 0) { + print "Package not found for header file: $file_name \n"; + $nopkg++; + $n++; + } else { # Delete the node. + splice(@{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}},$n, 1); + $header_num--; + } + } + print "Number of removed header files: " . $nopkg . "\n"; + if ($nopkg > 0) { # Save sub-report for removed header files. + # Write new XML to dest file. + $pkg_destfile = "removed_" . $report; + open OUT,">$pkg_destfile" or die("Cannot open file \"$pkg_destfile\" for writing. $!\n"); + print OUT XMLout($current_report, keeproot => 1); + close OUT; + # Insert: + # + tie @lines, 'Tie::File', $pkg_destfile or die ("Cannot tie file \"$pkg_destfile\". $!\n"); + unshift @lines, ""; + unshift @lines, ""; + untie @lines; + } + print "Number of packages: " . @pkgs . "\n"; + # Generate sub reports for all packages. + foreach $current_pkg (@pkgs) { + # Parse the stripped input XML into hashrefs. + print "Parsing " . $destfile . "... "; + $temp_report = XMLin("./$destfile", keeproot => 1, + forcearray => [ 'header', 'baselineversion', 'currentversion', 'timestamp', 'day', 'month', 'year', 'hour', 'minute', 'second', # + 'haversion', 'formatversion', 'cmdlineparms', 'parm', 'pname', 'pvalue', 'knownissuesversion', 'os', 'version', 'buildweek', 'issuelist',# + 'headerfile', 'filename', 'comparefilename', 'status', 'comment', 'issue', 'checksum', 'shortname', 'issueid', 'typeid', 'identityid', # + 'identitydescription', 'typestring', 'cause', 'documentation', 'ignoreinformation', 'linenumber', 'severity', 'scseverity'], keyattr => [] ); + print "complete \n"; + $n = 0; + $header_num = @{$temp_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}}; + print "Processing header files for $current_pkg... \n"; + while ($n < $header_num) { + $file_name = $temp_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}->[$n]->{'shortname'}->[0]; + $pkg_found = 0; + open FILE, "<$tsv_file" or print "Failed to read $tsv_file: $!\n" and return; + while ($line = ) + { + chomp $line; + ($hdr_to_pkg,$package) = split /\t/,$line; + $hdr_to_pkg =~ s/\//\\/g; + $hdr_to_pkg =~ s/\\epoc32\\include\\//; + if ((lc($file_name) eq lc($hdr_to_pkg)) && ($current_pkg eq $package)) { + $pkg_found = 1; + print "$file_name added to $package \n"; + } + } + close FILE; + if ($pkg_found == 0) { + splice(@{$temp_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}},$n, 1); + $header_num--; + } else { + $n++ + } + } + $header_num = @{$temp_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}}; + print "Number of header files for $current_pkg: $header_num \n"; + # Write new XML to dest file. + $pkg_destfile = $current_pkg . "_" . $report; + open OUT,">$pkg_destfile" or die("Cannot open file \"$pkg_destfile\" for writing. $!\n"); + print OUT XMLout($temp_report, keeproot => 1); + close OUT; + # Insert: + # + tie @lines, 'Tie::File', $pkg_destfile or die ("Cannot tie file \"$pkg_destfile\". $!\n"); + unshift @lines, ""; + unshift @lines, ""; + untie @lines; + } +} diff -r cf1d34408de3 -r 74890d706f0c bc_tools/la_filter.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bc_tools/la_filter.pl Mon Apr 12 11:55:43 2010 +0100 @@ -0,0 +1,258 @@ +#!/usr/bin/perl + +# Copyright (c) 2009 Symbian Foundation Ltd +# This component and the accompanying materials are made available +# under the terms of the License "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Symbian Foundation Ltd - initial contribution. +# Maciej Seroka, maciejs@symbian.org +# +# Description: +# This is a tool for filtering static BC libraries reports. + +use strict; +use XML::Simple; +use File::Copy; +use Tie::File; +use Data::Dumper; + +my $report; +my $xref_file; +my $destfile; +my $missing_destfile; +my @lines; +my $line; +my $n; +my $m; +my $counter; +my $short_name; +my $del_ok_issues = 1; # This variable determines whether to delete OK issues first. +my $gen_missing_report = 1; # This variable determines whether to produce report for missing libraries. +my $issues_num; +my $issue_name; +my $xref_name; +my $xref_type; +my $xref_line; +my $xref_hdr; +my $xref_def; +my $delete_node; +my @non_public_list; +my $current_item; +my $check_against_xref; +my $temp_lib_num; +my $temp_counter; + +if ($ARGV[1]) { + $report = $ARGV[0]; + $xref_file = $ARGV[1]; + $destfile = "filtered_" . $report; + $missing_destfile = "missing_" . $report; +} else { + die "Missing parameter(s). For example: la_filter.pl libraries_report.xml my_xref_file.txt"; +} + +# Parse the input XMLs into hashrefs. +print "Parsing " . $report . "... "; +my $current_report = XMLin("./$report", keeproot => 1, + forcearray => [ 'header', 'baselineversion', 'currentversion', 'timestamp', 'day', 'month', 'year', 'hour', 'minute', 'second', # + 'laversion', 'formatversion', 'cmdlineparms', 'parm', 'pname', 'pvalue', 'knownissuesversion', 'os', 'version', 'buildweek', 'issuelist',# + 'library', 'name', 'comparefilename', 'shortname', 'baseplatform', 'currentplatform', 'issue', 'typeinfo', 'typeid', 'funcname', 'newfuncname', 'newfuncpos', # + 'bc_severity', 'sc_severity', 'status', 'funcpos' ], keyattr => [] ); +print "complete \n"; + +# Get number of libraries. +my $lib_num = @{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'library'}}; +print "Number of all libraries with issues: $lib_num \n"; + +# Delete known issues. +if ($del_ok_issues) { + $n = 0; + while ($n < $lib_num) { + $issues_num = @{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'library'}->[$n]->{'issue'}}; + $m = 0; + while ($m < $issues_num) { + if ($current_report->{'bbcresults'}->{'issuelist'}->[0]->{'library'}->[$n]->{'issue'}->[$m]->{'status'}->[0]) { # I.e. if any status set (OK / _OK_). + splice(@{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'library'}->[$n]->{'issue'}},$m, 1); + $issues_num--; + print "Known issue in: $current_report->{'bbcresults'}->{'issuelist'}->[0]->{'library'}->[$n]->{'shortname'}->[0] ...deleted\n"; + } else { + $m++; + } + } + if ($issues_num == 0) { # If all issues deleted - remove the whole entry. + splice(@{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'library'}},$n, 1); + $lib_num--; + } else { + $n++; + } + } + # Get number of libraries again. + $lib_num = @{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'library'}}; + print "Number of remaining libraries with issues: $lib_num \n"; +} + +# Delete non-public API issues. +$n = 0; +$counter = 1; +$temp_counter = 0; +$temp_lib_num = $lib_num; +# Temporary variables - namespace fix. +my $count; +my $temp_issue; +while ($n < $lib_num) { + print "Processing library: $current_report->{'bbcresults'}->{'issuelist'}->[0]->{'library'}->[$n]->{'shortname'}->[0] ( $counter out of $temp_lib_num )\n"; + $issues_num = @{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'library'}->[$n]->{'issue'}}; + $m = 0; + while ($m < $issues_num) { + $delete_node = 1; + $issue_name = ""; + # Get issue name based on funcname or newfuncname (If both available get newfuncname). + if ($current_report->{'bbcresults'}->{'issuelist'}->[0]->{'library'}->[$n]->{'issue'}->[$m]->{'newfuncname'}->[0]) { + $issue_name = $current_report->{'bbcresults'}->{'issuelist'}->[0]->{'library'}->[$n]->{'issue'}->[$m]->{'newfuncname'}->[0]; +# print "newfuncname - $issue_name \n"; + } elsif ($current_report->{'bbcresults'}->{'issuelist'}->[0]->{'library'}->[$n]->{'issue'}->[$m]->{'funcname'}->[0]) { + $issue_name = $current_report->{'bbcresults'}->{'issuelist'}->[0]->{'library'}->[$n]->{'issue'}->[$m]->{'funcname'}->[0]; +# print "funcname - $issue_name \n"; + } + if ($issue_name) { + # Leave only Class name - modified to fix namespace issue. +# $issue_name =~ s/::.*//; + # Find '(' and delete all characters following it. + $issue_name =~ s/\(.*//; + # Count the number of '::'. + $count = () = $issue_name =~ /::/g; + if ($count > 1) { # Means the following format: xx::yy::zz/ + # Get the 2nd part (yy). + ($temp_issue, $issue_name) = split /:+/,$issue_name; + } else { # Means the following format: xx::yy + # For 'non-virtual thunk to ' (always refering to a method) - 1st part should be left in. + $issue_name =~ s/^non-virtual.* //; # Results in no more spaces left in the string. + # For vtable/typeinfo issues like: typeinfo for CommsFW::TCFDeregisterHookSignal get rid of the 1st part. + $issue_name =~ s/^.* .*:://; + # Leave only the 1st part (xx) for other issues. + $issue_name =~ s/::.*//; + } + # Find '<' and delete all characters following it, e.g. TMeta) + { + chomp $line; + ($xref_name, $xref_type, $xref_line, $xref_hdr, $xref_def) = split /\s+/,$line; + if (lc($issue_name) eq lc($xref_name)) { # Mark the node to NOT be deleted. + # Insert reference to header file. + $current_report->{'bbcresults'}->{'issuelist'}->[0]->{'library'}->[$n]->{'issue'}->[$m]->{'refheaderfile'}->[0] = $xref_hdr; + $delete_node = 0; + print "Found issue: $issue_name in public header file: $xref_hdr\n"; + last; + } + } + # Close xref file. + close FILE; + } + } else { # No newfuncname/funcname available (e.g. typeinfo only for missing DLLs or typeid only for not shown ones). +# print "Unclassified issue in $current_report->{'bbcresults'}->{'issuelist'}->[0]->{'library'}->[$n]->{'shortname'}->[0] \n"; + } + if ($delete_node) { # Delete the issue (Not public API-related). + splice(@{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'library'}->[$n]->{'issue'}},$m, 1); + $issues_num--; + if (($issue_name) && ($check_against_xref)) { # Looked for not found in the xref file - add the issue to the internal non-public API list. + push @non_public_list, $issue_name; + } + $temp_counter++; # To count how many issues deleted. + } else { + $m++; + } + } + if ($issues_num == 0) { # If all issues deleted - remove the whole entry. + splice(@{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'library'}},$n, 1); + $lib_num--; + } else { + $n++; + } + $counter++; +} +print "$temp_counter issue(s) has been deleted \n"; +# Get number of libraries again. +$lib_num = @{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'library'}}; +print "Final number of libraries with public API-related issues: $lib_num \n"; + +# Write new XML to dest file. +open OUT,">$destfile" or die("Cannot open file \"$destfile\" for writing. $!\n"); +print OUT XMLout($current_report, keeproot => 1); +close OUT; + +# Insert: +# +tie @lines, 'Tie::File', $destfile or die ("Cannot tie file \"$destfile\". $!\n"); +unshift @lines, ""; +unshift @lines, ""; +untie @lines; + +# Produce report for missing libraries. +if ($gen_missing_report) { + # Parse the input XMLs into hashrefs again. + print "Parsing " . $report . "... "; + my $current_report = XMLin("./$report", keeproot => 1, + forcearray => [ 'header', 'baselineversion', 'currentversion', 'timestamp', 'day', 'month', 'year', 'hour', 'minute', 'second', # + 'laversion', 'formatversion', 'cmdlineparms', 'parm', 'pname', 'pvalue', 'knownissuesversion', 'os', 'version', 'buildweek', 'issuelist',# + 'library', 'name', 'comparefilename', 'shortname', 'baseplatform', 'currentplatform', 'issue', 'typeinfo', 'typeid', 'funcname', 'newfuncname', 'newfuncpos', # + 'bc_severity', 'sc_severity', 'status', 'funcpos' ], keyattr => [] ); + print "complete \n"; + print "Generating report for missing libraries... "; + # Get number of libraries. + $lib_num = @{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'library'}}; + $n = 0; + while ($n < $lib_num) { + $issues_num = @{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'library'}->[$n]->{'issue'}}; + $m = 0; + $delete_node = 1; + while ($m < $issues_num) { + if (($current_report->{'bbcresults'}->{'issuelist'}->[0]->{'library'}->[$n]->{'issue'}->[$m]->{'typeid'}->[0] eq "13") && # + ($current_report->{'bbcresults'}->{'issuelist'}->[0]->{'library'}->[$n]->{'issue'}->[$m]->{'status'}->[0] ne "OK")) { + # If typeid=13 (DLL is missing in current SDK) and unknown issue - keep the node. + $delete_node = 0; + last; + } + $m++; + } + if ($delete_node) { # Remove the whole node (i.e. library). + splice(@{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'library'}},$n, 1); + $lib_num--; + } else { + $n++; + } + } + print "complete\n"; + # Get number of libraries again. + $lib_num = @{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'library'}}; + print "Number of missing libraries: $lib_num \n"; + + # Write new XML to dest file. + open OUT,">$missing_destfile" or die("Cannot open file \"$missing_destfile\" for writing. $!\n"); + print OUT XMLout($current_report, keeproot => 1); + close OUT; + + # Insert: + # + tie @lines, 'Tie::File', $missing_destfile or die ("Cannot tie file \"$missing_destfile\". $!\n"); + unshift @lines, ""; + unshift @lines, ""; + untie @lines; +} \ No newline at end of file diff -r cf1d34408de3 -r 74890d706f0c bc_tools/update_knownissues.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bc_tools/update_knownissues.pl Mon Apr 12 11:55:43 2010 +0100 @@ -0,0 +1,169 @@ +#!/usr/bin/perl + +# Copyright (c) 2009 Symbian Foundation Ltd +# This component and the accompanying materials are made available +# under the terms of the License "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Symbian Foundation Ltd - initial contribution. +# Maciej Seroka, maciejs@symbian.org +# +# Description: +# This is a tool for adding BC issues to Known Issues list. +# + +use strict; +use Getopt::Long; +use XML::Simple; +use Tie::File; + +my $hdr_report; +my $lib_report; +my $ki_file; +my $current_report; +my $header_num; +my $n; +my $m; +my $file_name; +my $check_sum; +my $comment = "Issue closed as invalid by the PkO (Not a BC break)."; # This is a default comment that will be added to Known Issues list with each header file. +my $header_found; +my $status; +my $line; +my @lines; +my $help; + +sub usage($); +sub help(); +sub usage_error(); + +my %optmap = ( 'headers-report' => \$hdr_report, + 'libraries-report' => \$lib_report, + 'knownissues-file' => \$ki_file, + 'help' => \$help); + +GetOptions(\%optmap, + 'headers-report=s', + 'libraries-report=s', + 'knownissues-file=s', + 'help!') + or usage_error(); + +if ($help) { + help(); +} + +# --headers-report is mandatory. +usage_error(), unless (defined($hdr_report) || defined($lib_report)); + +# --knownissues-file is mandatory. +usage_error(), unless (defined($ki_file)); + +# Open Known Isses file. +tie @lines, 'Tie::File', $ki_file or die ("Cannot tie file \"$ki_file\". $!\n"); + +if ($hdr_report) { + # Parse the input XML into hashrefs. + print "Parsing " . $hdr_report . "... "; + $current_report = XMLin("./$hdr_report", keeproot => 1, + forcearray => [ 'header', 'baselineversion', 'currentversion', 'timestamp', 'day', 'month', 'year', 'hour', 'minute', 'second', # + 'haversion', 'formatversion', 'cmdlineparms', 'parm', 'pname', 'pvalue', 'knownissuesversion', 'os', 'version', 'buildweek', 'issuelist',# + 'headerfile', 'filename', 'comparefilename', 'status', 'comment', 'issue', 'checksum', 'shortname', 'issueid', 'typeid', 'identityid', # + 'identitydescription', 'typestring', 'cause', 'documentation', 'ignoreinformation', 'linenumber', 'severity', 'scseverity'], keyattr => [] ); + print "complete \n"; + # Get number of header files. + my $header_num = @{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}}; + print "Number of header files in the report: $header_num \n"; + + $n = 0; + while ($n < $header_num) { + $file_name = $current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}->[$n]->{'shortname'}->[0]; + $check_sum = $current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}->[$n]->{'checksum'}->[0]; + $m = 0; + $header_found = 0; + $status = 0; + foreach (@lines) { + if (@lines[$m] =~ "\"$file_name\"") { # Mark header file as present in the Known Issues file. + $header_found = 1; + $line = $m; + last; + } + $m++; + } + if ($header_found) { # Ensure there is no duplicate in the Known Issues file. + $m = 0; + foreach (@lines) { + if (@lines[$m] =~ "checksum=\"$check_sum\"") { + $status = 1; # Means OK issue (already known). + print "Duplicate found ($check_sum) for header file: $file_name\n"; + last; + } + $m++; + } + } + if (($header_found) && (!($status))) { # Insert new version of header file. + splice @lines, $line+1, 0, " "; + splice @lines, $line+2, 0, " OK<\/status>"; + splice @lines, $line+3, 0, " $comment<\/comment>"; + splice @lines, $line+4, 0, " <\/version>"; + print "New version ($check_sum) of header file: $file_name added to Known Issues list\n"; + } + if (!($header_found)) { # Insert new header file. + # Find the first occurrence of . - ASSUMPTION: at least one entry exists. + $m = 0; + foreach (@lines) { + if (@lines[$m] =~ ""; + splice @lines, $m+1, 0, " "; + splice @lines, $m+2, 0, " OK<\/status>"; + splice @lines, $m+3, 0, " $comment<\/comment>"; + splice @lines, $m+4, 0, " <\/version>"; + splice @lines, $m+5, 0, " <\/headerfile>"; + print "Header file: $file_name ($check_sum) added to Known Issues list\n"; + } + $n++; + } + print "OK\n"; +} + +if ($lib_report) { + print "Warning: Automatic update of the Known Issues file based on a libraries report is not available in the current version of the script.\n" +} + +untie @lines; + +exit 0; + +sub usage($) +{ + my $error = shift; + my $fh = $error == 0 ? *STDOUT : *STDERR; + print $fh "update_knownissues.pl\n" . + "Specify the headers report or\/and libraries report and the known issues file\n" . + "synopsis:\n" . + " update_knownissues.pl --help\n" . + " update_knownissues.pl [--headers-report=FILENAME1] [--libraries-report=FILENAME2] [--knownissues-file=FILENAME3] \n" . + "options:\n" . + " --help Display this help and exit\n" . + " --headers-report=FILENAME1 FILENAME1 is the name of the filtered headers (sub-)report.\n" . + " --libraries-report=FILENAME2 FILENAME2 is the name of the filtered libraries report. This option is not implemented yet.\n" . + " --knownissues-file=FILENAME3 FILENAME3 is the name of the known issues file which will be updated.\n"; + exit $error; +} + +sub help() +{ + usage(0); +} + +sub usage_error() +{ + usage(1); +}