author | Maciej Seroka <maciejs@symbian.org> |
Fri, 20 Nov 2009 09:46:23 +0000 | |
changeset 781 | 2e4219f93467 |
parent 766 | adc25ece36f0 |
child 798 | db3cbddc6f4a |
permissions | -rw-r--r-- |
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"}, |
766
adc25ece36f0
Added interpretation of recipe "win32def2lib" failing.
Simon Howkins <simonh@symbian.org>
parents:
753
diff
changeset
|
90 |
win32def2lib => {message => "Failed to build DLL entry point library $context->{target}", severity => "minor"}, |
753
5069de517698
New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
91 |
"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
|
92 |
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
|
93 |
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
|
94 |
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
|
95 |
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
|
96 |
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
|
97 |
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
|
98 |
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
|
99 |
); |
5069de517698
New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
100 |
# 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
|
101 |
|
5069de517698
New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
102 |
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
|
103 |
$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
|
104 |
|
5069de517698
New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
105 |
# 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
|
106 |
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
|
107 |
# 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
|
108 |
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
|
109 |
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
|
110 |
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
|
111 |
# 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
|
112 |
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
|
113 |
|
5069de517698
New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
114 |
# 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
|
115 |
my $failureItem = bless { |
5069de517698
New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
116 |
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
|
117 |
}, "failure"; |
5069de517698
New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
118 |
if ($context->{component}) |
5069de517698
New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
119 |
{ |
5069de517698
New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
120 |
$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
|
121 |
$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
|
122 |
} |
5069de517698
New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
123 |
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
|
124 |
@causes = map { " $_" } @causes; |
5069de517698
New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
125 |
if (@causes) |
5069de517698
New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
126 |
{ |
5069de517698
New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
127 |
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
|
128 |
my $causesItem = bless { |
5069de517698
New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
129 |
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
|
130 |
}, "causes"; |
5069de517698
New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
131 |
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
|
132 |
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
|
133 |
$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
|
134 |
} |
5069de517698
New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
135 |
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
|
136 |
} |
5069de517698
New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
137 |
|
5069de517698
New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
138 |
$context = undef; |
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 |
} |
5069de517698
New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
141 |
sub Text |
5069de517698
New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
142 |
{ |
5069de517698
New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
143 |
s/^\n*//; |
5069de517698
New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
144 |
if ($context) |
5069de517698
New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
145 |
{ |
5069de517698
New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
146 |
$context->{Chars} .= $_; |
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 |
|
5069de517698
New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
150 |
sub min |
5069de517698
New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
151 |
{ |
5069de517698
New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
152 |
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
|
153 |
} |
5069de517698
New script which parses raptor logs directly to produce a BRAG summary.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
154 |