[Piglit] [PATCH 3/9] python: replace Test.interpretResult with Test.interpret_result

Dylan Baker baker.dylan.c at gmail.com
Wed Apr 9 18:27:21 PDT 2014


>From python's PEP8:

 "Function names should be lowercase, with words separated by
 underscores as necessary to improve readability."

This patch was generated with the following shell command:
find . -name '*py' | xargs sed -i -e 's!interpretResult!interpret_result!g'

Signed-off-by: Dylan Baker <baker.dylan.c at gmail.com>
---
 framework/exectest.py  | 6 +++---
 framework/gleantest.py | 2 +-
 framework/gtest.py     | 2 +-
 tests/es3conform.py    | 2 +-
 tests/igt.py           | 2 +-
 tests/oglconform.py    | 2 +-
 6 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/framework/exectest.py b/framework/exectest.py
index abf1059..a670ddd 100644
--- a/framework/exectest.py
+++ b/framework/exectest.py
@@ -126,7 +126,7 @@ class Test(object):
             return
         self._command = value
 
-    def interpretResult(self, out, returncode, results):
+    def interpret_result(self, out, returncode, results):
         raise NotImplementedError
         return out
 
@@ -194,7 +194,7 @@ class Test(object):
                 results['result'] = 'skip'
             else:
                 results['result'] = 'fail'
-                out = self.interpretResult(out, returncode, results)
+                out = self.interpret_result(out, returncode, results)
 
             crash_codes = [
                 # Unix: terminated by a signal
@@ -293,7 +293,7 @@ class PiglitTest(Test):
         # Prepend TEST_BIN_DIR to the path.
         self._command[0] = os.path.join(TEST_BIN_DIR, self._command[0])
 
-    def interpretResult(self, out, returncode, results):
+    def interpret_result(self, out, returncode, results):
         outlines = out.split('\n')
         outpiglit = map(lambda s: s[7:],
                         filter(lambda s: s.startswith('PIGLIT:'), outlines))
diff --git a/framework/gleantest.py b/framework/gleantest.py
index 29ce324..d2697d4 100644
--- a/framework/gleantest.py
+++ b/framework/gleantest.py
@@ -40,7 +40,7 @@ class GleanTest(Test):
     def command(self):
         return self._command + self.globalParams
 
-    def interpretResult(self, out, returncode, results):
+    def interpret_result(self, out, returncode, results):
         if "{'result': 'skip'}" in out:
             results['result'] = 'skip'
         elif out.find('FAIL') >= 0 or returncode != 0:
diff --git a/framework/gtest.py b/framework/gtest.py
index 03be7be..d728bb8 100644
--- a/framework/gtest.py
+++ b/framework/gtest.py
@@ -29,7 +29,7 @@ import re
 from framework.exectest import Test
 
 class GTest(Test):
-    def interpretResult(self, out, returncode, results):
+    def interpret_result(self, out, returncode, results):
         # Since gtests can have several subtets, if any of the subtests fail
         # then we need to report fail.
         if len(re.findall('FAILED', out, re.MULTILINE)) > 0:
diff --git a/tests/es3conform.py b/tests/es3conform.py
index bae964e..6549f4e 100644
--- a/tests/es3conform.py
+++ b/tests/es3conform.py
@@ -55,7 +55,7 @@ class GTFTest(Test):
                                        '-minfmt', '-width=113', '-height=47',
                                        '-run=' + testpath])
 
-    def interpretResult(self, out, returncode, results):
+    def interpret_result(self, out, returncode, results):
         mo = self.pass_re.search(out)
         if mo is not None and int(mo.group('passed')) > 0:
             results['result'] = 'pass'
diff --git a/tests/igt.py b/tests/igt.py
index 065ba0c..c2c522f 100644
--- a/tests/igt.py
+++ b/tests/igt.py
@@ -75,7 +75,7 @@ class IGTTest(Test):
         super(IGTTest, self).__init__(
             [path.join(igtTestRoot, binary)] + arguments)
 
-    def interpretResult(self, out, returncode, results):
+    def interpret_result(self, out, returncode, results):
         if not igtEnvironmentOk:
             return out
 
diff --git a/tests/oglconform.py b/tests/oglconform.py
index d0ac541..c303b3e 100644
--- a/tests/oglconform.py
+++ b/tests/oglconform.py
@@ -52,7 +52,7 @@ class OGLCTest(Test):
         super(OGLCTest, self).__init__([bin_oglconform, '-minFmt', '-v', '4',
                                         '-test', category, subtest])
 
-    def interpretResult(self, out, returncode, results):
+    def interpret_result(self, out, returncode, results):
         if self.skip_re.search(out) is not None:
             results['result'] = 'skip'
         elif re.search('Total Passed : 1', out) is not None:
-- 
1.9.1



More information about the Piglit mailing list