Expand PMF_FN_* macros.
[netbsd-mini2440.git] / external / bsd / atf / dist / data / tests-results.xsl
blob0449afb22b184596bd73f7c42bf14780dd3c4a23
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE xsl:stylesheet [<!ENTITY nbsp "&#160;">]>
4 <!--
5 ++ Automated Testing Framework (atf)
6 ++
7 ++ Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
8 ++ All rights reserved.
9 ++
10 ++ Redistribution and use in source and binary forms, with or without
11 ++ modification, are permitted provided that the following conditions
12 ++ are met:
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.
31 -->
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="/">
54 <xsl:copy>
55 <xsl:apply-templates select="@*|node()" />
56 </xsl:copy>
57 </xsl:template>
59 <xsl:template match="tests-results">
60 <html xmlns="http://www.w3.org/1999/xhtml">
61 <head>
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>
67 </head>
69 <body>
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" />
76 </xsl:if>
77 <xsl:if test="$ntcs-skipped > 0">
78 <xsl:call-template name="skipped-tcs-summary" />
79 </xsl:if>
80 <xsl:call-template name="info-bottom" />
82 <xsl:apply-templates select="tp" mode="details" />
83 </body>
84 </html>
85 </xsl:template>
87 <xsl:template name="info-top">
88 <h2>Execution summary</h2>
90 <table class="summary">
91 <tr>
92 <th><p>Item</p></th>
93 <th><p>Value</p></th>
94 </tr>
96 <tr class="group">
97 <td colspan="2"><p>ATF</p></td>
98 </tr>
99 <tr class="entry">
100 <td><p>Version</p></td>
101 <td><p><xsl:apply-templates
102 select="info[@class = 'atf.version']" /></p></td>
103 </tr>
105 <tr class="group">
106 <td colspan="2"><p>Timings</p></td>
107 </tr>
108 <tr class="entry">
109 <td><p>Start time of tests</p></td>
110 <td><p><xsl:apply-templates
111 select="info[@class = 'time.start']" /></p></td>
112 </tr>
113 <tr class="entry">
114 <td><p>End time of tests</p></td>
115 <td><p><xsl:apply-templates
116 select="info[@class = 'time.end']" /></p></td>
117 </tr>
119 <tr class="group">
120 <td colspan="2"><p>System information</p></td>
121 </tr>
122 <tr class="entry">
123 <td><p>Host name</p></td>
124 <td><p><xsl:apply-templates
125 select="info[@class = 'uname.nodename']" /></p></td>
126 </tr>
127 <tr class="entry">
128 <td><p>Operating system</p></td>
129 <td><p><xsl:apply-templates
130 select="info[@class = 'uname.sysname']" /></p></td>
131 </tr>
132 <tr class="entry">
133 <td><p>Operating system release</p></td>
134 <td><p><xsl:apply-templates
135 select="info[@class = 'uname.release']" /></p></td>
136 </tr>
137 <tr class="entry">
138 <td><p>Operating system version</p></td>
139 <td><p><xsl:apply-templates
140 select="info[@class = 'uname.version']" /></p></td>
141 </tr>
142 <tr class="entry">
143 <td><p>Platform</p></td>
144 <td><p><xsl:apply-templates
145 select="info[@class = 'uname.machine']" /></p></td>
146 </tr>
148 <tr class="group">
149 <td colspan="2"><p>Tests results</p></td>
150 </tr>
151 <tr class="entry">
152 <td><p>Root</p></td>
153 <td><p><xsl:value-of
154 select="info[@class = 'tests.dir']" /></p></td>
155 </tr>
156 <tr class="entry">
157 <td><p>Test programs</p></td>
158 <td class="numeric"><p><xsl:value-of select="$ntps" /></p></td>
159 </tr>
160 <tr class="entry">
161 <td><p>Bogus test programs</p></td>
162 <xsl:choose>
163 <xsl:when test="$ntps-failed > 0">
164 <td class="numeric-error">
165 <p><xsl:value-of select="$ntps-failed" /></p>
166 </td>
167 </xsl:when>
168 <xsl:otherwise>
169 <td class="numeric">
170 <p><xsl:value-of select="$ntps-failed" /></p>
171 </td>
172 </xsl:otherwise>
173 </xsl:choose>
174 </tr>
175 <tr class="entry">
176 <td><p>Test cases</p></td>
177 <td class="numeric"><p><xsl:value-of select="$ntcs" /></p></td>
178 </tr>
179 <tr class="entry">
180 <td><p>Passed test cases</p></td>
181 <td class="numeric"><p><xsl:value-of select="$ntcs-passed" /></p></td>
182 </tr>
183 <tr class="entry">
184 <xsl:choose>
185 <xsl:when test="$ntcs-failed > 0">
186 <td><p><a href="#failed-tcs-summary">Failed test
187 cases</a></p></td>
188 <td class="numeric-error">
189 <p><xsl:value-of select="$ntcs-failed" /></p>
190 </td>
191 </xsl:when>
192 <xsl:otherwise>
193 <td><p>Failed test cases</p></td>
194 <td class="numeric">
195 <p><xsl:value-of select="$ntcs-failed" /></p>
196 </td>
197 </xsl:otherwise>
198 </xsl:choose>
199 </tr>
200 <tr class="entry">
201 <xsl:choose>
202 <xsl:when test="$ntcs-skipped > 0">
203 <td><p><a href="#skipped-tcs-summary">Skipped test
204 cases</a></p></td>
205 <td class="numeric-warning">
206 <p><xsl:value-of select="$ntcs-skipped" /></p>
207 </td>
208 </xsl:when>
209 <xsl:otherwise>
210 <td><p>Skipped test cases</p></td>
211 <td class="numeric">
212 <p><xsl:value-of select="$ntcs-skipped" /></p>
213 </td>
214 </xsl:otherwise>
215 </xsl:choose>
216 </tr>
218 <tr class="group">
219 <td colspan="2"><p><a href="#execution-details">See more execution
220 details</a></p></td>
221 </tr>
222 </table>
223 </xsl:template>
225 <xsl:template name="info-bottom">
226 <a name="execution-details" />
227 <h2 id="execution-details">Execution details</h2>
229 <h3>Environment variables</h3>
231 <ul>
232 <xsl:apply-templates select="info[@class = 'env']">
233 <xsl:sort />
234 </xsl:apply-templates>
235 </ul>
236 </xsl:template>
238 <xsl:template match="info[@class = 'env']">
239 <li>
240 <p><xsl:apply-templates /></p>
241 </li>
242 </xsl:template>
244 <xsl:template name="tcs-summary">
245 <h2>Test cases summary</h2>
247 <table class="tcs-summary">
248 <tr>
249 <th><p>Test case</p></th>
250 <th><p>Result</p></th>
251 <th><p>Reason</p></th>
252 </tr>
253 <xsl:apply-templates select="tp" mode="summary">
254 <xsl:with-param name="which">all</xsl:with-param>
255 </xsl:apply-templates>
256 </table>
257 </xsl:template>
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">
264 <tr>
265 <th><p>Test case</p></th>
266 <th><p>Result</p></th>
267 <th><p>Reason</p></th>
268 </tr>
269 <xsl:apply-templates select="tp" mode="summary">
270 <xsl:with-param name="which">failed</xsl:with-param>
271 </xsl:apply-templates>
272 </table>
273 </xsl:template>
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">
280 <tr>
281 <th><p>Test case</p></th>
282 <th><p>Result</p></th>
283 <th><p>Reason</p></th>
284 </tr>
285 <xsl:apply-templates select="tp" mode="summary">
286 <xsl:with-param name="which">skipped</xsl:with-param>
287 </xsl:apply-templates>
288 </table>
289 </xsl:template>
291 <xsl:template match="tp" mode="summary">
292 <xsl:param name="which" />
294 <xsl:variable name="chosen">
295 <xsl:choose>
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>
301 </xsl:choose>
302 </xsl:variable>
304 <xsl:if test="$chosen = 'yes'">
305 <tr>
306 <td class="tp-id" colspan="3">
307 <p><xsl:value-of select="@id" /></p>
308 </td>
309 </tr>
310 <xsl:apply-templates select="tc" mode="summary">
311 <xsl:with-param name="which" select="$which" />
312 </xsl:apply-templates>
313 </xsl:if>
314 </xsl:template>
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">
323 <xsl:choose>
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>
329 </xsl:choose>
330 </xsl:variable>
332 <xsl:if test="$chosen = 'yes'">
333 <tr>
334 <td class="tc-id">
335 <xsl:choose>
336 <xsl:when test="failed|skipped">
337 <p><a href="#{$full-id}"><xsl:value-of select="@id" /></a></p>
338 </xsl:when>
339 <xsl:otherwise>
340 <p><xsl:value-of select="@id" /></p>
341 </xsl:otherwise>
342 </xsl:choose>
343 </td>
344 <xsl:apply-templates select="passed|failed|skipped" mode="tc" />
345 </tr>
346 </xsl:if>
347 </xsl:template>
349 <xsl:template match="passed" mode="tc">
350 <td class="tcr-passed"><p>Passed</p></td>
351 <td><p>N/A</p></td>
352 </xsl:template>
354 <xsl:template match="failed" mode="tc">
355 <td class="tcr-failed"><p>Failed</p></td>
356 <td><p><xsl:apply-templates /></p></td>
357 </xsl:template>
359 <xsl:template match="skipped" mode="tc">
360 <td class="tcr-skipped"><p>Skipped</p></td>
361 <td><p><xsl:apply-templates /></p></td>
362 </xsl:template>
364 <xsl:template match="tp" mode="details">
365 <xsl:apply-templates select="tc[failed|skipped]" mode="details" />
366 </xsl:template>
368 <xsl:template match="failed" mode="details">
369 <p class="term"><strong>FAILED</strong>: <xsl:apply-templates /></p>
370 </xsl:template>
372 <xsl:template match="skipped" mode="details">
373 <p class="term"><strong>SKIPPED</strong>: <xsl:apply-templates /></p>
374 </xsl:template>
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" />
388 <xsl:if test="so">
389 <h3>Standard output stream</h3>
390 <pre class="so"><xsl:apply-templates select="so" mode="details" /></pre>
391 </xsl:if>
393 <xsl:if test="se">
394 <h3>Standard error stream</h3>
395 <pre class="se"><xsl:apply-templates select="se" mode="details" /></pre>
396 </xsl:if>
397 </xsl:template>
399 <xsl:template match="so" mode="details">
400 <xsl:apply-templates />
401 <xsl:if test="position() != last()">
402 <xsl:text>
403 </xsl:text>
404 </xsl:if>
405 </xsl:template>
407 <xsl:template match="se" mode="details">
408 <xsl:apply-templates />
409 <xsl:if test="position() != last()">
410 <xsl:text>
411 </xsl:text>
412 </xsl:if>
413 </xsl:template>
415 <xsl:template match="@*|node()" priority="-1">
416 <xsl:copy>
417 <xsl:apply-templates select="@*|node()" />
418 </xsl:copy>
419 </xsl:template>
421 </xsl:stylesheet>