[Piglit] [PATCH] templates: add the totals to testrun_info

Thomas Wood thomas.wood at intel.com
Wed Jun 4 03:12:12 PDT 2014


Add the totals to the testrun_info template, including the total number
of tests evaluated.

Signed-off-by: Thomas Wood <thomas.wood at intel.com>
---
 framework/summary.py        |  3 +++
 templates/testrun_info.mako | 11 +++++++++++
 2 files changed, 14 insertions(+)

diff --git a/framework/summary.py b/framework/summary.py
index c905b98..e83bfb4 100644
--- a/framework/summary.py
+++ b/framework/summary.py
@@ -443,8 +443,11 @@ class Summary:
             else:
                 time = None
 
+            self.__find_totals()
+
             with open(path.join(destination, each.name, "index.html"), 'w') as out:
                 out.write(testindex.render(name=each.name,
+                                           totals=self.totals,
                                            time=time,
                                            options=each.options,
                                            uname=each.uname,
diff --git a/templates/testrun_info.mako b/templates/testrun_info.mako
index 6ff1f44..9ff5022 100644
--- a/templates/testrun_info.mako
+++ b/templates/testrun_info.mako
@@ -18,6 +18,17 @@
         <th>Value</th>
       </tr>
       <tr>
+        <td>totals</td>
+        <td>
+          <table>
+            % for key, value in sorted(totals.iteritems(), key=lambda (k,v): (v,k), reverse=True):
+            <tr><td>${key}</td><td>${value}</td></tr>
+            % endfor
+            <tr><td>total</td><td>${sum(totals.itervalues())}</td></tr>
+          </table>
+        </td>
+      </tr>
+      <tr>
         <td>time_elapsed</td>
         <td>${time}</td>
       </tr>
-- 
1.9.0



More information about the Piglit mailing list