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