1 <?xml version=
"1.0" encoding=
"ISO-8859-1"?>
2 <!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp
" ">]
>
5 ++ Automated Testing Framework (atf)
7 ++ Copyright (c) 2007, 2008 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)" />
53 <xsl:template match=
"/">
55 <xsl:apply-templates select=
"@*|node()" />
59 <xsl:template match=
"tests-results">
60 <html xmlns=
"http://www.w3.org/1999/xhtml">
62 <meta http-equiv=
"Content-Type"
63 content=
"text/html; charset=iso-8859-1" />
64 <link rel=
"stylesheet" type=
"text/css" href=
"{$global.css}" />
66 <title><xsl:value-of select=
"$global.title" /></title>
70 <h1><xsl:value-of select=
"$global.title" /></h1>
72 <xsl:call-template name=
"info-top" />
73 <xsl:call-template name=
"tcs-summary" />
74 <xsl:if test=
"$ntcs-failed > 0">
75 <xsl:call-template name=
"failed-tcs-summary" />
77 <xsl:if test=
"$ntcs-skipped > 0">
78 <xsl:call-template name=
"skipped-tcs-summary" />
80 <xsl:call-template name=
"info-bottom" />
82 <xsl:apply-templates select=
"tp" mode=
"details" />
87 <xsl:template name=
"info-top">
88 <h2>Execution summary
</h2>
90 <table class=
"summary">
97 <td colspan=
"2"><p>ATF
</p></td>
100 <td><p>Version
</p></td>
101 <td><p><xsl:apply-templates
102 select=
"info[@class = 'atf.version']" /></p></td>
106 <td colspan=
"2"><p>Timings
</p></td>
109 <td><p>Start time of tests
</p></td>
110 <td><p><xsl:apply-templates
111 select=
"info[@class = 'time.start']" /></p></td>
114 <td><p>End time of tests
</p></td>
115 <td><p><xsl:apply-templates
116 select=
"info[@class = 'time.end']" /></p></td>
120 <td colspan=
"2"><p>System information
</p></td>
123 <td><p>Host name
</p></td>
124 <td><p><xsl:apply-templates
125 select=
"info[@class = 'uname.nodename']" /></p></td>
128 <td><p>Operating system
</p></td>
129 <td><p><xsl:apply-templates
130 select=
"info[@class = 'uname.sysname']" /></p></td>
133 <td><p>Operating system release
</p></td>
134 <td><p><xsl:apply-templates
135 select=
"info[@class = 'uname.release']" /></p></td>
138 <td><p>Operating system version
</p></td>
139 <td><p><xsl:apply-templates
140 select=
"info[@class = 'uname.version']" /></p></td>
143 <td><p>Platform
</p></td>
144 <td><p><xsl:apply-templates
145 select=
"info[@class = 'uname.machine']" /></p></td>
149 <td colspan=
"2"><p>Tests results
</p></td>
154 select=
"info[@class = 'tests.dir']" /></p></td>
157 <td><p>Test programs
</p></td>
158 <td class=
"numeric"><p><xsl:value-of select=
"$ntps" /></p></td>
161 <td><p>Bogus test programs
</p></td>
163 <xsl:when test=
"$ntps-failed > 0">
164 <td class=
"numeric-error">
165 <p><xsl:value-of select=
"$ntps-failed" /></p>
170 <p><xsl:value-of select=
"$ntps-failed" /></p>
176 <td><p>Test cases
</p></td>
177 <td class=
"numeric"><p><xsl:value-of select=
"$ntcs" /></p></td>
180 <td><p>Passed test cases
</p></td>
181 <td class=
"numeric"><p><xsl:value-of select=
"$ntcs-passed" /></p></td>
185 <xsl:when test=
"$ntcs-failed > 0">
186 <td><p><a href=
"#failed-tcs-summary">Failed test
188 <td class=
"numeric-error">
189 <p><xsl:value-of select=
"$ntcs-failed" /></p>
193 <td><p>Failed test cases
</p></td>
195 <p><xsl:value-of select=
"$ntcs-failed" /></p>
202 <xsl:when test=
"$ntcs-skipped > 0">
203 <td><p><a href=
"#skipped-tcs-summary">Skipped test
205 <td class=
"numeric-warning">
206 <p><xsl:value-of select=
"$ntcs-skipped" /></p>
210 <td><p>Skipped test cases
</p></td>
212 <p><xsl:value-of select=
"$ntcs-skipped" /></p>
219 <td colspan=
"2"><p><a href=
"#execution-details">See more execution
225 <xsl:template name=
"info-bottom">
226 <a name=
"execution-details" />
227 <h2 id=
"execution-details">Execution details
</h2>
229 <h3>Environment variables
</h3>
232 <xsl:apply-templates select=
"info[@class = 'env']">
234 </xsl:apply-templates>
238 <xsl:template match=
"info[@class = 'env']">
240 <p><xsl:apply-templates /></p>
244 <xsl:template name=
"tcs-summary">
245 <h2>Test cases summary
</h2>
247 <table class=
"tcs-summary">
249 <th><p>Test case
</p></th>
250 <th><p>Result
</p></th>
251 <th><p>Reason
</p></th>
253 <xsl:apply-templates select=
"tp" mode=
"summary">
254 <xsl:with-param name=
"which">all
</xsl:with-param>
255 </xsl:apply-templates>
259 <xsl:template name=
"failed-tcs-summary">
260 <a name=
"failed-tcs-summary" />
261 <h2 id=
"failed-tcs-summary">Failed test cases summary
</h2>
263 <table class=
"tcs-summary">
265 <th><p>Test case
</p></th>
266 <th><p>Result
</p></th>
267 <th><p>Reason
</p></th>
269 <xsl:apply-templates select=
"tp" mode=
"summary">
270 <xsl:with-param name=
"which">failed
</xsl:with-param>
271 </xsl:apply-templates>
275 <xsl:template name=
"skipped-tcs-summary">
276 <a name=
"skipped-tcs-summary" />
277 <h2 id=
"skipped-tcs-summary">Skipped test cases summary
</h2>
279 <table class=
"tcs-summary">
281 <th><p>Test case
</p></th>
282 <th><p>Result
</p></th>
283 <th><p>Reason
</p></th>
285 <xsl:apply-templates select=
"tp" mode=
"summary">
286 <xsl:with-param name=
"which">skipped
</xsl:with-param>
287 </xsl:apply-templates>
291 <xsl:template match=
"tp" mode=
"summary">
292 <xsl:param name=
"which" />
294 <xsl:variable name=
"chosen">
296 <xsl:when test=
"$which = 'passed' and tc/passed">yes
</xsl:when>
297 <xsl:when test=
"$which = 'failed' and tc/failed">yes
</xsl:when>
298 <xsl:when test=
"$which = 'skipped' and tc/skipped">yes
</xsl:when>
299 <xsl:when test=
"$which = 'all'">yes
</xsl:when>
300 <xsl:otherwise>no
</xsl:otherwise>
304 <xsl:if test=
"$chosen = 'yes'">
306 <td class=
"tp-id" colspan=
"3">
307 <p><xsl:value-of select=
"@id" /></p>
310 <xsl:apply-templates select=
"tc" mode=
"summary">
311 <xsl:with-param name=
"which" select=
"$which" />
312 </xsl:apply-templates>
316 <xsl:template match=
"tc" mode=
"summary">
317 <xsl:param name=
"which" />
319 <xsl:variable name=
"full-id"
320 select=
"concat(translate(../@id, '/', '_'), '_', @id)" />
322 <xsl:variable name=
"chosen">
324 <xsl:when test=
"$which = 'passed' and ./passed">yes
</xsl:when>
325 <xsl:when test=
"$which = 'failed' and ./failed">yes
</xsl:when>
326 <xsl:when test=
"$which = 'skipped' and ./skipped">yes
</xsl:when>
327 <xsl:when test=
"$which = 'all'">yes
</xsl:when>
328 <xsl:otherwise>no
</xsl:otherwise>
332 <xsl:if test=
"$chosen = 'yes'">
336 <xsl:when test=
"failed|skipped">
337 <p><a href=
"#{$full-id}"><xsl:value-of select=
"@id" /></a></p>
340 <p><xsl:value-of select=
"@id" /></p>
344 <xsl:apply-templates select=
"passed|failed|skipped" mode=
"tc" />
349 <xsl:template match=
"passed" mode=
"tc">
350 <td class=
"tcr-passed"><p>Passed
</p></td>
354 <xsl:template match=
"failed" mode=
"tc">
355 <td class=
"tcr-failed"><p>Failed
</p></td>
356 <td><p><xsl:apply-templates /></p></td>
359 <xsl:template match=
"skipped" mode=
"tc">
360 <td class=
"tcr-skipped"><p>Skipped
</p></td>
361 <td><p><xsl:apply-templates /></p></td>
364 <xsl:template match=
"tp" mode=
"details">
365 <xsl:apply-templates select=
"tc[failed|skipped]" mode=
"details" />
368 <xsl:template match=
"failed" mode=
"details">
369 <p class=
"term"><strong>FAILED
</strong>:
<xsl:apply-templates /></p>
372 <xsl:template match=
"skipped" mode=
"details">
373 <p class=
"term"><strong>SKIPPED
</strong>:
<xsl:apply-templates /></p>
376 <xsl:template match=
"tc" mode=
"details">
377 <xsl:variable name=
"full-id"
378 select=
"concat(translate(../@id, '/', '_'), '_', @id)" />
380 <a name=
"{$full-id}" />
381 <h2 id=
"{$full-id}">Test case:
382 <xsl:value-of select=
"../@id" /><xsl:text>/
</xsl:text>
383 <xsl:value-of select=
"@id" /></h2>
385 <h3>Termination reason
</h3>
386 <xsl:apply-templates select=
"failed|skipped" mode=
"details" />
389 <h3>Standard output stream
</h3>
390 <pre class=
"so"><xsl:apply-templates select=
"so" mode=
"details" /></pre>
394 <h3>Standard error stream
</h3>
395 <pre class=
"se"><xsl:apply-templates select=
"se" mode=
"details" /></pre>
399 <xsl:template match=
"so" mode=
"details">
400 <xsl:apply-templates />
401 <xsl:if test=
"position() != last()">
407 <xsl:template match=
"se" mode=
"details">
408 <xsl:apply-templates />
409 <xsl:if test=
"position() != last()">
415 <xsl:template match=
"@*|node()" priority=
"-1">
417 <xsl:apply-templates select=
"@*|node()" />