Committer:
borlanic
Date:
Thu Mar 29 07:02:09 2018 +0000
Revision:
0:380207fcb5c1
Encoder, IMU --> OK; Controller --> in bearbeitung

Who changed what in which revision?

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