1 <?xml version=
"1.0" encoding=
"ISO-8859-1"?>
2 <!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp
" ">]
>
5 ++ Automated Testing Framework (atf)
7 ++ Copyright (c) 2007 The NetBSD Foundation, Inc.
8 ++ All rights reserved.
10 ++ Redistribution and use in source and binary forms, with or without
11 ++ modification, are permitted provided that the following conditions
13 ++ 1. Redistributions of source code must retain the above copyright
14 ++ notice, this list of conditions and the following disclaimer.
15 ++ 2. Redistributions in binary form must reproduce the above copyright
16 ++ notice, this list of conditions and the following disclaimer in the
17 ++ documentation and/or other materials provided with the distribution.
19 ++ THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
20 ++ CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
21 ++ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22 ++ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23 ++ IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
24 ++ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 ++ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
26 ++ GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 ++ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
28 ++ IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29 ++ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
30 ++ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 <xsl:stylesheet version=
"1.0"
34 xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform">
36 <!-- Parameters that can be overriden by the user. -->
37 <xsl:param name=
"global.css">tests-results.css
</xsl:param>
38 <xsl:param name=
"global.title">ATF Tests Results
</xsl:param>
40 <xsl:variable name=
"ntps"
41 select=
"count(tests-results/tp)" />
42 <xsl:variable name=
"ntps-failed"
43 select=
"count(tests-results/tp/failed)" />
44 <xsl:variable name=
"ntcs"
45 select=
"count(tests-results/tp/tc)" />
46 <xsl:variable name=
"ntcs-passed"
47 select=
"count(tests-results/tp/tc/passed)" />
48 <xsl:variable name=
"ntcs-failed"
49 select=
"count(tests-results/tp/tc/failed)" />
50 <xsl:variable name=
"ntcs-skipped"
51 select=
"count(tests-results/tp/tc/skipped)" />
52 <xsl:variable name=
"ntcs-xfail"
53 select=
"count(tests-results/tp/tc/expected_death) +
54 count(tests-results/tp/tc/expected_exit) +
55 count(tests-results/tp/tc/expected_failure) +
56 count(tests-results/tp/tc/expected_signal) +
57 count(tests-results/tp/tc/expected_timeout)" />
59 <xsl:template match=
"/">
61 <xsl:apply-templates select=
"@*|node()" />
65 <xsl:template match=
"tests-results">
66 <html xmlns=
"http://www.w3.org/1999/xhtml">
68 <meta http-equiv=
"Content-Type"
69 content=
"text/html; charset=iso-8859-1" />
70 <link rel=
"stylesheet" type=
"text/css" href=
"{$global.css}" />
72 <title><xsl:value-of select=
"$global.title" /></title>
76 <h1><xsl:value-of select=
"$global.title" /></h1>
78 <xsl:call-template name=
"info-top" />
79 <xsl:call-template name=
"tcs-summary" />
80 <xsl:if test=
"$ntcs-failed > 0">
81 <xsl:call-template name=
"failed-tcs-summary" />
83 <xsl:if test=
"$ntcs-xfail > 0">
84 <xsl:call-template name=
"xfail-tcs-summary" />
86 <xsl:if test=
"$ntcs-skipped > 0">
87 <xsl:call-template name=
"skipped-tcs-summary" />
89 <xsl:if test=
"$ntps-failed > 0">
90 <xsl:call-template name=
"failed-tps-summary" />
92 <xsl:call-template name=
"info-bottom" />
94 <xsl:apply-templates select=
"tp" mode=
"details" />
99 <xsl:template name=
"info-top">
100 <h2>Execution summary
</h2>
102 <table class=
"summary">
104 <th class=
"nobr"><p>Item
</p></th>
105 <th class=
"nobr"><p>Value
</p></th>
109 <td colspan=
"2"><p>ATF
</p></td>
112 <td><p>Version
</p></td>
113 <td><p><xsl:apply-templates
114 select=
"info[@class = 'atf.version']" /></p></td>
118 <td colspan=
"2"><p>Timings
</p></td>
121 <td><p>Start time of tests
</p></td>
122 <td><p><xsl:apply-templates
123 select=
"info[@class = 'time.start']" /></p></td>
126 <td><p>End time of tests
</p></td>
127 <td><p><xsl:apply-templates
128 select=
"info[@class = 'time.end']" /></p></td>
132 <td colspan=
"2"><p>System information
</p></td>
135 <td><p>Host name
</p></td>
136 <td><p><xsl:apply-templates
137 select=
"info[@class = 'uname.nodename']" /></p></td>
140 <td><p>Operating system
</p></td>
141 <td><p><xsl:apply-templates
142 select=
"info[@class = 'uname.sysname']" /></p></td>
145 <td><p>Operating system release
</p></td>
146 <td><p><xsl:apply-templates
147 select=
"info[@class = 'uname.release']" /></p></td>
150 <td><p>Operating system version
</p></td>
151 <td><p><xsl:apply-templates
152 select=
"info[@class = 'uname.version']" /></p></td>
155 <td><p>Platform
</p></td>
156 <td><p><xsl:apply-templates
157 select=
"info[@class = 'uname.machine']" /></p></td>
161 <td colspan=
"2"><p>Tests results
</p></td>
166 select=
"info[@class = 'tests.root']" /></p></td>
169 <td><p>Test programs
</p></td>
170 <td class=
"numeric"><p><xsl:value-of select=
"$ntps" /></p></td>
174 <xsl:when test=
"$ntps-failed > 0">
175 <td><p><a href=
"#failed-tps-summary">Bogus test
176 programs
</a></p></td>
177 <td class=
"numeric-error">
178 <p><xsl:value-of select=
"$ntps-failed" /></p>
182 <td><p>Bogus test programs
</p></td>
184 <p><xsl:value-of select=
"$ntps-failed" /></p>
190 <td><p>Test cases
</p></td>
191 <td class=
"numeric"><p><xsl:value-of select=
"$ntcs" /></p></td>
194 <td><p>Passed test cases
</p></td>
195 <td class=
"numeric"><p><xsl:value-of select=
"$ntcs-passed" /></p></td>
199 <xsl:when test=
"$ntcs-failed > 0">
200 <td><p><a href=
"#failed-tcs-summary">Failed test
202 <td class=
"numeric-error">
203 <p><xsl:value-of select=
"$ntcs-failed" /></p>
207 <td><p>Failed test cases
</p></td>
209 <p><xsl:value-of select=
"$ntcs-failed" /></p>
216 <xsl:when test=
"$ntcs-xfail > 0">
217 <td><p><a href=
"#xfail-tcs-summary">Expected
218 failures
</a></p></td>
219 <td class=
"numeric-warning">
220 <p><xsl:value-of select=
"$ntcs-xfail" /></p>
224 <td><p>Expected failures
</p></td>
226 <p><xsl:value-of select=
"$ntcs-xfail" /></p>
233 <xsl:when test=
"$ntcs-skipped > 0">
234 <td><p><a href=
"#skipped-tcs-summary">Skipped test
236 <td class=
"numeric-warning">
237 <p><xsl:value-of select=
"$ntcs-skipped" /></p>
241 <td><p>Skipped test cases
</p></td>
243 <p><xsl:value-of select=
"$ntcs-skipped" /></p>
250 <td colspan=
"2"><p><a href=
"#execution-details">See more execution
256 <xsl:template name=
"info-bottom">
257 <a name=
"execution-details" />
258 <h2 id=
"execution-details">Execution details
</h2>
260 <h3>Environment variables
</h3>
263 <xsl:apply-templates select=
"info[@class = 'env']">
265 </xsl:apply-templates>
269 <xsl:template match=
"info[@class = 'env']">
271 <p><xsl:apply-templates /></p>
275 <xsl:template name=
"tcs-summary">
276 <h2>Test cases summary
</h2>
278 <table class=
"tcs-summary">
280 <th class=
"nobr"><p>Test case
</p></th>
281 <th class=
"nobr"><p>Result
</p></th>
282 <th class=
"nobr"><p>Reason
</p></th>
283 <th class=
"nobr"><p>Duration
</p></th>
285 <xsl:apply-templates select=
"tp" mode=
"summary">
286 <xsl:with-param name=
"which">all
</xsl:with-param>
287 </xsl:apply-templates>
291 <xsl:template name=
"xfail-tcs-summary">
292 <a name=
"xfail-tcs-summary" />
293 <h2 id=
"xfail-tcs-summary">Expected failures summary
</h2>
295 <table class=
"tcs-summary">
297 <th class=
"nobr"><p>Test case
</p></th>
298 <th class=
"nobr"><p>Result
</p></th>
299 <th class=
"nobr"><p>Reason
</p></th>
300 <th class=
"nobr"><p>Duration
</p></th>
302 <xsl:apply-templates select=
"tp" mode=
"summary">
303 <xsl:with-param name=
"which">xfail
</xsl:with-param>
304 </xsl:apply-templates>
308 <xsl:template name=
"failed-tcs-summary">
309 <a name=
"failed-tcs-summary" />
310 <h2 id=
"failed-tcs-summary">Failed test cases summary
</h2>
312 <table class=
"tcs-summary">
314 <th class=
"nobr"><p>Test case
</p></th>
315 <th class=
"nobr"><p>Result
</p></th>
316 <th class=
"nobr"><p>Reason
</p></th>
317 <th class=
"nobr"><p>Duration
</p></th>
319 <xsl:apply-templates select=
"tp" mode=
"summary">
320 <xsl:with-param name=
"which">failed
</xsl:with-param>
321 </xsl:apply-templates>
325 <xsl:template name=
"failed-tps-summary">
326 <a name=
"failed-tps-summary" />
327 <h2 id=
"failed-tps-summary">Bogus test programs summary
</h2>
329 <table class=
"tcs-summary">
331 <th class=
"nobr">Test program
</th>
333 <xsl:apply-templates select=
"tp" mode=
"summary">
334 <xsl:with-param name=
"which">bogus
</xsl:with-param>
335 </xsl:apply-templates>
339 <xsl:template name=
"skipped-tcs-summary">
340 <a name=
"skipped-tcs-summary" />
341 <h2 id=
"skipped-tcs-summary">Skipped test cases summary
</h2>
343 <table class=
"tcs-summary">
345 <th class=
"nobr"><p>Test case
</p></th>
346 <th class=
"nobr"><p>Result
</p></th>
347 <th class=
"nobr"><p>Reason
</p></th>
348 <th class=
"nobr"><p>Duration
</p></th>
350 <xsl:apply-templates select=
"tp" mode=
"summary">
351 <xsl:with-param name=
"which">skipped
</xsl:with-param>
352 </xsl:apply-templates>
356 <xsl:template match=
"tp" mode=
"summary">
357 <xsl:param name=
"which" />
359 <xsl:variable name=
"chosen">
361 <xsl:when test=
"$which = 'bogus' and failed">yes
</xsl:when>
362 <xsl:when test=
"$which = 'passed' and tc/passed">yes
</xsl:when>
363 <xsl:when test=
"$which = 'failed' and tc/failed">yes
</xsl:when>
364 <xsl:when test=
"$which = 'xfail' and
365 tc/expected_death">yes
</xsl:when>
366 <xsl:when test=
"$which = 'xfail' and
367 tc/expected_exit">yes
</xsl:when>
368 <xsl:when test=
"$which = 'xfail' and
369 tc/expected_failure">yes
</xsl:when>
370 <xsl:when test=
"$which = 'xfail' and
371 tc/expected_signal">yes
</xsl:when>
372 <xsl:when test=
"$which = 'xfail' and
373 tc/expected_timeout">yes
</xsl:when>
374 <xsl:when test=
"$which = 'skipped' and tc/skipped">yes
</xsl:when>
375 <xsl:when test=
"$which = 'all'">yes
</xsl:when>
376 <xsl:otherwise>no
</xsl:otherwise>
380 <xsl:if test=
"$chosen = 'yes'">
382 <td class=
"tp-id" colspan=
"3">
383 <p><xsl:value-of select=
"@id" /></p>
385 <td class=
"tp-numeric">
386 <p><xsl:value-of select=
"tp-time" />s
</p>
389 <xsl:if test=
"$which != 'bogus'">
390 <xsl:apply-templates select=
"tc" mode=
"summary">
391 <xsl:with-param name=
"which" select=
"$which" />
392 </xsl:apply-templates>
397 <xsl:template match=
"tc" mode=
"summary">
398 <xsl:param name=
"which" />
400 <xsl:variable name=
"full-id"
401 select=
"concat(translate(../@id, '/', '_'), '_', @id)" />
403 <xsl:variable name=
"chosen">
405 <xsl:when test=
"$which = 'passed' and ./passed">yes
</xsl:when>
406 <xsl:when test=
"$which = 'failed' and ./failed">yes
</xsl:when>
407 <xsl:when test=
"$which = 'xfail' and
408 ./expected_death">yes
</xsl:when>
409 <xsl:when test=
"$which = 'xfail' and
410 ./expected_exit">yes
</xsl:when>
411 <xsl:when test=
"$which = 'xfail' and
412 ./expected_failure">yes
</xsl:when>
413 <xsl:when test=
"$which = 'xfail' and
414 ./expected_signal">yes
</xsl:when>
415 <xsl:when test=
"$which = 'xfail' and
416 ./expected_timeout">yes
</xsl:when>
417 <xsl:when test=
"$which = 'skipped' and ./skipped">yes
</xsl:when>
418 <xsl:when test=
"$which = 'all'">yes
</xsl:when>
419 <xsl:otherwise>no
</xsl:otherwise>
423 <xsl:if test=
"$chosen = 'yes'">
427 <xsl:when test=
"expected_death|expected_exit|expected_failure|
428 expected_signal|expected_timeout|failed|skipped">
429 <p><a href=
"#{$full-id}"><xsl:value-of select=
"@id" /></a></p>
432 <p><xsl:value-of select=
"@id" /></p>
436 <xsl:apply-templates select=
"expected_death|expected_exit|
437 expected_failure|expected_timeout|
438 expected_signal|failed|passed|
439 skipped" mode=
"tc" />
441 <p><xsl:value-of select=
"tc-time" />s
</p>
447 <xsl:template match=
"passed" mode=
"tc">
448 <td class=
"tcr-passed"><p class=
"nobr">Passed
</p></td>
449 <td class=
"tcr-reason"><p>N/A
</p></td>
452 <xsl:template match=
"expected_death" mode=
"tc">
453 <td class=
"tcr-xfail"><p class=
"nobr">Expected death
</p></td>
454 <td class=
"tcr-reason"><p><xsl:apply-templates /></p></td>
457 <xsl:template match=
"expected_exit" mode=
"tc">
458 <td class=
"tcr-xfail"><p class=
"nobr">Expected exit
</p></td>
459 <td class=
"tcr-reason"><p><xsl:apply-templates /></p></td>
462 <xsl:template match=
"expected_failure" mode=
"tc">
463 <td class=
"tcr-xfail"><p class=
"nobr">Expected failure
</p></td>
464 <td class=
"tcr-reason"><p><xsl:apply-templates /></p></td>
467 <xsl:template match=
"expected_timeout" mode=
"tc">
468 <td class=
"tcr-xfail"><p class=
"nobr">Expected timeout
</p></td>
469 <td class=
"tcr-reason"><p><xsl:apply-templates /></p></td>
472 <xsl:template match=
"expected_signal" mode=
"tc">
473 <td class=
"tcr-xfail"><p class=
"nobr">Expected signal
</p></td>
474 <td class=
"tcr-reason"><p><xsl:apply-templates /></p></td>
477 <xsl:template match=
"failed" mode=
"tc">
478 <td class=
"tcr-failed"><p class=
"nobr">Failed
</p></td>
479 <td class=
"tcr-reason"><p><xsl:apply-templates /></p></td>
482 <xsl:template match=
"skipped" mode=
"tc">
483 <td class=
"tcr-skipped"><p class=
"nobr">Skipped
</p></td>
484 <td class=
"tcr-reason"><p><xsl:apply-templates /></p></td>
487 <xsl:template match=
"tp" mode=
"details">
488 <xsl:apply-templates select=
"tc[expected_death|expected_exit|
489 expected_failure|expected_signal|
490 expected_timeout|failed|skipped]"
494 <xsl:template match=
"failed" mode=
"details">
495 <p class=
"term"><strong>FAILED
</strong>:
<xsl:apply-templates /></p>
498 <xsl:template match=
"expected_death|expected_exit|expected_failure|
499 expected_signal|expected_timeout" mode=
"details">
500 <p class=
"term"><strong>XFAIL
</strong>:
<xsl:apply-templates /></p>
503 <xsl:template match=
"skipped" mode=
"details">
504 <p class=
"term"><strong>SKIPPED
</strong>:
<xsl:apply-templates /></p>
507 <xsl:template match=
"tc" mode=
"details">
508 <xsl:variable name=
"full-id"
509 select=
"concat(translate(../@id, '/', '_'), '_', @id)" />
511 <a name=
"{$full-id}" />
512 <h2 id=
"{$full-id}">Test case:
513 <xsl:value-of select=
"../@id" /><xsl:text>/
</xsl:text>
514 <xsl:value-of select=
"@id" /></h2>
516 <xsl:if test=
"tc-time">
517 <p class=
"details">Duration:
518 <xsl:apply-templates select=
"tc-time" mode=
"details" /></p>
521 <h3>Termination reason
</h3>
522 <xsl:apply-templates select=
"expected_death|expected_exit|expected_failure|
523 expected_signal|expected_timeout|
528 <h3>Standard output stream
</h3>
529 <pre class=
"so"><xsl:apply-templates select=
"so" mode=
"details" /></pre>
533 <h3>Standard error stream
</h3>
534 <pre class=
"se"><xsl:apply-templates select=
"se" mode=
"details" /></pre>
538 <xsl:template match=
"tc-time" mode=
"details">
539 <xsl:apply-templates /> seconds
542 <xsl:template match=
"so" mode=
"details">
543 <xsl:apply-templates />
544 <xsl:if test=
"position() != last()">
550 <xsl:template match=
"se" mode=
"details">
551 <xsl:apply-templates />
552 <xsl:if test=
"position() != last()">
558 <xsl:template match=
"@*|node()" priority=
"-1">
560 <xsl:apply-templates select=
"@*|node()" />