File: fpcunit.xsl

package info (click to toggle)
lazarus 2.0.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 214,460 kB
  • sloc: pascal: 1,862,622; xml: 265,709; cpp: 56,595; sh: 3,008; java: 609; makefile: 535; perl: 297; sql: 222; ansic: 137
file content (206 lines) | stat: -rw-r--r-- 6,429 bytes parent folder | download | duplicates (12)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="UTF-8"/>

<xsl:template match="/">
  <xsl:variable name="title" select="TestResults/Title" />
  <html>
  <head>
    <title><xsl:value-of select="$title"/></title>
  	  <style type="text/css" title="fpcUnit" media="screen">
		    @import "fpcunit.css";
	    </style>
  </head>
  <body>

  <a name="Summary"></a>
  <xsl:apply-templates/>

	<address>
		<a href="http://opensoft.homeip.net">fpcUnit Report</a> 0.3.1 © 2006-2007 by 
		<a href="mailto:graemeg@gmail.com?subject=Comments about fpcUnit Report">Graeme Geldenhuys</a>.<br></br>
		Licensed under the <a href="http://www.gnu.org/copyleft/gpl.html">GNU General Public License</a>.<br></br>
		Modified by Vincent Snijders and Darius Blaszyk.<br></br>
	</address>
</body>
</html>
</xsl:template>


<xsl:template match="TestResults">
  <xsl:variable name="runnedCount" select="NumberOfRunnedTests" />
  <xsl:variable name="failureCount" select="NumberOfFailures" />
  <xsl:variable name="errorCount" select="NumberOfErrors" />
  <xsl:variable name="elapsedTime" select="TotalElapsedTime" />
  <xsl:variable name="dateRan" select="DateTimeRan" />
  <xsl:variable name="title" select="Title" />

  <h2><xsl:value-of select="$title"/></h2>
  <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 &gt; 0">
    <tr class="error">
      <td>Summary</td>
      <td><xsl:value-of select="$runnedCount"/></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:when test="$failureCount &gt; 0">
    <tr class="failure">
      <td>Summary</td>
      <td><xsl:value-of select="$runnedCount"/></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">
      <td>Summary</td>
      <td><xsl:value-of select="$runnedCount"/></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:otherwise>
  </xsl:choose>
	</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 name="test_failures"/>
  <xsl:call-template name="test_errors"/>
</xsl:template>


<xsl:template name="test_listing">
  <div id="testlisting">
  <a name="Test_Listing"></a>
	<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">
			<th width="89%" align="left">Name</th>
			<th width="11%" align="left">Elapsed Time<br/>(hh:mm:ss.zzz)</th>
		</tr>
    <xsl:for-each select="TestListing/Test">
    <xsl:variable name="testName" select="@Name" />
    <xsl:variable name="testElapsedTime" select="@ElapsedTime" />
    <tr class="success">
      <td><xsl:value-of select="$testName"/></td>
      <td><xsl:value-of select="$testElapsedTime"/></td>
    </tr>
	  </xsl:for-each>
  </table>
</div>  <!-- testlisting -->
</xsl:template>



<xsl:template name="test_failures">
  <div id="failures">
  <a name="Failures"></a>
  <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>



<xsl:template name="test_errors">
<div id="errors">
  <a name="Errors"></a>
  <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>



</xsl:stylesheet>