common/tools/brag/sbsToBrag.pl
author Maciej Seroka <maciejs@symbian.org>
Fri, 13 Nov 2009 12:42:38 +0000
changeset 762 6c9f5cf48773
parent 753 5069de517698
child 766 adc25ece36f0
permissions -rw-r--r--
Disabled Dynamic BC tests
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
753
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
     1
#!perl -w
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
     2
#
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
     3
# Copyright (c) 2009 Symbian Foundation Ltd
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
     4
# This component and the accompanying materials are made available
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
     5
# under the terms of the License "Eclipse Public License v1.0"
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
     6
# which accompanies this distribution, and is available
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
     8
#
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
     9
# Initial Contributors:
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    10
# Symbian Foundation Ltd - initial contribution.
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    11
#
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    12
# Contributors:
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    13
#
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    14
# Description:
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    15
# Generate the BRAG-compatible XML summary of the Raptor log from the CSV output of the raptor parser
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    16
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    17
use strict;
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    18
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    19
use FindBin;
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    20
use lib "$FindBin::Bin";
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    21
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    22
use XML::Parser;
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    23
#use Getopt::Long;
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    24
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    25
use ToBrag;
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    26
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    27
my $raptorLogGlob = shift or die "First argument must be raptor XML log to read\n";
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    28
shift and die "Only one argument please\n";
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    29
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    30
@ARGV = glob $raptorLogGlob;
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    31
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    32
# Start to build structure to be output as XML (same format as XML::Parser would create for us)
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    33
my ($doc, $buildStatus) = ToBrag::createDocumentAndRoot("buildStatus");
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    34
# Obtain a phase object
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    35
my $buildPhase = ToBrag::ensureChild($buildStatus, "phase", "name", "Build");
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    36
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    37
# Parse the Raptor logs
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    38
# (Use XML::Parser in "Stream" mode so we don't have to hold all the data in memory at the same time)
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    39
my $xml = XML::Parser->new(Style => "Stream", Pkg => "main");
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    40
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    41
foreach my $log (@ARGV)
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    42
{
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    43
	$xml->parsefile($log);
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    44
}
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    45
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    46
print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    47
print "<?xml-stylesheet type='text/xsl' href='brag.xsl'?>\n";
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    48
ToBrag::printTree($doc->[0]);
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    49
print "\n";
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    50
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    51
exit (0);
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    52
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    53
my $context;
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    54
sub StartTag
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    55
{
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    56
	my $expat = shift;
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    57
	my $tagName = shift;
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    58
	my %attrib = %_;
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    59
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    60
	if ($tagName eq "recipe")
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    61
	{
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    62
		$context = {%attrib};
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    63
	}
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    64
	elsif ($tagName eq "status")
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    65
	{
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    66
		$context->{"exit"} = $attrib{"exit"};
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    67
	}
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    68
}
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    69
sub EndTag
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    70
{
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    71
	my $expat = shift;
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    72
	my $tagName = shift;
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    73
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    74
	if ($tagName eq "recipe")
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    75
	{
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    76
		die unless $context;
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    77
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    78
		if ($context->{"exit"} ne "ok")
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    79
		{
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    80
			# Create a more readable error message
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    81
			my %errorIdToDetail = (
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    82
				tem => {message => "Failed to execute '$context->{source}' invoked via $context->{bldinf}", severity => "major"},
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    83
				msvctoolscompile => {message => "Failed to compile $context->{source}", severity => "minor"},
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    84
				compile => {message => "Failed to compile $context->{source}", severity => "minor"},
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    85
				compile2object => {message => "Failed to compile $context->{source}", severity => "minor"},
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    86
				win32compile2object => {message => "Failed to compile $context->{source}", severity => "minor"},
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    87
				tools2lib => {message => "Failed to build library $context->{target}", severity => "minor"},
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    88
				ar => {message => "Failed to build library $context->{target}", severity => "minor"},
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    89
				win32archive => {message => "Failed to build library $context->{target}", severity => "minor"},
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    90
				"link" => {message => "Failed to create symbols for $context->{target}", severity => "minor"},
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    91
				postlink => {message => "Failed to link $context->{target}", severity => "minor"},
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    92
				win32stageonelink => {message => "Failed to link $context->{target} (stage 1)", severity => "minor"},
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    93
				win32stagetwolink => {message => "Failed to link $context->{target}", severity => "minor"},
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    94
				win32simplelink => {message => "Failed to link $context->{target}", severity => "minor"},
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    95
				win32processexports => {message => "Failed to export $context->{source} to $context->{target}", severity => "minor"},
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    96
				tracecompile => {message => "Trace compile failure for $context->{target}", severity => "unknown"},
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    97
				extension_makefile => {message => "Failed within an extension makefile connected to $context->{bldinf}", severity => "major"},
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    98
			);
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    99
#			die $context->{name} unless exists $errorIdToDetail{$context->{name}};
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   100
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   101
			my $message = $errorIdToDetail{$context->{name}}->{message} || "Unknown failure tag '$context->{name}' ($context->{source} -> $context->{target})";
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   102
			$context->{severity} = $errorIdToDetail{$context->{name}}->{severity} || "unknown";
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   103
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   104
			# Obtain a step object
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   105
			my $step = ToBrag::ensureStep($buildPhase, $context->{config});
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   106
			# Also create empty <failures> tags with severities in a sensible order
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   107
			ToBrag::ensureFailureSet($step, "critical");
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   108
			ToBrag::ensureFailureSet($step, "major");
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   109
			ToBrag::ensureFailureSet($step, "minor");
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   110
			# Obtain a failures object
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   111
			my $failureSet = ToBrag::ensureFailureSet($step, $context->{severity});
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   112
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   113
			# Now create the failure itself, and add it to this failure set
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   114
			my $failureItem = bless {
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   115
				Kids => [ bless { Kids => [ bless { Text => $message }, "Characters" ]}, "effect" ],
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   116
			}, "failure";
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   117
			if ($context->{component})
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   118
			{
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   119
				$context->{bldinf} =~ s{^\w:(/sf/.*?/.*?)/.*$}{$1};
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   120
				$failureItem->{package} = $context->{bldinf};
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   121
			}
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   122
			my @causes = grep { $_ && ! m/^\+ / } split("\n", $context->{Chars});
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   123
			@causes = map { "  $_" } @causes;
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   124
			if (@causes)
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   125
			{
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   126
				my @reportedCauses = @causes[0 .. min($#causes, 49)];
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   127
				my $causesItem = bless {
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   128
					Kids => [ bless { Text => join "\n", @reportedCauses }, "Characters" ]
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   129
				}, "causes";
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   130
				push @{$failureItem->{Kids}}, $causesItem;
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   131
				my $unreportedCauses = scalar @causes - scalar @reportedCauses;
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   132
				$failureItem->{unreported_causes} = $unreportedCauses;
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   133
			}
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   134
			push @{$failureSet->{Kids}}, $failureItem, $ToBrag::xmlNewline;
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   135
		}
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   136
		
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   137
		$context = undef;
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   138
	}
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   139
}
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   140
sub Text
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   141
{
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   142
	s/^\n*//;
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   143
	if ($context)
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   144
	{
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   145
		$context->{Chars} .= $_;
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   146
	}
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   147
}
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   148
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   149
sub min
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   150
{
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   151
	return ($_[0] < $_[1]) ? $_[0] : $_[1] ;
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   152
}
5069de517698 New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   153