[Piglit] [PATCH] summary-html: Add Environment to HTML pages

Dylan Baker baker.dylan.c at gmail.com
Tue Oct 22 00:21:40 CEST 2013


Specifically for glean tests setting certain environment variables are
needed to run a certain subtest in glean. This patch prints that in the
HTML results.

CC: mattst88 at gmail.com
Signed-off-by: Dylan Baker <baker.dylan.c at gmail.com>
---
 framework/summary.py       | 3 +++
 templates/test_result.mako | 8 ++++++++
 2 files changed, 11 insertions(+)

diff --git a/framework/summary.py b/framework/summary.py
index 3e5c24e..14fe6e6 100644
--- a/framework/summary.py
+++ b/framework/summary.py
@@ -452,6 +452,9 @@ class Summary:
                         out.write(testfile.render(
                             testname=key,
                             status=value.get('result', 'None'),
+                            # Return a NoneType if envornment doesn't exist,
+                            # which stops it from being printed empty.
+                            env=value.get('environment', None),
                             returncode=value.get('returncode', 'None'),
                             time=value.get('time', 'None'),
                             info=value.get('info', 'None'),
diff --git a/templates/test_result.mako b/templates/test_result.mako
index b23fb8e..b06fd32 100644
--- a/templates/test_result.mako
+++ b/templates/test_result.mako
@@ -34,6 +34,14 @@
           <pre>${info}</pre>
         </td>
       </tr>
+      % if env:
+      <tr>
+        <td>Environment</td>
+        <td>
+          <pre>${env}</pre>
+        </td>
+      </tr>
+      % endif
       <tr>
         <td>Command</td>
         <td>
-- 
1.8.1.5



More information about the Piglit mailing list