-
Notifications
You must be signed in to change notification settings - Fork 3
/
ctest_valgrind_to_junit.xsl
47 lines (46 loc) · 1.37 KB
/
ctest_valgrind_to_junit.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
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/Site">
<testsuite name="ValgrindTests">
<xsl:attribute name="tests">
<xsl:value-of select="count(/Site/DynamicAnalysis/Test)"/>
</xsl:attribute>
<properties>
<xsl:for-each select="@*">
<property>
<xsl:attribute name="name">
<xsl:value-of select="name(.)"/>
</xsl:attribute>
<xsl:attribute name="value">
<xsl:value-of select="."/>
</xsl:attribute>
</property>
</xsl:for-each>
</properties>
<xsl:apply-templates select="DynamicAnalysis/Test"/>
<system-out>
<xsl:for-each select="@*">
<xsl:value-of select="name(.)"/>
<xsl:text>: </xsl:text>
<xsl:value-of select="."/>
<xsl:text> </xsl:text>
</xsl:for-each>
</system-out>
</testsuite>
</xsl:template>
<xsl:template match="DynamicAnalysis/Test">
<testcase name="{Name}" classname="ValgrindTests">
<error>
<xsl:attribute name="message">
<xsl:for-each select="Results/*">
<xsl:value-of select="."/>
<xsl:text> </xsl:text>
<xsl:value-of select="@type"/>
<xsl:if test="not(position() = last())">, </xsl:if>
</xsl:for-each>
</xsl:attribute>
<xsl:value-of select="Log" />
</error>
</testcase>
</xsl:template>
</xsl:stylesheet>