diff options
author | Zachary Turner <zturner@google.com> | 2015-10-22 20:06:20 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2015-10-22 20:06:20 +0000 |
commit | 77db4a855239049488e09f28c6665fdb3b51ef90 (patch) | |
tree | 11f22a87f27e28b3a71914ee3d80a039a79d2c9a /lldb/test/python_api/watchpoint | |
parent | bd832d513156cea8645f1c3da1296f791edfbbab (diff) | |
download | bcm5719-llvm-77db4a855239049488e09f28c6665fdb3b51ef90.tar.gz bcm5719-llvm-77db4a855239049488e09f28c6665fdb3b51ef90.zip |
Update every test to import `lldb_shared`.
This is necessary in order to allow third party modules to be
located under lldb/third_party rather than under the test
folder directly.
Since we're already touching every test file anyway, we also
go ahead and delete the unittest2 import and main block wherever
possible. The ability to run a test as a standalone file has
already been broken for some time, and if we decide we want this
back, we should use unittest instead of unittest2.
A few places could not have the import of unittest2 removed,because
they depend on the unittest2.expectedFailure or skip decorators.
Removing all those was orthogonal in spirit to the purpose of this
CL, so the import of unittest2 remains in those files that were
using it for its test decorators. Those can be addressed
separately.
llvm-svn: 251055
Diffstat (limited to 'lldb/test/python_api/watchpoint')
6 files changed, 12 insertions, 48 deletions
diff --git a/lldb/test/python_api/watchpoint/TestSetWatchpoint.py b/lldb/test/python_api/watchpoint/TestSetWatchpoint.py index 9e464ad363a..242b199db7d 100644 --- a/lldb/test/python_api/watchpoint/TestSetWatchpoint.py +++ b/lldb/test/python_api/watchpoint/TestSetWatchpoint.py @@ -2,9 +2,10 @@ Use lldb Python SBValue API to create a watchpoint for read_write of 'globl' var. """ +import lldb_shared + import os, time import re -import unittest2 import lldb, lldbutil from lldbtest import * @@ -87,10 +88,3 @@ class SetWatchpointAPITestCase(TestBase): # At this point, the inferior process should have exited. self.assertTrue(process.GetState() == lldb.eStateExited, PROCESS_EXITED) - - -if __name__ == '__main__': - import atexit - lldb.SBDebugger.Initialize() - atexit.register(lambda: lldb.SBDebugger.Terminate()) - unittest2.main() diff --git a/lldb/test/python_api/watchpoint/TestWatchpointIgnoreCount.py b/lldb/test/python_api/watchpoint/TestWatchpointIgnoreCount.py index 6b4197b3d48..f8ae2a23966 100644 --- a/lldb/test/python_api/watchpoint/TestWatchpointIgnoreCount.py +++ b/lldb/test/python_api/watchpoint/TestWatchpointIgnoreCount.py @@ -2,9 +2,10 @@ Use lldb Python SBWatchpoint API to set the ignore count. """ +import lldb_shared + import os, time import re -import unittest2 import lldb, lldbutil from lldbtest import * @@ -83,10 +84,3 @@ class WatchpointIgnoreCountTestCase(TestBase): self.assertTrue(watchpoint.GetWatchSize() == 4) self.assertTrue(watchpoint.GetHitCount() == 2) print watchpoint - - -if __name__ == '__main__': - import atexit - lldb.SBDebugger.Initialize() - atexit.register(lambda: lldb.SBDebugger.Terminate()) - unittest2.main() diff --git a/lldb/test/python_api/watchpoint/TestWatchpointIter.py b/lldb/test/python_api/watchpoint/TestWatchpointIter.py index 8a6877930ee..0ba73c0500b 100644 --- a/lldb/test/python_api/watchpoint/TestWatchpointIter.py +++ b/lldb/test/python_api/watchpoint/TestWatchpointIter.py @@ -2,9 +2,10 @@ Use lldb Python SBTarget API to iterate on the watchpoint(s) for the target. """ +import lldb_shared + import os, time import re -import unittest2 import lldb, lldbutil from lldbtest import * @@ -108,10 +109,3 @@ class WatchpointIteratorTestCase(TestBase): self.assertTrue(watchpoint.GetWatchSize() == 4) self.assertTrue(watchpoint.GetHitCount() == 1) print watchpoint - - -if __name__ == '__main__': - import atexit - lldb.SBDebugger.Initialize() - atexit.register(lambda: lldb.SBDebugger.Terminate()) - unittest2.main() diff --git a/lldb/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py b/lldb/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py index 041e185de54..dd7c79971e8 100644 --- a/lldb/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py +++ b/lldb/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py @@ -2,8 +2,9 @@ Test watchpoint condition API. """ +import lldb_shared + import os, time -import unittest2 import lldb import lldbutil from lldbtest import * @@ -84,10 +85,3 @@ class WatchpointConditionAPITestCase(TestBase): # Verify that the condition is met. self.assertTrue(value.GetValueAsUnsigned() == 5) - - -if __name__ == '__main__': - import atexit - lldb.SBDebugger.Initialize() - atexit.register(lambda: lldb.SBDebugger.Terminate()) - unittest2.main() diff --git a/lldb/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py b/lldb/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py index 9830dd19777..51a8955b689 100644 --- a/lldb/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py +++ b/lldb/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py @@ -2,9 +2,10 @@ Use lldb Python SBValue.WatchPointee() API to create a watchpoint for write of '*g_char_ptr'. """ +import lldb_shared + import os, time import re -import unittest2 import lldb, lldbutil from lldbtest import * @@ -84,10 +85,3 @@ class SetWatchlocationAPITestCase(TestBase): substrs = [self.violating_func]) # This finishes our test. - - -if __name__ == '__main__': - import atexit - lldb.SBDebugger.Initialize() - atexit.register(lambda: lldb.SBDebugger.Terminate()) - unittest2.main() diff --git a/lldb/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py b/lldb/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py index ebcb6ff12d9..d6a3ca60c87 100644 --- a/lldb/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py +++ b/lldb/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py @@ -2,9 +2,10 @@ Use lldb Python SBtarget.WatchAddress() API to create a watchpoint for write of '*g_char_ptr'. """ +import lldb_shared + import os, time import re -import unittest2 import lldb, lldbutil from lldbtest import * @@ -124,10 +125,3 @@ class TargetWatchAddressAPITestCase(TestBase): self.assertFalse(watchpoint) self.expect(error.GetCString(), exe=False, substrs = ['watch size of %d is not supported' % 365]) - - -if __name__ == '__main__': - import atexit - lldb.SBDebugger.Initialize() - atexit.register(lambda: lldb.SBDebugger.Terminate()) - unittest2.main() |