Update test status on Linux
- add decorators @expectedFailLinux and @skipOnLinux
- skip/mark xfail cases due to open bugzillas # 14323, 14416, 14423, 14424, 14425, 14426
Patch by Ashok Thirumurthi!
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@168529 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/lldbtest.py b/test/lldbtest.py
index 5fa0d8c..64024d0 100644
--- a/test/lldbtest.py
+++ b/test/lldbtest.py
@@ -410,6 +410,42 @@
raise case._UnexpectedSuccess
return wrapper
+def expectedFailureLinux(func):
+ """Decorate the item as a Linux only expectedFailure."""
+ if isinstance(func, type) and issubclass(func, unittest2.TestCase):
+ raise Exception("@expectedFailureLinux can only be used to decorate a test method")
+ @wraps(func)
+ def wrapper(*args, **kwargs):
+ from unittest2 import case
+ self = args[0]
+ platform = sys.platform
+ try:
+ func(*args, **kwargs)
+ except Exception:
+ if "linux" in platform:
+ raise case._ExpectedFailure(sys.exc_info())
+ else:
+ raise
+
+ if "linux" in platform:
+ raise case._UnexpectedSuccess
+ return wrapper
+
+def skipOnLinux(func):
+ """Decorate the item to skip tests that should be skipped on Linux."""
+ if isinstance(func, type) and issubclass(func, unittest2.TestCase):
+ raise Exception("@skipOnLinux can only be used to decorate a test method")
+ @wraps(func)
+ def wrapper(*args, **kwargs):
+ from unittest2 import case
+ self = args[0]
+ platform = sys.platform
+ if "linux" in platform:
+ self.skipTest("skip on linux")
+ else:
+ func(self, *args, **kwargs)
+ return wrapper
+
class Base(unittest2.TestCase):
"""
Abstract base for performing lldb (see TestBase) or other generic tests (see