|
@@ -1,82 +1,63 @@
|
|
|
-<?xml version="1.0"?>
|
|
|
+<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
|
|
-<xsl:output method="html" encoding="UTF-8"/>
|
|
|
+
|
|
|
+ <!-- Change the encoding here if you need it, i.e. UTF-8 -->
|
|
|
+ <xsl:output method="html" encoding="UTF-8" indent="yes"
|
|
|
+ doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN"
|
|
|
+ />
|
|
|
+
|
|
|
+ <!-- ************************************ Parameters ************************************ -->
|
|
|
+ <!-- expand-treeview, boolean - true if you want to expand the tree-view at the first print -->
|
|
|
+ <xsl:param name="param-expand-treeview" select="'false'"/>
|
|
|
+ <!-- preferred browser Netscape/Mozilla or Internet Explorer. Thanks to Bill, 90% of the sheeps use IE, but I don't so NS is the default here -->
|
|
|
+ <xsl:param name="param-is-netscape" select="'true'"/>
|
|
|
+ <!-- horizontal distance in pixels between a folder and its leaves -->
|
|
|
+ <xsl:param name="param-shift-width" select="15"/>
|
|
|
+ <!-- image source directory-->
|
|
|
+ <xsl:param name="param-img-directory" select="'images/'"/>
|
|
|
+ <!-- scripts and stylesheet source directory-->
|
|
|
+ <xsl:param name="param-scripts-directory" select="'scripts/'"/>
|
|
|
+ <!-- expand-errors-and-failures, boolean - true if you want to expand the testcase nodes (errors & failures) at the first print -->
|
|
|
+ <xsl:param name="param-expand-errors-and-failures" select="'false'"/>
|
|
|
+ <!-- if expand-treeview is false we can auto expand first few nodes. if 0 then expand until error or failure testcases. -->
|
|
|
+ <xsl:param name="param-expand-depth" select="3"/>
|
|
|
+
|
|
|
+ <!-- ************************************ Variables ************************************ -->
|
|
|
+ <xsl:variable name="var-simple-quote">'</xsl:variable>
|
|
|
+ <xsl:variable name="var-slash-quote">\'</xsl:variable>
|
|
|
+
|
|
|
|
|
|
<xsl:template match="/">
|
|
|
<html>
|
|
|
<head>
|
|
|
- <title>fpcUnit Results</title>
|
|
|
- <style type="text/css" title="fpcUnit" media="screen">
|
|
|
- @import "fpcunit.css";
|
|
|
- </style>
|
|
|
- <script>
|
|
|
-window.onload = function () {
|
|
|
- var x = document.getElementsByTagName('div');
|
|
|
- for (var i=0;i<x.length;i++)
|
|
|
- {
|
|
|
- if (x[i].className == 'testsuitelabel')
|
|
|
- x[i].onclick = clickSuite;
|
|
|
- if (x[i].className == 'testsuiteshowall')
|
|
|
- x[i].onclick = openSuites;
|
|
|
- if (x[i].className == 'testsuitehideall')
|
|
|
- x[i].onclick = closeSuites;
|
|
|
- }
|
|
|
-
|
|
|
- closeSuites();
|
|
|
-}
|
|
|
-
|
|
|
-function closeSuites()
|
|
|
-{
|
|
|
- var x = document.getElementsByTagName('div');
|
|
|
- for (var i=0;i<x.length;i++)
|
|
|
- {
|
|
|
- if (x[i].className == 'testcontent')
|
|
|
- x[i].style.display = 'none';
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-function openSuites()
|
|
|
-{
|
|
|
- var x = document.getElementsByTagName('div');
|
|
|
- for (var i=0;i<x.length;i++)
|
|
|
- {
|
|
|
- if (x[i].className == 'testcontent')
|
|
|
- x[i].style.display = 'block';
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-function clickSuite(e)
|
|
|
-{
|
|
|
- if (!e) var e = window.event;
|
|
|
- if (e.target) var tg = e.target;
|
|
|
- else if (e.srcElement) var tg = e.srcElement;
|
|
|
- while (tg.nodeName != 'DIV') // Safari GRRRRRRRRRR
|
|
|
- tg = tg.parentNode;
|
|
|
- var nextSib = tg.nextSibling;
|
|
|
- while (nextSib.nodeType != 1)
|
|
|
- nextSib = nextSib.nextSibling;
|
|
|
- var nextSibStatus = (nextSib.style.display == 'none') ? 'block' : 'none';
|
|
|
- nextSib.style.display = nextSibStatus;
|
|
|
-}
|
|
|
- </script>
|
|
|
+ <title>FPCUnit Results</title>
|
|
|
+ <link href="{$param-scripts-directory}fpcunit.css" rel="stylesheet" type="text/css"/>
|
|
|
+ <script src="{$param-scripts-directory}treeview.js" language="javascript" type="text/javascript"/>
|
|
|
</head>
|
|
|
<body>
|
|
|
|
|
|
<a name="Summary"/>
|
|
|
- <h2>fpcUnit Results</h2>
|
|
|
+ <h2>FPCUnit Results</h2>
|
|
|
<xsl:apply-templates/>
|
|
|
|
|
|
- <address>
|
|
|
- <a href="http://opensoft.homeip.net">fpcUnit Report</a> 0.3.1 © 2006 by
|
|
|
- <a href="mailto:[email protected]?subject=Comments about fpcUnit Report">Graeme Geldenhuys</a>.<br/>
|
|
|
- Licensed under the <a href="http://www.gnu.org/copyleft/gpl.html">GNU General Public License</a>.<br/>
|
|
|
- </address>
|
|
|
+
|
|
|
+ <address>
|
|
|
+ <a href="http://opensoft.homeip.net">FPCUnit Report</a> 0.4.0 [beta3] © 2006-2008 by
|
|
|
+ <a href="mailto:[email protected]?subject=Comments about FPCUnit Report">Graeme Geldenhuys</a>.<br/>
|
|
|
+ Licensed under the <a href="http://www.gnu.org/copyleft/gpl.html">GNU General Public License</a>.<br/>
|
|
|
+ </address>
|
|
|
+
|
|
|
+ <p align="right">
|
|
|
+ <a href="http://validator.w3.org/check?uri=referer"><img
|
|
|
+ src="http://www.w3.org/Icons/valid-html40" border="0"
|
|
|
+ alt="Valid HTML 4.0 Transitional" height="31" width="88"/></a>
|
|
|
+ </p>
|
|
|
</body>
|
|
|
</html>
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
|
-<xsl:template match="TestResults">
|
|
|
+<xsl:template name="summary" match="TestResults">
|
|
|
<xsl:variable name="runCount" select="NumberOfRunTests"/>
|
|
|
<xsl:variable name="failureCount" select="NumberOfFailures"/>
|
|
|
<xsl:variable name="errorCount" select="NumberOfErrors"/>
|
|
@@ -85,38 +66,24 @@ function clickSuite(e)
|
|
|
|
|
|
<h3>Summary</h3>
|
|
|
<!-- Summary Table -->
|
|
|
- <table border="0" rules="none" width="100%">
|
|
|
- <tr align="left" class="title">
|
|
|
- <th width="45%" align="left">Name</th>
|
|
|
- <th width="7%" align="left">Tests</th>
|
|
|
- <th width="8%" align="left">Failures</th>
|
|
|
- <th width="8%" align="left">Errors</th>
|
|
|
- <th width="11%" align="left">Elapsed Time</th>
|
|
|
- <th width="14%" align="left">Run Date</th>
|
|
|
- </tr>
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$errorCount > 0">
|
|
|
- <tr class="error">
|
|
|
- <td>Summary</td>
|
|
|
- <td><xsl:value-of select="$runCount"/></td>
|
|
|
- <td><xsl:value-of select="$failureCount"/></td>
|
|
|
- <td><xsl:value-of select="$errorCount"/></td>
|
|
|
- <td><xsl:value-of select="$elapsedTime"/></td>
|
|
|
- <td><xsl:value-of select="$dateRan"/></td>
|
|
|
+ <table border="0" rules="none" width="100%">
|
|
|
+ <tr align="left" class="title">
|
|
|
+ <th width="45%" align="left">Name</th>
|
|
|
+ <th width="7%" align="left">Tests</th>
|
|
|
+ <th width="8%" align="left">Failures</th>
|
|
|
+ <th width="8%" align="left">Errors</th>
|
|
|
+ <th width="11%" align="left">Elapsed Time</th>
|
|
|
+ <th width="14%" align="left">Run Date</th>
|
|
|
</tr>
|
|
|
- </xsl:when>
|
|
|
- <xsl:when test="$failureCount > 0">
|
|
|
- <tr class="failure">
|
|
|
- <td>Summary</td>
|
|
|
- <td><xsl:value-of select="$runCount"/></td>
|
|
|
- <td><xsl:value-of select="$failureCount"/></td>
|
|
|
- <td><xsl:value-of select="$errorCount"/></td>
|
|
|
- <td><xsl:value-of select="$elapsedTime"/></td>
|
|
|
- <td><xsl:value-of select="$dateRan"/></td>
|
|
|
- </tr>
|
|
|
- </xsl:when>
|
|
|
- <xsl:otherwise>
|
|
|
<tr class="success">
|
|
|
+ <!-- Set class attribute based on test results -->
|
|
|
+ <xsl:if test="$failureCount > 0">
|
|
|
+ <xsl:attribute name="class">failure</xsl:attribute>
|
|
|
+ </xsl:if>
|
|
|
+ <xsl:if test="$errorCount > 0">
|
|
|
+ <xsl:attribute name="class">error</xsl:attribute>
|
|
|
+ </xsl:if>
|
|
|
+
|
|
|
<td>Summary</td>
|
|
|
<td><xsl:value-of select="$runCount"/></td>
|
|
|
<td><xsl:value-of select="$failureCount"/></td>
|
|
@@ -124,136 +91,357 @@ function clickSuite(e)
|
|
|
<td><xsl:value-of select="$elapsedTime"/></td>
|
|
|
<td><xsl:value-of select="$dateRan"/></td>
|
|
|
</tr>
|
|
|
- </xsl:otherwise>
|
|
|
- </xsl:choose>
|
|
|
- </table>
|
|
|
+ </table>
|
|
|
|
|
|
<p>Note: <i>Failures</i> are anticipated and checked for with assertions. <i>Errors</i> are
|
|
|
unexpected results.</p>
|
|
|
- <hr/>
|
|
|
+ <hr/>
|
|
|
+
|
|
|
+ <xsl:call-template name="test_listing"></xsl:call-template>
|
|
|
|
|
|
- <xsl:call-template name="test_listing"/>
|
|
|
- <xsl:call-template name="test_failures"/>
|
|
|
- <xsl:call-template name="test_errors"/>
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
|
-<xsl:template name="test_listing">
|
|
|
- <div id="testlisting">
|
|
|
- <a name="Test_Listing"/>
|
|
|
- <h3>Test Listing</h3>
|
|
|
- <p>
|
|
|
- [<a href="#Summary">Summary</a>]
|
|
|
- [<a href="#Test_Listing">Test Listing</a>]
|
|
|
- [<a href="#Failures">Failures</a>]
|
|
|
- [<a href="#Errors">Errors</a>]
|
|
|
- </p>
|
|
|
- <!-- Test Listing Table -->
|
|
|
- <table border="0" rules="none" width="100%">
|
|
|
- <tr align="left" class="title">
|
|
|
- <td align="left">Name<br/><div class="testsuiteshowall">[show all]</div><div class="testsuitehideall">[hide all]</div></td>
|
|
|
- <td width="150" align="right">Elapsed Time<br/>(hh:mm:ss.zzz)</td>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
- <xsl:for-each select="TestListing/TestSuite">
|
|
|
- <div class="testsuitelabel"><xsl:value-of select="@Name"/></div>
|
|
|
- <div class="testcontent">
|
|
|
- <table border="0" cellspacing="1" width="100%">
|
|
|
- <xsl:for-each select="./Test">
|
|
|
- <tr class="success">
|
|
|
- <td><xsl:value-of select="@Name"/></td>
|
|
|
- <td width="150" align="right"><xsl:value-of select="ElapsedTime"/></td>
|
|
|
+<!--
|
|
|
+**********************************************************************
|
|
|
+ Represents the test suites as a treeview
|
|
|
+**********************************************************************
|
|
|
+-->
|
|
|
+ <xsl:template name="test_listing">
|
|
|
+ <div id="testlisting">
|
|
|
+ <a name="Test_Listing"/>
|
|
|
+ <h3>Test Listing</h3>
|
|
|
+ <!-- Treeview Start -->
|
|
|
+ <table border="0" cellspacing="0" cellpadding="0">
|
|
|
+ <tr>
|
|
|
+ <td>
|
|
|
+ <!-- Apply the template TestSuite starting with a depth in the tree of 1-->
|
|
|
+ <xsl:call-template name="test_suite">
|
|
|
+ <xsl:with-param name="depth" select="1"/>
|
|
|
+ </xsl:call-template>
|
|
|
+ </td>
|
|
|
</tr>
|
|
|
- </xsl:for-each> <!-- Test -->
|
|
|
</table>
|
|
|
- </div>
|
|
|
- </xsl:for-each> <!-- TestSuite -->
|
|
|
+ <!-- Treeview End -->
|
|
|
+ </div> <!-- testlisting -->
|
|
|
+ </xsl:template>
|
|
|
|
|
|
-</div> <!-- testlisting -->
|
|
|
-</xsl:template>
|
|
|
|
|
|
+<!--
|
|
|
+**********************************************************************
|
|
|
+ Creates a image and text representing a test suite.
|
|
|
+**********************************************************************
|
|
|
+-->
|
|
|
+ <xsl:template name="test_suite" match="TestSuite">
|
|
|
+ <xsl:param name="depth"/>
|
|
|
+ <table border="0" cellspacing="0" cellpadding="0">
|
|
|
+ <tr>
|
|
|
+ <!-- If first level of depth, do not shift of $param-shift-width-->
|
|
|
+ <xsl:if test="$depth>1">
|
|
|
+ <!-- highlight the test results -->
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="@NumberOfErrors > 0">
|
|
|
+ <td width="{$param-shift-width}" class="error_"> </td>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:when test="@NumberOfFailures > 0">
|
|
|
+ <td width="{$param-shift-width}" class="failure_"> </td>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <td width="{$param-shift-width}"> </td>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:if>
|
|
|
+ <td>
|
|
|
+ <a class="folder">
|
|
|
+ <xsl:attribute name="onclick">toggle(this)</xsl:attribute>
|
|
|
+ <!-- If the treeview is unfold, the image minus (-) is displayed-->
|
|
|
+ <xsl:if test="@expanded">
|
|
|
+ <xsl:if test="@expanded='true'">
|
|
|
+ <img src="{$param-img-directory}minus.gif" alt=""/>
|
|
|
+ </xsl:if>
|
|
|
+ <xsl:if test="@expanded='false'">
|
|
|
+ <img src="{$param-img-directory}plus.gif" alt=""/>
|
|
|
+ </xsl:if>
|
|
|
+ </xsl:if>
|
|
|
|
|
|
+ <xsl:if test="not(@expanded)">
|
|
|
+ <xsl:if test="$param-expand-treeview = 'true'">
|
|
|
+ <img src="{$param-img-directory}minus.gif" alt=""/>
|
|
|
+ </xsl:if>
|
|
|
+ <xsl:if test="$param-expand-treeview = 'false' or not(@expanded)">
|
|
|
+ <img src="{$param-img-directory}plus.gif" alt=""/>
|
|
|
+ </xsl:if>
|
|
|
+ </xsl:if>
|
|
|
+ <img src="{$param-img-directory}testsuite.gif" alt="">
|
|
|
+ <!-- if the attribut Name is present-->
|
|
|
+ <xsl:if test="@Name">
|
|
|
+ <!-- if Netscape / Mozilla -->
|
|
|
+ <xsl:if test="$param-is-netscape='true'">
|
|
|
+ <xsl:attribute name="title"><xsl:value-of select="@Name"/></xsl:attribute>
|
|
|
+ </xsl:if>
|
|
|
+ <!-- if Internet Explorer -->
|
|
|
+ <xsl:if test="$param-is-netscape='false'">
|
|
|
+ <xsl:attribute name="alt"><xsl:value-of select="@Name"/></xsl:attribute>
|
|
|
+ </xsl:if>
|
|
|
+ </xsl:if>
|
|
|
+ </img>
|
|
|
+ <!-- Tree node text can be decorated based on the test results -->
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="@NumberOfErrors > 0">
|
|
|
+ <span class="node_error"><xsl:value-of select="@Name"/></span>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:when test="@NumberOfFailures > 0">
|
|
|
+ <span class="node_failure"><xsl:value-of select="@Name"/></span>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <span class="node_success"><xsl:value-of select="@Name"/></span>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </a>
|
|
|
|
|
|
-<xsl:template name="test_failures">
|
|
|
- <div id="failures">
|
|
|
- <a name="Failures"/>
|
|
|
- <h3>Failures:</h3>
|
|
|
- <p>
|
|
|
- [<a href="#Summary">Summary</a>]
|
|
|
- [<a href="#Test_Listing">Test Listing</a>]
|
|
|
- [<a href="#Failures">Failures</a>]
|
|
|
- [<a href="#Errors">Errors</a>]
|
|
|
- </p>
|
|
|
-<xsl:for-each select="ListOfFailures/Failure">
|
|
|
- <p class="backToTop">
|
|
|
- [<a href="#Failures">Back to top</a>]
|
|
|
- </p>
|
|
|
- <table>
|
|
|
- <!-- Error Table Body -->
|
|
|
- <TR>
|
|
|
- <TD valign="top" class="title" width="300">Message:</TD>
|
|
|
- <TD valign="top" class="resultmessage"><xsl:value-of select="Message"/></TD>
|
|
|
- </TR>
|
|
|
- <TR>
|
|
|
- <TD valign="top" class="title">Exception Class:</TD>
|
|
|
- <TD valign="top" class="resultmessage"><xsl:value-of select="ExceptionClass"/></TD>
|
|
|
- </TR>
|
|
|
- <TR>
|
|
|
- <TD valign="top" class="title">Exception Message:</TD>
|
|
|
- <TD valign="top" class="resultmessage"><xsl:value-of select="ExceptionMessage"/></TD>
|
|
|
- </TR>
|
|
|
- </table>
|
|
|
-</xsl:for-each>
|
|
|
-</div> <!-- failures -->
|
|
|
-</xsl:template>
|
|
|
+ <!-- Shall we expand all the leaves of the treeview? No by default -->
|
|
|
+ <div>
|
|
|
+ <xsl:if test="@expanded">
|
|
|
+ <xsl:if test="@expanded='true'">
|
|
|
+ <xsl:attribute name="style">display:block;</xsl:attribute>
|
|
|
+ </xsl:if>
|
|
|
+ <!-- plus (+) otherwise-->
|
|
|
+ <xsl:if test="@expanded='false'">
|
|
|
+ <xsl:attribute name="style">display:none;</xsl:attribute>
|
|
|
+ </xsl:if>
|
|
|
+ </xsl:if>
|
|
|
|
|
|
+ <xsl:if test="not(@expanded)">
|
|
|
+ <xsl:if test="$param-expand-treeview = 'true'">
|
|
|
+ <xsl:attribute name="style">display:block;</xsl:attribute>
|
|
|
+ </xsl:if>
|
|
|
+ <xsl:if test="$param-expand-treeview = 'false'">
|
|
|
+ <xsl:attribute name="style">display:none;</xsl:attribute>
|
|
|
+ </xsl:if>
|
|
|
+ <!-- Auto expand any nodes containing failures or errors -->
|
|
|
+ <xsl:if test="($param-expand-treeview = 'false') and ($param-expand-depth = 0)">
|
|
|
+ <xsl:if test="@NumberOfErrors > 0">
|
|
|
+ <xsl:attribute name="style">display:block;</xsl:attribute>
|
|
|
+ </xsl:if>
|
|
|
+ <xsl:if test="@NumberOfFailures > 0">
|
|
|
+ <xsl:attribute name="style">display:block;</xsl:attribute>
|
|
|
+ </xsl:if>
|
|
|
+ </xsl:if>
|
|
|
+ <!-- Auto expand the first few nodes as defined by param-expand-depth -->
|
|
|
+ <xsl:if test="($param-expand-treeview = 'false') and ($param-expand-depth > 0)">
|
|
|
+ <xsl:if test="($depth < $param-expand-depth)">
|
|
|
+ <xsl:attribute name="style">display:block;</xsl:attribute>
|
|
|
+ </xsl:if>
|
|
|
+ </xsl:if>
|
|
|
+ </xsl:if>
|
|
|
+ <!-- Thanks to the magic of recursive calls, all the descendants of
|
|
|
+ the current folder are going to be built -->
|
|
|
+ <xsl:apply-templates name="test_suite">
|
|
|
+ <xsl:with-param name="depth" select="$depth+1"/>
|
|
|
+ </xsl:apply-templates>
|
|
|
+ <!-- print all the leaves of this folder-->
|
|
|
+ <xsl:apply-templates select="/Test"></xsl:apply-templates>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ </xsl:template>
|
|
|
|
|
|
|
|
|
-<xsl:template name="test_errors">
|
|
|
-<div id="errors">
|
|
|
- <a name="Errors"/>
|
|
|
- <h3>Errors</h3>
|
|
|
- <p>
|
|
|
- [<a href="#Summary">Summary</a>]
|
|
|
- [<a href="#Test_Listing">Test Listing</a>]
|
|
|
- [<a href="#Failures">Failures</a>]
|
|
|
- [<a href="#Errors">Errors</a>]
|
|
|
- </p>
|
|
|
-<xsl:for-each select="ListOfErrors/Error">
|
|
|
- <p class="backToTop">
|
|
|
- [<a href="#Errors">Back to top</a>]
|
|
|
- </p>
|
|
|
-<table>
|
|
|
- <!-- Error Table Body -->
|
|
|
-<TR>
|
|
|
- <TD valign="top" class="title" width="300">Message:</TD>
|
|
|
- <TD valign="top" class="resultmessage"><xsl:value-of select="Message"/></TD>
|
|
|
-</TR>
|
|
|
-<TR>
|
|
|
- <TD valign="top" class="title">Exception Class:</TD>
|
|
|
- <TD valign="top" class="resultmessage"><xsl:value-of select="ExceptionClass"/></TD>
|
|
|
-</TR>
|
|
|
-<TR>
|
|
|
- <TD valign="top" class="title">Exception Message:</TD>
|
|
|
- <TD valign="top" class="resultmessage"><xsl:value-of select="ExceptionMessage"/></TD>
|
|
|
-</TR>
|
|
|
-<TR>
|
|
|
- <TD valign="top" class="title">UnitName:</TD>
|
|
|
- <TD valign="top" class="resultmessage"><xsl:value-of select="SourceUnitName"/></TD>
|
|
|
-</TR>
|
|
|
-<TR>
|
|
|
- <TD valign="top" class="title">LineNumber:</TD>
|
|
|
- <TD valign="top" class="resultmessage"><xsl:value-of select="LineNumber"/></TD>
|
|
|
-</TR>
|
|
|
-<TR>
|
|
|
- <TD valign="top" class="title">Method Name:</TD>
|
|
|
- <TD valign="top" class="resultmessage"><xsl:value-of select="FailedMethodName"/></TD>
|
|
|
-</TR>
|
|
|
-</table>
|
|
|
-</xsl:for-each>
|
|
|
-</div> <!-- errors -->
|
|
|
-</xsl:template>
|
|
|
+<!--
|
|
|
+**********************************************************************
|
|
|
+ Represents the actual test.
|
|
|
+**********************************************************************
|
|
|
+-->
|
|
|
+ <xsl:template match="Test">
|
|
|
+ <table border="0" cellspacing="1" cellpadding="0">
|
|
|
+ <tr>
|
|
|
+ <!-- highlight the test result -->
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="@Result = 'Error'">
|
|
|
+ <td width="{$param-shift-width}" class="error_"> </td>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:when test="@Result = 'Failed'">
|
|
|
+ <td width="{$param-shift-width}" class="failure_"> </td>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <td width="{$param-shift-width}"> </td>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ <td class="success">
|
|
|
+ <!-- Set class attribute based on test result -->
|
|
|
+ <xsl:if test="@Result = 'Error'">
|
|
|
+ <xsl:attribute name="class">error</xsl:attribute>
|
|
|
+ </xsl:if>
|
|
|
+ <xsl:if test="@Result = 'Failed'">
|
|
|
+ <xsl:attribute name="class">failure</xsl:attribute>
|
|
|
+ </xsl:if>
|
|
|
+ <a class="leaf">
|
|
|
+ <xsl:attribute name="onclick">toggle(this)</xsl:attribute>
|
|
|
+ <!-- if it is the last leaf, print a different image for the link to the folder-->
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="($param-expand-errors-and-failures='false') and ((@Result = 'Error') or (@Result = 'Failed'))">
|
|
|
+ <img src="{$param-img-directory}plus.gif" alt=""/>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:when test="($param-expand-errors-and-failures='true') and ((@Result = 'Error') or (@Result = 'Failed'))">
|
|
|
+ <img src="{$param-img-directory}minus.gif" alt=""/>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:when test="position()=last()">
|
|
|
+ <img src="{$param-img-directory}lastlink.gif" alt=""/>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <img src="{$param-img-directory}link.gif" alt=""/>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+
|
|
|
+ <img src="{$param-img-directory}testcase.gif" alt="">
|
|
|
+ <!-- if the attribut alt is present-->
|
|
|
+ <xsl:if test="@ElapsedTime">
|
|
|
+ <!-- if Netscape / Mozilla -->
|
|
|
+ <xsl:if test="$param-is-netscape='true'">
|
|
|
+ <xsl:attribute name="title"><xsl:value-of select="@ElapsedTime"/></xsl:attribute>
|
|
|
+ </xsl:if>
|
|
|
+ <!-- if Internet Explorer -->
|
|
|
+ <xsl:if test="$param-is-netscape='false'">
|
|
|
+ <xsl:attribute name="alt"><xsl:value-of select="@ElapsedTime"/></xsl:attribute>
|
|
|
+ </xsl:if>
|
|
|
+ </xsl:if>
|
|
|
+ </img>
|
|
|
+
|
|
|
+ <!-- Text background can be highlighted based on the test results -->
|
|
|
+<!-- <xsl:choose>
|
|
|
+ <xsl:when test="@Result = 'Error'">
|
|
|
+ <span class="node_error"><xsl:value-of select="@Name"/></span>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:when test="@Result = 'Failed'">
|
|
|
+ <span class="node_failure"><xsl:value-of select="@Name"/></span>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <span class="node_success"><xsl:value-of select="@Name"/></span>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+-->
|
|
|
+ <span class="node_success"><xsl:value-of select="@Name"/></span>
|
|
|
+ </a>
|
|
|
+ <!-- Show test result if they exist -->
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="@Result = 'Error'">
|
|
|
+ <xsl:call-template name="error_results"></xsl:call-template>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:when test="@Result = 'Failed'">
|
|
|
+ <xsl:call-template name="failed_results"></xsl:call-template>
|
|
|
+ </xsl:when>
|
|
|
+ </xsl:choose>
|
|
|
+
|
|
|
+ </td>
|
|
|
+ <td width="150" align="right" class="success">
|
|
|
+ <!-- Set class attribute based on test result -->
|
|
|
+ <xsl:if test="@Result = 'Error'">
|
|
|
+ <xsl:attribute name="class">error</xsl:attribute>
|
|
|
+ </xsl:if>
|
|
|
+ <xsl:if test="@Result = 'Failed'">
|
|
|
+ <xsl:attribute name="class">failure</xsl:attribute>
|
|
|
+ </xsl:if>
|
|
|
+
|
|
|
+ <xsl:value-of select="@ElapsedTime"/>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ </xsl:template>
|
|
|
+
|
|
|
+
|
|
|
+ <xsl:template name="error_results">
|
|
|
+ <div style="display:none">
|
|
|
+ <xsl:if test="$param-expand-errors-and-failures='true'">
|
|
|
+ <xsl:attribute name="style">display:block;</xsl:attribute>
|
|
|
+ </xsl:if>
|
|
|
+
|
|
|
+ <table border="0">
|
|
|
+ <!-- Error Table Body -->
|
|
|
+ <TR>
|
|
|
+ <td width="{$param-shift-width}"> </td>
|
|
|
+ <TD width="200" valign="top" class="title">Message:</TD>
|
|
|
+ <TD valign="top" class="resultmessage"><xsl:value-of select="Message"/></TD>
|
|
|
+ </TR>
|
|
|
+ <TR>
|
|
|
+ <td width="{$param-shift-width}"> </td>
|
|
|
+ <TD valign="top" class="title">Exception Class:</TD>
|
|
|
+ <TD valign="top" class="resultmessage"><xsl:value-of select="ExceptionClass"/></TD>
|
|
|
+ </TR>
|
|
|
+ <TR>
|
|
|
+ <td width="{$param-shift-width}"> </td>
|
|
|
+ <TD valign="top" class="title">Exception Message:</TD>
|
|
|
+ <TD valign="top" class="resultmessage"><xsl:value-of select="ExceptionMessage"/></TD>
|
|
|
+ </TR>
|
|
|
+ <TR>
|
|
|
+ <td width="{$param-shift-width}"> </td>
|
|
|
+ <TD valign="top" class="title">UnitName:</TD>
|
|
|
+ <TD valign="top" class="resultmessage"><xsl:value-of select="SourceUnitName"/></TD>
|
|
|
+ </TR>
|
|
|
+ <TR>
|
|
|
+ <td width="{$param-shift-width}"> </td>
|
|
|
+ <TD valign="top" class="title">LineNumber:</TD>
|
|
|
+ <TD valign="top" class="resultmessage"><xsl:value-of select="LineNumber"/></TD>
|
|
|
+ </TR>
|
|
|
+ <TR>
|
|
|
+ <td width="{$param-shift-width}"> </td>
|
|
|
+ <TD valign="top" class="title">Method Name:</TD>
|
|
|
+ <TD valign="top" class="resultmessage"><xsl:value-of select="FailedMethodName"/></TD>
|
|
|
+ </TR>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ </xsl:template>
|
|
|
+
|
|
|
+
|
|
|
+ <xsl:template name="failed_results">
|
|
|
+ <div style="display:none">
|
|
|
+ <xsl:if test="$param-expand-errors-and-failures='true'">
|
|
|
+ <xsl:attribute name="style">display:block;</xsl:attribute>
|
|
|
+ </xsl:if>
|
|
|
+
|
|
|
+ <table border="0">
|
|
|
+ <!-- Error Table Body -->
|
|
|
+ <tr>
|
|
|
+ <td width="{$param-shift-width}"> </td>
|
|
|
+ <td width="200" valign="top" class="title">Message:</td>
|
|
|
+ <td valign="top" class="resultmessage"><xsl:value-of select="Message"/></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td width="{$param-shift-width}"> </td>
|
|
|
+ <td valign="top" class="title">Exception Class:</td>
|
|
|
+ <td valign="top" class="resultmessage"><xsl:value-of select="ExceptionClass"/></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td width="{$param-shift-width}"> </td>
|
|
|
+ <td valign="top" class="title">Exception Message:</td>
|
|
|
+ <td valign="top" class="resultmessage"><xsl:value-of select="ExceptionMessage"/></td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ </xsl:template>
|
|
|
|
|
|
|
|
|
+ <xsl:template name="replace-string">
|
|
|
+ <xsl:param name="text"/>
|
|
|
+ <xsl:param name="from"/>
|
|
|
+ <xsl:param name="to"/>
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="contains($text, $from)">
|
|
|
+ <xsl:variable name="before" select="substring-before($text, $from)"/>
|
|
|
+ <xsl:variable name="after" select="substring-after($text, $from)"/>
|
|
|
+ <xsl:variable name="prefix" select="concat($before, $to)"/>
|
|
|
+ <xsl:value-of select="$before"/>
|
|
|
+ <xsl:value-of select="$to"/>
|
|
|
+ <xsl:call-template name="replace-string">
|
|
|
+ <xsl:with-param name="text" select="$after"/>
|
|
|
+ <xsl:with-param name="from" select="$from"/>
|
|
|
+ <xsl:with-param name="to" select="$to"/>
|
|
|
+ </xsl:call-template>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <xsl:value-of select="$text"/>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:template>
|
|
|
|
|
|
</xsl:stylesheet>
|