[Piglit] [PATCH 1/2] framework: use formatted time values in the HTML report
Thomas Wood
thomas.wood at intel.com
Mon Feb 24 08:56:58 PST 2014
Signed-off-by: Thomas Wood <thomas.wood at intel.com>
---
framework/summary.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/framework/summary.py b/framework/summary.py
index 2fc16ce..c1104c3 100644
--- a/framework/summary.py
+++ b/framework/summary.py
@@ -26,6 +26,7 @@ import shutil
import collections
import tempfile
from mako.template import Template
+from datetime import timedelta
# a local variable status exists, prevent accidental overloading by renaming
# the module
@@ -379,7 +380,7 @@ class Summary:
with open(path.join(destination, each.name, "index.html"), 'w') as out:
out.write(testindex.render(name=each.name,
- time=each.time_elapsed,
+ time=str(timedelta(0,each.time_elapsed)),
options=each.options,
glxinfo=each.glxinfo,
lspci=each.lspci))
@@ -401,6 +402,7 @@ class Summary:
with open(path.join(destination, each.name, key + ".html"),
'w') as out:
+ time=value.get('time', 'None')
out.write(testfile.render(
testname=key,
status=value.get('result', 'None'),
@@ -410,7 +412,7 @@ class Summary:
# disapear at somepoint
env=value.get('environment', None),
returncode=value.get('returncode', 'None'),
- time=value.get('time', 'None'),
+ time=time if time == 'None' else str(timedelta(0, time)),
info=value.get('info', 'None'),
traceback=value.get('traceback', 'None'),
command=value.get('command', 'None'),
--
1.8.5.3
More information about the Piglit
mailing list