-
Notifications
You must be signed in to change notification settings - Fork 517
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move HtmlTransform.xslt here from maccore.
- Loading branch information
1 parent
6df7be5
commit 20da795
Showing
1 changed file
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<!-- Got this from here: http://bazaar.launchpad.net/~charlie.poole/nunit-summary/trunk/view/head:/Transforms/DefaultTransform.xslt --> | ||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | ||
<xsl:output method='text'/> | ||
<xsl:template match="/"> | ||
<xsl:apply-templates/> | ||
</xsl:template> | ||
|
||
<xsl:template match="test-results"> | ||
<xsl:text><b></xsl:text> | ||
<xsl:value-of select="@name"/> | ||
<xsl:text></b><br><br>

</xsl:text> | ||
|
||
<xsl:text><b>NUnit Version:</b> </xsl:text> | ||
<xsl:value-of select="environment/@nunit-version"/> | ||
<xsl:text>&nbsp;&nbsp;&nbsp;<b>Date:</b> </xsl:text> | ||
<xsl:value-of select="@date"/> | ||
<xsl:text>&nbsp;&nbsp;&nbsp;<b>Time:</b> </xsl:text> | ||
<xsl:value-of select="@time"/> | ||
<xsl:text><br><br>

</xsl:text> | ||
|
||
<xsl:text><b>Runtime Environment -</b><br>
</xsl:text> | ||
<xsl:text>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>OS Version:</b> </xsl:text> | ||
<xsl:value-of select="environment/@os-version"/> | ||
<xsl:text><br>
</xsl:text> | ||
<xsl:text>&nbsp;&nbsp;&nbsp;<b>CLR Version:</b> </xsl:text> | ||
<xsl:value-of select="environment/@clr-version"/> | ||
<xsl:text><br><br>

</xsl:text> | ||
|
||
<xsl:text><b>Tests run: </xsl:text> | ||
<xsl:value-of select="@total"/> | ||
<xsl:choose> | ||
<xsl:when test ="substring(environment/@nunit-version,1,3)>='2.5'"> | ||
<xsl:text>, Errors: </xsl:text> | ||
<xsl:value-of select="@errors"/> | ||
<xsl:text>, Failures: </xsl:text> | ||
<xsl:value-of select="@failures"/> | ||
<xsl:if test="@inconclusive"> | ||
<!-- Introduced in 2.5.1 --> | ||
<xsl:text>, Inconclusive: </xsl:text> | ||
<xsl:value-of select="@inconclusive"/> | ||
</xsl:if> | ||
<xsl:text>, Time: </xsl:text> | ||
<xsl:value-of select="test-suite/@time"/> | ||
<xsl:text> seconds<br></xsl:text> | ||
<xsl:text>&nbsp;&nbsp;&nbsp;Not run: </xsl:text> | ||
<xsl:value-of select="@not-run"/> | ||
<xsl:text>, Invalid: </xsl:text> | ||
<xsl:value-of select="@invalid"/> | ||
<xsl:text>, Ignored: </xsl:text> | ||
<xsl:value-of select="@ignored"/> | ||
<xsl:text>, Skipped: </xsl:text> | ||
<xsl:value-of select="@skipped"/> | ||
<xsl:text></b><br><br>
</xsl:text> | ||
</xsl:when> | ||
<xsl:otherwise> | ||
<xsl:text>, Failures: </xsl:text> | ||
<xsl:value-of select="@failures"/> | ||
<xsl:text>, Not run: </xsl:text> | ||
<xsl:value-of select="@not-run"/> | ||
<xsl:text>, Time: </xsl:text> | ||
<xsl:value-of select="test-suite/@time"/> | ||
<xsl:text> seconds</b><br><br></xsl:text> | ||
</xsl:otherwise> | ||
</xsl:choose> | ||
<xsl:text> | ||
</xsl:text> | ||
|
||
<xsl:if test="//test-case[failure]"> | ||
<xsl:text><h4>Failures:</h4>
</xsl:text> | ||
<xsl:text><ol>
</xsl:text> | ||
<xsl:apply-templates select="//test-case[failure]"/> | ||
<xsl:text></ol>
</xsl:text> | ||
</xsl:if> | ||
|
||
<xsl:if test="//test-case[@executed='False']"> | ||
<xsl:text><h4>Tests not run:</h4>
</xsl:text> | ||
<xsl:text><ol>
</xsl:text> | ||
<xsl:apply-templates select="//test-case[@executed='False']"/> | ||
<xsl:text></ol>
</xsl:text> | ||
</xsl:if> | ||
|
||
<xsl:text disable-output-escaping='yes'>
</xsl:text> | ||
<xsl:text><hr>
</xsl:text> | ||
</xsl:template> | ||
|
||
<xsl:template match="test-case"> | ||
<xsl:text><pre>
</xsl:text> | ||
<xsl:text><li></xsl:text> | ||
<xsl:value-of select="@name"/> | ||
<xsl:text> : </xsl:text> | ||
<xsl:value-of select="child::node()/message"/> | ||
<xsl:text disable-output-escaping='yes'>
</xsl:text> | ||
<xsl:if test="failure"> | ||
<xsl:value-of select="failure/stack-trace"/> | ||
</xsl:if> | ||
<xsl:text></pre>
</xsl:text> | ||
</xsl:template> | ||
|
||
</xsl:stylesheet> |