Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 38 additions & 13 deletions src/NUnit2Report.Console/xsl/NUnit-NoFrame.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,27 @@
span.covered {
background: #00df00;
border:#9c9c9c 1px solid;
display:block;
height:14px;
float:left;
}
span.uncovered {
background: #df0000;
border-top:#9c9c9c 1px solid;
border-bottom:#9c9c9c 1px solid;
border-right:#9c9c9c 1px solid;
display:block;
height:14px;
float:left;
}
span.ignored {
background: #ffff00;
border-top:#9c9c9c 1px solid;
border-bottom:#9c9c9c 1px solid;
border-right:#9c9c9c 1px solid;
display:block;
height:14px;
float:left;
}

td {
Expand Down Expand Up @@ -248,9 +257,10 @@
<xsl:for-each select="//test-suite[(child::results/test-case)]">
<xsl:sort select="@name"/>
<xsl:variable name="testCount" select="count(child::results/test-case)"/>
<xsl:variable name="errorCount" select="count(child::results/test-case[@executed='False'])"/>
<xsl:variable name="errorCount" select="count(child::results/test-case[@executed='False' and @result!='Ignored'])"/>
<xsl:variable name="failureCount" select="count(child::results/test-case[@success='False'])"/>
<xsl:variable name="runCount" select="$testCount - $errorCount - $failureCount"/>
<xsl:variable name="ignoreCount" select="count(child::results/test-case[@result='Ignored'])"/>
<xsl:variable name="runCount" select="$testCount - $ignoreCount - $errorCount - $failureCount"/>
<xsl:variable name="timeCount" select="translate(@time,',','.')"/>

<!-- write a summary for the package -->
Expand All @@ -260,16 +270,17 @@
<xsl:choose>
<xsl:when test="$failureCount &gt; 0">Failure</xsl:when>
<xsl:when test="$errorCount &gt; 0"> Error</xsl:when>
<xsl:when test="$ignoreCount &gt; 0">Ignored</xsl:when>
<xsl:otherwise>Pass</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:attribute>
<td width="25%">
<a href="#{generate-id(@name)}">
<xsl:attribute name="class">
<xsl:choose>
<xsl:when test="$failureCount &gt; 0">Failure</xsl:when>
</xsl:choose>
</xsl:attribute>
</xsl:attribute>
<xsl:value-of select="@name"/>
</a>
</td>
Expand All @@ -282,33 +293,47 @@
</b>
</td>
<td width="20%" height="9px">
<xsl:text>�</xsl:text>
<xsl:if test="round($runCount * 200 div $testCount )!=0">
<span class="covered">
<xsl:attribute name="style">width:<xsl:value-of select="round($runCount * 200 div $testCount )"/>px</xsl:attribute>
</span>
<span class="covered">
<xsl:attribute name="style">width:<xsl:value-of select="round($runCount * 200 div $testCount )"/>px</xsl:attribute>
<xsl:attribute name="title">
<xsl:text>Success</xsl:text>
</xsl:attribute>
<xsl:text>�</xsl:text>
</span>
</xsl:if>
<xsl:if test="round($errorCount * 200 div $testCount )!=0">
<span class="ignored">
<xsl:attribute name="style">width:<xsl:value-of select="round($errorCount * 200 div $testCount )"/>px</xsl:attribute>
<xsl:attribute name="title">
<xsl:text>Errors</xsl:text>
</xsl:attribute>
<xsl:text>�</xsl:text>
</span>
</xsl:if>
<xsl:if test="round($failureCount * 200 div $testCount )!=0">
<span class="uncovered">
<xsl:attribute name="style">width:<xsl:value-of select="round($failureCount * 200 div $testCount )"/>px</xsl:attribute>
</span>
<span class="uncovered">
<xsl:attribute name="style">width:<xsl:value-of select="round($failureCount * 200 div $testCount )"/>px</xsl:attribute>
<xsl:attribute name="title">
<xsl:text>Failures</xsl:text>
</xsl:attribute>
<xsl:text>�</xsl:text>
</span>
</xsl:if>
</td>
<td><xsl:value-of select="$runCount"/></td>
<td><xsl:value-of select="$errorCount"/></td>
<td><xsl:value-of select="$failureCount"/></td>
<td><xsl:value-of select="$ignoreCount"/></td>
<td>
<xsl:call-template name="display-time">
<xsl:with-param name="value" select="$timeCount"/>
</xsl:call-template>
</td>
</xsl:call-template>
</td>
</tr>
</xsl:for-each>
</table>
</table>
</xsl:template>


Expand Down
31 changes: 27 additions & 4 deletions src/NUnit2Report.Console/xsl/toolkit.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@
<td width="70px">
<b id=":i18n:Errors">Errors</b>
</td>
<td width="70px">
<b id=":i18n:Errors">Ignored</b>
</td>
<td colspan="2">
<b id=":i18n:SuccessRate">Success Rate</b>
</td>
Expand Down Expand Up @@ -149,6 +152,9 @@
<td width="5%">
<b id=":i18n:Failures">Failures</b>
</td>
<td width="5%">
<b id=":i18n:Ignored">Ignored</b>
</td>
<td width="10%" nowrap="nowrap">
<b id=":i18n:Time">Time(s)</b>
</td>
Expand Down Expand Up @@ -186,8 +192,9 @@
<h2 id=":i18n:Summary">Summary</h2>
<xsl:variable name="runCount" select="@total"/>
<xsl:variable name="failureCount" select="@failures"/>
<xsl:variable name="errorCount" select="@errors"/>
<xsl:variable name="ignoreCount" select="@not-run"/>
<xsl:variable name="total" select="$runCount + $ignoreCount + $failureCount"/>
<xsl:variable name="total" select="$runCount + $errorCount + $failureCount"/>

<xsl:variable name="timeCount" select="translate(test-suite/@time,',','.')"/>

Expand All @@ -198,7 +205,8 @@
<xsl:attribute name="class">
<xsl:choose>
<xsl:when test="$failureCount &gt; 0">Failure</xsl:when>
<xsl:when test="$ignoreCount &gt; 0">Error</xsl:when>
<xsl:when test="$errorCount &gt; 0">Error</xsl:when>
<xsl:when test="$ignoreCount &gt; 0">Ignored</xsl:when>
<xsl:otherwise>Pass</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
Expand All @@ -208,6 +216,9 @@
<td>
<xsl:value-of select="$failureCount"/>
</td>
<td>
<xsl:value-of select="$errorCount"/>
</td>
<td>
<xsl:value-of select="$ignoreCount"/>
</td>
Expand All @@ -222,32 +233,44 @@
<xsl:attribute name="style">
width:<xsl:value-of select="round($runCount * 200 div $total )"/>px
</xsl:attribute>
<xsl:attribute name="title">
<xsl:text>Success</xsl:text>
</xsl:attribute>
<xsl:call-template name="for.loop">
<xsl:with-param name="i">1</xsl:with-param>
<xsl:with-param name="count">
<xsl:value-of select="round($runCount * 10 div $total )"/>
</xsl:with-param>
</xsl:call-template>
<xsl:text>�</xsl:text>
</span>
</xsl:if>
<xsl:if test="round($ignoreCount * 200 div $total )!=0">
<xsl:if test="round($errorCount * 200 div $total )!=0">
<span class="ignored">
<xsl:attribute name="style">
width:<xsl:value-of select="round($ignoreCount * 200 div $total )"/>px
width:<xsl:value-of select="round($errorCount * 200 div $total )"/>px
</xsl:attribute>
<xsl:attribute name="title">
<xsl:text>Errors</xsl:text>
</xsl:attribute>
<xsl:text>�</xsl:text>
</span>
</xsl:if>
<xsl:if test="round($failureCount * 200 div $total )!=0">
<span class="uncovered">
<xsl:attribute name="style">
width:<xsl:value-of select="round($failureCount * 200 div $total )"/>px
</xsl:attribute>
<xsl:attribute name="title">
<xsl:text>Failures</xsl:text>
</xsl:attribute>
<xsl:call-template name="for.loop">
<xsl:with-param name="i">1</xsl:with-param>
<xsl:with-param name="count">
<xsl:value-of select="round($runCount * 10 div $total )"/>
</xsl:with-param>
</xsl:call-template>
<xsl:text>�</xsl:text>
</span>
</xsl:if>
</td>
Expand Down