Added package attribute (when failure is package specific).
authorSimon Howkins <simonh@symbian.org>
Thu, 01 Oct 2009 16:17:02 +0100
changeset 556 fa2414b24dc4
parent 555 499a0581085d
child 557 c6145fb2403d
Added package attribute (when failure is package specific). Created more tags up-front, so that if there are 0 critical failures, then it's recorded.
common/tools/brag/raptorToBRAG.pl
--- a/common/tools/brag/raptorToBRAG.pl	Thu Oct 01 14:54:20 2009 +0100
+++ b/common/tools/brag/raptorToBRAG.pl	Thu Oct 01 16:17:02 2009 +0100
@@ -63,6 +63,7 @@
 		next;
 	}
 	
+	# Populate the hash using a hash slice
 	my $failure = {};
 	@{$failure}{@keys} = @values;
 	
@@ -96,6 +97,12 @@
 		# First item found in this step - create step entry
 		$step = bless { name => $failure->{config}, Kids => [ $xmlNewline ] }, "step";
 		push @{$buildStage->{Kids}}, $step, $xmlNewline;
+		# Also create empty <failures> tags with severities in a sensible order
+		foreach my $severity (qw{critical major minor})
+		{
+			my $failureSet = bless { level => $severity, Kids => [ $xmlNewline ] }, "failures";
+			push @{$step->{Kids}}, $failureSet, $xmlNewline;
+		}
 	}
 	
 	# Look through the sets of failures in this step to see if we hve one which matches this severity
@@ -117,7 +124,15 @@
 	}
 
 	# Now create the failure itself, and add it to this failure set
-	my $failureItem = bless { href => "", Kids => [ bless { Text => $failure->{subcategory} }, "Characters" ] }, "failure";
+	my $failureItem = bless {
+#		href => "",
+		Kids => [ bless { Text => $failure->{subcategory} }, "Characters" ]
+	}, "failure";
+	if ($failure->{component})
+	{
+		$failure->{component} =~ s{^(/sf/.*?/.*?)/.*$}{$1};
+		$failureItem->{package} = $failure->{component};
+	}
 	push @{$failureSet->{Kids}}, $failureItem, $xmlNewline;
 }
 close(CSV);