Decorate the two test cases in TestReturnValue.py as i386 only expectedFailure, aka @expectedFailurei386.

llvm-svn: 147177
This commit is contained in:
Johnny Chen 2011-12-22 21:14:31 +00:00
parent 3ba90a1655
commit a33843f5b4
2 changed files with 23 additions and 0 deletions

View File

@ -13,12 +13,14 @@ class ReturnValueTestCase(TestBase):
mydir = os.path.join("functionalities", "return-value")
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
@expectedFailurei386
@python_api_test
def test_with_dsym_python(self):
"""Test getting return values from stepping out with dsyms."""
self.buildDsym()
self.do_return_value()
@expectedFailurei386
@python_api_test
def test_with_dwarf_python(self):
"""Test getting return values from stepping out."""

View File

@ -394,6 +394,27 @@ def expectedFailureClang(func):
raise case._UnexpectedSuccess
return wrapper
def expectedFailurei386(func):
"""Decorate the item as an i386 only expectedFailure."""
if isinstance(func, type) and issubclass(func, unittest2.TestCase):
raise Exception("@expectedFailurei386 can only be used to decorate a test method")
@wraps(func)
def wrapper(*args, **kwargs):
from unittest2 import case
self = args[0]
arch = self.getArchitecture()
try:
func(*args, **kwargs)
except Exception:
if "i386" in arch:
raise case._ExpectedFailure(sys.exc_info())
else:
raise
if "i386" in arch:
raise case._UnexpectedSuccess
return wrapper
class Base(unittest2.TestCase):
"""
Abstract base for performing lldb (see TestBase) or other generic tests (see