[Lldb-commits] [lldb] r187069 - Add expectedFailureFreeBSD test wrapper
Ed Maste
emaste at freebsd.org
Wed Jul 24 12:47:09 PDT 2013
Author: emaste
Date: Wed Jul 24 14:47:08 2013
New Revision: 187069
URL: http://llvm.org/viewvc/llvm-project?rev=187069&view=rev
Log:
Add expectedFailureFreeBSD test wrapper
Modified:
lldb/trunk/test/lldbtest.py
Modified: lldb/trunk/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=187069&r1=187068&r2=187069&view=diff
==============================================================================
--- lldb/trunk/test/lldbtest.py (original)
+++ lldb/trunk/test/lldbtest.py Wed Jul 24 14:47:08 2013
@@ -516,6 +516,42 @@ def expectedFailurei386(bugnumber=None):
return wrapper
return expectedFailurei386_impl
+def expectedFailureFreeBSD(bugnumber=None, compilers=None):
+ if callable(bugnumber):
+ @wraps(bugnumber)
+ def expectedFailureFreeBSD_easy_wrapper(*args, **kwargs):
+ from unittest2 import case
+ self = args[0]
+ platform = sys.platform
+ try:
+ bugnumber(*args, **kwargs)
+ except Exception:
+ if "freebsd" in platform and self.expectedCompiler(compilers):
+ raise case._ExpectedFailure(sys.exc_info(),None)
+ else:
+ raise
+ if "freebsd" in platform and self.expectedCompiler(compilers):
+ raise case._UnexpectedSuccess(sys.exc_info(),None)
+ return expectedFailureFreeBSD_easy_wrapper
+ else:
+ def expectedFailureFreeBSD_impl(func):
+ @wraps(func)
+ def wrapper(*args, **kwargs):
+ from unittest2 import case
+ self = args[0]
+ platform = sys.platform
+ try:
+ func(*args, **kwargs)
+ except Exception:
+ if "freebsd" in platform and self.expectedCompiler(compilers):
+ raise case._ExpectedFailure(sys.exc_info(),bugnumber)
+ else:
+ raise
+ if "freebsd" in platform and self.expectedCompiler(compilers):
+ raise case._UnexpectedSuccess(sys.exc_info(),bugnumber)
+ return wrapper
+ return expectedFailureFreeBSD_impl
+
def expectedFailureLinux(bugnumber=None, compilers=None):
if callable(bugnumber):
@wraps(bugnumber)
More information about the lldb-commits
mailing list