From 4da5a1dbab579da5975de573719c50fd3c1faeab Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Wed, 3 Apr 2019 11:48:38 +0000 Subject: modify-python-lldb.py: clean up __iter__ and __len__ support Summary: Instead of modifying the swig-generated code, just add the appropriate methods to the interface files in order to get the swig to do the generation for us. This is a straight-forward move from the python script to the interface files. The single class which has nontrivial handling in the script (SBModule) has been left for a separate patch. For the cases where I did not find any tests exercising the iteration/length methods (i.e., no tests failed after I stopped emitting them), I tried to add basic tests for that functionality. Reviewers: zturner, jingham, amccarth Subscribers: jdoerfert, lldb-commits Differential Revision: https://reviews.llvm.org/D60119 llvm-svn: 357572 --- .../Python/lldbsuite/test/python_api/debugger/TestDebuggerAPI.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lldb/packages/Python/lldbsuite/test/python_api/debugger') diff --git a/lldb/packages/Python/lldbsuite/test/python_api/debugger/TestDebuggerAPI.py b/lldb/packages/Python/lldbsuite/test/python_api/debugger/TestDebuggerAPI.py index 1cd15646f97..fcb17cbb8e7 100644 --- a/lldb/packages/Python/lldbsuite/test/python_api/debugger/TestDebuggerAPI.py +++ b/lldb/packages/Python/lldbsuite/test/python_api/debugger/TestDebuggerAPI.py @@ -34,6 +34,9 @@ class DebuggerAPITestCase(TestBase): self.dbg.SetPrompt(None) self.dbg.SetCurrentPlatform(None) self.dbg.SetCurrentPlatformSDKRoot(None) + + fresh_dbg = lldb.SBDebugger() + self.assertEquals(len(fresh_dbg), 0) @add_test_categories(['pyapi']) def test_debugger_delete_invalid_target(self): -- cgit v1.2.3