-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathjunit2html.xslt
More file actions
70 lines (68 loc) · 2.87 KB
/
junit2html.xslt
File metadata and controls
70 lines (68 loc) · 2.87 KB
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
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<script language="javascript" type="text/javascript">
function show(name) {
document.getElementById(name).style.display = 'block';
}
function hide(name) {
document.getElementById(name).style.display = 'none';
}
function toggle(name) {
if (document.getElementById(name).style.display == 'none')
show(name)
else
hide(name)
}
</script>
</head>
<body>
<xsl:for-each select="testsuite">
<xsl:for-each select="testcase">
<a><xsl:attribute name="href">javascript:toggle("test<xsl:value-of select="position()"/>")</xsl:attribute>>>></a>
<xsl:text> </xsl:text>
<xsl:value-of select="@classname"/>.<xsl:value-of select="@name"/>
<xsl:if test="not(*)">
<font color="green">
- PASSED <br/>
</font>
</xsl:if>
<xsl:for-each select="skipped">
<font color="orange">
- SKIPPED <br/>
</font>
</xsl:for-each>
<xsl:for-each select="failure">
<font color="red">
- FAILED <br/>
</font>
</xsl:for-each>
<div style="display: none">
<xsl:attribute name="id">test<xsl:value-of select="position()"/></xsl:attribute>
<xsl:for-each select="failure">
<font color="red">
<pre><xsl:value-of select="."/></pre>
</font>
</xsl:for-each>
<xsl:for-each select="skipped">
<font color="orange">
<pre><xsl:value-of select="@message"/></pre>
</font>
</xsl:for-each>
<xsl:for-each select="system-out">
stdout <br/>
<pre><xsl:value-of select="."/></pre>
</xsl:for-each>
<xsl:for-each select="system-err">
stderr <br/>
<pre><xsl:value-of select="."/></pre>
</xsl:for-each>
</div>
</xsl:for-each>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>