Menu

[r1]: / MSTest2Xml.xslt  Maximize  Restore  History

Download this file

57 lines (56 with data), 2.8 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
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="low_coverage" select="30"/>
<xsl:param name="ok_coverage" select="10"/>
<xsl:template match="/">
<html>
<body>
<h1>Coverage report</h1>
<h2>Assembly coverage</h2>
<table style="width:640;border:2px solid black;">
<tr>
<td style="font-weight:bold">Assembly</td>
<td style="text-align:right;font-weight:bold">Blocks covered (absolute)</td>
<td style="text-align:right;font-weight:bold">Blocks not covered (absolute)</td>
<td style="text-align:right;font-weight:bold">Blocks covered (percent)</td>
<td style="text-align:right;font-weight:bold">Blocks not covered (percent)</td>
</tr>
<xsl:for-each select="//CoverageDSPriv/Module">
<xsl:sort select="ModuleName"/>
<tr>
<td>
<xsl:value-of select="ModuleName"/>
</td>
<td style="text-align:right">
<xsl:value-of select="BlocksCovered"/>
</td>
<td style="text-align:right">
<xsl:value-of select="BlocksNotCovered"/>
</td>
<td>
<xsl:variable name="pct2" select="(BlocksCovered div (BlocksNotCovered + BlocksCovered))*100"/>
<xsl:attribute name="style">text-align:right;<xsl:choose>
<xsl:when test="number($pct2 &lt;= $low_coverage)">background-color:red;</xsl:when>
<xsl:when test="number($pct2 &lt;= $ok_coverage)">background-color:yellow;</xsl:when>
<xsl:otherwise>background-color:green;</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:value-of select="format-number($pct2, '##0.00')"/>
</td>
<td>
<xsl:variable name="pct" select="(BlocksNotCovered div (BlocksNotCovered + BlocksCovered))*100"/>
<xsl:attribute name="style">text-align:right;<xsl:choose>
<xsl:when test="number($pct &gt; $low_coverage)">background-color:red;</xsl:when>
<xsl:when test="number($pct &gt; $ok_coverage)">background-color:yellow;</xsl:when>
<xsl:otherwise>background-color:green;</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:value-of select="format-number($pct, '##0.00')" />
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.