summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorDylan Baker <baker.dylan.c@gmail.com>2014-04-18 14:46:27 (GMT)
committerDylan Baker <baker.dylan.c@gmail.com>2014-04-18 15:14:29 (GMT)
commitd9f87269c28ca5a3345720c0298ea819692d1f80 (patch)
treeae41f3178d6557a5f3bcd03d6313849bef8d5109 /templates
parentf8983c5947cd9e47243ea6813a020f2756dc5197 (diff)
downloadpiglit-d9f87269c28ca5a3345720c0298ea819692d1f80.tar.gz
piglit-d9f87269c28ca5a3345720c0298ea819692d1f80.tar.xz
framework: small refactor of test_result page generation
Previously each value of a dictionary was pulled out and passed one by one to mako, that results in a lot of values being passed. With this patch the dictionary is passed and the keys are pulled out in the mako. This is much cleaner and easier to read. v2: - fix dmesg is list problem by altering the dictionary Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Diffstat (limited to 'templates')
-rw-r--r--templates/test_result.mako28
1 files changed, 15 insertions, 13 deletions
diff --git a/templates/test_result.mako b/templates/test_result.mako
index 49e6fd2..70b9f91 100644
--- a/templates/test_result.mako
+++ b/templates/test_result.mako
@@ -11,7 +11,7 @@
<h1>Results for ${testname}</h1>
<h2>Overview</h2>
<div>
- <p><b>Result:</b> ${status}</p>
+ <p><b>Result:</b> ${value.get('status', 'None')}</p>
</div>
<p><a href="${index}">Back to summary</a></p>
<h2>Details</h2>
@@ -22,57 +22,59 @@
</tr>
<tr>
<td>Returncode</td>
- <td>${returncode}</td>
+ <td>${value.get('returncode', 'None')}</td>
</tr>
<tr>
<td>Time</td>
- <td>${time}</b>
+ <td>${value.get('time', 'None')}</b>
</tr>
## Info is deprecated and may disapear someday
- % if info is not None:
+ % if value.get('info') is not None:
<tr>
<td>Info</td>
<td>
- <pre>${info | h}</pre>
+ <pre>${value.get('info') | h}</pre>
</td>
</tr>
% endif
<tr>
<td>Stdout</td>
<td>
- <pre>${out | h}</pre>
+ <pre>${value.get('out', 'None') | h}</pre>
</td>
</tr>
<tr>
<td>Stderr</td>
<td>
- <pre>${err | h}</pre>
+ <pre>${value.get('err', 'None') | h}</pre>
</td>
</tr>
- % if env:
+ % if value.get('env') is not None:
<tr>
<td>Environment</td>
<td>
- <pre>${env | h}</pre>
+ <pre>${value.get('env') | h}</pre>
</td>
</tr>
- % endif
+ % endif
<tr>
<td>Command</td>
<td>
- </pre>${command}</pre>
+ </pre>${value.get('command', 'None')}</pre>
</td>
</tr>
+ % if value.get('traceback') is not None:
<tr>
<td>Traceback</td>
<td>
- <pre>${traceback | h}</pre>
+ <pre>${value.get('traceback') | h}</pre>
</td>
</tr>
+ % endif
<tr>
<td>dmesg</td>
<td>
- <pre>${dmesg | h}</pre>
+ <pre>${value.get('dmesg', 'None') | h}</pre>
</td>
</tr>
</table>