-
Notifications
You must be signed in to change notification settings - Fork 0
/
junitreport.xsl
48 lines (33 loc) · 1023 Bytes
/
junitreport.xsl
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
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes" method="xml" standalone="yes" omit-xml-declaration="yes"/>
<xsl:template match="test_results">
<depunit>
<xsl:for-each select="run">
<testsuite errors="0" time="5.0">
<xsl:attribute name="tests">
<xsl:value-of select="@total"/>
</xsl:attribute>
<xsl:attribute name="failed">
<xsl:value-of select="@failed"/>
</xsl:attribute>
<xsl:attribute name="name">
<xsl:value-of select="@name"/>
</xsl:attribute>
<xsl:for-each select="test">
<testcase classname="{@class}" name="{@method}" time="1.0">
<xsl:if test="@status = 'failed'">
<error message="{error/message}" type="{error/stack/trace[1]/@className}">
<xsl:for-each select="error/stack/trace">
at <xsl:value-of select="@print"/><xsl:text>
</xsl:text>
</xsl:for-each>
</error>
</xsl:if>
</testcase>
</xsl:for-each>
</testsuite>
</xsl:for-each>
</depunit>
</xsl:template>
</xsl:stylesheet>