BBR 1 Ebene

Committer:
borlanic
Date:
Mon May 14 11:29:06 2018 +0000
Revision:
0:fbdae7e6d805
BBR

Who changed what in which revision?

UserRevisionLine numberNew contents of line
borlanic 0:fbdae7e6d805 1 <?xml version="1.0" encoding="UTF-8" ?>
borlanic 0:fbdae7e6d805 2 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
borlanic 0:fbdae7e6d805 3
borlanic 0:fbdae7e6d805 4 <xsl:output encoding="UTF-8" indent="yes" method="html"/>
borlanic 0:fbdae7e6d805 5 <xsl:strip-space elements="*"/>
borlanic 0:fbdae7e6d805 6
borlanic 0:fbdae7e6d805 7 <xsl:variable name="list"
borlanic 0:fbdae7e6d805 8 select="document('index.xml')/list" />
borlanic 0:fbdae7e6d805 9
borlanic 0:fbdae7e6d805 10 <xsl:template match="/">
borlanic 0:fbdae7e6d805 11 <h1>
borlanic 0:fbdae7e6d805 12 Unittest report
borlanic 0:fbdae7e6d805 13 </h1>
borlanic 0:fbdae7e6d805 14
borlanic 0:fbdae7e6d805 15 <p>
borlanic 0:fbdae7e6d805 16 <b>
borlanic 0:fbdae7e6d805 17 Total tests run <xsl:value-of select="sum(document($list/entry/@name)/testsuite/@tests)"/>
borlanic 0:fbdae7e6d805 18 , failures: <xsl:value-of select="sum(document($list/entry/@name)/testsuite/@failures) + sum(document($list/entry/@name)/testsuite/@errors)"/>
borlanic 0:fbdae7e6d805 19 </b>
borlanic 0:fbdae7e6d805 20
borlanic 0:fbdae7e6d805 21 <xsl:for-each select="document($list/entry/@name)" >
borlanic 0:fbdae7e6d805 22 <xsl:apply-templates select="testsuite"/>
borlanic 0:fbdae7e6d805 23 </xsl:for-each>
borlanic 0:fbdae7e6d805 24 </p>
borlanic 0:fbdae7e6d805 25 </xsl:template>
borlanic 0:fbdae7e6d805 26
borlanic 0:fbdae7e6d805 27 <xsl:template match="testsuite">
borlanic 0:fbdae7e6d805 28 <h2>
borlanic 0:fbdae7e6d805 29 <xsl:value-of select="@name" />
borlanic 0:fbdae7e6d805 30 </h2>
borlanic 0:fbdae7e6d805 31 <table border="1" cellSpacing="0" cellPadding="10" >
borlanic 0:fbdae7e6d805 32 <tr>
borlanic 0:fbdae7e6d805 33 <th>Tests run</th>
borlanic 0:fbdae7e6d805 34 <th>Tests failed</th>
borlanic 0:fbdae7e6d805 35 <th>Other errors</th>
borlanic 0:fbdae7e6d805 36 </tr>
borlanic 0:fbdae7e6d805 37 <tr>
borlanic 0:fbdae7e6d805 38 <td><xsl:value-of select="@tests"/></td>
borlanic 0:fbdae7e6d805 39 <td><xsl:value-of select="@failures"/></td>
borlanic 0:fbdae7e6d805 40 <td><xsl:value-of select="@errors"/></td>
borlanic 0:fbdae7e6d805 41 </tr>
borlanic 0:fbdae7e6d805 42 </table>
borlanic 0:fbdae7e6d805 43 <br/>
borlanic 0:fbdae7e6d805 44 <table border="1" cellSpacing="0" cellPadding="10" >
borlanic 0:fbdae7e6d805 45 <tr>
borlanic 0:fbdae7e6d805 46 <th>Tests name</th>
borlanic 0:fbdae7e6d805 47 <th>PASS/FAIL</th>
borlanic 0:fbdae7e6d805 48 <th>Failing case</th>
borlanic 0:fbdae7e6d805 49 <th>Reason</th>
borlanic 0:fbdae7e6d805 50 </tr>
borlanic 0:fbdae7e6d805 51 <xsl:apply-templates select="testcase"/>
borlanic 0:fbdae7e6d805 52 </table>
borlanic 0:fbdae7e6d805 53 </xsl:template>
borlanic 0:fbdae7e6d805 54
borlanic 0:fbdae7e6d805 55 <xsl:template match="testcase">
borlanic 0:fbdae7e6d805 56 <xsl:choose>
borlanic 0:fbdae7e6d805 57 <xsl:when test="failure">
borlanic 0:fbdae7e6d805 58 <tr><td><font color="#FF0000"><xsl:value-of select="@name" /></font></td><xsl:apply-templates select="failure"/></tr>
borlanic 0:fbdae7e6d805 59 </xsl:when>
borlanic 0:fbdae7e6d805 60 <xsl:when test="error">
borlanic 0:fbdae7e6d805 61 <tr><td><font color="#FF0000"><xsl:value-of select="@name" /></font></td><xsl:apply-templates select="error"/></tr>
borlanic 0:fbdae7e6d805 62 </xsl:when>
borlanic 0:fbdae7e6d805 63 <xsl:otherwise>
borlanic 0:fbdae7e6d805 64 <tr><td><xsl:value-of select="@name" /></td><td><font color="#00FF00">PASS</font></td><td></td><td></td></tr>
borlanic 0:fbdae7e6d805 65 </xsl:otherwise>
borlanic 0:fbdae7e6d805 66 </xsl:choose>
borlanic 0:fbdae7e6d805 67 </xsl:template>
borlanic 0:fbdae7e6d805 68
borlanic 0:fbdae7e6d805 69 <xsl:template match="failure">
borlanic 0:fbdae7e6d805 70 <td>
borlanic 0:fbdae7e6d805 71 <b><font color="#FF0000">FAIL</font></b>
borlanic 0:fbdae7e6d805 72 </td>
borlanic 0:fbdae7e6d805 73 <td>
borlanic 0:fbdae7e6d805 74 <font color="#ff0000">
borlanic 0:fbdae7e6d805 75 <xsl:value-of select="@message" />
borlanic 0:fbdae7e6d805 76 </font>
borlanic 0:fbdae7e6d805 77 </td>
borlanic 0:fbdae7e6d805 78 <td>
borlanic 0:fbdae7e6d805 79 <font color="#ff0000">
borlanic 0:fbdae7e6d805 80 <xsl:value-of select="@type" />
borlanic 0:fbdae7e6d805 81 </font>
borlanic 0:fbdae7e6d805 82 </td>
borlanic 0:fbdae7e6d805 83 </xsl:template>
borlanic 0:fbdae7e6d805 84
borlanic 0:fbdae7e6d805 85 <xsl:template match="error">
borlanic 0:fbdae7e6d805 86 <td>
borlanic 0:fbdae7e6d805 87 <b><font color="#FF0000">FAIL</font></b>
borlanic 0:fbdae7e6d805 88 </td>
borlanic 0:fbdae7e6d805 89 <td>
borlanic 0:fbdae7e6d805 90 <font color="#ff0000">
borlanic 0:fbdae7e6d805 91 <xsl:value-of select="@message" />
borlanic 0:fbdae7e6d805 92 </font>
borlanic 0:fbdae7e6d805 93 </td>
borlanic 0:fbdae7e6d805 94 <td>
borlanic 0:fbdae7e6d805 95 <font color="#ff0000">
borlanic 0:fbdae7e6d805 96 <xsl:value-of select="@type" />
borlanic 0:fbdae7e6d805 97 </font>
borlanic 0:fbdae7e6d805 98 </td>
borlanic 0:fbdae7e6d805 99 </xsl:template>
borlanic 0:fbdae7e6d805 100
borlanic 0:fbdae7e6d805 101 </xsl:stylesheet>