1 <?xml version="1.0" encoding="utf-8"?>
3 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
5 <xsl:template match="/">
8 <title>Tests of <xsl:value-of select="//product/@name" /></title>
9 <style type="text/css">
10 .def { font-family: Arial, Verdana, "Times New Roman", Times, serif;}
11 .OK { background-color:#00FF00; }
12 .KO { background-color:#FF0000; }
13 .KF { background-color:#FFA500; }
14 .NA { background-color:#BBBBBB; }
15 .PASS { background-color:#00FF00; }
16 .FAILED { background-color:#F22000; }
17 .TIMEOUT { background-color:#DFFF00; }
18 .OK2 { color:#00FF00; }
19 .KO2 { color:#F22000; font-weight: bold; }
20 .NA2 { color:#BBBBBB; }
21 .CHECK2 { color:#FFA500; }
22 .ok { color:#00AA00; }
23 .ko { color:#AA0000; }
24 .new { background-color:#FF5500; }
25 .undercontrol { background-color:#AA0000; }
26 .ignored { color:#A0A0A0; }
27 div.pqlist { -moz-column-count: 5;
31 table.pq { width: 100%;
34 border-collapse: collapse;
40 border-collapse:collapse;
44 td.KO2 { border: solid 1px black; padding: 0px; }
45 td.OK2 { border: solid 1px black; padding: 0px; }
46 td { border: solid 1px black; padding: 1px; }
47 h2 { text-align: center; }
48 .legend { font-weight: bold;
51 span.covered { display:-moz-inline-box; display: inline-block;
56 span.uncovered { display:-moz-inline-box; display: inline-block;
61 span.ignored { display:-moz-inline-box; display: inline-block;
66 span.knownfailure { display:-moz-inline-box; display: inline-block;
71 span.notApplicable { display:-moz-inline-box; display: inline-block;
76 span.zero { color: #A0A0A0; }
77 a.node { color: #0000FF }
80 <script language="JavaScript"><![CDATA[
83 var element = document.getElementById(id);
85 if ( element.style.display == "none" )
86 element.style.display = "block";
88 element.style.display = "none";
91 function collapseall() {
92 var divlist = document.getElementsByName("mod");
93 for (i = 0; i < divlist.length; i++)
95 divlist[i].style.display = "none";
98 function collapsealltext() {
99 var divlist = document.getElementsByName("text");
100 for (i = 0; i < divlist.length; i++)
102 divlist[i].style.display = "none";
111 <xsl:apply-templates select="//product" mode="test" />
120 <xsl:template match="product" mode="test">
124 <xsl:for-each select="tests/testbase">
125 <b>test base <xsl:value-of select="@name" /></b><br/><br/>
127 <xsl:apply-templates select="." mode="test-base" />
132 <xsl:template match="testbase" mode="test-base">
135 <tr bgcolor="#9acd32">
136 <th width="150">grid</th>
137 <th width="100">success</th>
138 <th width="200"></th>
139 <th width="100">total</th>
140 <th width="100">pass</th>
141 <th width="100">failed</th>
142 <th width="100">timeout</th>
143 <th width="100">known failures</th>
144 <th width="100">not run</th>
145 <th width="100">N/A</th>
146 <th width="100">Time</th>
149 <xsl:for-each select="./grid">
150 <xsl:variable name="total" select="count(.//test)"/>
151 <xsl:variable name="failureCount" select="count(.//test[@res='KO'])"/>
152 <xsl:variable name="successCount" select="count(.//test[@res='OK'])"/>
153 <xsl:variable name="timeoutCount" select="count(.//test[@res='TIMEOUT'])"/>
154 <xsl:variable name="knownFailures" select="count(.//test[@res='KF'])"/>
155 <xsl:variable name="notApplicable" select="count(.//test[@res='NA'])"/>
156 <xsl:variable name="ignoreCount" select="$total - $successCount - $failureCount - $knownFailures - $notApplicable"/>
157 <xsl:variable name="successRate" select="$successCount div $total"/>
160 <td><a href="#test" class="node" title="voir">
161 <xsl:attribute name="onclick">javascript:collapseall();Toggle('mod_<xsl:value-of select="../@name"/>.<xsl:value-of select="@name"/>');</xsl:attribute>
162 <xsl:attribute name="id">img_<xsl:value-of select="@name"/></xsl:attribute><xsl:value-of select="@name"/> </a>
166 <xsl:call-template name="display-percent">
167 <xsl:with-param name="value" select="$successRate"/>
170 <td width="210px" align="center">
171 <!-- Progress bar -->
172 <xsl:if test="round($successCount * 200 div $total) != 0">
173 <span class="covered">
174 <xsl:attribute name="style">width:<xsl:value-of select="round($successCount * 200 div $total)"/>px</xsl:attribute> 
177 <xsl:if test="round($failureCount * 200 div $total) != 0">
178 <span class="uncovered">
179 <xsl:attribute name="style">width:<xsl:value-of select="round($failureCount * 200 div $total)"/>px</xsl:attribute> 
182 <xsl:if test="round($knownFailures * 200 div $total) != 0">
183 <span class="knownfailure">
184 <xsl:attribute name="style">width:<xsl:value-of select="round($knownFailures * 200 div $total)"/>px</xsl:attribute> 
187 <xsl:if test="round($notApplicable * 200 div $total) != 0">
188 <span class="notApplicable">
189 <xsl:attribute name="style">width:<xsl:value-of select="round($notApplicable * 200 div $total)"/>px</xsl:attribute> 
192 <xsl:if test="round($ignoreCount * 200 div $total) != 0">
193 <span class="ignored">
194 <xsl:attribute name="style">width:<xsl:value-of select="round($ignoreCount * 200 div $total)"/>px</xsl:attribute> 
198 <td align="right"><xsl:value-of select="$total" /></td>
199 <td align="right"><xsl:value-of select="$successCount" /></td>
200 <xsl:call-template name="display-count"><xsl:with-param name="value" select="$failureCount"/></xsl:call-template>
202 <xsl:call-template name="display-count"><xsl:with-param name="value" select="$timeoutCount"/></xsl:call-template>
203 <xsl:call-template name="display-count"><xsl:with-param name="value" select="$knownFailures"/></xsl:call-template>
204 <xsl:call-template name="display-count"><xsl:with-param name="value" select="$ignoreCount"/></xsl:call-template>
205 <xsl:call-template name="display-count"><xsl:with-param name="value" select="$notApplicable"/></xsl:call-template>
206 <td align="right"><xsl:value-of select="format-number(sum(.//test/@exec_time), '0.0')" /></td>
211 <xsl:variable name="GrandTotal" select="count(//test)"/>
212 <xsl:variable name="TotalFailure" select="count(//test[@res='KO'])"/>
213 <xsl:variable name="TotalSuccess" select="count(//test[@res='OK'])"/>
214 <xsl:variable name="TotalTimeout" select="count(//test[@res='TIMEOUT'])"/>
215 <xsl:variable name="TotalKnownFailures" select="count(//test[@res='KF'])"/>
216 <xsl:variable name="TotalNA" select="count(//test[@res='NA'])"/>
217 <xsl:variable name="TotalIgnore" select="$GrandTotal - $TotalSuccess - $TotalFailure - $TotalKnownFailures - $TotalNA"/>
218 <xsl:variable name="TotalSuccessRate" select="$TotalSuccess div $GrandTotal"/>
220 <tr bgcolor="#EF9C9C">
223 <xsl:call-template name="display-percent">
224 <xsl:with-param name="value" select="$TotalSuccessRate"/>
227 <td width="210px" align="center">
228 <xsl:if test="round($TotalSuccess * 200 div $GrandTotal) != 0">
229 <span class="covered">
230 <xsl:attribute name="style">width:<xsl:value-of select="round($TotalSuccess * 200 div $GrandTotal)"/>px</xsl:attribute> 
233 <xsl:if test="round($TotalFailure * 200 div $GrandTotal) != 0">
234 <span class="uncovered">
235 <xsl:attribute name="style">width:<xsl:value-of select="round($TotalFailure * 200 div $GrandTotal)"/>px</xsl:attribute> 
238 <xsl:if test="round($TotalKnownFailures * 200 div $GrandTotal) != 0">
239 <span class="knownfailure">
240 <xsl:attribute name="style">width:<xsl:value-of select="round($TotalKnownFailures * 200 div $GrandTotal)"/>px</xsl:attribute> 
243 <xsl:if test="round($TotalIgnore * 200 div $GrandTotal) != 0">
244 <span class="ignored">
245 <xsl:attribute name="style">width:<xsl:value-of select="round($TotalIgnore * 200 div $GrandTotal)"/>px</xsl:attribute> 
249 <td align="right"><xsl:value-of select="$GrandTotal" /></td>
250 <td align="right"><xsl:value-of select="$TotalSuccess" /></td>
251 <td align="right"><xsl:value-of select="$TotalFailure" /></td>
252 <td align="right"><xsl:value-of select="$TotalTimeout" /></td>
253 <td align="right"><xsl:value-of select="$TotalKnownFailures" /></td>
254 <td align="right"><xsl:value-of select="$TotalIgnore" /></td>
255 <td align="right"><xsl:value-of select="$TotalNA" /></td>
256 <td align="right"><xsl:value-of select="format-number(sum(//test/@exec_time), '0.0')" /></td>
261 <!-- Show details -->
262 <xsl:for-each select="./grid">
263 <xsl:sort select="@name" />
264 <xsl:sort select="@session" />
266 <div style="display:none" name="mod"><xsl:attribute name="id">mod_<xsl:value-of select="../@name"/>.<xsl:value-of select="@name"/></xsl:attribute>
267 Tests of grid <b><xsl:value-of select="@name"/></b>
269 <tr bgcolor="#9acd32">
270 <th width="100">session</th>
272 <th width="100">result</th>
273 <th width="100">time</th>
276 <xsl:for-each select="./session">
277 <xsl:sort select="@name" />
280 <td align="center"><xsl:attribute name="rowspan"><xsl:value-of select="count(./test)+count(.//callback)+1" /></xsl:attribute>
281 <xsl:value-of select="@name" />
282 <br/>(<xsl:value-of select="format-number(sum(./test/@exec_time), '0')" /> s)
286 <xsl:for-each select="./test">
287 <xsl:sort select="@script" />
290 <xsl:when test="count(./callback) != 0">
293 <xsl:attribute name="class"><xsl:value-of select="@res" /></xsl:attribute>
294 <a href="#content" class="node">
295 <xsl:attribute name="onclick">javascript:Toggle('<xsl:value-of select="@script"/>')</xsl:attribute>
296 <xsl:attribute name="title">Click to see the script content</xsl:attribute>
297 <xsl:value-of select="@script" />
300 <a href="#content" class="node">
301 <xsl:attribute name="onclick">javascript:Toggle('<xsl:value-of select="@script"/>log')</xsl:attribute>
302 <xsl:attribute name="title">Click to see the execution log</xsl:attribute>
306 <td align="center"><xsl:attribute name="class"><xsl:value-of select="@res" /></xsl:attribute><xsl:value-of select="@res" /></td>
307 <td align="right"><xsl:value-of select="format-number(@exec_time, '0.0')" /></td>
310 <td align="left" colspan="3" class="linkification-disabled"><xsl:value-of select="./callback" /></td>
316 <a href="#content" class="node">
317 <xsl:attribute name="onclick">javascript:Toggle('<xsl:value-of select="@script"/>')</xsl:attribute>
318 <xsl:attribute name="title">Click to see the script content</xsl:attribute>
319 <xsl:value-of select="@script" />
322 <a href="#content" class="node">
323 <xsl:attribute name="onclick">javascript:Toggle('<xsl:value-of select="@script"/>log')</xsl:attribute>
324 <xsl:attribute name="title">Click to see the execution log</xsl:attribute>
328 <td align="center"><xsl:attribute name="class"><xsl:value-of select="@res" /></xsl:attribute><xsl:value-of select="@res" /></td>
329 <td align="right"><xsl:value-of select="format-number(@exec_time, '0.0')" /></td>
333 <xsl:if test="count(./amend) != 0">
335 <td class="ko"><b>Amended</b></td>
336 <td align="left" colspan="3"><xsl:value-of select="./amend" /></td>
346 <xsl:for-each select="./grid">
347 <xsl:for-each select="./session">
348 <xsl:for-each select="./test">
349 <div style="display:none" name="text"><xsl:attribute name="id"><xsl:value-of select="@script"/></xsl:attribute>
350 <PRE><xsl:value-of select="./content"/></PRE>
352 <div style="display:none" name="text"><xsl:attribute name="id"><xsl:value-of select="@script"/>log</xsl:attribute>
353 <PRE><xsl:value-of select="./out"/></PRE>
361 <xsl:template name="display-percent">
362 <xsl:param name="value"/>
363 <xsl:value-of select="format-number($value, '00.00 %')"/>
366 <xsl:template name="display-count">
367 <xsl:param name="value"/>
369 <xsl:if test="$value > 0">
370 <xsl:value-of select="$value"/>
372 <xsl:if test="$value = 0"><span class="zero">0</span></xsl:if>