[Piglit] [PATCH 12/13] framework/exectest.py: optimize 'fail' if not result
Dylan Baker
baker.dylan.c at gmail.com
Tue Apr 15 16:12:45 PDT 2014
There are several checks that look for the 'result' in self._result and
set it to fail if it's not there. Let's just make the default value of
'result' 'fail' and get rid of all of these checks.
Signed-off-by: Dylan Baker <baker.dylan.c at gmail.com>
---
framework/exectest.py | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/framework/exectest.py b/framework/exectest.py
index 9eedcc4..966116c 100644
--- a/framework/exectest.py
+++ b/framework/exectest.py
@@ -60,7 +60,7 @@ class Test(object):
self.run_concurrent = run_concurrent
self.command = command
self.env = {}
- self.result = TestResult()
+ self.result = TestResult({'result': 'fail'})
# This is a hook for doing some testing on execute right before
# self.run is called.
@@ -85,8 +85,6 @@ class Test(object):
self.run()
self.result['time'] = time.time() - time_start
self.result = dmesg.update_result(self.result)
- if 'result' not in self.result:
- self.result['result'] = 'fail'
except:
exception = sys.exc_info()
self.result['result'] = 'fail'
@@ -290,6 +288,3 @@ class PiglitTest(Test):
except:
self.result['result'] = 'fail'
self.result['note'] = 'Failed to parse result string'
-
- if 'result' not in self.result:
- self.result['result'] = 'fail'
--
1.9.2
More information about the Piglit
mailing list