summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2015-11-14 00:20:33 +0000
committerJim Ingham <jingham@apple.com>2015-11-14 00:20:33 +0000
commit6d048942c563dff83fb743ccf16959fe8e240d11 (patch)
tree8f2153834c255e783fc17b21e81599e62a20509e /lldb/packages/Python/lldbsuite/test
parent06f9a27a512fbeb6dd5c71774e93c7b7fa71db5e (diff)
downloadbcm5719-llvm-6d048942c563dff83fb743ccf16959fe8e240d11.tar.gz
bcm5719-llvm-6d048942c563dff83fb743ccf16959fe8e240d11.zip
Add a "not_in()" function you can apply to the list type arguments to expectedFailureAll to reverse
the sense of the test. llvm-svn: 253106
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py2
-rw-r--r--lldb/packages/Python/lldbsuite/test/lldbtest.py23
2 files changed, 21 insertions, 4 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py
index 5a91f0f7f94..af6df376482 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py
@@ -15,7 +15,7 @@ class ConsecutiveBreakpoitsTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @unittest2.expectedFailure("llvm.org/pr23478")
+ @expectedFailureAll("llvm.org/pr23478", oslist = not_in(["macosx"]))
def test (self):
self.build ()
self.consecutive_breakpoints_tests()
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index e52c5bf5eb7..908add0d77f 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -620,13 +620,30 @@ def expectedFailure(expected_fn, bugnumber=None):
# @expectedFailureAll, xfail for all platform/compiler/arch,
# @expectedFailureAll(compiler='gcc'), xfail for gcc on all platform/architecture
# @expectedFailureAll(bugnumber, ["linux"], "gcc", ['>=', '4.9'], ['i386']), xfail for gcc>=4.9 on linux with i386
+
+# You can also pass not_in(list) to reverse the sense of the test for the arguments that
+# are simple lists, namely oslist, compiler and debug_info.
+
+def not_in (iterable):
+ return lambda x : x not in iterable
+
+def check_list_or_lambda (list_or_lambda, value):
+ if six.callable(list_or_lambda):
+ return list_or_lambda(value)
+ else:
+ return list_or_lambda is None or value in list_or_lambda
+
def expectedFailureAll(bugnumber=None, oslist=None, compiler=None, compiler_version=None, archs=None, triple=None, debug_info=None):
def fn(self):
- return ((oslist is None or self.getPlatform() in oslist) and
- (compiler is None or (compiler in self.getCompiler() and self.expectedCompilerVersion(compiler_version))) and
+ os_list_passes = check_list_or_lambda(oslist, self.getPlatform())
+ compiler_passes = check_list_or_lambda(compiler, self.getCompiler()) and self.expectedCompilerVersion(compiler_version)
+ debug_info_passes = check_list_or_lambda(debug_info, self.debug_info)
+
+ return (os_list_passes and
+ compiler_passes and
self.expectedArch(archs) and
(triple is None or re.match(triple, lldb.DBG.GetSelectedPlatform().GetTriple())) and
- (debug_info is None or self.debug_info in debug_info))
+ debug_info_passes)
return expectedFailure(fn, bugnumber)
def expectedFailureDwarf(bugnumber=None):
OpenPOWER on IntegriCloud