summaryrefslogtreecommitdiff
path: root/emu/tests/check_unittest.xslt
blob: b8005fe3110ca3aa868c5c97b4cbdcf43cd1faef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:c="http://check.sourceforge.net/ns">

<!--

bart@vankuik.nl, 13-MAR-2006

You can use this xslt on the commandline as follows:
$ xsltproc check_unittest.xslt check_output.xml > check_output.html

-->

<xsl:output method="html"/>

<xsl:template match="c:testsuites">
  <html><title>Test results</title><body>
  <p>
  <table width="100%" border="1" cellpadding="0">
  <tr><td colspan="7" style='background:#e5E5f5'><h1>Unittests</h1></td></tr>
    <xsl:apply-templates/>
  </table></p>
  </body></html>
</xsl:template>

<xsl:template match="c:suite">
  <xsl:apply-templates/>
</xsl:template>

<xsl:template match="c:title">
  <tr>
  <th colspan="7">Test suite <xsl:apply-templates/></th>
  </tr>
  <tr>
  <td>Path</td>
  <td>Filename</td>
  <td>Test ID</td>
  <td>Iteration</td>
  <td>Duration</td>
  <td>Description</td>
  <td>Message</td>
  </tr>
</xsl:template>

<xsl:template match="c:datetime">
  <tr><th colspan="7">Test ran at: <xsl:apply-templates/></th></tr>
</xsl:template>

<xsl:template match="c:test[@result='success']">
  <tr bgcolor="green"><xsl:apply-templates/></tr>
</xsl:template>

<xsl:template match="c:test[@result='error']">
  <tr bgcolor="red"><xsl:apply-templates/></tr>
</xsl:template>

<xsl:template match="c:test[@result='failure']">
  <tr bgcolor="red"><xsl:apply-templates/></tr>
</xsl:template>

<xsl:template match="c:path">
  <td><xsl:apply-templates/></td>
</xsl:template>

<xsl:template match="c:fn">
  <td><xsl:apply-templates/></td>
</xsl:template>

<xsl:template match="c:id">
  <td><xsl:apply-templates/></td>
</xsl:template>

<xsl:template match="c:iteration">
  <td><xsl:apply-templates/></td>
</xsl:template>

<xsl:template match="c:description">
  <td><xsl:apply-templates/></td>
</xsl:template>

<xsl:template match="c:message">
  <td><pre><tt><xsl:apply-templates/></tt></pre></td>
</xsl:template>

<xsl:template match="c:test/c:duration">
  <td><xsl:apply-templates/></td>
</xsl:template>

<xsl:template match="c:duration">
  <tr><th colspan="7">Test duration: <xsl:apply-templates/> seconds</th></tr>
</xsl:template>

</xsl:stylesheet>