arb_gpu_shader_int64: add display list test
[piglit.git] / templates / index.mako
blobf9b453e80e39c9bf9eb93000c114f0c4bb3b358b
1 <%!
2   import os
3   import posixpath  # this must be posixpath, since we want /'s not \'s
4   import re
6   import six
7   from six.moves import range
9   from framework import grouptools, status
11   def group_changes(test, current):
12       group = grouptools.groupname(test)
13       common = grouptools.commonprefix((current, group))
15       common = grouptools.split(common)
16       open = grouptools.split(group)[len(common):]
17       close = grouptools.split(current)[len(common):]
19       return open, close
21   def group_result(result, group):
22       """Get the worst status in a group."""
23       if group not in result.totals:
24           return status.NOTRUN
26       return max([status.status_lookup(s) for s, v in
27                   six.iteritems(result.totals[group]) if v > 0])
29   def group_fraction(result, group):
30       """Get the fraction value for a group."""
31       if group not in result.totals:
32           return '0/0'
34       num = 0
35       den = 0
36       for k, v in six.iteritems(result.totals[group]):
37           if v > 0:
38               s = status.status_lookup(k)
39               num += s.fraction[0] * v
40               den += s.fraction[1] * v
42       return '{}/{}'.format(num, den)
45   def escape_filename(key):
46       """Avoid reserved characters in filenames."""
47       return re.sub(r'[<>:"|?*#]', '_', key)
50   def escape_pathname(key):
51       """ Remove / and \\ from names """
52       return re.sub(r'[/\\]', '_', key)
55   def normalize_href(href):
56       """Force backward slashes in URLs."""
57       return href.replace('\\', '/')
60 <!DOCTYPE html>
61 <html lang="en">
62   <head>
63     <meta charset="UTF-8">
64     <title>Result summary</title>
65     <link rel="stylesheet" href="index.css">
66   </head>
67   <body>
68     <h1>Result summary</h1>
69     <p>Currently showing: ${page}</p>
70     <p>Show:
71       % if page == 'all':
72         all
73       % else:
74         <a href="index.html">all</a>
75       % endif
76       % for i in pages:
77         % if i == page:
78           | ${i}
79         % else:
80           | <a href="${i}.html">${i}</a>
81         % endif
82       % endfor
83     </p>
84     <table>
85       <colgroup>
86         ## Name Column
87         <col />
89         ## Status columns
90         ## Create an additional column for each summary
91         % for _ in range(len(results.results)):
92         <col />
93         % endfor
94       </colgroup>
95       <tr>
96         <th/>
97         % for res in results.results:
98           <th class="head"><b>${res.name}</b><br>\
99           (<a href="${normalize_href(os.path.join(escape_pathname(res.name), 'index.html'))}">info</a>)</th>
100         % endfor
101       </tr>
102       <tr>
103         <td class="head"><b>all</b></td>
104         % for res in results.results:
105           <td class="${group_result(res, 'root')}">
106             <b>${group_fraction(res, 'root')}</b>
107           </td>
108         % endfor
109       </tr>
110       <%
111         depth = 1
112         group = ''
113       %>
114       % for test in sorted(getattr(results.names, page if page == 'all' else 'all_' + page)):
115         <%
116           open, close = group_changes(test, group)
117           depth -= len(close)  # lower the indent for the groups we're not using
118           if close:
119             # remove the groups we're not using from current
120             group = grouptools.split(group)[:-len(close)]
121             if group:
122               group = grouptools.join(*group)
123             else:
124               group = ''
125         %>
126         <tr>
127         % if open:
128           % for elem in open:
129             <% group = grouptools.join(group, elem) %>
130             ## Add the left most column, the name of the group
131             <td>
132               <div class="head" style="margin-left: ${depth * 1.75}em">
133                 <b>${elem | h}</b>
134               </div>
135             </td>
136             ## add each group's totals
137             % for res in results.results:
138               <td class="${group_result(res, group)}">
139                 <b>${group_fraction(res, group)}</b>
140               </td>
141             % endfor
142             <% depth += 1 %>
143             </tr><tr>
144           % endfor
145         % endif
146         
147         <td>
148           <div class="group" style="margin-left: ${depth * 1.75}em">
149             ${grouptools.testname(test) | h}
150           </div>
151         </td>
152         % for res in results.results:
153           <%
154             # Get the raw result, if it's none check to see if it's a subtest, if that's still None
155             # then declare it not run
156             # This very intentionally uses posix path, we're generating urls, and while
157             # some windows based browsers support \\ as a url separator, *nix systems do not,
158             # which would make a result generated on windows non-portable
159             raw = res.tests.get(test)
160             if raw is not None:
161               result = raw.result
162               href = normalize_href(posixpath.join(escape_pathname(res.name),
163                                                    escape_filename(test)))
164             else:
165               raw = res.tests.get(grouptools.groupname(test))
166               name = grouptools.testname(test)
167               if raw is not None and name in raw.subtests:
168                 result = raw.subtests[name]
169                 href = normalize_href(posixpath.join(escape_pathname(res.name),
170                                                      escape_filename(grouptools.groupname(test))))
171               else:
172                 result = status.NOTRUN
173             del raw  # we don't need this, so don't let it leak
174           %>
175           <td class="${str(result)}">
176           % if str(result) not in exclude and result is not status.NOTRUN:
177             <a href="${href}.html">
178               ${str(result)}
179             </a>
180           % else:
181             ${str(result)}
182           % endif
183           </td>
184         % endfor
185         </tr>
186       % endfor
187     </table>
188   </body>
189 </html>