common/tools/brag/brag.xsl
author Simon Howkins <simonh@symbian.org>
Wed, 30 Sep 2009 17:48:55 +0100 (2009-09-30)
changeset 547 19f9d5fc6406
child 557 c6145fb2403d
permissions -rw-r--r--
Added really basic failure extraction and BRAG calculation to build.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
547
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
     1
<xsl:stylesheet version="1.0"
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
     2
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
     3
	xmlns:fn="http://www.w3.org/2005/xpath-functions"
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
     4
	>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
     5
<xsl:template match="/">
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
     6
	<html>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
     7
	<link href="http://developer.symbian.org/css/reset.css" rel="stylesheet" type="text/css" />
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
     8
	<link href="http://developer.symbian.org/css/portal-merged.css" rel="stylesheet" type="text/css" />
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
     9
	<link href="http://developer.symbian.org/css/iefix.css" rel="stylesheet" type="text/css" />
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    10
	<head><title>Build Status</title></head>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    11
	<body>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    12
	<h2>Build Status</h2>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    13
	<table border="1">
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    14
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    15
	<xsl:for-each select="stage">
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    16
		<tr>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    17
		<th>Stage: <xsl:value-of select="@name"/></th>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    18
		</tr>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    19
		<xsl:for-each select="step">
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    20
			<tr>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    21
			<td>Step: <xsl:value-of select="@name"/></td>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    22
			</tr>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    23
			<xsl:for-each select="failures">
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    24
				<tr>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    25
				<td>Failures: <xsl:value-of select="@level"/></td>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    26
				<td>Number: <xsl:value-of select="count(failure)"/></td>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    27
				</tr>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    28
			</xsl:for-each>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    29
		</xsl:for-each>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    30
	</xsl:for-each>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    31
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    32
	</table>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    33
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    34
	<xsl:variable name="criticalCount" select="count(stage/step/failures[@level='critical']/failure)"/>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    35
	<xsl:variable name="majorCount" select="count(stage/step/failures[@level='major']/failure)"/>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    36
	<xsl:variable name="minorCount" select="count(stage/step/failures[@level='minor']/failure)"/>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    37
	<xsl:variable name="unknownCount" select="count(stage/step/failures[@level!='critical' and @level!='major' and @level!='minor']/failure)"/>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    38
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    39
	<p>Total number of critical errors = <xsl:value-of select="$criticalCount"/></p>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    40
	<p>Total number of major errors = <xsl:value-of select="$majorCount"/></p>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    41
	<p>Total number of minor errors = <xsl:value-of select="$minorCount"/></p>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    42
	<p>Total number of unknown errors = <xsl:value-of select="$unknownCount"/></p>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    43
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    44
	<h2>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    45
	Final BRAG staus: 
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    46
	<xsl:choose>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    47
		<xsl:when test="$criticalCount != 0">BLACK</xsl:when>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    48
		<xsl:when test="$majorCount != 0">RED</xsl:when>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    49
		<xsl:when test="$minorCount != 0">AMBER</xsl:when>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    50
		<xsl:when test="$unknownCount != 0">GREEN</xsl:when>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    51
		<xsl:otherwise>GOLD!</xsl:otherwise>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    52
	</xsl:choose>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    53
	</h2>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    54
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    55
	</body>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    56
	</html>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    57
</xsl:template>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    58
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    59
</xsl:stylesheet>
19f9d5fc6406 Added really basic failure extraction and BRAG calculation to build.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    60