summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2016-07-28 15:07:09 -0700
committerDylan Baker <dylan@pnwbakers.com>2016-08-05 10:45:05 -0700
commit13b97ad898319ac0d0362a83dcdbfbf0a72b6d21 (patch)
treec59cd4f729805c45c52a705bb9c0404fa7d1a2b2
parentd1aed1647a0568b7256f3d57d3f415fdc581c0bd (diff)
framework: Fix valgrind mixin.
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@intel.com>
-rw-r--r--framework/test/base.py4
-rw-r--r--unittests/framework/test/test_base.py3
2 files changed, 3 insertions, 4 deletions
diff --git a/framework/test/base.py b/framework/test/base.py
index 0d5fc1e45..63fcaf4c4 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 40df8f06e..ba7719d3a 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'.