[Piglit] [PATCH 46/49] framework: Fix valgrind mixin.

Dylan Baker dylan at pnwbakers.com
Fri Jul 29 18:39:32 UTC 2016


This Mixin is currently broken because it doesn't handle warn statuses,
but it really needs to handle them because the underlying Test class is
going to turn a number of statuses it expects to be 'pass' into 'warn'

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

diff --git a/framework/test/base.py b/framework/test/base.py
index 0d5fc1e..63fcaf4 100644
--- a/framework/test/base.py
+++ b/framework/test/base.py
@@ -429,7 +429,9 @@ class ValgrindMixin(object):
         if options.OPTIONS.valgrind:
             # If the underlying test failed, simply report
             # 'skip' for this valgrind test.
-            if self.result.result != 'pass':
+            if self.result.result != 'pass' and (
+                    self.result.result != 'warn' and
+                    self.result.returncode != 0):
                 self.result.result = 'skip'
             elif self.result.returncode == 0:
                 # Test passes and is valgrind clean.
diff --git a/unittests/framework/test/test_base.py b/unittests/framework/test/test_base.py
index 40df8f0..ba7719d 100644
--- a/unittests/framework/test/test_base.py
+++ b/unittests/framework/test/test_base.py
@@ -395,9 +395,6 @@ class TestValgrindMixin(object):
             test.run()
             assert test.result.result is status.PASS
 
-        # There is a bug in Valgrind mixin, It needs to handle warn, since
-        # Test will set a returncode of != 0 to warn
-        @pytest.mark.xfail
         def test_failed_valgrind(self, mocker):
             """test.base.ValgrindMixin.run: when a test is 'pass' but
             returncode is not 0 it's 'fail'.
-- 
2.9.0



More information about the Piglit mailing list