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; text-decoration: none; visited: #FF0000; }
80 <script language="JavaScript"><![CDATA[
82 var element = document.getElementById(id);
84 if ( element.style.display == "none" )
85 element.style.display = "block";
87 element.style.display = "none";
90 function collapseall() {
91 var divlist = document.getElementsByName("mod");
92 for (i = 0; i < divlist.length; i++)
94 divlist[i].style.display = "none";
103 <xsl:apply-templates select="//product" mode="test" />
112 <xsl:template match="product" mode="test">
116 <xsl:for-each select="tests/grid">
117 <b>grid <xsl:value-of select="@name" /></b><br/><br/>
119 <xsl:apply-templates select="." mode="test-grid" />
124 <xsl:template match="grid" mode="test-grid">
127 <tr bgcolor="#9acd32">
128 <th width="150">module</th>
129 <th width="100">success</th>
130 <th width="200"></th>
131 <th width="100">total</th>
132 <th width="100">pass</th>
133 <th width="100">failed</th>
134 <th width="100">timeout</th>
135 <th width="100">known failures</th>
136 <th width="100">not run</th>
137 <th width="100">N/A</th>
138 <th width="100">Time</th>
141 <xsl:for-each select="./module">
142 <xsl:variable name="total" select="count(.//test)"/>
143 <xsl:variable name="failureCount" select="count(.//test[@res='KO'])"/>
144 <xsl:variable name="successCount" select="count(.//test[@res='OK'])"/>
145 <xsl:variable name="timeoutCount" select="count(.//test[@res='TIMEOUT'])"/>
146 <xsl:variable name="knownFailures" select="count(.//test[@res='KF'])"/>
147 <xsl:variable name="notApplicable" select="count(.//test[@res='NA'])"/>
148 <xsl:variable name="ignoreCount" select="$total - $successCount - $failureCount - $knownFailures - $notApplicable"/>
149 <xsl:variable name="successRate" select="$successCount div $total"/>
152 <td><a href="#test" class="node" title="voir">
153 <xsl:attribute name="onclick">javascript:collapseall();Toggle('mod_<xsl:value-of select="../@name"/>.<xsl:value-of select="@name"/>');</xsl:attribute>
154 <xsl:attribute name="id">img_<xsl:value-of select="@name"/></xsl:attribute><xsl:value-of select="@name"/> </a>
158 <xsl:call-template name="display-percent">
159 <xsl:with-param name="value" select="$successRate"/>
162 <td width="210px" align="center">
163 <!-- Progress bar -->
164 <xsl:if test="round($successCount * 200 div $total) != 0">
165 <span class="covered">
166 <xsl:attribute name="style">width:<xsl:value-of select="round($successCount * 200 div $total)"/>px</xsl:attribute> 
169 <xsl:if test="round($failureCount * 200 div $total) != 0">
170 <span class="uncovered">
171 <xsl:attribute name="style">width:<xsl:value-of select="round($failureCount * 200 div $total)"/>px</xsl:attribute> 
174 <xsl:if test="round($knownFailures * 200 div $total) != 0">
175 <span class="knownfailure">
176 <xsl:attribute name="style">width:<xsl:value-of select="round($knownFailures * 200 div $total)"/>px</xsl:attribute> 
179 <xsl:if test="round($notApplicable * 200 div $total) != 0">
180 <span class="notApplicable">
181 <xsl:attribute name="style">width:<xsl:value-of select="round($notApplicable * 200 div $total)"/>px</xsl:attribute> 
184 <xsl:if test="round($ignoreCount * 200 div $total) != 0">
185 <span class="ignored">
186 <xsl:attribute name="style">width:<xsl:value-of select="round($ignoreCount * 200 div $total)"/>px</xsl:attribute> 
190 <td align="right"><xsl:value-of select="$total" /></td>
191 <td align="right"><xsl:value-of select="$successCount" /></td>
192 <xsl:call-template name="display-count"><xsl:with-param name="value" select="$failureCount"/></xsl:call-template>
194 <xsl:call-template name="display-count"><xsl:with-param name="value" select="$timeoutCount"/></xsl:call-template>
195 <xsl:call-template name="display-count"><xsl:with-param name="value" select="$knownFailures"/></xsl:call-template>
196 <xsl:call-template name="display-count"><xsl:with-param name="value" select="$ignoreCount"/></xsl:call-template>
197 <xsl:call-template name="display-count"><xsl:with-param name="value" select="$notApplicable"/></xsl:call-template>
198 <td align="right"><xsl:value-of select="format-number(sum(.//test/@exec_time), '0.0')" /></td>
203 <xsl:variable name="GrandTotal" select="count(//test)"/>
204 <xsl:variable name="TotalFailure" select="count(//test[@res='KO'])"/>
205 <xsl:variable name="TotalSuccess" select="count(//test[@res='OK'])"/>
206 <xsl:variable name="TotalTimeout" select="count(//test[@res='TIMEOUT'])"/>
207 <xsl:variable name="TotalKnownFailures" select="count(//test[@res='KF'])"/>
208 <xsl:variable name="TotalNA" select="count(//test[@res='NA'])"/>
209 <xsl:variable name="TotalIgnore" select="$GrandTotal - $TotalSuccess - $TotalFailure - $TotalKnownFailures - $TotalNA"/>
210 <xsl:variable name="TotalSuccessRate" select="$TotalSuccess div $GrandTotal"/>
212 <tr bgcolor="#EF9C9C">
215 <xsl:call-template name="display-percent">
216 <xsl:with-param name="value" select="$TotalSuccessRate"/>
219 <td width="210px" align="center">
220 <xsl:if test="round($TotalSuccess * 200 div $GrandTotal) != 0">
221 <span class="covered">
222 <xsl:attribute name="style">width:<xsl:value-of select="round($TotalSuccess * 200 div $GrandTotal)"/>px</xsl:attribute> 
225 <xsl:if test="round($TotalFailure * 200 div $GrandTotal) != 0">
226 <span class="uncovered">
227 <xsl:attribute name="style">width:<xsl:value-of select="round($TotalFailure * 200 div $GrandTotal)"/>px</xsl:attribute> 
230 <xsl:if test="round($TotalKnownFailures * 200 div $GrandTotal) != 0">
231 <span class="knownfailure">
232 <xsl:attribute name="style">width:<xsl:value-of select="round($TotalKnownFailures * 200 div $GrandTotal)"/>px</xsl:attribute> 
235 <xsl:if test="round($TotalIgnore * 200 div $GrandTotal) != 0">
236 <span class="ignored">
237 <xsl:attribute name="style">width:<xsl:value-of select="round($TotalIgnore * 200 div $GrandTotal)"/>px</xsl:attribute> 
241 <td align="right"><xsl:value-of select="$GrandTotal" /></td>
242 <td align="right"><xsl:value-of select="$TotalSuccess" /></td>
243 <td align="right"><xsl:value-of select="$TotalFailure" /></td>
244 <td align="right"><xsl:value-of select="$TotalTimeout" /></td>
245 <td align="right"><xsl:value-of select="$TotalKnownFailures" /></td>
246 <td align="right"><xsl:value-of select="$TotalIgnore" /></td>
247 <td align="right"><xsl:value-of select="$TotalNA" /></td>
248 <td align="right"><xsl:value-of select="format-number(sum(//test/@exec_time), '0.0')" /></td>
253 <!-- Show details -->
254 <xsl:for-each select="./module">
255 <xsl:sort select="@name" />
256 <xsl:sort select="@type" />
258 <div style="display:none" name="mod"><xsl:attribute name="id">mod_<xsl:value-of select="../@name"/>.<xsl:value-of select="@name"/></xsl:attribute>
259 Tests of module <b><xsl:value-of select="@name"/></b>
261 <tr bgcolor="#9acd32">
262 <th width="100">type</th>
264 <th width="100">result</th>
265 <th width="100">time</th>
268 <xsl:for-each select="./type">
269 <xsl:sort select="@name" />
272 <td align="center"><xsl:attribute name="rowspan"><xsl:value-of select="count(./test)+count(.//callback)+1" /></xsl:attribute>
273 <xsl:value-of select="@name" />
274 <br/>(<xsl:value-of select="format-number(sum(./test/@exec_time), '0')" /> s)
278 <xsl:for-each select="./test">
279 <xsl:sort select="@script" />
282 <xsl:when test="count(./callback) != 0">
284 <td align="left"><xsl:attribute name="class"><xsl:value-of select="@res" /></xsl:attribute><xsl:value-of select="@script" /></td>
285 <td align="center"><xsl:attribute name="class"><xsl:value-of select="@res" /></xsl:attribute><xsl:value-of select="@res" /></td>
286 <td align="right"><xsl:value-of select="format-number(@exec_time, '0.0')" /></td>
289 <td align="left" colspan="3" class="linkification-disabled"><xsl:value-of select="./callback" /></td>
294 <td align="left"><xsl:value-of select="@script" /></td>
295 <td align="center"><xsl:attribute name="class"><xsl:value-of select="@res" /></xsl:attribute><xsl:value-of select="@res" /></td>
296 <td align="right"><xsl:value-of select="format-number(@exec_time, '0.0')" /></td>
300 <xsl:if test="count(./amend) != 0">
302 <td class="ko"><b>Amended</b></td>
303 <td align="left" colspan="3"><xsl:value-of select="./amend" /></td>
315 <xsl:template name="display-percent">
316 <xsl:param name="value"/>
317 <xsl:value-of select="format-number($value, '00.00 %')"/>
320 <xsl:template name="display-count">
321 <xsl:param name="value"/>
323 <xsl:if test="$value > 0">
324 <xsl:value-of select="$value"/>
326 <xsl:if test="$value = 0"><span class="zero">0</span></xsl:if>