[Piglit] [PATCH] framework: add clinfo to system information

Dylan Baker baker.dylan.c at gmail.com
Wed Sep 30 12:05:36 PDT 2015


It's like glxinfo or wglinfo, but for cl.

cc: Serge Martin <edb+piglit at sigluy.net>
Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
 framework/core.py                | 1 +
 framework/results.py             | 3 ++-
 framework/summary/html_.py       | 1 +
 framework/tests/results_tests.py | 8 +++++++-
 templates/testrun_info.mako      | 6 ++++++
 5 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/framework/core.py b/framework/core.py
index 549130b..c30f961 100644
--- a/framework/core.py
+++ b/framework/core.py
@@ -194,6 +194,7 @@ def collect_system_info():
     progs = [('wglinfo', ['wglinfo']),
              ('glxinfo', ['glxinfo']),
              ('uname', ['uname', '-a']),
+             ('clinfo', ['clinfo']),
              ('lspci', ['lspci'])]
 
     result = {}
diff --git a/framework/results.py b/framework/results.py
index c5f90e8..8d3fe17 100644
--- a/framework/results.py
+++ b/framework/results.py
@@ -241,6 +241,7 @@ class TestrunResult(object):
         self.options = None
         self.glxinfo = None
         self.wglinfo = None
+        self.clinfo = None
         self.lspci = None
         self.time_elapsed = None
         self.tests = {}
@@ -288,7 +289,7 @@ class TestrunResult(object):
         """
         res = cls()
         for name in ['name', 'uname', 'options', 'glxinfo', 'wglinfo', 'lspci',
-                     'tests', 'totals', 'results_version']:
+                     'tests', 'totals', 'results_version', 'clinfo']:
             value = dict_.get(name)
             if value:
                 setattr(res, name, value)
diff --git a/framework/summary/html_.py b/framework/summary/html_.py
index 0036b83..689bcf1 100644
--- a/framework/summary/html_.py
+++ b/framework/summary/html_.py
@@ -89,6 +89,7 @@ def _make_testrun_info(results, destination, exclude):
                 options=each.options,
                 uname=each.uname,
                 glxinfo=each.glxinfo,
+                clinfo=each.clinfo,
                 lspci=each.lspci))
 
         # Then build the individual test results
diff --git a/framework/tests/results_tests.py b/framework/tests/results_tests.py
index a28d78b..728d479 100644
--- a/framework/tests/results_tests.py
+++ b/framework/tests/results_tests.py
@@ -456,6 +456,7 @@ class TestTestrunResultToJson(object):
         test.uname = 'this is uname'
         test.options = {'some': 'option'}
         test.glxinfo = 'glxinfo'
+        test.clinfo = 'clinfo'
         test.wglinfo = 'wglinfo'
         test.lspci = 'this is lspci'
         test.time_elapsed = 1.23
@@ -483,6 +484,10 @@ class TestTestrunResultToJson(object):
         """results.TestrunResult.to_json: wglinfo is properly encoded"""
         nt.eq_(self.test['wglinfo'], 'wglinfo')
 
+    def test_clinfo(self):
+        """results.TestrunResult.to_json: clinfo is properly encoded"""
+        nt.eq_(self.test['clinfo'], 'clinfo')
+
     def test_lspci(self):
         """results.TestrunResult.to_json: lspci is properly encoded"""
         nt.eq_(self.test['lspci'], 'this is lspci')
@@ -513,6 +518,7 @@ class TestTestrunResultFromDict(object):
         test.options = {'some': 'option'}
         test.glxinfo = 'glxinfo'
         test.wglinfo = 'wglinfo'
+        test.clinfo = 'clinfo'
         test.lspci = 'this is lspci'
         test.time_elapsed = 1.23
         test.tests = {
@@ -532,7 +538,7 @@ class TestTestrunResultFromDict(object):
             nt.eq_(baseline, test)
 
         for attrib in ['name', 'uname', 'glxinfo', 'wglinfo', 'lspci',
-                       'time_elapsed', 'results_version']:
+                       'time_elapsed', 'results_version', 'clinfo']:
             test.description = ('results.TestrunResult.from_dict: '
                                 '{} is restored correctly'.format(attrib))
             yield (test,
diff --git a/templates/testrun_info.mako b/templates/testrun_info.mako
index 9ff5022..f8e1b47 100644
--- a/templates/testrun_info.mako
+++ b/templates/testrun_info.mako
@@ -58,6 +58,12 @@
           <pre>${glxinfo}</pre>
         </td>
       </tr>
+      <tr>
+        <td>clinfo</td>
+        <td>
+          <pre>${clinfo}</pre>
+        </td>
+      </tr>
     </table>
     <p>
       <a href="../index.html">Back to summary</a>
-- 
2.6.0



More information about the Piglit mailing list