mbed-os

Fork of mbed-os by erkin yucel

Committer:
xuaner
Date:
Thu Jul 20 14:26:57 2017 +0000
Revision:
1:3deb71413561
Parent:
0:f269e3021894
mbed_os

Who changed what in which revision?

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