Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: mbed-client/junit_xsl.xslt
- Revision:
- 0:06ee5f8a484a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-client/junit_xsl.xslt Sat Mar 18 22:37:16 2017 +0000
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:output encoding="UTF-8" indent="yes" method="html"/>
+<xsl:strip-space elements="*"/>
+
+<xsl:variable name="list"
+ select="document('index.xml')/list" />
+
+<xsl:template match="/">
+ <h1>
+ Unittest report
+ </h1>
+
+ <p>
+ <b>
+ Total tests run <xsl:value-of select="sum(document($list/entry/@name)/testsuite/@tests)"/>
+ , failures: <xsl:value-of select="sum(document($list/entry/@name)/testsuite/@failures) + sum(document($list/entry/@name)/testsuite/@errors)"/>
+ </b>
+
+ <xsl:for-each select="document($list/entry/@name)" >
+ <xsl:apply-templates select="testsuite"/>
+ </xsl:for-each>
+ </p>
+</xsl:template>
+
+<xsl:template match="testsuite">
+ <h2>
+ <xsl:value-of select="@name" />
+ </h2>
+ <table border="1" cellSpacing="0" cellPadding="10" >
+ <tr>
+ <th>Tests run</th>
+ <th>Tests failed</th>
+ <th>Other errors</th>
+ </tr>
+ <tr>
+ <td><xsl:value-of select="@tests"/></td>
+ <td><xsl:value-of select="@failures"/></td>
+ <td><xsl:value-of select="@errors"/></td>
+ </tr>
+ </table>
+ <br/>
+ <table border="1" cellSpacing="0" cellPadding="10" >
+ <tr>
+ <th>Tests name</th>
+ <th>PASS/FAIL</th>
+ <th>Failing case</th>
+ <th>Reason</th>
+ </tr>
+ <xsl:apply-templates select="testcase"/>
+ </table>
+</xsl:template>
+
+<xsl:template match="testcase">
+ <xsl:choose>
+ <xsl:when test="failure">
+ <tr><td><font color="#FF0000"><xsl:value-of select="@name" /></font></td><xsl:apply-templates select="failure"/></tr>
+ </xsl:when>
+ <xsl:when test="error">
+ <tr><td><font color="#FF0000"><xsl:value-of select="@name" /></font></td><xsl:apply-templates select="error"/></tr>
+ </xsl:when>
+ <xsl:otherwise>
+ <tr><td><xsl:value-of select="@name" /></td><td><font color="#00FF00">PASS</font></td><td></td><td></td></tr>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template match="failure">
+ <td>
+ <b><font color="#FF0000">FAIL</font></b>
+ </td>
+ <td>
+ <font color="#ff0000">
+ <xsl:value-of select="@message" />
+ </font>
+ </td>
+ <td>
+ <font color="#ff0000">
+ <xsl:value-of select="@type" />
+ </font>
+ </td>
+</xsl:template>
+
+<xsl:template match="error">
+ <td>
+ <b><font color="#FF0000">FAIL</font></b>
+ </td>
+ <td>
+ <font color="#ff0000">
+ <xsl:value-of select="@message" />
+ </font>
+ </td>
+ <td>
+ <font color="#ff0000">
+ <xsl:value-of select="@type" />
+ </font>
+ </td>
+</xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file