Adding new test harness
[platform/core/uifw/dali-toolkit.git] / automated-tests / style / testresult.xsl
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet version="1.0"
3         xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
4         <xsl:output method="html" version="1.0" encoding="UTF-8"
5                 indent="yes" />
6         <xsl:template match="/">
7                 <html>
8                         <STYLE type="text/css">
9                                 @import "./style/tests.css";
10                         </STYLE>
11                         <head>
12                                 <script type="text/javascript" src="./style/jquery.min.js" />
13                                 <script type="text/javascript" src="./style/popup.js" />
14                         </head>
15                         <body>
16                                 <div id="title">
17                                         <table>
18                                                 <tr>
19                                                         <td class="title">
20                                                                 <h1 align="center">Suite Test Results</h1>
21                                                         </td>
22                                                 </tr>
23                                         </table>
24                                 </div>
25                                 <div id="btc">
26                                         <table>
27                                                 <tr>
28                                                         <td>
29                                                                 <a href="#" class="see_all">Show all</a>
30                                                         </td>
31                                                         <td>
32                                                                 <a href="#" class="see_failed">Show only failed</a>
33                                                         </td>
34                                                         <td>
35                                                                 <a href="#" class="see_blocked">Show only blocked</a>
36                                                         </td>
37                                                         <td>
38                                                                 <a href="#" class="see_na">Show only not executed</a>
39                                                         </td>
40                                                         <td>
41                                                                 <a href="summary.xml">Summary</a>
42                                                         </td>
43                                                 </tr>
44                                         </table>
45                                 </div>
46                                 <div id="testcasepage">
47                                         <div id="cases">
48                                                 <div id="see_all">
49                                                         <xsl:for-each select="test_definition/suite">
50                                                                 <xsl:sort select="@name" />
51                                                                 <div id="suite_title">
52                                                                         <h2>
53                                                                                 Test Suite:
54                                                                                 <xsl:value-of select="@name" />
55                                                                                 (All)
56                                                                         </h2>
57                                                                         <a>
58                                                                                 <xsl:attribute name="name">
59                                                                      <xsl:value-of
60                                                                                         select="@name" />
61                                                                   </xsl:attribute>
62                                                                         </a>
63                                                                 </div>
64                                                                 <table>
65                                                                         <tr>
66                                                                                 <th>Case_ID</th>
67                                                                                 <th>Purpose</th>
68                                                                                 <th>Result</th>
69                                                                                 <th>Stderr</th>
70                                                                         </tr>
71                                                                         <xsl:for-each select=".//set">
72                                                                                 <xsl:sort select="@name" />
73                                                                                 <tr>
74                                                                                         <xsl:choose>
75                                                                                                 <xsl:when test="@name">
76                                                                                                         <td colspan="3">
77                                                                                                                 <h3>
78                                                                                                                         Test Set:
79                                                                                                                         <xsl:value-of select="@name" />
80                                                                                                                 </h3>
81                                                                                                         </td>
82                                                                                                         <td colspan="1">
83                                                                                                                 <h4>
84                                                                                                                         <a>
85                                                                                                                                 <xsl:attribute name="href"><xsl:value-of
86                                                                                                                                         select="@set_debug_msg" /></xsl:attribute>
87                                                                                                                                 dlog
88                                                                                                                         </a>
89                                                                                                                 </h4>
90                                                                                                         </td>
91                                                                                                 </xsl:when>
92                                                                                                 <xsl:otherwise>
93                                                                                                         <td colspan="4">
94                                                                                                                 <h3>
95                                                                                                                         Test Set:
96                                                                                                                         <xsl:value-of select="@name" />
97                                                                                                                 </h3>
98                                                                                                         </td>
99                                                                                                 </xsl:otherwise>
100                                                                                         </xsl:choose>
101                                                                                 </tr>
102                                                                                 <xsl:for-each select=".//testcase">
103                                                                                         <xsl:sort select="@id" />
104                                                                                         <tr>
105                                                                                                 <td>
106                                                                                                         <div
107                                                                                                                 style="background-color:#F5DEB3;border:1px solid black;display:none;">
108                                                                                                                 <xsl:attribute name="id"><xsl:value-of
109                                                                                                                         select="@id" /></xsl:attribute>
110                                                                                                                 <p>
111                                                                                                                         <xsl:for-each select="./description/steps//step">
112                                                                                                                                 <xsl:sort select="@order" />
113                                                                                                                                 <B>
114                                                                                                                                         Step
115                                                                                                                                         <xsl:value-of select="@order" />
116                                                                                                                                         :
117                                                                                                                                 </B>
118                                                                                                                                 <br />
119                                                                                                                                 <xsl:value-of select=".//step_desc" />
120                                                                                                                                 <br />
121                                                                                                                                 <B>Expected:</B>
122                                                                                                                                 <xsl:value-of select=".//expected" />
123                                                                                                                                 <br />
124                                                                                                                         </xsl:for-each>
125                                                                                                                 </p>
126                                                                                                                 <p>
127                                                                                                                         <br />
128                                                                                                                         <B>
129                                                                                                                                 Entry:
130                                                                                                                                 <br />
131                                                                                                                         </B>
132                                                                                                                         <xsl:value-of select="./description//test_script_entry" />
133                                                                                                                         <br />
134                                                                                                                 </p>
135                                                                                                         </div>
136                                                                                                         <a href="#" class="test_case_popup">
137                                                                                                                 <xsl:attribute name="id"><xsl:value-of
138                                                                                                                         select="@id" /></xsl:attribute>
139                                                                                                                 <xsl:value-of select="@id" />
140                                                                                                         </a>
141                                                                                                 </td>
142                                                                                                 <td>
143                                                                                                         <xsl:value-of select="@purpose" />
144                                                                                                 </td>
145
146                                                                                                 <xsl:choose>
147                                                                                                         <xsl:when test="@result">
148                                                                                                                 <xsl:if test="@result = 'FAIL'">
149                                                                                                                         <td class="red_rate">
150                                                                                                                                 <xsl:value-of select="@result" />
151                                                                                                                         </td>
152                                                                                                                 </xsl:if>
153                                                                                                                 <xsl:if test="@result = 'PASS'">
154                                                                                                                         <td class="green_rate">
155                                                                                                                                 <xsl:value-of select="@result" />
156                                                                                                                         </td>
157                                                                                                                 </xsl:if>
158                                                                                                                 <xsl:if test="@result = 'BLOCK' ">
159                                                                                                                         <td class="orange_rate">
160                                                                                                                                 BLOCK
161                                                                                                                         </td>
162                                                                                                                 </xsl:if>
163                                                                                                                 <xsl:if
164                                                                                                                         test="@result != 'BLOCK' and @result != 'FAIL' and @result != 'PASS' ">
165                                                                                                                         <td class="gray_rate">
166                                                                                                                                 Not Run
167                                                                                                                         </td>
168                                                                                                                 </xsl:if>
169                                                                                                         </xsl:when>
170                                                                                                         <xsl:otherwise>
171                                                                                                                 <td>
172
173                                                                                                                 </td>
174                                                                                                         </xsl:otherwise>
175                                                                                                 </xsl:choose>
176                                                                                                 <td>
177                                                                                                         <xsl:call-template name="br-replace">
178                                                                                                                 <xsl:with-param name="word"
179                                                                                                                         select=".//result_info/stderr" />
180                                                                                                         </xsl:call-template>
181                                                                                                         <xsl:if test=".//result_info/stderr = ''">
182                                                                                                                 N/A
183                                                                                                         </xsl:if>
184                                                                                                 </td>
185                                                                                         </tr>
186                                                                                 </xsl:for-each>
187                                                                         </xsl:for-each>
188                                                                 </table>
189                                                         </xsl:for-each>
190                                                 </div>
191                                                 <div id="see_fail" style="display:none;">
192                                                         <xsl:for-each select="test_definition/suite">
193                                                                 <xsl:sort select="@name" />
194                                                                 <div id="suite_title">
195                                                                         <h2>
196                                                                                 Test Suite:
197                                                                                 <xsl:value-of select="@name" />
198                                                                                 (Failed only)
199                                                                         </h2>
200                                                                         <a>
201                                                                                 <xsl:attribute name="name">
202                                                                      <xsl:value-of
203                                                                                         select="@name" />
204                                                                   </xsl:attribute>
205                                                                         </a>
206                                                                 </div>
207                                                                 <table>
208                                                                         <tr>
209                                                                                 <th>Case_ID</th>
210                                                                                 <th>Purpose</th>
211                                                                                 <th>Result</th>
212                                                                                 <th>Stderr</th>
213                                                                         </tr>
214                                                                         <xsl:for-each select=".//set">
215                                                                                 <xsl:sort select="@name" />
216                                                                                 <tr>
217                                                                                         <xsl:choose>
218                                                                                                 <xsl:when test="@name">
219                                                                                                         <td colspan="3">
220                                                                                                                 <h3>
221                                                                                                                         Test Set:
222                                                                                                                         <xsl:value-of select="@name" />
223                                                                                                                 </h3>
224                                                                                                         </td>
225                                                                                                         <td colspan="1">
226                                                                                                                 <h4>
227                                                                                                                         <a>
228                                                                                                                                 <xsl:attribute name="href"><xsl:value-of
229                                                                                                                                         select="@set_debug_msg" /></xsl:attribute>
230                                                                                                                                 dlog
231                                                                                                                         </a>
232                                                                                                                 </h4>
233                                                                                                         </td>
234                                                                                                 </xsl:when>
235                                                                                                 <xsl:otherwise>
236                                                                                                         <td colspan="4">
237                                                                                                                 <h3>
238                                                                                                                         Test Set:
239                                                                                                                         <xsl:value-of select="@name" />
240                                                                                                                 </h3>
241                                                                                                         </td>
242                                                                                                 </xsl:otherwise>
243                                                                                         </xsl:choose>
244                                                                                 </tr>
245                                                                                 <xsl:for-each select=".//testcase[@result='FAIL']">
246                                                                                         <xsl:sort select="@id" />
247                                                                                         <tr>
248                                                                                                 <td>
249                                                                                                         <div
250                                                                                                                 style="background-color:#F5DEB3;border:1px solid black;display:none;">
251                                                                                                                 <xsl:attribute name="id">fail_<xsl:value-of
252                                                                                                                         select="@id" /></xsl:attribute>
253                                                                                                                 <p>
254                                                                                                                         <xsl:for-each select="./description/steps//step">
255                                                                                                                                 <xsl:sort select="@order" />
256                                                                                                                                 <B>
257                                                                                                                                         Step
258                                                                                                                                         <xsl:value-of select="@order" />
259                                                                                                                                         :
260                                                                                                                                 </B>
261                                                                                                                                 <br />
262                                                                                                                                 <xsl:value-of select=".//step_desc" />
263                                                                                                                                 <br />
264                                                                                                                                 <B>Expected:</B>
265                                                                                                                                 <xsl:value-of select=".//expected" />
266                                                                                                                                 <br />
267                                                                                                                         </xsl:for-each>
268                                                                                                                 </p>
269                                                                                                                 <p>
270                                                                                                                         <br />
271                                                                                                                         <B>
272                                                                                                                                 Entry:
273                                                                                                                                 <br />
274                                                                                                                         </B>
275                                                                                                                         <xsl:value-of select="./description//test_script_entry" />
276                                                                                                                         <br />
277                                                                                                                 </p>
278                                                                                                         </div>
279                                                                                                         <a href="#" class="test_case_popup">
280                                                                                                                 <xsl:attribute name="id">fail_<xsl:value-of
281                                                                                                                         select="@id" /></xsl:attribute>
282                                                                                                                 <xsl:value-of select="@id" />
283                                                                                                         </a>
284                                                                                                 </td>
285                                                                                                 <td>
286                                                                                                         <xsl:value-of select="@purpose" />
287                                                                                                 </td>
288
289                                                                                                 <td class="red_rate">
290                                                                                                         <xsl:value-of select="@result" />
291                                                                                                 </td>
292                                                                                                 <td>
293                                                                                                         <xsl:call-template name="br-replace">
294                                                                                                                 <xsl:with-param name="word"
295                                                                                                                         select=".//result_info/stderr" />
296                                                                                                         </xsl:call-template>
297                                                                                                         <xsl:if test=".//result_info/stderr = ''">
298                                                                                                                 N/A
299                                                                                                         </xsl:if>
300                                                                                                 </td>
301                                                                                         </tr>
302                                                                                 </xsl:for-each>
303                                                                         </xsl:for-each>
304                                                                 </table>
305                                                         </xsl:for-each>
306                                                 </div>
307                                                 <div id="see_block" style="display:none;">
308                                                         <xsl:for-each select="test_definition/suite">
309                                                                 <xsl:sort select="@name" />
310                                                                 <div id="suite_title">
311                                                                         <h2>
312                                                                                 Test Suite:
313                                                                                 <xsl:value-of select="@name" />
314                                                                                 (Blocked Only)
315                                                                         </h2>
316                                                                         <a>
317                                                                                 <xsl:attribute name="name">
318                                                                      <xsl:value-of
319                                                                                         select="@name" />
320                                                                   </xsl:attribute>
321                                                                         </a>
322                                                                 </div>
323                                                                 <table>
324                                                                         <tr>
325                                                                                 <th>Case_ID</th>
326                                                                                 <th>Purpose</th>
327                                                                                 <th>Result</th>
328                                                                                 <th>Stderr</th>
329                                                                         </tr>
330                                                                         <xsl:for-each select=".//set">
331                                                                                 <xsl:sort select="@name" />
332                                                                                 <tr>
333                                                                                         <xsl:choose>
334                                                                                                 <xsl:when test="@name">
335                                                                                                         <td colspan="3">
336                                                                                                                 <h3>
337                                                                                                                         Test Set:
338                                                                                                                         <xsl:value-of select="@name" />
339                                                                                                                 </h3>
340                                                                                                         </td>
341                                                                                                         <td colspan="1">
342                                                                                                                 <h4>
343                                                                                                                         <a>
344                                                                                                                                 <xsl:attribute name="href"><xsl:value-of
345                                                                                                                                         select="@set_debug_msg" /></xsl:attribute>
346                                                                                                                                 dlog
347                                                                                                                         </a>
348                                                                                                                 </h4>
349                                                                                                         </td>
350                                                                                                 </xsl:when>
351                                                                                                 <xsl:otherwise>
352                                                                                                         <td colspan="4">
353                                                                                                                 <h3>
354                                                                                                                         Test Set:
355                                                                                                                         <xsl:value-of select="@name" />
356                                                                                                                 </h3>
357                                                                                                         </td>
358                                                                                                 </xsl:otherwise>
359                                                                                         </xsl:choose>
360                                                                                 </tr>
361                                                                                 <xsl:for-each select=".//testcase[@result='BLOCK']">
362                                                                                         <xsl:sort select="@id" />
363                                                                                         <tr>
364                                                                                                 <td>
365                                                                                                         <div
366                                                                                                                 style="background-color:#F5DEB3;border:1px solid black;display:none;">
367                                                                                                                 <xsl:attribute name="id">block_<xsl:value-of
368                                                                                                                         select="@id" /></xsl:attribute>
369                                                                                                                 <p>
370                                                                                                                         <xsl:for-each select="./description/steps//step">
371                                                                                                                                 <xsl:sort select="@order" />
372                                                                                                                                 <B>
373                                                                                                                                         Step
374                                                                                                                                         <xsl:value-of select="@order" />
375                                                                                                                                         :
376                                                                                                                                 </B>
377                                                                                                                                 <br />
378                                                                                                                                 <xsl:value-of select=".//step_desc" />
379                                                                                                                                 <br />
380                                                                                                                                 <B>Expected:</B>
381                                                                                                                                 <xsl:value-of select=".//expected" />
382                                                                                                                                 <br />
383                                                                                                                         </xsl:for-each>
384                                                                                                                 </p>
385                                                                                                                 <p>
386                                                                                                                         <br />
387                                                                                                                         <B>
388                                                                                                                                 Entry:
389                                                                                                                                 <br />
390                                                                                                                         </B>
391                                                                                                                         <xsl:value-of select="./description//test_script_entry" />
392                                                                                                                         <br />
393                                                                                                                 </p>
394                                                                                                         </div>
395                                                                                                         <a href="#" class="test_case_popup">
396                                                                                                                 <xsl:attribute name="id">block_<xsl:value-of
397                                                                                                                         select="@id" /></xsl:attribute>
398                                                                                                                 <xsl:value-of select="@id" />
399                                                                                                         </a>
400                                                                                                 </td>
401                                                                                                 <td>
402                                                                                                         <xsl:value-of select="@purpose" />
403                                                                                                 </td>
404
405                                                                                                 <td class="orange_rate">
406                                                                                                         <xsl:value-of select="@result" />
407                                                                                                 </td>
408                                                                                                 <td>
409                                                                                                         <xsl:call-template name="br-replace">
410                                                                                                                 <xsl:with-param name="word"
411                                                                                                                         select=".//result_info/stderr" />
412                                                                                                         </xsl:call-template>
413                                                                                                         <xsl:if test=".//result_info/stderr = ''">
414                                                                                                                 N/A
415                                                                                                         </xsl:if>
416                                                                                                 </td>
417                                                                                         </tr>
418                                                                                 </xsl:for-each>
419                                                                         </xsl:for-each>
420                                                                 </table>
421                                                         </xsl:for-each>
422                                                 </div>
423                                                 <div id="see_na" style="display:none;">
424                                                         <xsl:for-each select="test_definition/suite">
425                                                                 <xsl:sort select="@name" />
426                                                                 <div id="suite_title">
427                                                                         <h2>
428                                                                                 Test Suite:
429                                                                                 <xsl:value-of select="@name" />
430                                                                                 (Not executed Only)
431                                                                         </h2>
432                                                                         <a>
433                                                                                 <xsl:attribute name="name">
434                                                                      <xsl:value-of
435                                                                                         select="@name" />
436                                                                   </xsl:attribute>
437                                                                         </a>
438                                                                 </div>
439                                                                 <table>
440                                                                         <tr>
441                                                                                 <th>Case_ID</th>
442                                                                                 <th>Purpose</th>
443                                                                                 <th>Result</th>
444                                                                                 <th>Stderr</th>
445                                                                         </tr>
446                                                                         <xsl:for-each select=".//set">
447                                                                                 <xsl:sort select="@name" />
448                                                                                 <tr>
449                                                                                         <xsl:choose>
450                                                                                                 <xsl:when test="@name">
451                                                                                                         <td colspan="3">
452                                                                                                                 <h3>
453                                                                                                                         Test Set:
454                                                                                                                         <xsl:value-of select="@name" />
455                                                                                                                 </h3>
456                                                                                                         </td>
457                                                                                                         <td colspan="1">
458                                                                                                                 <h4>
459                                                                                                                         <a>
460                                                                                                                                 <xsl:attribute name="href"><xsl:value-of
461                                                                                                                                         select="@set_debug_msg" /></xsl:attribute>
462                                                                                                                                 dlog
463                                                                                                                         </a>
464                                                                                                                 </h4>
465                                                                                                         </td>
466                                                                                                 </xsl:when>
467                                                                                                 <xsl:otherwise>
468                                                                                                         <td colspan="4">
469                                                                                                                 <h3>
470                                                                                                                         Test Set:
471                                                                                                                         <xsl:value-of select="@name" />
472                                                                                                                 </h3>
473                                                                                                         </td>
474                                                                                                 </xsl:otherwise>
475                                                                                         </xsl:choose>
476                                                                                 </tr>
477                                                                                 <xsl:for-each select=".//testcase[@result='N/A']">
478                                                                                         <xsl:sort select="@id" />
479                                                                                         <tr>
480                                                                                                 <td>
481                                                                                                         <div
482                                                                                                                 style="background-color:#F5DEB3;border:1px solid black;display:none;">
483                                                                                                                 <xsl:attribute name="id">na_<xsl:value-of
484                                                                                                                         select="@id" /></xsl:attribute>
485                                                                                                                 <p>
486                                                                                                                         <xsl:for-each select="./description/steps//step">
487                                                                                                                                 <xsl:sort select="@order" />
488                                                                                                                                 <B>
489                                                                                                                                         Step
490                                                                                                                                         <xsl:value-of select="@order" />
491                                                                                                                                         :
492                                                                                                                                 </B>
493                                                                                                                                 <br />
494                                                                                                                                 <xsl:value-of select=".//step_desc" />
495                                                                                                                                 <br />
496                                                                                                                                 <B>Expected:</B>
497                                                                                                                                 <xsl:value-of select=".//expected" />
498                                                                                                                                 <br />
499                                                                                                                         </xsl:for-each>
500                                                                                                                 </p>
501                                                                                                                 <p>
502                                                                                                                         <br />
503                                                                                                                         <B>
504                                                                                                                                 Entry:
505                                                                                                                                 <br />
506                                                                                                                         </B>
507                                                                                                                         <xsl:value-of select="./description//test_script_entry" />
508                                                                                                                         <br />
509                                                                                                                 </p>
510                                                                                                         </div>
511                                                                                                         <a href="#" class="test_case_popup">
512                                                                                                                 <xsl:attribute name="id">na_<xsl:value-of
513                                                                                                                         select="@id" /></xsl:attribute>
514                                                                                                                 <xsl:value-of select="@id" />
515                                                                                                         </a>
516                                                                                                 </td>
517                                                                                                 <td>
518                                                                                                         <xsl:value-of select="@purpose" />
519                                                                                                 </td>
520
521                                                                                                 <td class="gray_rate">
522                                                                                                         <xsl:value-of select="@result" />
523                                                                                                 </td>
524                                                                                                 <td>
525                                                                                                         <xsl:call-template name="br-replace">
526                                                                                                                 <xsl:with-param name="word"
527                                                                                                                         select=".//result_info/stderr" />
528                                                                                                         </xsl:call-template>
529                                                                                                         <xsl:if test=".//result_info/stderr = ''">
530                                                                                                                 N/A
531                                                                                                         </xsl:if>
532                                                                                                 </td>
533                                                                                         </tr>
534                                                                                 </xsl:for-each>
535                                                                         </xsl:for-each>
536                                                                 </table>
537                                                         </xsl:for-each>
538                                                 </div>
539                                         </div>
540                                 </div>
541                                 <div id="goTopBtn">
542                                         <img border="0" src="./style/back_top.png" />
543                                 </div>
544                                 <script type="text/javascript" src="./style/application.js" />
545                                 <script language="javascript" type="text/javascript">
546                                         $(document).ready(function(){
547                                         goTopEx();
548                                         });
549                                 </script>
550                         </body>
551                 </html>
552         </xsl:template>
553         <xsl:template name="br-replace">
554                 <xsl:param name="word" />
555                 <xsl:variable name="cr">
556                         <xsl:text>\n</xsl:text>
557                 </xsl:variable>
558                 <xsl:choose>
559                         <xsl:when test="contains($word,$cr)">
560                                 <xsl:value-of select="substring-before($word,$cr)" />
561                                 <br />
562                                 <xsl:call-template name="br-replace">
563                                         <xsl:with-param name="word" select="substring-after($word,$cr)" />
564                                 </xsl:call-template>
565                         </xsl:when>
566                         <xsl:otherwise>
567                                 <xsl:value-of select="$word" />
568                         </xsl:otherwise>
569                 </xsl:choose>
570         </xsl:template>
571 </xsl:stylesheet>