Git: no need to clone the whole history
[ci.git] / hbuild / web / report.xsl
blobbbdf71164a4fcc1b85277906fcd8387324758cd8
1 <!--
2 - Copyright (c) 2017 Vojtech Horky
3 - All rights reserved.
5 - Redistribution and use in source and binary forms, with or without
6 - modification, are permitted provided that the following conditions
7 - are met:
9 - - Redistributions of source code must retain the above copyright
10 - notice, this list of conditions and the following disclaimer.
11 - - Redistributions in binary form must reproduce the above copyright
12 - notice, this list of conditions and the following disclaimer in the
13 - documentation and/or other materials provided with the distribution.
14 - - The name of the author may not be used to endorse or promote products
15 - derived from this software without specific prior written permission.
17 - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 - IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 -->
28 <xsl:stylesheet version="1.0"
29 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
30 xmlns="http://www.w3.org/1999/xhtml">
32 <xsl:import href="common.xsl" />
34 <xsl:output
35 method="xml"
36 indent="yes"
37 omit-xml-declaration="yes"
38 doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
39 doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
42 <xsl:key name="by-arch" match="/build/*" use="@arch" />
43 <xsl:key name="by-harbour" match="/build/*" use="@package" />
44 <xsl:key name="by-scenario" match="/build/*" use="@scenario" />
46 <xsl:variable name="LINK_TO_TOP">
47 <span class="back-to-top"><a href="#top-of-page">(back to top)</a></span>
48 </xsl:variable>
51 <xsl:template match="build">
52 <xsl:variable name="BUILD" select="." />
53 <xsl:call-template name="HTML_PAGE">
54 <xsl:with-param name="TITLE">
55 <xsl:text>HelenOS CI (build </xsl:text>
56 <xsl:value-of select="@number" />
57 <xsl:text>)</xsl:text>
58 </xsl:with-param>
59 <xsl:with-param name="EXTRA_HEAD">
60 <script type="text/javascript" language="JavaScript">
61 $( document ).ready(function() {
62 $(".logdump").hide();
63 });
64 function showHideLog(link, target) {
65 target = $(link).parents("table").find("." + target)
66 if (target.is(":hidden")) {
67 target.show();
68 $(link).text("hide");
69 } else {
70 target.hide();
71 $(link).text("tail");
73 return false;
75 </script>
76 </xsl:with-param>
77 <xsl:with-param name="BODY">
78 <div id="centeredd">
80 <h1 id="top-of-page">HelenOS continuous integration testing</h1>
81 <h2 id="build-info">
82 Build <xsl:value-of select="@number" /> from <xsl:value-of select="buildinfo/@started" />
83 (<xsl:apply-templates select="buildinfo" mode="duration" />)
84 </h2>
85 <div id="summary">
86 <h2>Summary results</h2>
87 <xsl:apply-templates select="." mode="html-summary-table" />
88 </div>
90 <div id="quick-links" class="buttonset">
91 <h2>Quick links</h2>
93 <div class="quick-link-group">
94 <h3>Miscellaneous</h3>
95 <ul>
96 <li><a href="#matrix">Summary matrix</a></li>
97 <li><a href="#failures">List of failed tasks</a></li>
98 <xsl:if test="helenos-build">
99 <li><a href="#helenos">HelenOS</a></li>
100 </xsl:if>
101 </ul>
102 </div>
104 <xsl:if test="count(*[@arch]) &gt; 0">
105 <div class="quick-link-group">
106 <h3>Architectures</h3>
107 <ul>
108 <xsl:for-each select="*[@arch and count(. | key('by-arch', @arch)[parent::build = $BUILD][1]) = 1]">
109 <xsl:sort select="@arch" />
110 <xsl:variable name="ARCH" select="@arch" />
111 <li><a href="#arch-{$ARCH}"><xsl:value-of select="$ARCH" /></a></li>
112 </xsl:for-each>
113 </ul>
114 </div>
115 </xsl:if>
117 <xsl:if test="count(*[@package]) &gt; 0">
118 <div class="quick-link-group">
119 <h3>Harbours</h3>
120 <ul>
121 <xsl:for-each select="*[@package and count(. | key('by-harbour', @package)[parent::build = $BUILD][1]) = 1]">
122 <xsl:sort select="@package" />
123 <xsl:variable name="PKG" select="@package" />
124 <li><a href="#harbour-{$PKG}"><xsl:value-of select="$PKG" /></a></li>
125 </xsl:for-each>
126 </ul>
127 </div>
128 </xsl:if>
130 <xsl:if test="count(*[@scenario]) &gt; 0">
131 <div class="quick-link-group">
132 <h3>Testing scenarios</h3>
133 <ul>
134 <xsl:for-each select="*[@scenario and count(. | key('by-scenario', @scenario)[parent::build = $BUILD][1]) = 1]">
135 <xsl:sort select="@scenario" />
136 <xsl:variable name="SCENARIO" select="@scenario" />
137 <li><a href="#scenario-{$SCENARIO}"><xsl:value-of select="$SCENARIO" /></a></li>
138 </xsl:for-each>
139 </ul>
140 </div>
141 </xsl:if>
143 </div>
145 <h2 id="matrix">Summary matrix<xsl:copy-of select="$LINK_TO_TOP" /></h2>
146 <table class="matrix">
147 <thead>
148 <tr>
149 <th></th>
150 <xsl:for-each select="*[@arch and count(. | key('by-arch', @arch)[parent::build = $BUILD][1]) = 1]">
151 <xsl:sort select="@arch" />
152 <th>
153 <a href="#arch-{@arch}">
154 <xsl:apply-templates select="@arch" mode="architecture-with-hyphens" />
155 </a>
156 </th>
157 </xsl:for-each>
158 </tr>
159 </thead>
160 <tbody>
161 <tr>
162 <th>
163 <a href="#helenos">HelenOS</a>
164 </th>
165 <xsl:for-each select="*[@arch and count(. | key('by-arch', @arch)[parent::build = $BUILD][1]) = 1]">
166 <xsl:sort select="@arch" />
167 <xsl:variable name="ARCH" select="@arch" />
168 <xsl:variable name="RESULT" select="//helenos-build[@arch=$ARCH]" />
169 <td class="result-{$RESULT/@result}"><xsl:apply-templates select="$RESULT" mode="log-link-matrix" /></td>
170 </xsl:for-each>
171 </tr>
172 <xsl:for-each select="*[@package and count(. | key('by-harbour', @package)[parent::build = $BUILD][1]) = 1]">
173 <xsl:sort select="@package" />
174 <xsl:variable name="PKG" select="@package" />
175 <tr>
176 <th>
177 <a href="#harbour-{$PKG}">
178 <xsl:value-of select="$PKG" />
179 </a>
180 </th>
181 <xsl:for-each select="//*[@arch and count(. | key('by-arch', @arch)[parent::build = $BUILD][1]) = 1]">
182 <xsl:sort select="@arch" />
183 <xsl:variable name="ARCH" select="@arch" />
184 <xsl:variable name="RESULT" select="//harbour-build[@arch=$ARCH and @package=$PKG]" />
185 <xsl:choose>
186 <xsl:when test="$RESULT">
187 <td class="result-{$RESULT/@result}"><xsl:apply-templates select="$RESULT" mode="log-link-matrix" /></td>
188 </xsl:when>
189 <xsl:otherwise>
190 <td class="result-na">N/A</td>
191 </xsl:otherwise>
192 </xsl:choose>
193 </xsl:for-each>
194 </tr>
195 </xsl:for-each>
196 <xsl:for-each select="*[@scenario and count(. | key('by-scenario', @scenario)[parent::build = $BUILD][1]) = 1]">
197 <xsl:sort select="@scenario" />
198 <xsl:variable name="SCENARIO" select="@scenario" />
199 <tr>
200 <th style="white-space: nowrap;">
201 <a title="{$SCENARIO}" href="#scenario-{$SCENARIO}">
202 <xsl:value-of select="$SCENARIO" />
203 </a>
204 </th>
205 <xsl:for-each select="//*[@arch and count(. | key('by-arch', @arch)[parent::build = $BUILD][1]) = 1]">
206 <xsl:sort select="@arch" />
207 <xsl:variable name="ARCH" select="@arch" />
208 <xsl:variable name="RESULT" select="//test[@arch=$ARCH and @scenario=$SCENARIO]" />
209 <xsl:choose>
210 <xsl:when test="$RESULT">
211 <td class="result-{$RESULT/@result}"><xsl:apply-templates select="$RESULT" mode="log-link-matrix" /></td>
212 </xsl:when>
213 <xsl:otherwise>
214 <td class="result-na">N/A</td>
215 </xsl:otherwise>
216 </xsl:choose>
217 </xsl:for-each>
218 </tr>
219 </xsl:for-each>
220 </tbody>
221 </table>
223 <h2>Miscellaneous</h2>
224 <h3 id="failures">List of failed tasks <xsl:copy-of select="$LINK_TO_TOP" /></h3>
225 <xsl:choose>
226 <xsl:when test="count(*[@result='fail']) = 0">
227 <p>There were no failures.</p>
228 </xsl:when>
229 <xsl:otherwise>
230 <table>
231 <thead>
232 <tr>
233 <th width="25%">Task</th>
234 <th width="25%">Component</th>
235 <th width="20%">Architecture</th>
236 <th width="20%">Log</th>
237 <th width="10%">Duration</th>
238 </tr>
239 </thead>
240 <tbody>
241 <xsl:for-each select="checkout[@result='fail']">
242 <xsl:sort select="@repository" />
243 <xsl:apply-templates select="." mode="html-failed-task-table-row" />
244 </xsl:for-each>
245 <xsl:apply-templates select="harbour-check[@result='fail']" mode="html-failed-task-table-row" />
246 <xsl:for-each select="helenos-build[@result='fail']">
247 <xsl:sort select="@arch" />
248 <xsl:apply-templates select="." mode="html-failed-task-table-row" />
249 </xsl:for-each>
250 <xsl:for-each select="harbour-fetch[@result='fail']">
251 <xsl:sort select="@package" />
252 <xsl:apply-templates select="." mode="html-failed-task-table-row" />
253 </xsl:for-each>
254 <xsl:for-each select="harbour-build[@result='fail']">
255 <xsl:sort select="@package" />
256 <xsl:sort select="@arch" />
257 <xsl:apply-templates select="." mode="html-failed-task-table-row" />
258 </xsl:for-each>
259 <xsl:for-each select="helenos-extra-build[@result='fail']">
260 <xsl:sort select="@arch" />
261 <xsl:sort select="@packages" />
262 <xsl:apply-templates select="." mode="html-failed-task-table-row" />
263 </xsl:for-each>
264 <xsl:for-each select="test[@result='fail']">
265 <xsl:sort select="@scenario" />
266 <xsl:sort select="@arch" />
267 <xsl:apply-templates select="." mode="html-failed-task-table-row" />
268 </xsl:for-each>
269 <!-- xsl:apply-templates select="*[@result='fail']" mode="html-failed-task-table-row" /-->
270 </tbody>
271 </table>
272 </xsl:otherwise>
273 </xsl:choose>
275 <xsl:if test="helenos-build">
276 <h3 id="helenos">HelenOS <xsl:copy-of select="$LINK_TO_TOP" /></h3>
277 <table>
278 <thead>
279 <tr>
280 <th width="25%">Architecture</th>
281 <th width="10%">Result</th>
282 <th width="35%">Download</th>
283 <th width="20%">Log</th>
284 <th width="10%">Duration</th>
285 </tr>
286 </thead>
287 <tbody>
288 <xsl:if test="browsable-sources-global">
289 <tr class="result-{browsable-sources-global/@result}">
290 <td>
291 <xsl:text disable-output-escaping="yes"><![CDATA[&mdash;]]></xsl:text>
292 </td>
293 <td>
294 <xsl:apply-templates select="browsable-sources-global" mode="yes-no" />
295 </td>
296 <td>
297 <xsl:apply-templates select="browsable-sources-global" mode="download" />
298 </td>
299 <td>
300 <xsl:apply-templates select="browsable-sources-global" mode="log-link" />
301 </td>
302 <td>
303 <xsl:apply-templates select="browsable-sources-global" mode="duration" />
304 </td>
305 </tr>
306 </xsl:if>
307 <xsl:for-each select="helenos-build">
308 <xsl:sort select="@arch" />
309 <tr class="result-{@result}">
310 <td>
311 <xsl:value-of select="@arch" />
312 </td>
313 <td>
314 <xsl:apply-templates select="." mode="yes-no" />
315 </td>
316 <td>
317 <xsl:apply-templates select="." mode="download" />
318 </td>
319 <td>
320 <xsl:apply-templates select="." mode="log-link" />
321 </td>
322 <td>
323 <xsl:apply-templates select="." mode="duration" />
324 </td>
325 </tr>
326 <xsl:apply-templates select="." mode="log-dump" />
327 </xsl:for-each>
328 </tbody>
329 </table>
330 </xsl:if>
333 <xsl:if test="count(*[@arch]) &gt; 0">
334 <h2>Per-architecture details <xsl:copy-of select="$LINK_TO_TOP" /></h2>
335 <xsl:for-each select="$BUILD/*[@arch and count(. | key('by-arch', @arch)[parent::build = $BUILD][1]) = 1]">
336 <xsl:sort select="@arch" />
337 <xsl:variable name="ARCH" select="@arch" />
338 <h3 id="arch-{$ARCH}"><xsl:value-of select="$ARCH" /><xsl:copy-of select="$LINK_TO_TOP" /></h3>
339 <table>
340 <thead>
341 <tr>
342 <th width="25%">Task</th>
343 <th width="10%">Result</th>
344 <th width="35%">Download</th>
345 <th width="20%">Log</th>
346 <th width="10%">Duration</th>
347 </tr>
348 </thead>
349 <tbody>
350 <tr class="result-{$BUILD/helenos-build[@arch=$ARCH]/@result}">
351 <td>HelenOS</td>
352 <td>
353 <xsl:apply-templates select="$BUILD/helenos-build[@arch=$ARCH]" mode="yes-no" />
354 </td>
355 <td>
356 <xsl:apply-templates select="." mode="download" />
357 </td>
358 <td>
359 <xsl:apply-templates select="$BUILD/helenos-build[@arch=$ARCH]" mode="log-link" />
360 </td>
361 <td>
362 <xsl:apply-templates select="." mode="duration" />
363 </td>
364 </tr>
365 <xsl:apply-templates select="$BUILD/helenos-build[@arch=$ARCH]" mode="log-dump" />
366 <xsl:for-each select="$BUILD/harbour-build[@arch=$ARCH]">
367 <tr class="result-{@result}">
368 <td><xsl:value-of select="@package" /></td>
369 <td>
370 <xsl:apply-templates select="." mode="yes-no" />
371 </td>
372 <td>
373 <xsl:apply-templates select="." mode="download" />
374 </td>
375 <td>
376 <xsl:apply-templates select="." mode="log-link" />
377 </td>
378 <td>
379 <xsl:apply-templates select="." mode="duration" />
380 </td>
381 </tr>
382 <xsl:apply-templates select="." mode="log-dump" />
383 </xsl:for-each>
384 <xsl:for-each select="$BUILD/helenos-extra-build[@arch=$ARCH]">
385 <tr class="result-{@result}">
386 <td>HelenOS with <xsl:value-of select="@harbours" /></td>
387 <td>
388 <xsl:apply-templates select="." mode="yes-no" />
389 </td>
390 <td>
391 <xsl:apply-templates select="." mode="download" />
392 </td>
393 <td>
394 <xsl:apply-templates select="." mode="log-link" />
395 </td>
396 <td>
397 <xsl:apply-templates select="." mode="duration" />
398 </td>
399 </tr>
400 <xsl:apply-templates select="." mode="log-dump" />
401 </xsl:for-each>
402 <xsl:for-each select="$BUILD/test[@arch=$ARCH]">
403 <tr class="result-{@result}">
404 <td><xsl:value-of select="@scenario" /></td>
405 <td>
406 <xsl:apply-templates select="." mode="yes-no" />
407 </td>
408 <td>
409 <xsl:apply-templates select="." mode="download" />
410 </td>
411 <td>
412 <xsl:apply-templates select="." mode="log-link" />
413 </td>
414 <td>
415 <xsl:apply-templates select="." mode="duration" />
416 </td>
417 </tr>
418 <xsl:apply-templates select="." mode="log-dump" />
419 </xsl:for-each>
420 </tbody>
421 </table>
422 </xsl:for-each>
423 </xsl:if>
425 <xsl:if test="count(*[@package]) &gt; 0">
426 <h2>Per-harbour details<xsl:copy-of select="$LINK_TO_TOP" /></h2>
427 <xsl:for-each select="$BUILD/*[@package and count(. | key('by-harbour', @package)[parent::build = $BUILD][1]) = 1]">
428 <xsl:sort select="@package" />
429 <xsl:variable name="PKG" select="@package" />
430 <h3 id="harbour-{$PKG}"><xsl:value-of select="$PKG" /><xsl:copy-of select="$LINK_TO_TOP" /></h3>
431 <table>
432 <thead>
433 <tr>
434 <th width="25%">Architecture</th>
435 <th width="10%">Result</th>
436 <th width="35%">Download</th>
437 <th width="20%">Log</th>
438 <th width="10%">Duration</th>
439 </tr>
440 </thead>
441 <tbody>
442 <tr class="result-{$BUILD/harbour-fetch[@package=$PKG]/@result}">
443 <td><i>Tarball fetch</i></td>
444 <td>
445 <xsl:apply-templates select="$BUILD/harbour-fetch[@package=$PKG]" mode="yes-no" />
446 </td>
447 <td>
448 <xsl:apply-templates select="." mode="download" />
449 </td>
450 <td>
451 <xsl:apply-templates select="$BUILD/harbour-fetch[@package=$PKG]" mode="log-link" />
452 </td>
453 <td>
454 <xsl:apply-templates select="." mode="duration" />
455 </td>
456 </tr>
457 <xsl:apply-templates select="$BUILD/harbour-fetch[@package=$PKG]" mode="log-dump" />
458 <xsl:for-each select="$BUILD/harbour-build[@package=$PKG]">
459 <xsl:sort select="@arch" />
460 <tr class="result-{@result}">
461 <td><xsl:value-of select="@arch" /></td>
462 <td>
463 <xsl:apply-templates select="." mode="yes-no" />
464 </td>
465 <td>
466 <xsl:apply-templates select="." mode="download" />
467 </td>
468 <td>
469 <xsl:apply-templates select="." mode="log-link" />
470 </td>
471 <td>
472 <xsl:apply-templates select="." mode="duration" />
473 </td>
474 </tr>
475 <xsl:apply-templates select="." mode="log-dump" />
476 </xsl:for-each>
477 </tbody>
478 </table>
479 </xsl:for-each>
480 </xsl:if>
482 <xsl:if test="count(*[@scenario]) &gt; 0">
483 <h2>Per-scenario details<xsl:copy-of select="$LINK_TO_TOP" /></h2>
484 <xsl:for-each select="$BUILD/*[@scenario and count(. | key('by-scenario', @scenario)[parent::build = $BUILD][1]) = 1]">
485 <xsl:sort select="@scenario" />
486 <xsl:variable name="SCENARIO" select="@scenario" />
487 <h3 id="scenario-{$SCENARIO}"><xsl:value-of select="$SCENARIO" /><xsl:copy-of select="$LINK_TO_TOP" /></h3>
488 <table>
489 <thead>
490 <tr>
491 <th width="25%">Architecture</th>
492 <th width="10%">Result</th>
493 <th width="35%">Download</th>
494 <th width="20%">Log</th>
495 <th width="10%">Duration</th>
496 </tr>
497 </thead>
498 <tbody>
499 <xsl:for-each select="$BUILD/test[@scenario=$SCENARIO]">
500 <xsl:sort select="@arch" />
501 <tr class="result-{@result}">
502 <td><xsl:value-of select="@arch" /></td>
503 <td>
504 <xsl:apply-templates select="." mode="yes-no" />
505 </td>
506 <td>
507 <xsl:apply-templates select="." mode="download" />
508 </td>
509 <td>
510 <xsl:apply-templates select="." mode="log-link" />
511 </td>
512 <td>
513 <xsl:apply-templates select="." mode="duration" />
514 </td>
515 </tr>
516 <xsl:apply-templates select="." mode="log-dump" />
517 </xsl:for-each>
518 </tbody>
519 </table>
520 </xsl:for-each>
521 </xsl:if>
523 </div>
525 </xsl:with-param>
526 </xsl:call-template>
527 </xsl:template>
529 <xsl:template match="@*" mode="architecture-with-hyphens">
530 <xsl:variable name="PLATFORM" select="substring-before(., '/')" />
531 <xsl:variable name="MACHINE" select="substring-after(., '/')" />
532 <xsl:choose>
533 <xsl:when test="concat($PLATFORM, $MACHINE) = ''">
534 <xsl:value-of select="." />
535 </xsl:when>
536 <xsl:otherwise>
537 <xsl:value-of select="$PLATFORM" />
538 <xsl:text> </xsl:text>
539 <xsl:choose>
540 <xsl:when test="$MACHINE = 'beagleboardxm'">
541 <xsl:text disable-output-escaping="yes"><![CDATA[beagle&shy;board&shy;xm]]></xsl:text>
542 </xsl:when>
543 <xsl:when test="$MACHINE = 'beaglebone'">
544 <xsl:text disable-output-escaping="yes"><![CDATA[beagle&shy;bone]]></xsl:text>
545 </xsl:when>
546 <xsl:when test="$MACHINE = 'malta-be'">
547 <xsl:text disable-output-escaping="yes"><![CDATA[malta&shy;-be]]></xsl:text>
548 </xsl:when>
549 <xsl:when test="$MACHINE = 'malta-le'">
550 <xsl:text disable-output-escaping="yes"><![CDATA[malta&shy;-le]]></xsl:text>
551 </xsl:when>
552 <xsl:when test="$MACHINE = 'integratorcp'">
553 <xsl:text disable-output-escaping="yes"><![CDATA[inte&shy;gra&shy;torcp]]></xsl:text>
554 </xsl:when>
555 <xsl:when test="$MACHINE = 'raspberrypi'">
556 <xsl:text disable-output-escaping="yes"><![CDATA[rasp&shy;ber&shy;ry&shy;pi]]></xsl:text>
557 </xsl:when>
558 <xsl:when test="$MACHINE = 'raspberrypi'">
559 <xsl:text disable-output-escaping="yes"><![CDATA[rasp&shy;ber&shy;ry&shy;pi]]></xsl:text>
560 </xsl:when>
561 <xsl:otherwise>
562 <xsl:value-of select="$MACHINE" />
563 </xsl:otherwise>
564 </xsl:choose>
565 </xsl:otherwise>
566 </xsl:choose>
567 </xsl:template>
569 <xsl:template match="*" mode="yes-no">
570 <xsl:choose>
571 <xsl:when test="@result = 'ok'">
572 <xsl:text>OK</xsl:text>
573 </xsl:when>
574 <xsl:when test="@result = 'fail'">
575 <xsl:text>Failed</xsl:text>
576 </xsl:when>
577 <xsl:when test="@result = 'skip'">
578 <xsl:text>Skipped</xsl:text>
579 </xsl:when>
580 <xsl:otherwise>
581 <xsl:text>? </xsl:text>
582 <code>(<xsl:value-of select="@result" />)</code>
583 </xsl:otherwise>
584 </xsl:choose>
585 </xsl:template>
587 <xsl:template match="*" mode="image-link">
588 <xsl:if test="@image">
589 <a href="{@image}">Image</a>
590 </xsl:if>
591 </xsl:template>
593 <xsl:template match="*" mode="log-link">
594 <xsl:if test="@log">
595 <a href="{@log}">View</a>
596 <xsl:if test="log/logline">
597 (<a href="#" onclick="return showHideLog(this, 'log-{generate-id(.)}');">tail</a>)
598 </xsl:if>
599 </xsl:if>
600 </xsl:template>
602 <xsl:template match="*" mode="log-link-matrix">
603 <xsl:if test="@log">
604 <a href="{@log}"><xsl:apply-templates select="." mode="yes-no" /></a>
605 </xsl:if>
606 </xsl:template>
608 <xsl:template match="*" mode="duration">
609 <xsl:if test="@duration">
610 <xsl:variable name="SECONDS" select="@duration div 1000" />
611 <xsl:variable name="MINUTES" select="floor($SECONDS div 60)" />
612 <xsl:variable name="HOURS" select="floor($MINUTES div 60)" />
613 <xsl:choose>
614 <xsl:when test="$MINUTES &gt; 90">
615 <xsl:value-of select="$HOURS" /><xsl:text disable-output-escaping="yes"><![CDATA[&#8201;]]>h </xsl:text>
616 <xsl:value-of select="format-number($MINUTES - 60 * $HOURS, '#')" /><xsl:text disable-output-escaping="yes"><![CDATA[&#8201;]]>min</xsl:text>
617 </xsl:when>
618 <xsl:when test="$SECONDS &gt; 90">
619 <xsl:value-of select="$MINUTES" /><xsl:text disable-output-escaping="yes"><![CDATA[&#8201;]]>min </xsl:text>
620 <xsl:value-of select="format-number($SECONDS - 60 * $MINUTES, '#')" /><xsl:text disable-output-escaping="yes"><![CDATA[&#8201;]]>s</xsl:text>
621 </xsl:when>
622 <xsl:otherwise>
623 <xsl:value-of select="format-number($SECONDS, '#')" /><xsl:text disable-output-escaping="yes"><![CDATA[&#8201;]]>s</xsl:text>
624 </xsl:otherwise>
625 </xsl:choose>
626 <!-- (<xsl:value-of select="format-number(@duration div 1000, '#.00')" />s) -->
627 </xsl:if>
628 </xsl:template>
630 <xsl:template match="*" mode="log-dump">
631 <xsl:if test="count(log/logline) > 0">
632 <tr class="logdump log-{generate-id(.)}">
633 <td colspan="5">
634 <pre><xsl:for-each select="log/logline">
635 <xsl:value-of select="text()" /><xsl:text>
636 </xsl:text>
637 </xsl:for-each></pre>
638 </td>
639 </tr>
640 </xsl:if>
641 </xsl:template>
643 <xsl:template match="*" mode="download">
644 <xsl:for-each select="file">
645 <a href="{@filename}"><xsl:value-of select="@title" /></a>
646 <xsl:if test="not(last())">, </xsl:if>
647 </xsl:for-each>
648 <xsl:if test="not(file)">
649 <xsl:text disable-output-escaping="yes"><![CDATA[&mdash;]]></xsl:text>
650 </xsl:if>
651 </xsl:template>
655 <xsl:template match="*" mode="html-failed-task-table-row">
656 <tr class="result-fail">
657 <xsl:apply-templates select="." mode="html-failed-task-table-row-inner" />
658 <td>
659 <xsl:apply-templates select="." mode="log-link" />
660 </td>
661 <td>
662 <xsl:apply-templates select="." mode="duration" />
663 </td>
664 </tr>
665 <xsl:apply-templates select="." mode="log-dump" />
666 </xsl:template>
668 <xsl:template match="checkout" mode="html-failed-task-table-row-inner">
669 <td>Repository checkout</td>
670 <td><xsl:value-of select="@repository" /></td>
671 <td><xsl:text disable-output-escaping="yes"><![CDATA[&mdash;]]></xsl:text></td>
672 </xsl:template>
674 <xsl:template match="harbour-check" mode="html-failed-task-table-row-inner">
675 <td>Harbour self-check</td>
676 <td><xsl:text disable-output-escaping="yes"><![CDATA[&mdash;]]></xsl:text></td>
677 <td><xsl:text disable-output-escaping="yes"><![CDATA[&mdash;]]></xsl:text></td>
678 </xsl:template>
680 <xsl:template match="harbour-fetch" mode="html-failed-task-table-row-inner">
681 <td>Tarball fetch</td>
682 <td><xsl:value-of select="@package" /></td>
683 <td><xsl:text disable-output-escaping="yes"><![CDATA[&mdash;]]></xsl:text></td>
684 </xsl:template>
686 <xsl:template match="helenos-build" mode="html-failed-task-table-row-inner">
687 <td>HelenOS</td>
688 <td><xsl:text disable-output-escaping="yes"><![CDATA[&mdash;]]></xsl:text></td>
689 <td><xsl:value-of select="@arch" /></td>
690 </xsl:template>
692 <xsl:template match="harbour-build" mode="html-failed-task-table-row-inner">
693 <td>Harbour build</td>
694 <td><xsl:value-of select="@package" /></td>
695 <td><xsl:value-of select="@arch" /></td>
696 </xsl:template>
698 <xsl:template match="helenos-extra-build" mode="html-failed-task-table-row-inner">
699 <td>Extras build</td>
700 <td>HelenOS and <xsl:value-of select="@packages" /></td>
701 <td><xsl:value-of select="@arch" /></td>
702 </xsl:template>
704 <xsl:template match="test" mode="html-failed-task-table-row-inner">
705 <td>Test in VM</td>
706 <td><xsl:value-of select="@scenario" /></td>
707 <td><xsl:value-of select="@arch" /></td>
708 </xsl:template>
710 <xsl:template match="*" mode="html-failed-task-table-row-inner">
711 <td><xsl:value-of select="name()" /></td>
712 <td><xsl:text disable-output-escaping="yes"><![CDATA[&mdash;]]></xsl:text></td>
713 <td><xsl:text disable-output-escaping="yes"><![CDATA[&mdash;]]></xsl:text></td>
714 </xsl:template>
716 </xsl:stylesheet>