summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2015-11-16 23:58:20 +0000
committerZachary Turner <zturner@google.com>2015-11-16 23:58:20 +0000
commitba1057022cd442258d722235f17c5c97a591c158 (patch)
tree8e86d833a74187a95414cded6967212f257a529d /lldb/packages/Python/lldbsuite/test
parent0c35282c659b91836522d28001ebedfc4efd15b2 (diff)
downloadbcm5719-llvm-ba1057022cd442258d722235f17c5c97a591c158.tar.gz
bcm5719-llvm-ba1057022cd442258d722235f17c5c97a591c158.zip
Python 3 - Skip a certain test for a particular (swig,python) combo.
Current versions of SWIG have a bug with Python 3 that causes Python to assert when iterating over a generator. This patch skips the test for the right combination of Python version and SWIG version. I'm attempting to upstream a patch to SWIG to fix this in a subsequent as-of-yet unreleased version, but I don't know how long that will take. llvm-svn: 253273
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lldbtest.py9
-rw-r--r--lldb/packages/Python/lldbsuite/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py2
2 files changed, 10 insertions, 1 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index 897cdeb1287..4cda90385b1 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -40,6 +40,7 @@ import collections
from distutils.version import LooseVersion
import gc
import glob
+import inspect
import os, sys, traceback
import os.path
import re
@@ -1109,7 +1110,13 @@ def skipIf(bugnumber=None, oslist=None, compiler=None, compiler_version=None, ar
debug_info_passes and
swig_version_passes and
py_version_passes)
- return skipTestIfFn(fn, bugnumber, skipReason="skipping because os:%s compiler: %s %s arch: %s debug info: %s"%(oslist, compiler, compiler_version, archs, debug_info))
+
+ local_vars = locals()
+ args = [x for x in inspect.getargspec(skipIf).args]
+ arg_vals = [eval(x, globals(), local_vars) for x in args]
+ args = [x for x in zip(args, arg_vals) if x[1] is not None]
+ reasons = ['%s=%s' % (x, str(y)) for (x,y) in args]
+ return skipTestIfFn(fn, bugnumber, skipReason='skipping because ' + ' && '.join(reasons))
def skipIfDebugInfo(bugnumber=None, debug_info=None):
return skipIf(bugnumber=bugnumber, debug_info=debug_info)
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py b/lldb/packages/Python/lldbsuite/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
index 822b2c74392..aa3a6141326 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
@@ -227,6 +227,8 @@ class APIDefaultConstructorTestCase(TestBase):
@add_test_categories(['pyapi'])
@no_debug_info_test
+ # Py3 asserts due to a bug in SWIG. Trying to upstream a patch to fix this in 3.0.8
+ @skipIf(py_version=['>=', (3,0)], swig_version=['<', (3,0,8)])
def test_SBModule(self):
obj = lldb.SBModule()
if self.TraceOn():
OpenPOWER on IntegriCloud