[Piglit] [PATCH 5/5] framework/test: move valgrind out of Test into PiglitBaseTest

Dylan Baker baker.dylan.c at gmail.com
Thu May 21 14:18:43 PDT 2015


This option has never been tested against anything except Piglit tests,
and probably isn't useful anyway, since we probably don't care if
integrated tests are leaking.

Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
 framework/test/base.py        | 3 ---
 framework/test/piglit_test.py | 8 ++++++++
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/framework/test/base.py b/framework/test/base.py
index b01d378..cd15a9d 100644
--- a/framework/test/base.py
+++ b/framework/test/base.py
@@ -186,9 +186,6 @@ class Test(object):
     @property
     def command(self):
         assert self._command
-        if self.OPTS.valgrind:
-            return ['valgrind', '--quiet', '--error-exitcode=1',
-                    '--tool=memcheck'] + self._command
         return self._command
 
     @abc.abstractmethod
diff --git a/framework/test/piglit_test.py b/framework/test/piglit_test.py
index 86843a2..a4d3c8d 100644
--- a/framework/test/piglit_test.py
+++ b/framework/test/piglit_test.py
@@ -65,6 +65,14 @@ class PiglitBaseTest(Test):
         # Prepend TEST_BIN_DIR to the path.
         self._command[0] = os.path.join(TEST_BIN_DIR, self._command[0])
 
+    @Test.command.getter
+    def command(self):
+        command = super(PiglitBaseTest, self).command
+        if self.OPTS.valgrind:
+            return ['valgrind', '--quiet', '--error-exitcode=1',
+                    '--tool=memcheck'] + command
+        return command
+
     def interpret_result(self):
         outlines = self.result['out'].split('\n')
         outpiglit = (s[7:] for s in outlines if s.startswith('PIGLIT:'))
-- 
2.4.1



More information about the Piglit mailing list