[Lldb-commits] [lldb] r147177 - in /lldb/trunk/test: functionalities/return-value/TestReturnValue.py lldbtest.py
Johnny Chen
johnny.chen at apple.com
Thu Dec 22 13:14:32 PST 2011
Author: johnny
Date: Thu Dec 22 15:14:31 2011
New Revision: 147177
URL: http://llvm.org/viewvc/llvm-project?rev=147177&view=rev
Log:
Decorate the two test cases in TestReturnValue.py as i386 only expectedFailure, aka @expectedFailurei386.
Modified:
lldb/trunk/test/functionalities/return-value/TestReturnValue.py
lldb/trunk/test/lldbtest.py
Modified: lldb/trunk/test/functionalities/return-value/TestReturnValue.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/return-value/TestReturnValue.py?rev=147177&r1=147176&r2=147177&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/return-value/TestReturnValue.py (original)
+++ lldb/trunk/test/functionalities/return-value/TestReturnValue.py Thu Dec 22 15:14:31 2011
@@ -13,12 +13,14 @@
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."""
Modified: lldb/trunk/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=147177&r1=147176&r2=147177&view=diff
==============================================================================
--- lldb/trunk/test/lldbtest.py (original)
+++ lldb/trunk/test/lldbtest.py Thu Dec 22 15:14:31 2011
@@ -394,6 +394,27 @@
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
More information about the lldb-commits
mailing list