[Lldb-commits] [PATCH] Allow ExpectedFailure* decorators to work with optional arguments

Ying Chen chying at google.com
Tue Mar 24 16:25:09 PDT 2015


Hi sivachandra, ovyalov, chaoren, vharron,

-if the decorators functions called with optional arguments, return itself with the optinal arguments filled in

http://reviews.llvm.org/D8595

Files:
  test/lldbtest.py

Index: test/lldbtest.py
===================================================================
--- test/lldbtest.py
+++ test/lldbtest.py
@@ -42,6 +42,7 @@
 import types
 import unittest2
 import lldb
+import functools
 from _pyio import __metaclass__
 
 # See also dotest.parseOptionsAndInitTestdirs(), where the environment variables
@@ -565,9 +566,13 @@
 # to XFAIL a specific clang versions, try this
 # @expectedFailureClang('bugnumber', ['<=', '3.4'])
 def expectedFailureClang(bugnumber=None, compiler_version=None):
+    if bugnumber is None:
+        return functools.partial(expectedFailureClang,compiler_version=compiler_version)
     if bugnumber: return expectedFailureCompiler('clang', compiler_version, bugnumber)
 
 def expectedFailureGcc(bugnumber=None, compiler_version=None):
+    if bugnumber is None:
+        return functools.partial(expectedFailureGcc,compiler_version=compiler_version)
     if bugnumber: return expectedFailureCompiler('gcc', compiler_version, bugnumber)
 
 def expectedFailureIcc(bugnumber=None):
@@ -590,18 +595,28 @@
     if bugnumber: return expectedFailure(fn, bugnumber)
 
 def expectedFailureDarwin(bugnumber=None, compilers=None):
+    if bugnumber is None:
+        return functools.partial(expectedFailureDarwin,compilers=compilers)
     if bugnumber: return expectedFailureOS('darwin', bugnumber, compilers)
 
 def expectedFailureFreeBSD(bugnumber=None, compilers=None):
+    if bugnumber is None:
+        return functools.partial(expectedFailureFreeBSD,compilers=compilers)
     if bugnumber: return expectedFailureOS('freebsd', bugnumber, compilers)
 
 def expectedFailureLinux(bugnumber=None, compilers=None):
+    if bugnumber is None:
+        return functools.partial(expectedFailureLinux,compilers=compilers)
     if bugnumber: return expectedFailureOS('linux', bugnumber, compilers)
 
 def expectedFailureWindows(bugnumber=None, compilers=None):
+    if bugnumber is None:
+        return functools.partial(expectedFailureWindows,compilers=compilers)
     if bugnumber: return expectedFailureOS('win32', bugnumber, compilers)
 
 def expectedFailureLLGS(bugnumber=None, compilers=None):
+    if bugnumber is None:
+        return functools.partial(expectedFailureLLGS, compilers=compilers)
     def fn(self):
         # llgs local is only an option on Linux systems
         if 'linux' not in sys.platform:

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8595.22613.patch
Type: text/x-patch
Size: 2363 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150324/b0bb2317/attachment.bin>


More information about the lldb-commits mailing list