Author: zturner Date: Mon Nov 16 17:58:20 2015 New Revision: 253273 URL: http://llvm.org/viewvc/llvm-project?rev=253273&view=rev Log: 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. Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=253273&r1=253272&r2=253273&view=diff ============================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Mon Nov 16 17:58:20 2015 @@ -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, 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) Modified: lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py?rev=253273&r1=253272&r2=253273&view=diff ============================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Mon Nov 16 17:58:20 2015 @@ -227,6 +227,8 @@ class APIDefaultConstructorTestCase(Test @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(): _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits