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