summaryrefslogtreecommitdiffstats
path: root/lldb/test/functionalities
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/test/functionalities')
-rw-r--r--lldb/test/functionalities/abbreviation/TestAbbreviations.py11
-rw-r--r--lldb/test/functionalities/abbreviation/TestCommonShortSpellings.py11
-rw-r--r--lldb/test/functionalities/archives/TestBSDArchives.py10
-rw-r--r--lldb/test/functionalities/asan/TestMemoryHistory.py9
-rw-r--r--lldb/test/functionalities/asan/TestReportData.py9
-rw-r--r--lldb/test/functionalities/attach_resume/TestAttachResume.py9
-rw-r--r--lldb/test/functionalities/avoids-fd-leak/TestFdLeak.py10
-rw-r--r--lldb/test/functionalities/backticks/TestBackticksWithoutATarget.py9
-rw-r--r--lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py9
-rw-r--r--lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py10
-rw-r--r--lldb/test/functionalities/breakpoint/breakpoint_command/TestRegexpBreakCommand.py10
-rw-r--r--lldb/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py10
-rw-r--r--lldb/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py10
-rw-r--r--lldb/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py10
-rw-r--r--lldb/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py10
-rw-r--r--lldb/test/functionalities/breakpoint/breakpoint_options/TestBreakpointOptions.py9
-rw-r--r--lldb/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py10
-rw-r--r--lldb/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py9
-rw-r--r--lldb/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py11
-rw-r--r--lldb/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py9
-rw-r--r--lldb/test/functionalities/breakpoint/dummy_target_breakpoints/TestBreakpointsWithNoTargets.py9
-rw-r--r--lldb/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py10
-rw-r--r--lldb/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py9
-rw-r--r--lldb/test/functionalities/command_history/TestCommandHistory.py10
-rw-r--r--lldb/test/functionalities/command_regex/TestCommandRegex.py9
-rw-r--r--lldb/test/functionalities/command_script/TestCommandScript.py10
-rw-r--r--lldb/test/functionalities/command_script/import/TestImport.py10
-rw-r--r--lldb/test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py9
-rw-r--r--lldb/test/functionalities/command_source/TestCommandSource.py10
-rw-r--r--lldb/test/functionalities/completion/TestCompletion.py10
-rw-r--r--lldb/test/functionalities/conditional_break/TestConditionalBreak.py11
-rw-r--r--lldb/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py10
-rw-r--r--lldb/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py9
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py10
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py9
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py9
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py10
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-enum-format/TestDataFormatterEnumFormat.py9
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py10
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py10
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py9
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py10
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py10
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py10
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py10
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py10
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py10
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py10
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py9
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py9
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py9
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py9
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py9
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py9
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py9
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py9
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py9
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py9
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py9
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py9
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py9
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py9
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py9
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py9
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py9
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py9
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py10
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py9
-rw-r--r--lldb/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py9
-rw-r--r--lldb/test/functionalities/data-formatter/frameformat_smallstruct/TestFrameFormatSmallStruct.py9
-rw-r--r--lldb/test/functionalities/data-formatter/hexcaps/TestDataFormatterHexCaps.py10
-rw-r--r--lldb/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py10
-rw-r--r--lldb/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py10
-rw-r--r--lldb/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py9
-rw-r--r--lldb/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py10
-rw-r--r--lldb/test/functionalities/data-formatter/ptr_ref_typedef/TestPtrRef2Typedef.py9
-rw-r--r--lldb/test/functionalities/data-formatter/refpointer-recursion/TestDataFormatterRefPtrRecursion.py9
-rw-r--r--lldb/test/functionalities/data-formatter/summary-string-onfail/Test-rdar-9974002.py10
-rw-r--r--lldb/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py9
-rw-r--r--lldb/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py10
-rw-r--r--lldb/test/functionalities/data-formatter/user-format-vs-summary/TestUserFormatVsSummary.py9
-rw-r--r--lldb/test/functionalities/data-formatter/var-in-aggregate-misuse/TestVarInAggregateMisuse.py9
-rw-r--r--lldb/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py9
-rw-r--r--lldb/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py9
-rw-r--r--lldb/test/functionalities/dead-strip/TestDeadStrip.py10
-rw-r--r--lldb/test/functionalities/disassembly/TestDisassembleBreakpoint.py10
-rw-r--r--lldb/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py9
-rw-r--r--lldb/test/functionalities/embedded_interpreter/TestConvenienceVariables.py10
-rw-r--r--lldb/test/functionalities/exec/TestExec.py10
-rw-r--r--lldb/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py9
-rw-r--r--lldb/test/functionalities/fat_archives/TestFatArchives.py10
-rw-r--r--lldb/test/functionalities/format/TestFormats.py9
-rw-r--r--lldb/test/functionalities/inferior-assert/TestInferiorAssert.py9
-rw-r--r--lldb/test/functionalities/inferior-changed/TestInferiorChanged.py10
-rw-r--r--lldb/test/functionalities/inferior-crashing/TestInferiorCrashing.py10
-rw-r--r--lldb/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py9
-rw-r--r--lldb/test/functionalities/inline-stepping/TestInlineStepping.py9
-rw-r--r--lldb/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py10
-rw-r--r--lldb/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py10
-rw-r--r--lldb/test/functionalities/load_unload/TestLoadUnload.py9
-rw-r--r--lldb/test/functionalities/longjmp/TestLongjmp.py9
-rw-r--r--lldb/test/functionalities/memory/read/TestMemoryRead.py10
-rw-r--r--lldb/test/functionalities/non-overlapping-index-variable-i/TestIndexVariable.py9
-rw-r--r--lldb/test/functionalities/nosucharch/TestNoSuchArch.py10
-rw-r--r--lldb/test/functionalities/object-file/TestImageListMultiArchitecture.py9
-rw-r--r--lldb/test/functionalities/paths/TestPaths.py10
-rw-r--r--lldb/test/functionalities/platform/TestPlatformCommand.py10
-rw-r--r--lldb/test/functionalities/plugins/commands/TestPluginCommands.py10
-rw-r--r--lldb/test/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py10
-rw-r--r--lldb/test/functionalities/postmortem/minidump/TestMiniDump.py9
-rw-r--r--lldb/test/functionalities/process_attach/TestProcessAttach.py9
-rw-r--r--lldb/test/functionalities/process_attach/attach_denied/TestAttachDenied.py10
-rw-r--r--lldb/test/functionalities/process_group/TestChangeProcessGroup.py9
-rw-r--r--lldb/test/functionalities/process_launch/TestProcessLaunch.py11
-rw-r--r--lldb/test/functionalities/recursion/TestValueObjectRecursion.py9
-rwxr-xr-xlldb/test/functionalities/register/TestRegisters.py9
-rw-r--r--lldb/test/functionalities/rerun/TestRerun.py11
-rw-r--r--lldb/test/functionalities/return-value/TestReturnValue.py9
-rw-r--r--lldb/test/functionalities/set-data/TestSetData.py9
-rw-r--r--lldb/test/functionalities/signal/TestSendSignal.py9
-rw-r--r--lldb/test/functionalities/signal/handle-segv/TestHandleSegv.py9
-rw-r--r--lldb/test/functionalities/signal/raise/TestRaise.py9
-rw-r--r--lldb/test/functionalities/single-quote-in-filename-to-lldb/TestSingleQuoteInFilename.py10
-rw-r--r--lldb/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py10
-rw-r--r--lldb/test/functionalities/stop-hook/TestStopHookCmd.py8
-rw-r--r--lldb/test/functionalities/stop-hook/TestStopHookMechanism.py10
-rw-r--r--lldb/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py10
-rw-r--r--lldb/test/functionalities/target_command/TestTargetCommand.py9
-rw-r--r--lldb/test/functionalities/thread/TestNumThreads.py9
-rw-r--r--lldb/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py9
-rw-r--r--lldb/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py11
-rw-r--r--lldb/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py10
-rw-r--r--lldb/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py10
-rw-r--r--lldb/test/functionalities/thread/create_during_step/TestCreateDuringStep.py9
-rw-r--r--lldb/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py9
-rw-r--r--lldb/test/functionalities/thread/exit_during_step/TestExitDuringStep.py9
-rw-r--r--lldb/test/functionalities/thread/jump/TestThreadJump.py9
-rw-r--r--lldb/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py9
-rw-r--r--lldb/test/functionalities/thread/state/TestThreadStates.py10
-rw-r--r--lldb/test/functionalities/thread/step_out/TestThreadStepOut.py9
-rw-r--r--lldb/test/functionalities/thread/thread_exit/TestThreadExit.py9
-rw-r--r--lldb/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py10
-rw-r--r--lldb/test/functionalities/tty/TestTerminal.py11
-rw-r--r--lldb/test/functionalities/type_completion/TestTypeCompletion.py9
-rw-r--r--lldb/test/functionalities/type_lookup/TestTypeLookup.py9
-rw-r--r--lldb/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py10
-rw-r--r--lldb/test/functionalities/unwind/sigtramp/TestSigtrampUnwind.py9
-rw-r--r--lldb/test/functionalities/unwind/standard/TestStandardUnwind.py10
-rw-r--r--lldb/test/functionalities/value_md5_crash/TestValueMD5Crash.py9
-rw-r--r--lldb/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py10
-rw-r--r--lldb/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py10
-rw-r--r--lldb/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py10
-rw-r--r--lldb/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py9
-rw-r--r--lldb/test/functionalities/watchpoint/variable_out_of_scope/TestWatchedVarHitWhenInScope.py11
-rw-r--r--lldb/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py10
-rw-r--r--lldb/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py10
-rw-r--r--lldb/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py10
-rw-r--r--lldb/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py10
-rw-r--r--lldb/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py9
-rw-r--r--lldb/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py9
-rw-r--r--lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py10
-rw-r--r--lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py10
162 files changed, 328 insertions, 1216 deletions
diff --git a/lldb/test/functionalities/abbreviation/TestAbbreviations.py b/lldb/test/functionalities/abbreviation/TestAbbreviations.py
index d0bbd15b749..86268bba1a2 100644
--- a/lldb/test/functionalities/abbreviation/TestAbbreviations.py
+++ b/lldb/test/functionalities/abbreviation/TestAbbreviations.py
@@ -2,8 +2,9 @@
Test some lldb command abbreviations and aliases for proper resolution.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -96,11 +97,3 @@ class AbbreviationsTestCase(TestBase):
#self.runCmd("se cl prompt")
#self.expect("set sh prompt",
# startstr = 'prompt (string) = "(lldb) "')
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
-
diff --git a/lldb/test/functionalities/abbreviation/TestCommonShortSpellings.py b/lldb/test/functionalities/abbreviation/TestCommonShortSpellings.py
index 5f7e84df40c..d184edc6572 100644
--- a/lldb/test/functionalities/abbreviation/TestCommonShortSpellings.py
+++ b/lldb/test/functionalities/abbreviation/TestCommonShortSpellings.py
@@ -3,8 +3,9 @@ Test some lldb command abbreviations to make sure the common short spellings of
many commands remain available even after we add/delete commands in the future.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -33,11 +34,3 @@ class CommonShortSpellingsTestCase(TestBase):
command_interpreter.ResolveCommand(short, result)
self.assertTrue(result.Succeeded())
self.assertEqual(long, result.GetOutput())
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
-
diff --git a/lldb/test/functionalities/archives/TestBSDArchives.py b/lldb/test/functionalities/archives/TestBSDArchives.py
index 0404e25a39e..9246c5eaf58 100644
--- a/lldb/test/functionalities/archives/TestBSDArchives.py
+++ b/lldb/test/functionalities/archives/TestBSDArchives.py
@@ -1,7 +1,8 @@
"""Test breaking inside functions defined within a BSD archive file libfoo.a."""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -52,10 +53,3 @@ class BSDArchivesTestCase(TestBase):
substrs = ['(int) arg = 2'])
self.expect("frame variable __b_global", VARIABLES_DISPLAYED_CORRECTLY,
substrs = ['(int) __b_global = 2'])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/asan/TestMemoryHistory.py b/lldb/test/functionalities/asan/TestMemoryHistory.py
index 541c1c5fa14..d9334d5f2a2 100644
--- a/lldb/test/functionalities/asan/TestMemoryHistory.py
+++ b/lldb/test/functionalities/asan/TestMemoryHistory.py
@@ -2,8 +2,9 @@
Test that ASan memory history provider returns correct stack traces
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -102,9 +103,3 @@ class AsanTestCase(TestBase):
self.expect("memory history 'another_pointer'",
substrs = [
'Memory allocated at', 'a.out`f1', 'main.c:%d' % self.line_malloc2])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/asan/TestReportData.py b/lldb/test/functionalities/asan/TestReportData.py
index cfa0141dd36..19e0b61498a 100644
--- a/lldb/test/functionalities/asan/TestReportData.py
+++ b/lldb/test/functionalities/asan/TestReportData.py
@@ -2,8 +2,9 @@
Test the AddressSanitizer runtime support for report breakpoint and data extraction.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -78,9 +79,3 @@ class AsanTestReportDataCase(TestBase):
s = s.GetData()
data2 = json.loads(s)
self.assertEqual(data, data2)
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/attach_resume/TestAttachResume.py b/lldb/test/functionalities/attach_resume/TestAttachResume.py
index c03d7d75685..0a5e7f20eab 100644
--- a/lldb/test/functionalities/attach_resume/TestAttachResume.py
+++ b/lldb/test/functionalities/attach_resume/TestAttachResume.py
@@ -2,8 +2,9 @@
Test process attach/resume.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -66,9 +67,3 @@ class AttachResumeTestCase(TestBase):
# make sure to detach while in running state (r204759)
self.runCmd("detach")
lldbutil.expect_state_changes(self, listener, [lldb.eStateDetached])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/avoids-fd-leak/TestFdLeak.py b/lldb/test/functionalities/avoids-fd-leak/TestFdLeak.py
index c28221a7f90..abceb6a3ca4 100644
--- a/lldb/test/functionalities/avoids-fd-leak/TestFdLeak.py
+++ b/lldb/test/functionalities/avoids-fd-leak/TestFdLeak.py
@@ -2,8 +2,9 @@
Test whether a process started by lldb has no extra file descriptors open.
"""
+import lldb_shared
+
import os
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -70,10 +71,3 @@ class AvoidsFdLeakTestCase(TestBase):
self.assertTrue(process2.GetState() == lldb.eStateExited, "Process should have exited.")
self.assertTrue(process2.GetExitStatus() == 0,
"Process returned non-zero status. Were incorrect file descriptors passed?")
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/backticks/TestBackticksWithoutATarget.py b/lldb/test/functionalities/backticks/TestBackticksWithoutATarget.py
index 7d9be675292..d2a6e5ce87e 100644
--- a/lldb/test/functionalities/backticks/TestBackticksWithoutATarget.py
+++ b/lldb/test/functionalities/backticks/TestBackticksWithoutATarget.py
@@ -2,8 +2,9 @@
Test that backticks without a target should work (not infinite looping).
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
@@ -16,9 +17,3 @@ class BackticksWithNoTargetTestCase(TestBase):
"""A simple test of backticks without a target."""
self.expect("print `1+2-3`",
substrs = [' = 0'])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py b/lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
index d6a9f70baa9..660f463ee90 100644
--- a/lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
+++ b/lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
@@ -2,8 +2,9 @@
Test lldb breakpoint command add/list/delete.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -201,9 +202,3 @@ class BreakpointCommandTestCase(TestBase):
# Now remove 'output-2.txt'
os.remove ('output-2.txt')
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py b/lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py
index c7bc773d4d5..0058bff9d80 100644
--- a/lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py
+++ b/lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py
@@ -2,9 +2,10 @@
Test that you can set breakpoint commands successfully with the Python API's:
"""
+import lldb_shared
+
import os
import re
-import unittest2
import lldb, lldbutil
import sys
from lldbtest import *
@@ -89,10 +90,3 @@ print 'Hit breakpoint'")
self.assertTrue(os.path.isfile("output2.txt"),
"'output2.txt' exists due to breakpoint command for breakpoint function.")
self.RemoveTempFile("output2.txt")
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/breakpoint/breakpoint_command/TestRegexpBreakCommand.py b/lldb/test/functionalities/breakpoint/breakpoint_command/TestRegexpBreakCommand.py
index e5fda67c212..2e2eac98aa4 100644
--- a/lldb/test/functionalities/breakpoint/breakpoint_command/TestRegexpBreakCommand.py
+++ b/lldb/test/functionalities/breakpoint/breakpoint_command/TestRegexpBreakCommand.py
@@ -2,8 +2,9 @@
Test _regexp-break command which uses regular expression matching to dispatch to other built in breakpoint commands.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -46,10 +47,3 @@ class RegexpBreakCommandTestCase(TestBase):
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
substrs = ['stopped',
'stop reason = breakpoint'])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py b/lldb/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
index 1aa01542075..2c3090436e3 100644
--- a/lldb/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
+++ b/lldb/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
@@ -2,9 +2,10 @@
Test breakpoint conditions with 'breakpoint modify -c <expr> id'.
"""
+import lldb_shared
+
import os, time
import re
-import unittest2
import lldb, lldbutil
from lldbtest import *
@@ -172,10 +173,3 @@ class BreakpointConditionsTestCase(TestBase):
self.assertTrue(breakpoint.GetHitCount() == 1)
process.Continue()
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py b/lldb/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py
index efab6fba918..effd1ef2231 100644
--- a/lldb/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py
+++ b/lldb/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py
@@ -2,8 +2,9 @@
Test lldb breakpoint ids.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -46,10 +47,3 @@ class BreakpointIDTestCase(TestBase):
self.expect ("breakpoint enable 2.*",
patterns = [ ".* breakpoints enabled."] )
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
-
diff --git a/lldb/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py b/lldb/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py
index 6daa68d8a45..690d35da424 100644
--- a/lldb/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py
+++ b/lldb/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py
@@ -2,9 +2,10 @@
Test breakpoint ignore count features.
"""
+import lldb_shared
+
import os, time
import re
-import unittest2
import lldb, lldbutil
from lldbtest import *
@@ -130,10 +131,3 @@ class BreakpointIgnoreCountTestCase(TestBase):
self.assertTrue(breakpoint.GetHitCount() == 3)
process.Continue()
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py b/lldb/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py
index 9e118406dbc..e992df3dcd5 100644
--- a/lldb/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py
+++ b/lldb/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py
@@ -2,8 +2,9 @@
Test breakpoint commands for a breakpoint ID with multiple locations.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -83,10 +84,3 @@ class BreakpointLocationsTestCase(TestBase):
patterns = ["1\.1: .+ unresolved, hit count = 0 +Options: disabled",
"1\.2: .+ resolved, hit count = 1",
"1\.3: .+ resolved, hit count = 1"])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/breakpoint/breakpoint_options/TestBreakpointOptions.py b/lldb/test/functionalities/breakpoint/breakpoint_options/TestBreakpointOptions.py
index b71fbabea7e..a2545adebb5 100644
--- a/lldb/test/functionalities/breakpoint/breakpoint_options/TestBreakpointOptions.py
+++ b/lldb/test/functionalities/breakpoint/breakpoint_options/TestBreakpointOptions.py
@@ -2,8 +2,9 @@
Test breakpoint command for different options.
"""
+import lldb_shared
+
import os
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -88,9 +89,3 @@ class BreakpointOptionsTestCase(TestBase):
# We should exit.
self.expect("process status", "Process exited successfully",
patterns = ["^Process [0-9]+ exited with status = 0"])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py b/lldb/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
index ba2a54932e9..809a7944503 100644
--- a/lldb/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
+++ b/lldb/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
@@ -1,8 +1,9 @@
"""
Test breakpoint command with AT_comp_dir set to symbolic link.
"""
+import lldb_shared
+
import os
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -58,10 +59,3 @@ class CompDirSymLinkTestCase(TestBase):
exe = os.path.join(os.getcwd(), _EXE_NAME)
self.runCmd('file ' + exe, CURRENT_EXECUTABLE_SET)
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py b/lldb/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py
index 5f94352953a..103b38c7624 100644
--- a/lldb/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py
+++ b/lldb/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py
@@ -2,6 +2,8 @@
Test continue from a breakpoint when there is a breakpoint on the next instruction also.
"""
+import lldb_shared
+
import unittest2
import lldb, lldbutil
from lldbtest import *
@@ -61,10 +63,3 @@ class ConsecutiveBreakpoitsTestCase(TestBase):
# Run the process until termination
process.Continue()
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
-
diff --git a/lldb/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py b/lldb/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py
index 23ccbb54078..fb27df1a11a 100644
--- a/lldb/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py
+++ b/lldb/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py
@@ -2,8 +2,9 @@
Test lldb breakpoint ids.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -57,11 +58,3 @@ class TestCPPBreakpointLocations(TestBase):
for bp_dict in bp_dicts:
self.verify_breakpoint_locations(target, bp_dict)
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
-
diff --git a/lldb/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py b/lldb/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py
index aa52a2cf1a5..e01bdb4828d 100644
--- a/lldb/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py
+++ b/lldb/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py
@@ -2,9 +2,10 @@
Test that you can set breakpoint and hit the C++ language exception breakpoint
"""
+import lldb_shared
+
import os
import re
-import unittest2
import lldb, lldbutil
import sys
from lldbtest import *
@@ -42,9 +43,3 @@ class TestCPPExceptionBreakpoint (TestBase):
thread_list = lldbutil.get_threads_stopped_at_breakpoint (process, exception_bkpt)
self.assertTrue (len(thread_list) == 1, "One thread stopped at the exception breakpoint.")
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/breakpoint/dummy_target_breakpoints/TestBreakpointsWithNoTargets.py b/lldb/test/functionalities/breakpoint/dummy_target_breakpoints/TestBreakpointsWithNoTargets.py
index 65197ed5290..da62c9dc754 100644
--- a/lldb/test/functionalities/breakpoint/dummy_target_breakpoints/TestBreakpointsWithNoTargets.py
+++ b/lldb/test/functionalities/breakpoint/dummy_target_breakpoints/TestBreakpointsWithNoTargets.py
@@ -2,8 +2,9 @@
Test breakpoint commands set before we have a target
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -62,9 +63,3 @@ class BreakpointInDummyTarget (TestBase):
# Stopped again.
self.expect("thread backtrace", STOPPED_DUE_TO_BREAKPOINT,
substrs = ["stop reason = breakpoint 2."])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py b/lldb/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py
index 5681b1281c7..d12b39d1cb7 100644
--- a/lldb/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py
+++ b/lldb/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py
@@ -3,8 +3,9 @@ Test that inlined breakpoints (breakpoint set on a file/line included from
another source file) works correctly.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -52,10 +53,3 @@ class InlinedBreakpointsTestCase(TestBase):
substrs = ['stopped',
'stop reason = breakpoint',
'basic_type.cpp:%d' % self.line])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py b/lldb/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py
index 6feb31a13fe..b61132d5e32 100644
--- a/lldb/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py
+++ b/lldb/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py
@@ -3,8 +3,9 @@ Test that objective-c constant strings are generated correctly by the expression
parser.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -89,9 +90,3 @@ class TestObjCBreakpoints(TestBase):
# Check breakpoints again, this time using the symbol table only
self.check_category_breakpoints()
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/command_history/TestCommandHistory.py b/lldb/test/functionalities/command_history/TestCommandHistory.py
index 6cca992ced3..3022433a594 100644
--- a/lldb/test/functionalities/command_history/TestCommandHistory.py
+++ b/lldb/test/functionalities/command_history/TestCommandHistory.py
@@ -2,8 +2,9 @@
Test the command history mechanism
"""
+import lldb_shared
+
import os
-import unittest2
import lldb
from lldbtest import *
@@ -63,10 +64,3 @@ class CommandHistoryTestCase(TestBase):
self.expect ("command history -c 1 -e 3 -s 5",error=True, inHistory=True,
substrs = ['error: --count, --start-index and --end-index cannot be all specified in the same invocation'])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/command_regex/TestCommandRegex.py b/lldb/test/functionalities/command_regex/TestCommandRegex.py
index 93c0aa4fed5..5400b547fce 100644
--- a/lldb/test/functionalities/command_regex/TestCommandRegex.py
+++ b/lldb/test/functionalities/command_regex/TestCommandRegex.py
@@ -2,8 +2,9 @@
Test lldb 'commands regex' command which allows the user to create a regular expression command.
"""
+import lldb_shared
+
import os
-import unittest2
import lldb
from lldbtest import *
@@ -51,9 +52,3 @@ class CommandRegexTestCase(TestBase):
child.sendline('Help__')
child.expect_exact("error: 'Help__' is not a valid command")
child.expect_exact(prompt)
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/command_script/TestCommandScript.py b/lldb/test/functionalities/command_script/TestCommandScript.py
index 40d0b694fa9..b8a891630c3 100644
--- a/lldb/test/functionalities/command_script/TestCommandScript.py
+++ b/lldb/test/functionalities/command_script/TestCommandScript.py
@@ -2,8 +2,9 @@
Test lldb Python commands.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
@@ -137,10 +138,3 @@ class CmdPythonTestCase(TestBase):
self.runCmd('command script add -f bug11569 bug11569')
# This should not crash.
self.runCmd('bug11569', check=False)
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
-
diff --git a/lldb/test/functionalities/command_script/import/TestImport.py b/lldb/test/functionalities/command_script/import/TestImport.py
index a00db8e7dfe..f413bdc4baa 100644
--- a/lldb/test/functionalities/command_script/import/TestImport.py
+++ b/lldb/test/functionalities/command_script/import/TestImport.py
@@ -1,7 +1,8 @@
"""Test custom import command to import files by path."""
+import lldb_shared
+
import os, sys, time
-import unittest2
import lldb
from lldbtest import *
@@ -68,10 +69,3 @@ class ImportTestCase(TestBase):
substrs = ['barutil says', 'bar told me', 'hello'])
self.expect("foobarcmd hello",
substrs = ['foobar says', 'hello'])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py b/lldb/test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py
index 17368197e0b..4b19386379b 100644
--- a/lldb/test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py
+++ b/lldb/test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py
@@ -1,7 +1,8 @@
"""Check that we handle an ImportError in a special way when command script importing files."""
+import lldb_shared
+
import os, sys, time
-import unittest2
import lldb
from lldbtest import *
@@ -26,9 +27,3 @@ class Rdar12586188TestCase(TestBase):
error=True, substrs = ['raise ImportError("I do not want to be imported")'])
self.expect("command script import ./fail212586188.py --allow-reload",
error=True, substrs = ['raise ValueError("I do not want to be imported")'])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/command_source/TestCommandSource.py b/lldb/test/functionalities/command_source/TestCommandSource.py
index 122d4c69d88..22f8ff74798 100644
--- a/lldb/test/functionalities/command_source/TestCommandSource.py
+++ b/lldb/test/functionalities/command_source/TestCommandSource.py
@@ -4,8 +4,9 @@ Test that lldb command "command source" works correctly.
See also http://llvm.org/viewvc/llvm-project?view=rev&revision=109673.
"""
+import lldb_shared
+
import os, sys
-import unittest2
import lldb
from lldbtest import *
@@ -31,10 +32,3 @@ class CommandSourceTestCase(TestBase):
self.expect(result.GetOutput(), "script my.date() runs successfully",
exe=False,
substrs = [str(datetime.date.today())])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/completion/TestCompletion.py b/lldb/test/functionalities/completion/TestCompletion.py
index fa2c427a588..f2c5302a7d4 100644
--- a/lldb/test/functionalities/completion/TestCompletion.py
+++ b/lldb/test/functionalities/completion/TestCompletion.py
@@ -2,8 +2,9 @@
Test the lldb command line completion mechanism.
"""
+import lldb_shared
+
import os
-import unittest2
import lldb
from lldbtest import *
@@ -318,10 +319,3 @@ class CommandLineCompletionTestCase(TestBase):
else:
self.expect(from_child, msg=COMPLETION_MSG(str_input, p), exe=False,
patterns = [p])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/conditional_break/TestConditionalBreak.py b/lldb/test/functionalities/conditional_break/TestConditionalBreak.py
index 4ca3a010550..f077bcdc919 100644
--- a/lldb/test/functionalities/conditional_break/TestConditionalBreak.py
+++ b/lldb/test/functionalities/conditional_break/TestConditionalBreak.py
@@ -2,9 +2,10 @@
Test conditionally break on a function and inspect its variables.
"""
+import lldb_shared
+
import os, time
import re
-import unittest2
import lldb, lldbutil
from lldbtest import *
@@ -128,11 +129,3 @@ class ConditionalBreakTestCase(TestBase):
self.runCmd("frame select 1")
self.expect("frame info", "The immediate caller should be a()",
substrs = ["a.out`a"])
-
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py b/lldb/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py
index 4464ba0b127..ed73ccc0537 100644
--- a/lldb/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py
+++ b/lldb/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import datetime
@@ -67,10 +68,3 @@ class DataFormatterBoolRefPtr(TestBase):
substrs = ['YES'])
self.expect('frame variable no',
substrs = ['NO'])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py b/lldb/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py
index eeb5ffbcff1..9fd66a0148d 100644
--- a/lldb/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py
+++ b/lldb/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -53,9 +54,3 @@ class CompactVectorsFormattingTestCase(TestBase):
'(vSInt16) valueS16 = (1, 0, 4, 0, 0, 1, 0, 4)',
'(vSInt32) valueS32 = (4, 3, 2, 1)',
'(vBool32) valueBool32 = (0, 1, 0, 1)'])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py b/lldb/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
index 97dcb7447b8..f645febe751 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -280,10 +281,3 @@ class AdvDataFormatterTestCase(TestBase):
'o_2'])
self.expect('frame variable a_long_guy --show-all-children', matching=False,
substrs = ['...'])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py b/lldb/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py
index 6aa51e012b8..a367e391a6e 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -321,9 +322,3 @@ class CategoriesDataFormatterTestCase(TestBase):
self.expect('frame variable r2',
substrs = ['w = 9',
'h = 16'])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py b/lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
index 259abc030f2..f2911eccd34 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -260,9 +261,3 @@ class CppDataFormatterTestCase(TestBase):
self.expect("frame variable iAmInt --format hex", substrs = ['(int) iAmInt = 0x00000001'])
self.expect("frame variable iAmInt", matching=False, substrs = ['(int) iAmInt = 0x00000001'])
self.expect("frame variable iAmInt", substrs = ['(int) iAmInt = 1'])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py b/lldb/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py
index e15f17d82ff..7be7276a918 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -75,10 +76,3 @@ class DataFormatterDisablingTestCase(TestBase):
# last check - our cleanup will re-enable everything
self.runCmd('type category disable *')
self.expect('type category list', substrs = ['system','disabled'])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-enum-format/TestDataFormatterEnumFormat.py b/lldb/test/functionalities/data-formatter/data-formatter-enum-format/TestDataFormatterEnumFormat.py
index 4c3d390025a..e004e59ca1b 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-enum-format/TestDataFormatterEnumFormat.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-enum-format/TestDataFormatterEnumFormat.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -60,9 +61,3 @@ class EnumFormatTestCase(TestBase):
'(int) y = Case45',
'(int) z = 43'
]);
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py b/lldb/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py
index 44ed11b0ed3..d81891c4ff2 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -62,10 +63,3 @@ class GlobalsDataFormatterTestCase(TestBase):
self.expect("target variable g_point_pointer",
substrs = ['(Point *) g_point_pointer ='])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py b/lldb/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py
index 12f59b7c2de..516c54e593f 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -117,10 +118,3 @@ class NamedSummariesDataFormatterTestCase(TestBase):
self.expect("frame variable first",matching=False,
substrs = ['FirstAndFriends: x=12',
'y=34'])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py b/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
index eced5a13b77..c7ee9f6bf2e 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
@@ -3,8 +3,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import datetime
@@ -459,9 +460,3 @@ class ObjCDataFormatterTestCase(TestBase):
self.runCmd("continue")
self.expect("frame variable _cmd",substrs = ['setAtoms:'])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py b/lldb/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py
index fb0442957ce..2778035d149 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py
@@ -3,8 +3,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import datetime
@@ -102,10 +103,3 @@ class NSStringDataFormatterTestCase(TestBase):
self.expect('po strwithNULs2', substrs=['a very much boring task to write'])
self.expect('expr [strwithNULs2 length]', substrs=['52'])
self.expect('frame variable strwithNULs2', substrs=['@"a very much boring task to write\\0a string this way!!'])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py b/lldb/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py
index e8b915f29c7..30d13231883 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import datetime
@@ -85,10 +86,3 @@ class DataFormatterOneIsSingularTestCase(TestBase):
substrs = ['1 byte'])
self.expect('frame variable immutableData', matching=False,
substrs = ['1 bytes'])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py b/lldb/test/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py
index 172cfdd1a8d..84cb74bcee1 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -52,10 +53,3 @@ class PtrToArrayDataFormatterTestCase(TestBase):
substrs = ['01 00 00 00 02 00 00 00 03 00 00 00'])
self.expect('p *(int (*)[3])foo', matching=False,
substrs = ['0x000000030000000200000001'])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py b/lldb/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py
index f6a3e2d14d4..39e363a986d 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -247,10 +248,3 @@ class PythonSynthDataFormatterTestCase(TestBase):
self.assertTrue(str_cast.find('T') != -1, 'could not find T in output')
self.assertTrue(str_cast.find('F') != -1, 'could not find F in output')
self.assertTrue(str_cast.find("4 = '\\0'") != -1, 'could not find item 4 == 0')
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py b/lldb/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py
index 4eecda472c0..b025ba0dbd8 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -165,10 +166,3 @@ class ScriptDataFormatterTestCase(TestBase):
self.expect("frame variable array",
substrs = ['Python summary'])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py b/lldb/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py
index 5ef92574c51..03e713e5569 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -170,10 +171,3 @@ class SkipSummaryDataFormatterTestCase(TestBase):
substrs = ['(DeepData_5) data2.m_child4.m_child2.m_child2 = {',
'm_some_text = "Just a test"',
'}'])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py b/lldb/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py
index e4eb325bbcc..bb0e4e571ae 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -343,10 +344,3 @@ class SmartArrayDataFormatterTestCase(TestBase):
substrs = ['intarr = arr = ',
'09 00 00 00',
'....,07 00 00 00'])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py
index 7abb6eded71..24878443d10 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -35,9 +36,3 @@ class InitializerListTestCase(TestBase):
self.expect("frame variable ils", substrs = ['[4] = "surprise it is a long string!! yay!!"'])
self.expect('image list', substrs = self.getLibcPlusPlusLibs())
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
index 82ff6d131bb..8781f45faae 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -61,9 +62,3 @@ class LibcxxIteratorDataFormatterTestCase(TestBase):
self.expect('frame variable svI', substrs = ['item = "hello"'])
self.expect('expr svI', substrs = ['item = "hello"'])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
index 3390ae3d01c..9f7d2947fd6 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time, re
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -181,9 +182,3 @@ class LibcxxListDataFormatterTestCase(TestBase):
self.assertTrue(countingList.GetChildAtIndex(0).GetValueAsUnsigned(0) == 3141, "uniqued list[0] == 3141")
self.assertTrue(countingList.GetChildAtIndex(1).GetValueAsUnsigned(0) == 3142, "uniqued list[1] == 3142")
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py
index f89369c4c19..1681e32a4ff 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py
@@ -3,8 +3,9 @@ Test that the debugger handles loops in std::list (which can appear as a result
corruption).
"""
+import lldb_shared
+
import os, time, re
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -48,9 +49,3 @@ class LibcxxListDataFormatterTestCase(TestBase):
# Run to completion.
process.Continue()
self.assertEqual(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/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
index 25565bf4045..54406bd547f 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -293,9 +294,3 @@ class LibcxxMapDataFormatterTestCase(TestBase):
self.expect('frame variable ss',
substrs = ['size=0',
'{}'])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py
index ebd74fb839f..d7f1f7dcb01 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -293,9 +294,3 @@ class LibcxxMultiMapDataFormatterTestCase(TestBase):
self.expect('frame variable ss',
substrs = ['size=0',
'{}'])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py
index 68d1c9e77ed..da59ee51f64 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -64,9 +65,3 @@ class LibcxxMultiSetDataFormatterTestCase(TestBase):
self.expect("frame variable ss[2]",substrs = [' = "b"'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable ss",substrs = ["size=3",'[0] = "a"','[1] = "a very long string is right here"','[2] = "c"'])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py
index e6ceff983b5..c775b28ef77 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -64,9 +65,3 @@ class LibcxxSetDataFormatterTestCase(TestBase):
self.expect("frame variable ss[2]",substrs = [' = "b"'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable ss",substrs = ["size=3",'[0] = "a"','[1] = "a very long string is right here"','[2] = "c"'])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
index ee050cdfd56..c69bab5a912 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
@@ -3,8 +3,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -81,9 +82,3 @@ class LibcxxStringDataFormatterTestCase(TestBase):
'(std::__1::string) Q = "quite a long std::strin with lots of info inside it"',
'(std::__1::string) IHaveEmbeddedZeros = "a\\0b\\0c\\0d"',
'(std::__1::wstring) IHaveEmbeddedZerosToo = L"hello world!\\0てざ ル゜䋨ミ㠧槊 きゅへ狦穤襩 じゃ馩リョ 䤦監"'])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py
index 04caa51b98c..cd8172bbde1 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -70,9 +71,3 @@ class LibcxxUnorderedDataFormatterTestCase(TestBase):
def look_for_content_and_continue(self, var_name, patterns):
self.expect( ("frame variable %s" % var_name), patterns=patterns)
self.runCmd("continue")
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py
index 92368d13225..e4e65ed50d4 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -53,9 +54,3 @@ class LibcxxVBoolDataFormatterTestCase(TestBase):
self.expect("expr vBool",
substrs = ['size=49','[0] = false','[1] = true','[18] = false','[27] = true','[36] = false','[47] = true','[48] = true'])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py
index 5cec93ed61e..086972da7ba 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -175,9 +176,3 @@ class LibcxxVectorDataFormatterTestCase(TestBase):
self.expect("frame variable strings",
substrs = ['vector has 0 items'])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py
index 9b830787152..08a89d89333 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -58,9 +59,3 @@ class StdIteratorDataFormatterTestCase(TestBase):
self.expect('frame variable svI', substrs = ['item = "hello"'])
self.expect('expr svI', substrs = ['item = "hello"'])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py
index f82caa85a4b..5f8468b1f5d 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -184,9 +185,3 @@ class StdListDataFormatterTestCase(TestBase):
# check that MightHaveChildren() gets it right
self.assertTrue(self.frame().FindVariable("text_list").MightHaveChildren(), "text_list.MightHaveChildren() says False for non empty!")
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py
index 0a2cdf1c0c0..89be9575beb 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -317,9 +318,3 @@ class StdMapDataFormatterTestCase(TestBase):
self.expect('frame variable ss',
substrs = ['map has 0 items',
'{}'])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py
index 1a13571c4d6..7f071875cb6 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py
@@ -3,8 +3,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -62,9 +63,3 @@ class StdStringDataFormatterTestCase(TestBase):
self.runCmd("next")
self.assertTrue(var_S.GetSummary() == 'L"!!!!!"', "new S summary wrong")
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py
index ec34c528ad3..71434eff620 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -53,9 +54,3 @@ class StdVBoolDataFormatterTestCase(TestBase):
self.expect("expr vBool",
substrs = ['size=49','[0] = false','[1] = true','[18] = false','[27] = true','[36] = false','[47] = true','[48] = true'])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py
index c268317144b..30ded55f901 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -202,9 +203,3 @@ class StdVectorDataFormatterTestCase(TestBase):
self.expect("frame variable strings",
substrs = ['vector has 0 items'])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py b/lldb/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py
index dc125366da0..f6bdacc98f1 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -201,10 +202,3 @@ class SynthDataFormatterTestCase(TestBase):
self.runCmd('type summary add -e -h -s "I am really empty" EmptyStruct')
self.expect('frame variable es', substrs = ["I am really empty"])
self.expect('frame variable es', substrs = ["I am really empty {}"], matching=False)
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py b/lldb/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py
index 65f57332221..418083dc939 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -91,9 +92,3 @@ class DataFormatterSynthValueTestCase(TestBase):
self.assertEqual(ma.GetNumChildren(15), 15)
self.assertEqual(ma.GetNumChildren(16), 16)
self.assertEqual(ma.GetNumChildren(17), 16)
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py b/lldb/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py
index 6a949ff0373..471086b9a2f 100644
--- a/lldb/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py
+++ b/lldb/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py
@@ -2,8 +2,9 @@
Check if changing Format on an SBValue correctly propagates that new format to children as it should
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -70,9 +71,3 @@ class FormatPropagationTestCase(TestBase):
Y.SetFormat(lldb.eFormatDefault)
self.assertTrue(X.GetValue() == "0x00000004", "X is not hex as it asked")
self.assertTrue(Y.GetValue() == "2", "Y is not defaulted")
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/frameformat_smallstruct/TestFrameFormatSmallStruct.py b/lldb/test/functionalities/data-formatter/frameformat_smallstruct/TestFrameFormatSmallStruct.py
index 1e9008ac7db..ad5ee5ade7c 100644
--- a/lldb/test/functionalities/data-formatter/frameformat_smallstruct/TestFrameFormatSmallStruct.py
+++ b/lldb/test/functionalities/data-formatter/frameformat_smallstruct/TestFrameFormatSmallStruct.py
@@ -2,8 +2,9 @@
Test that the user can input a format but it will not prevail over summary format's choices.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -33,9 +34,3 @@ class FrameFormatSmallStructTestCase(TestBase):
'stop reason = breakpoint'])
self.expect("thread list", substrs = ['addPair(p=(x = 3, y = -3))'])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/hexcaps/TestDataFormatterHexCaps.py b/lldb/test/functionalities/data-formatter/hexcaps/TestDataFormatterHexCaps.py
index dc486c7bf2a..909c00f2b9f 100644
--- a/lldb/test/functionalities/data-formatter/hexcaps/TestDataFormatterHexCaps.py
+++ b/lldb/test/functionalities/data-formatter/hexcaps/TestDataFormatterHexCaps.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -77,10 +78,3 @@ class DataFormatterHexCapsTestCase(TestBase):
self.runCmd("type summary add -s \"${var.first%X} and ${var.second%X}\" foo")
self.expect('frame variable mine',
substrs = ['(foo) mine = 0xAABBCCDD and 0xFF00FF00'])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py b/lldb/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py
index 885bec8012e..30846038285 100644
--- a/lldb/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py
+++ b/lldb/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import datetime
@@ -62,10 +63,3 @@ class NSArraySyntheticTestCase(TestBase):
self.assertTrue(self.frame().FindVariable("arr").MightHaveChildren(), "arr says it does not have children!")
self.assertTrue(self.frame().FindVariable("other_arr").MightHaveChildren(), "arr says it does not have children!")
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py b/lldb/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py
index c9454fcee05..54442f2b32a 100644
--- a/lldb/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py
+++ b/lldb/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import datetime
@@ -64,10 +65,3 @@ class NSDictionarySyntheticTestCase(TestBase):
self.assertTrue(self.frame().FindVariable("dictionary").MightHaveChildren(), "dictionary says it does not have children!")
self.assertTrue(self.frame().FindVariable("mutabledict").MightHaveChildren(), "mutable says it does not have children!")
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py b/lldb/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py
index 1b57f0fcbcb..41f7049882f 100644
--- a/lldb/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py
+++ b/lldb/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import datetime
@@ -69,9 +70,3 @@ class NSSetSyntheticTestCase(TestBase):
substrs = ['4 elements'])
self.expect('frame variable mutable --ptr-depth 1 -d run -T',
substrs = ['4 elements','[0]','[1]','[2]','[3]','hello','world','(int)1','(int)2'])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py b/lldb/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py
index afca9bd0493..b044fc7f172 100644
--- a/lldb/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py
+++ b/lldb/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import datetime
@@ -47,10 +48,3 @@ class DataFormatterOSTypeTestCase(TestBase):
# Now check that we use the right summary for OSType
self.expect('frame variable',
substrs = ["'test'","'best'"])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/ptr_ref_typedef/TestPtrRef2Typedef.py b/lldb/test/functionalities/data-formatter/ptr_ref_typedef/TestPtrRef2Typedef.py
index 7bac2cfae21..88e345c6fce 100644
--- a/lldb/test/functionalities/data-formatter/ptr_ref_typedef/TestPtrRef2Typedef.py
+++ b/lldb/test/functionalities/data-formatter/ptr_ref_typedef/TestPtrRef2Typedef.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -52,9 +53,3 @@ class PtrRef2TypedefTestCase(TestBase):
# the match.
self.expect("frame variable y", substrs = ['(Foo &', ') y = 0x','IntLRef'])
self.expect("frame variable z", substrs = ['(Foo &&', ') z = 0x','IntRRef'])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/refpointer-recursion/TestDataFormatterRefPtrRecursion.py b/lldb/test/functionalities/data-formatter/refpointer-recursion/TestDataFormatterRefPtrRecursion.py
index e9927f13b1a..0869ea9e74b 100644
--- a/lldb/test/functionalities/data-formatter/refpointer-recursion/TestDataFormatterRefPtrRecursion.py
+++ b/lldb/test/functionalities/data-formatter/refpointer-recursion/TestDataFormatterRefPtrRecursion.py
@@ -2,8 +2,9 @@
Test that ValueObjectPrinter does not cause an infinite loop when a reference to a struct that contains a pointer to itself is printed.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -36,9 +37,3 @@ class DataFormatterRefPtrRecursionTestCase(TestBase):
self.expect("frame variable foo --ptr-depth=1", substrs = ['ID = 1']);
self.expect("frame variable foo --ptr-depth=2", substrs = ['ID = 1']);
self.expect("frame variable foo --ptr-depth=3", substrs = ['ID = 1']);
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/summary-string-onfail/Test-rdar-9974002.py b/lldb/test/functionalities/data-formatter/summary-string-onfail/Test-rdar-9974002.py
index 6dc9e1216a2..4b0ed7384ed 100644
--- a/lldb/test/functionalities/data-formatter/summary-string-onfail/Test-rdar-9974002.py
+++ b/lldb/test/functionalities/data-formatter/summary-string-onfail/Test-rdar-9974002.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -128,10 +129,3 @@ class Radar9974002DataFormatterTestCase(TestBase):
self.expect('frame variable mine',
substrs = ['mine = ',
'1', '<parent is NULL>'])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py b/lldb/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py
index bf18d44b2cc..a4f50cbbbf9 100644
--- a/lldb/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py
+++ b/lldb/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py
@@ -2,8 +2,9 @@
Check for an issue where capping does not work because the Target pointer appears to be changing behind our backs
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -70,9 +71,3 @@ class SyntheticCappingTestCase(TestBase):
self.expect("frame variable f00_1", matching=True,
substrs = ['r = 33']);
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py b/lldb/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py
index 969bc0ceae6..80224ccf6aa 100644
--- a/lldb/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py
+++ b/lldb/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import datetime
@@ -69,10 +70,3 @@ class SyntheticFilterRecomputingTestCase(TestBase):
self.assertFalse(id_x.GetNumChildren() == 7, "dictionary still looks synthetic")
id_x.SetPreferSyntheticValue(True)
self.assertTrue(id_x.GetSummary() == "7 key/value pairs", "dictionary does not get correct summary")
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/user-format-vs-summary/TestUserFormatVsSummary.py b/lldb/test/functionalities/data-formatter/user-format-vs-summary/TestUserFormatVsSummary.py
index 63beed23274..8842896684a 100644
--- a/lldb/test/functionalities/data-formatter/user-format-vs-summary/TestUserFormatVsSummary.py
+++ b/lldb/test/functionalities/data-formatter/user-format-vs-summary/TestUserFormatVsSummary.py
@@ -2,8 +2,9 @@
Test that the user can input a format but it will not prevail over summary format's choices.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -54,9 +55,3 @@ class UserFormatVSSummaryTestCase(TestBase):
self.expect("frame variable p1", substrs = ['(Pair) p1 = x=0x00000003,y=4294967293']);
self.expect("frame variable -f d p1", substrs = ['(Pair) p1 = x=3,y=-3'],matching=False);
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/var-in-aggregate-misuse/TestVarInAggregateMisuse.py b/lldb/test/functionalities/data-formatter/var-in-aggregate-misuse/TestVarInAggregateMisuse.py
index d3eaa1dbb35..55c6c308f00 100644
--- a/lldb/test/functionalities/data-formatter/var-in-aggregate-misuse/TestVarInAggregateMisuse.py
+++ b/lldb/test/functionalities/data-formatter/var-in-aggregate-misuse/TestVarInAggregateMisuse.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -69,9 +70,3 @@ class VarInAggregateMisuseTestCase(TestBase):
substrs = ['(TwoSummarizes) twos = TwoSummarizes @ ',
'first = SUMMARY SUCCESS 1',
'second = SUMMARY SUCCESS 3'])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py b/lldb/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py
index 777dc29cb3e..4de0325ea4e 100644
--- a/lldb/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py
+++ b/lldb/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -51,9 +52,3 @@ class PythonSynthDataFormatterTestCase(TestBase):
self.expect("frame variable x", substrs = ['T is a non-pointer type']);
self.expect("frame variable y", substrs = ['T is a pointer type']);
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py b/lldb/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py
index 58a31cedd0a..6235e61c712 100644
--- a/lldb/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py
+++ b/lldb/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py
@@ -2,8 +2,9 @@
Check that vector types format properly
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -68,9 +69,3 @@ class VectorTypesFormattingTestCase(TestBase):
v.SetFormat(lldb.eFormatVectorOfFloat32)
oldValueAgain = v.GetChildAtIndex(0).GetValue()
self.assertTrue(oldValue == oldValueAgain, "same format but different values")
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/dead-strip/TestDeadStrip.py b/lldb/test/functionalities/dead-strip/TestDeadStrip.py
index da74fb0ca3c..e61476139de 100644
--- a/lldb/test/functionalities/dead-strip/TestDeadStrip.py
+++ b/lldb/test/functionalities/dead-strip/TestDeadStrip.py
@@ -2,8 +2,9 @@
Test that breakpoint works correctly in the presence of dead-code stripping.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -53,10 +54,3 @@ class DeadStripTestCase(TestBase):
# The breakpoint should have a hit count of 1.
self.expect("breakpoint list -f 3", BREAKPOINT_HIT_ONCE,
substrs = [' resolved, hit count = 1'])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/disassembly/TestDisassembleBreakpoint.py b/lldb/test/functionalities/disassembly/TestDisassembleBreakpoint.py
index fe7e3d674d7..e9ddf122f02 100644
--- a/lldb/test/functionalities/disassembly/TestDisassembleBreakpoint.py
+++ b/lldb/test/functionalities/disassembly/TestDisassembleBreakpoint.py
@@ -2,8 +2,9 @@
Test some lldb command abbreviations.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -45,10 +46,3 @@ class DisassemblyTestCase(TestBase):
# make sure a few reasonable assembly instructions are here
self.expect(disassembly, exe=False, startstr = "a.out`sum", substrs = instructions)
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
-
diff --git a/lldb/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py b/lldb/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py
index e6702638119..67c4d971233 100644
--- a/lldb/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py
+++ b/lldb/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py
@@ -2,9 +2,10 @@
Test that dynamic values update their child count correctly
"""
+import lldb_shared
+
import os, time
import re
-import unittest2
import lldb, lldbutil
from lldbtest import *
@@ -72,9 +73,3 @@ class DynamicValueChildCountTestCase(TestBase):
self.assertTrue(b.GetNumChildren() != 0, "b now has 1 child")
self.runCmd("continue")
self.assertTrue(b.GetNumChildren() == 0, "b didn't go back to 0 children")
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/embedded_interpreter/TestConvenienceVariables.py b/lldb/test/functionalities/embedded_interpreter/TestConvenienceVariables.py
index 0f66a3e7cb9..c07628b7abe 100644
--- a/lldb/test/functionalities/embedded_interpreter/TestConvenienceVariables.py
+++ b/lldb/test/functionalities/embedded_interpreter/TestConvenienceVariables.py
@@ -1,7 +1,8 @@
"""Test convenience variables when you drop in from lldb prompt into an embedded interpreter."""
+import lldb_shared
+
import os
-import unittest2
import lldb
from lldbtest import *
@@ -74,10 +75,3 @@ class ConvenienceVariablesCase(TestBase):
child.expect_exact(python_prompt)
self.expect(child.before, exe=False,
patterns = ['frame #0: 0x[0-9a-f]+ a\.out`main\(argc=1, argv=0x[0-9a-f]+\) \+ \d+ at main\.c:%d' % self.line])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/exec/TestExec.py b/lldb/test/functionalities/exec/TestExec.py
index c81ebefafb1..7b6ce977669 100644
--- a/lldb/test/functionalities/exec/TestExec.py
+++ b/lldb/test/functionalities/exec/TestExec.py
@@ -1,11 +1,12 @@
"""
Test some lldb command abbreviations.
"""
+import lldb_shared
+
import commands
import lldb
import os
import time
-import unittest2
from lldbtest import *
import lldbutil
@@ -80,10 +81,3 @@ class ExecTestCase(TestBase):
# Run and we should stop at breakpoint in main after exec
process.Continue()
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
-
diff --git a/lldb/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py b/lldb/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py
index 76677ff2afb..89d7f721905 100644
--- a/lldb/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py
+++ b/lldb/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py
@@ -2,9 +2,10 @@
Test that expr will time out and allow other threads to run if it blocks.
"""
+import lldb_shared
+
import os, time
import re
-import unittest2
import lldb, lldbutil
from lldbtest import *
@@ -51,9 +52,3 @@ class ExprDoesntDeadlockTestCase(TestBase):
var = frame0.EvaluateExpression ("call_me_to_get_lock()")
self.assertTrue (var.IsValid())
self.assertTrue (var.GetValueAsSigned (0) == 567)
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/fat_archives/TestFatArchives.py b/lldb/test/functionalities/fat_archives/TestFatArchives.py
index d4be28f7a56..f6d06949b91 100644
--- a/lldb/test/functionalities/fat_archives/TestFatArchives.py
+++ b/lldb/test/functionalities/fat_archives/TestFatArchives.py
@@ -1,11 +1,12 @@
"""
Test some lldb command abbreviations.
"""
+import lldb_shared
+
import commands
import lldb
import os
import time
-import unittest2
from lldbtest import *
import lldbutil
@@ -53,10 +54,3 @@ class FatArchiveTestCase(TestBase):
self.assertTrue(function.IsValid(), "Verify breakpoint in fat BSD archive has valid function debug info")
self.assertTrue(line_entry.GetFileSpec(), "Verify breakpoint in fat BSD archive has source file information")
self.assertTrue(line_entry.GetLine() != 0, "Verify breakpoint in fat BSD archive has source line information")
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
-
diff --git a/lldb/test/functionalities/format/TestFormats.py b/lldb/test/functionalities/format/TestFormats.py
index 878f276b234..84566ea2fc9 100644
--- a/lldb/test/functionalities/format/TestFormats.py
+++ b/lldb/test/functionalities/format/TestFormats.py
@@ -2,8 +2,9 @@
Test the command history mechanism
"""
+import lldb_shared
+
import os
-import unittest2
import lldb
from lldbtest import *
@@ -54,9 +55,3 @@ class TestFormats(TestBase):
# child.sendline('Help__')
# child.expect_exact("error: 'Help__' is not a valid command")
# child.expect_exact(prompt)
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/inferior-assert/TestInferiorAssert.py b/lldb/test/functionalities/inferior-assert/TestInferiorAssert.py
index bea265fad12..37e88c7bc45 100644
--- a/lldb/test/functionalities/inferior-assert/TestInferiorAssert.py
+++ b/lldb/test/functionalities/inferior-assert/TestInferiorAssert.py
@@ -1,7 +1,8 @@
"""Test that lldb functions correctly after the inferior has asserted."""
+import lldb_shared
+
import os, time
-import unittest2
import lldb, lldbutil, lldbplatformutil
from lldbtest import *
@@ -237,9 +238,3 @@ class AssertingInferiorTestCase(TestBase):
self.expect("thread backtrace all",
substrs = [stop_reason,
'main.c:%d' % self.line])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/inferior-changed/TestInferiorChanged.py b/lldb/test/functionalities/inferior-changed/TestInferiorChanged.py
index cd13b803c1a..9fce54c3c67 100644
--- a/lldb/test/functionalities/inferior-changed/TestInferiorChanged.py
+++ b/lldb/test/functionalities/inferior-changed/TestInferiorChanged.py
@@ -1,7 +1,8 @@
"""Test lldb reloads the inferior after it was changed during the session."""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -77,10 +78,3 @@ class ChangedInferiorTestCase(TestBase):
substrs = ['= 7'])
self.expect("expression *int_ptr",
substrs = ['= 7'])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/inferior-crashing/TestInferiorCrashing.py b/lldb/test/functionalities/inferior-crashing/TestInferiorCrashing.py
index 40d76884d88..cd4ba304019 100644
--- a/lldb/test/functionalities/inferior-crashing/TestInferiorCrashing.py
+++ b/lldb/test/functionalities/inferior-crashing/TestInferiorCrashing.py
@@ -1,7 +1,8 @@
"""Test that lldb functions correctly after the inferior has crashed."""
+import lldb_shared
+
import os, time
-import unittest2
import lldb, lldbutil, lldbplatformutil
from lldbtest import *
@@ -214,10 +215,3 @@ class CrashingInferiorTestCase(TestBase):
# The lldb expression interpreter should be able to read from addresses of the inferior after a crash.
self.expect("p argv[0]",
substrs = ['a.out'])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py b/lldb/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
index 86eba5de4d5..61eea6e4b82 100644
--- a/lldb/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
+++ b/lldb/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
@@ -1,7 +1,8 @@
"""Test that lldb functions correctly after the inferior has crashed while in a recursive routine."""
+import lldb_shared
+
import os, time
-import unittest2
import lldb, lldbutil, lldbplatformutil
import sys
from lldbtest import *
@@ -214,9 +215,3 @@ class CrashingRecursiveInferiorTestCase(TestBase):
startstr = '(char *) $1 = 0x0')
self.check_stop_reason()
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/inline-stepping/TestInlineStepping.py b/lldb/test/functionalities/inline-stepping/TestInlineStepping.py
index 6c2a31e3711..b0d620e7443 100644
--- a/lldb/test/functionalities/inline-stepping/TestInlineStepping.py
+++ b/lldb/test/functionalities/inline-stepping/TestInlineStepping.py
@@ -1,7 +1,8 @@
"""Test stepping over and into inlined functions."""
+import lldb_shared
+
import os, time, sys
-import unittest2
import lldb
import lldbutil
from lldbtest import *
@@ -267,9 +268,3 @@ class TestInlineStepping(TestBase):
step_sequence = [["// In max_value specialized", "into"]]
self.run_step_sequence(step_sequence)
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py b/lldb/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py
index 8a7b4d00a2c..5b8b11d578e 100644
--- a/lldb/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py
+++ b/lldb/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py
@@ -1,7 +1,9 @@
"""Test for the JITLoaderGDB interface"""
-import os
+import lldb_shared
+
import unittest2
+import os
import lldb
from lldbtest import *
import lldbutil
@@ -31,9 +33,3 @@ class JITLoaderGDBTestCase(TestBase):
self.assertEqual(process.GetState(), lldb.eStateExited)
self.assertEqual(process.GetExitStatus(), 0)
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py b/lldb/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py
index e6bd49ad2d7..609a1b937a7 100644
--- a/lldb/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py
+++ b/lldb/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py
@@ -1,10 +1,11 @@
"""
Test that argdumper is a viable launching strategy.
"""
+import lldb_shared
+
import lldb
import os
import time
-import unittest2
from lldbtest import *
import lldbutil
@@ -92,10 +93,3 @@ class LaunchWithShellExpandTestCase(TestBase):
"Thread in process stopped in 'main' should have a stop reason of eStopReasonBreakpoint");
self.expect("frame variable argv[1]", substrs=['foo bar'])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
-
diff --git a/lldb/test/functionalities/load_unload/TestLoadUnload.py b/lldb/test/functionalities/load_unload/TestLoadUnload.py
index fa1455bdba9..7122cdc3c60 100644
--- a/lldb/test/functionalities/load_unload/TestLoadUnload.py
+++ b/lldb/test/functionalities/load_unload/TestLoadUnload.py
@@ -2,9 +2,10 @@
Test that breakpoint by symbol name works correctly with dynamic libs.
"""
+import lldb_shared
+
import os, time
import re
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -310,9 +311,3 @@ class LoadUnloadTestCase(TestBase):
self.expect("thread list", "step over succeeded.",
substrs = ['stopped',
'stop reason = step over'])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/longjmp/TestLongjmp.py b/lldb/test/functionalities/longjmp/TestLongjmp.py
index 3fd06f258fb..8cb51e68db8 100644
--- a/lldb/test/functionalities/longjmp/TestLongjmp.py
+++ b/lldb/test/functionalities/longjmp/TestLongjmp.py
@@ -2,8 +2,9 @@
Test the use of setjmp/longjmp for non-local goto operations in a single-threaded inferior.
"""
+import lldb_shared
+
import os
-import unittest2
import lldb
import lldbutil
from lldbtest import *
@@ -80,9 +81,3 @@ class LongjmpTestCase(TestBase):
self.runCmd("thread step-in", RUN_SUCCEEDED)
self.runCmd("thread step-out", RUN_SUCCEEDED)
self.check_status()
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/memory/read/TestMemoryRead.py b/lldb/test/functionalities/memory/read/TestMemoryRead.py
index 67cf389d20d..c6430aae91d 100644
--- a/lldb/test/functionalities/memory/read/TestMemoryRead.py
+++ b/lldb/test/functionalities/memory/read/TestMemoryRead.py
@@ -2,9 +2,10 @@
Test the 'memory read' command.
"""
+import lldb_shared
+
import os, time
import re
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -86,10 +87,3 @@ class MemoryReadTestCase(TestBase):
# 0x7fff5fbff598: error: unsupported byte size (20) for float format
self.expect("memory read --format 'float' --count 1 --size 20 `&my_double`",
substrs = ['unsupported byte size (20) for float format'])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/non-overlapping-index-variable-i/TestIndexVariable.py b/lldb/test/functionalities/non-overlapping-index-variable-i/TestIndexVariable.py
index 786102eae81..7835a3733be 100644
--- a/lldb/test/functionalities/non-overlapping-index-variable-i/TestIndexVariable.py
+++ b/lldb/test/functionalities/non-overlapping-index-variable-i/TestIndexVariable.py
@@ -1,7 +1,8 @@
"""Test evaluating expressions which ref. index variable 'i' which just goes
from out of scope to in scope when stopped at the breakpoint."""
-import unittest2
+import lldb_shared
+
import lldb
from lldbtest import *
import lldbutil
@@ -38,9 +39,3 @@ class NonOverlappingIndexVariableCase(TestBase):
self.runCmd('expr ptr[0]->point.y')
self.runCmd('expr ptr[i]->point.x')
self.runCmd('expr ptr[i]->point.y')
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/nosucharch/TestNoSuchArch.py b/lldb/test/functionalities/nosucharch/TestNoSuchArch.py
index cda0cd6606e..bf29645062c 100644
--- a/lldb/test/functionalities/nosucharch/TestNoSuchArch.py
+++ b/lldb/test/functionalities/nosucharch/TestNoSuchArch.py
@@ -1,8 +1,9 @@
"""
Test that using a non-existent architecture name does not crash LLDB.
"""
+import lldb_shared
+
import lldb
-import unittest2
from lldbtest import *
import lldbutil
@@ -24,10 +25,3 @@ class NoSuchArchTestCase(TestBase):
# Now just create the target with the default arch and check it's fine
target = self.dbg.CreateTarget(exe)
self.assertTrue(target.IsValid(), "This target should now be valid")
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
-
diff --git a/lldb/test/functionalities/object-file/TestImageListMultiArchitecture.py b/lldb/test/functionalities/object-file/TestImageListMultiArchitecture.py
index 47e7db4b366..54c1d21c766 100644
--- a/lldb/test/functionalities/object-file/TestImageListMultiArchitecture.py
+++ b/lldb/test/functionalities/object-file/TestImageListMultiArchitecture.py
@@ -4,8 +4,9 @@ This exercises classes like ObjectFileELF and their support for opening
foreign-architecture object files.
"""
+import lldb_shared
+
import os.path
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -36,9 +37,3 @@ class TestImageListMultiArchitecture(TestBase):
self.match("image list -t -A", [expected_triple_and_arch_regex])
# Revert to the host platform after all of this is done
self.runCmd("platform select host")
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/paths/TestPaths.py b/lldb/test/functionalities/paths/TestPaths.py
index c9245b03e6b..35769206565 100644
--- a/lldb/test/functionalities/paths/TestPaths.py
+++ b/lldb/test/functionalities/paths/TestPaths.py
@@ -1,10 +1,11 @@
"""
Test some lldb command abbreviations.
"""
+import lldb_shared
+
import lldb
import os
import time
-import unittest2
from lldbtest import *
import lldbutil
@@ -43,10 +44,3 @@ class TestPaths(TestBase):
fspec = lldb.SBFileSpec("C:\\dummy1\\dummy2//unknown_file", True);
self.assertEqual(os.path.normpath(fspec.GetDirectory()), os.path.normpath("C:/dummy1/dummy2"));
self.assertEqual(fspec.GetFilename(), "unknown_file");
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
-
diff --git a/lldb/test/functionalities/platform/TestPlatformCommand.py b/lldb/test/functionalities/platform/TestPlatformCommand.py
index c7afacf5478..97908269da8 100644
--- a/lldb/test/functionalities/platform/TestPlatformCommand.py
+++ b/lldb/test/functionalities/platform/TestPlatformCommand.py
@@ -2,8 +2,9 @@
Test some lldb platform commands.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
@@ -60,10 +61,3 @@ class PlatformCommandTestCase(TestBase):
self.skipTest("due to taking too long to complete.")
self.expect("platform shell sleep 15", error=True,
substrs = ["error: timed out waiting for shell command to complete"])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/plugins/commands/TestPluginCommands.py b/lldb/test/functionalities/plugins/commands/TestPluginCommands.py
index f00ada5040a..4053fe336c1 100644
--- a/lldb/test/functionalities/plugins/commands/TestPluginCommands.py
+++ b/lldb/test/functionalities/plugins/commands/TestPluginCommands.py
@@ -2,9 +2,10 @@
Test that plugins that load commands work correctly.
"""
+import lldb_shared
+
import os, time
import re
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -59,10 +60,3 @@ class PluginCommandTestCase(TestBase):
print retobj.GetOutput()
self.expect(retobj,substrs = ['abc def ghi'], exe=False)
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py b/lldb/test/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py
index d4b1b5f47c8..749916fefd7 100644
--- a/lldb/test/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py
+++ b/lldb/test/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py
@@ -2,9 +2,10 @@
Test that the Python operating system plugin works correctly
"""
+import lldb_shared
+
import os, time
import re
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -145,10 +146,3 @@ class PluginPythonOSPlugin(TestBase):
self.assertTrue(line_entry.GetFileSpec().GetFilename() == 'main.c', "Make sure we stepped from line 5 to line 6 in main.c")
self.assertTrue(line_entry.GetLine() == 6, "Make sure we stepped from line 5 to line 6 in main.c")
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/postmortem/minidump/TestMiniDump.py b/lldb/test/functionalities/postmortem/minidump/TestMiniDump.py
index 84bf777767f..bbacc19846c 100644
--- a/lldb/test/functionalities/postmortem/minidump/TestMiniDump.py
+++ b/lldb/test/functionalities/postmortem/minidump/TestMiniDump.py
@@ -2,7 +2,8 @@
Test basics of mini dump debugging.
"""
-import unittest2
+import lldb_shared
+
import lldb
from lldbtest import *
import lldbutil
@@ -36,9 +37,3 @@ class MiniDumpTestCase(TestBase):
self.dbg.CreateTarget("")
self.target = self.dbg.GetSelectedTarget()
self.process = self.target.LoadCore("fizzbuzz_no_heap.dmp")
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/process_attach/TestProcessAttach.py b/lldb/test/functionalities/process_attach/TestProcessAttach.py
index b8005c2c02a..ed11a486181 100644
--- a/lldb/test/functionalities/process_attach/TestProcessAttach.py
+++ b/lldb/test/functionalities/process_attach/TestProcessAttach.py
@@ -2,8 +2,9 @@
Test process attach.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -52,9 +53,3 @@ class ProcessAttachTestCase(TestBase):
# Call super's tearDown().
TestBase.tearDown(self)
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/process_attach/attach_denied/TestAttachDenied.py b/lldb/test/functionalities/process_attach/attach_denied/TestAttachDenied.py
index 33eb35ff313..74013faacfb 100644
--- a/lldb/test/functionalities/process_attach/attach_denied/TestAttachDenied.py
+++ b/lldb/test/functionalities/process_attach/attach_denied/TestAttachDenied.py
@@ -2,9 +2,10 @@
Test denied process attach.
"""
+import lldb_shared
+
import os
import time
-import unittest2
import lldb
from lldbtest import *
@@ -54,10 +55,3 @@ class AttachDeniedTestCase(TestBase):
self.expect('process attach -p ' + pid,
startstr = 'error: attach failed:',
error = True)
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/process_group/TestChangeProcessGroup.py b/lldb/test/functionalities/process_group/TestChangeProcessGroup.py
index 343e53d134f..6864c475953 100644
--- a/lldb/test/functionalities/process_group/TestChangeProcessGroup.py
+++ b/lldb/test/functionalities/process_group/TestChangeProcessGroup.py
@@ -1,7 +1,8 @@
"""Test that we handle inferiors which change their process group"""
+import lldb_shared
+
import os
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -97,9 +98,3 @@ class ChangeProcessGroupTestCase(TestBase):
shell_command = lldb.SBPlatformShellCommand(cmd)
err = platform.Run(shell_command)
return (err, shell_command.GetStatus(), shell_command.GetOutput())
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/process_launch/TestProcessLaunch.py b/lldb/test/functionalities/process_launch/TestProcessLaunch.py
index e843bfc1812..50e219f4dcb 100644
--- a/lldb/test/functionalities/process_launch/TestProcessLaunch.py
+++ b/lldb/test/functionalities/process_launch/TestProcessLaunch.py
@@ -2,8 +2,9 @@
Test lldb process launch flags.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
@@ -175,11 +176,3 @@ class ProcessLaunchTestCase(TestBase):
if not success:
self.fail(err_msg)
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
-
diff --git a/lldb/test/functionalities/recursion/TestValueObjectRecursion.py b/lldb/test/functionalities/recursion/TestValueObjectRecursion.py
index 243b8621a40..fa9000410e0 100644
--- a/lldb/test/functionalities/recursion/TestValueObjectRecursion.py
+++ b/lldb/test/functionalities/recursion/TestValueObjectRecursion.py
@@ -2,8 +2,9 @@
Test lldb data formatter subsystem.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -54,9 +55,3 @@ class ValueObjectRecursionTestCase(TestBase):
self.assertTrue(child.GetChildAtIndex(0).IsValid(),"the deep ValueObject has no value")
self.assertTrue(child.GetChildAtIndex(0).GetValueAsUnsigned() != 0,"the deep ValueObject has a zero value")
self.assertTrue(child.GetChildAtIndex(1).GetValueAsUnsigned() != 0, "the deep ValueObject has no next")
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/register/TestRegisters.py b/lldb/test/functionalities/register/TestRegisters.py
index 32750de3806..efdbaaf8e47 100755
--- a/lldb/test/functionalities/register/TestRegisters.py
+++ b/lldb/test/functionalities/register/TestRegisters.py
@@ -2,9 +2,10 @@
Test the 'register' command.
"""
+import lldb_shared
+
import os, sys, time
import re
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -352,9 +353,3 @@ class RegisterCommandsTestCase(TestBase):
if test_16bit_regs:
self.expect("expr -- $ax == (($ah << 8) | $al)",
substrs = ['true'])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/rerun/TestRerun.py b/lldb/test/functionalities/rerun/TestRerun.py
index 1a0430fad68..7d5972bb9b5 100644
--- a/lldb/test/functionalities/rerun/TestRerun.py
+++ b/lldb/test/functionalities/rerun/TestRerun.py
@@ -1,10 +1,11 @@
"""
Test that argdumper is a viable launching strategy.
"""
+import lldb_shared
+
import lldb
import os
import time
-import unittest2
from lldbtest import *
import lldbutil
@@ -71,11 +72,3 @@ class TestRerun(TestBase):
self.expect("frame variable argv[1]", substrs=['1'])
self.expect("frame variable argv[2]", substrs=['2'])
self.expect("frame variable argv[3]", substrs=['3'])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
-
diff --git a/lldb/test/functionalities/return-value/TestReturnValue.py b/lldb/test/functionalities/return-value/TestReturnValue.py
index bafde43e7e2..9f7c07a3653 100644
--- a/lldb/test/functionalities/return-value/TestReturnValue.py
+++ b/lldb/test/functionalities/return-value/TestReturnValue.py
@@ -2,9 +2,10 @@
Test getting return-values correctly when stepping out
"""
+import lldb_shared
+
import os, time
import re
-import unittest2
import lldb, lldbutil
from lldbtest import *
@@ -206,9 +207,3 @@ class ReturnValueTestCase(TestBase):
ret_child_str = ret_child.GetValue()
self.assertEqual(in_child_str, ret_child_str)
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/set-data/TestSetData.py b/lldb/test/functionalities/set-data/TestSetData.py
index 3bd5ee4ce96..f260bbdd9ef 100644
--- a/lldb/test/functionalities/set-data/TestSetData.py
+++ b/lldb/test/functionalities/set-data/TestSetData.py
@@ -2,8 +2,9 @@
Set the contents of variables and registers using raw data
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -57,9 +58,3 @@ class SetDataTestCase(TestBase):
self.expect("fr var -d run-target string", VARIABLES_DISPLAYED_CORRECTLY,
substrs = ['NSString *', 'nil'])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/signal/TestSendSignal.py b/lldb/test/functionalities/signal/TestSendSignal.py
index 5ce843d5286..71b96b76c11 100644
--- a/lldb/test/functionalities/signal/TestSendSignal.py
+++ b/lldb/test/functionalities/signal/TestSendSignal.py
@@ -1,7 +1,8 @@
"""Test that lldb command 'process signal SIGUSR1' to send a signal to the inferior works."""
+import lldb_shared
+
import os, time, signal
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -100,9 +101,3 @@ class SendSignalTestCase(TestBase):
self.assertTrue(state == expected_state,
"It was the %s state." %
lldb.SBDebugger_StateAsCString(expected_state))
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/signal/handle-segv/TestHandleSegv.py b/lldb/test/functionalities/signal/handle-segv/TestHandleSegv.py
index fdb8f995e75..70b8cf2498e 100644
--- a/lldb/test/functionalities/signal/handle-segv/TestHandleSegv.py
+++ b/lldb/test/functionalities/signal/handle-segv/TestHandleSegv.py
@@ -1,7 +1,8 @@
"""Test that we can debug inferiors that handle SIGSEGV by themselves"""
+import lldb_shared
+
import os
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -38,9 +39,3 @@ class HandleSegvTestCase(TestBase):
process.Continue()
self.assertEqual(process.GetState(), lldb.eStateExited)
self.assertEqual(process.GetExitStatus(), 0)
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/signal/raise/TestRaise.py b/lldb/test/functionalities/signal/raise/TestRaise.py
index 0099251cb98..6705bfd5ff3 100644
--- a/lldb/test/functionalities/signal/raise/TestRaise.py
+++ b/lldb/test/functionalities/signal/raise/TestRaise.py
@@ -1,7 +1,8 @@
"""Test that we handle inferiors that send signals to themselves"""
+import lldb_shared
+
import os
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -216,9 +217,3 @@ class RaiseTestCase(TestBase):
# We are done
process.Kill()
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/single-quote-in-filename-to-lldb/TestSingleQuoteInFilename.py b/lldb/test/functionalities/single-quote-in-filename-to-lldb/TestSingleQuoteInFilename.py
index cd45412679a..17af6cb8c5e 100644
--- a/lldb/test/functionalities/single-quote-in-filename-to-lldb/TestSingleQuoteInFilename.py
+++ b/lldb/test/functionalities/single-quote-in-filename-to-lldb/TestSingleQuoteInFilename.py
@@ -2,8 +2,9 @@
Test the lldb command line takes a filename with single quote chars.
"""
+import lldb_shared
+
import os
-import unittest2
import lldb
from lldbtest import *
@@ -66,10 +67,3 @@ class SingleQuoteInCommandLineTestCase(TestBase):
self.expect(from_child, exe=False,
substrs = ["Current executable set to"])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py b/lldb/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py
index 1b38afc3aaa..3585b2f531a 100644
--- a/lldb/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py
+++ b/lldb/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py
@@ -2,9 +2,10 @@
Test thread step-in, step-over and step-out work with the "Avoid no debug" option.
"""
+import lldb_shared
+
import os
import re
-import unittest2
import lldb, lldbutil
import sys
from lldbtest import *
@@ -107,10 +108,3 @@ class ReturnValueTestCase(TestBase):
# frame. In gdb, step-over/step-in move to the end of the line they stepped out to.
# If we ever change this we will need to fix this test.
self.hit_correct_line ("int return_value = no_debug_caller(5, called_from_nodebug)")
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/stop-hook/TestStopHookCmd.py b/lldb/test/functionalities/stop-hook/TestStopHookCmd.py
index df94835e380..9158412fc5a 100644
--- a/lldb/test/functionalities/stop-hook/TestStopHookCmd.py
+++ b/lldb/test/functionalities/stop-hook/TestStopHookCmd.py
@@ -5,7 +5,6 @@ Test lldb target stop-hook command.
import lldb_shared
import os
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -62,10 +61,3 @@ class StopHookCmdTestCase(TestBase):
self.expect('target stop-hook list', 'Stop Hook deleted successfully',
substrs = ['No stop hooks.'])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/stop-hook/TestStopHookMechanism.py b/lldb/test/functionalities/stop-hook/TestStopHookMechanism.py
index abb99953bc9..211c3f97cb2 100644
--- a/lldb/test/functionalities/stop-hook/TestStopHookMechanism.py
+++ b/lldb/test/functionalities/stop-hook/TestStopHookMechanism.py
@@ -2,8 +2,9 @@
Test lldb target stop-hook mechanism to see whether it fires off correctly .
"""
+import lldb_shared
+
import os
-import unittest2
import lldb
from lldbtest import *
@@ -95,10 +96,3 @@ class StopHookMechanismTestCase(TestBase):
# Verify that the 'Stop Hooks' mechanism is NOT BEING fired off.
self.expect(child.before, exe=False, matching=False,
substrs = ['(void *) $'])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py b/lldb/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py
index 59c5222f5e1..49da3fae154 100644
--- a/lldb/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py
+++ b/lldb/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py
@@ -2,8 +2,9 @@
Test that lldb stop-hook works for multiple threads.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
@@ -71,10 +72,3 @@ class StopHookForMultipleThreadsTestCase(TestBase):
# Continue and expect to find the output emitted by the firing of our stop hook.
child.sendline('continue')
child.expect_exact('(uint32_t) ::g_val = ')
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/target_command/TestTargetCommand.py b/lldb/test/functionalities/target_command/TestTargetCommand.py
index 8e81deaa81e..28dcd1c8a45 100644
--- a/lldb/test/functionalities/target_command/TestTargetCommand.py
+++ b/lldb/test/functionalities/target_command/TestTargetCommand.py
@@ -2,7 +2,8 @@
Test some target commands: create, list, select, variable.
"""
-import unittest2
+import lldb_shared
+
import lldb
import sys
from lldbtest import *
@@ -196,9 +197,3 @@ class targetCommandTestCase(TestBase):
substrs = ['a'])
self.expect("target variable my_global_char", VARIABLES_DISPLAYED_CORRECTLY,
substrs = ["my_global_char", "'X'"])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/thread/TestNumThreads.py b/lldb/test/functionalities/thread/TestNumThreads.py
index 65ca699332f..8a2ad59e258 100644
--- a/lldb/test/functionalities/thread/TestNumThreads.py
+++ b/lldb/test/functionalities/thread/TestNumThreads.py
@@ -2,8 +2,9 @@
Test number of threads.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -48,9 +49,3 @@ class NumberOfThreadsTestCase(TestBase):
# Using std::thread may involve extra threads, so we assert that there are
# at least 4 rather than exactly 4.
self.assertTrue(num_threads >= 4, 'Number of expected threads and actual threads do not match.')
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py b/lldb/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py
index e149f361ea0..462314b735d 100644
--- a/lldb/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py
+++ b/lldb/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py
@@ -2,8 +2,9 @@
Test number of threads.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -72,9 +73,3 @@ class BreakpointAfterJoinTestCase(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/functionalities/thread/concurrent_events/TestConcurrentEvents.py b/lldb/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py
index 149d6a22bc8..3fa1b4968bc 100644
--- a/lldb/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py
+++ b/lldb/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py
@@ -10,8 +10,10 @@ until exit or a crash takes place, and the number of events seen by LLDB is
verified to match the expected number of events.
"""
-import os, time
+import lldb_shared
+
import unittest2
+import os, time
import lldb
from lldbtest import *
import lldbutil
@@ -484,10 +486,3 @@ class ConcurrentEventsTestCase(TestBase):
watchpoint_hit_count = self.thread_watchpoint.GetHitCount() if expected_watchpoint_threads > 0 else 0
self.assertEqual(expected_watchpoint_threads, watchpoint_hit_count,
"Expected %d watchpoint hits, got %d" % (expected_watchpoint_threads, watchpoint_hit_count))
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py b/lldb/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py
index e196fa29429..89eccfdccf7 100644
--- a/lldb/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py
+++ b/lldb/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py
@@ -2,8 +2,9 @@
Test that step-inst over a crash behaves correctly.
"""
+import lldb_shared
+
import os
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -47,10 +48,3 @@ class CreateDuringStepTestCase(TestBase):
self.assertEqual(process.GetState(), lldb.eStateStopped, PROCESS_STOPPED)
self.assertTrue(lldbutil.is_thread_crashed(self, thread), "Thread has crashed")
process.Kill()
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py b/lldb/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py
index 51bc26f9d0e..d91f8d5d4eb 100644
--- a/lldb/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py
+++ b/lldb/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py
@@ -2,8 +2,9 @@
Test thread creation after process attach.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -115,10 +116,3 @@ class CreateAfterAttachTestCase(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/functionalities/thread/create_during_step/TestCreateDuringStep.py b/lldb/test/functionalities/thread/create_during_step/TestCreateDuringStep.py
index 76fbc1559ba..a5ceae3dacd 100644
--- a/lldb/test/functionalities/thread/create_during_step/TestCreateDuringStep.py
+++ b/lldb/test/functionalities/thread/create_during_step/TestCreateDuringStep.py
@@ -2,8 +2,9 @@
Test number of threads.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -122,9 +123,3 @@ class CreateDuringStepTestCase(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/functionalities/thread/exit_during_break/TestExitDuringBreak.py b/lldb/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py
index cecc5d91f78..dc1d4dca9b0 100644
--- a/lldb/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py
+++ b/lldb/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py
@@ -2,8 +2,9 @@
Test number of threads.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -76,9 +77,3 @@ class ExitDuringBreakpointTestCase(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/functionalities/thread/exit_during_step/TestExitDuringStep.py b/lldb/test/functionalities/thread/exit_during_step/TestExitDuringStep.py
index a69bb7f2a76..30ca8fe9025 100644
--- a/lldb/test/functionalities/thread/exit_during_step/TestExitDuringStep.py
+++ b/lldb/test/functionalities/thread/exit_during_step/TestExitDuringStep.py
@@ -2,8 +2,9 @@
Test number of threads.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -138,9 +139,3 @@ class ExitDuringStepTestCase(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/functionalities/thread/jump/TestThreadJump.py b/lldb/test/functionalities/thread/jump/TestThreadJump.py
index 3919a242127..a9b06863a72 100644
--- a/lldb/test/functionalities/thread/jump/TestThreadJump.py
+++ b/lldb/test/functionalities/thread/jump/TestThreadJump.py
@@ -2,8 +2,9 @@
Test jumping to different places.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -55,9 +56,3 @@ class ThreadJumpTestCase(TestBase):
self.runCmd("thread step-out") # return out
self.runCmd("thread step-over") # assign to the global
self.expect("expr %s" % var, substrs = [value]) # check it
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py b/lldb/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py
index cf6cda62a30..3afd6a22475 100644
--- a/lldb/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py
+++ b/lldb/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py
@@ -2,8 +2,9 @@
Test number of threads.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -72,9 +73,3 @@ class MultipleBreakpointTestCase(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/functionalities/thread/state/TestThreadStates.py b/lldb/test/functionalities/thread/state/TestThreadStates.py
index e1f29a40b05..06225f1eefc 100644
--- a/lldb/test/functionalities/thread/state/TestThreadStates.py
+++ b/lldb/test/functionalities/thread/state/TestThreadStates.py
@@ -2,8 +2,10 @@
Test thread states.
"""
-import os, time
+import lldb_shared
+
import unittest2
+import os, time
import lldb
from lldbtest import *
import lldbutil
@@ -340,9 +342,3 @@ class ThreadStateTestCase(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/functionalities/thread/step_out/TestThreadStepOut.py b/lldb/test/functionalities/thread/step_out/TestThreadStepOut.py
index 96a62e3ddca..3100b361d16 100644
--- a/lldb/test/functionalities/thread/step_out/TestThreadStepOut.py
+++ b/lldb/test/functionalities/thread/step_out/TestThreadStepOut.py
@@ -2,8 +2,9 @@
Test stepping out from a function in a multi-threaded program.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -126,9 +127,3 @@ class ThreadStepOutTestCase(TestBase):
# At this point, the inferior process should have exited.
self.assertTrue(self.inferior_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/functionalities/thread/thread_exit/TestThreadExit.py b/lldb/test/functionalities/thread/thread_exit/TestThreadExit.py
index 99f7ac63b20..39797651e79 100644
--- a/lldb/test/functionalities/thread/thread_exit/TestThreadExit.py
+++ b/lldb/test/functionalities/thread/thread_exit/TestThreadExit.py
@@ -2,8 +2,9 @@
Test number of threads.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -112,9 +113,3 @@ class ThreadExitTestCase(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/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py b/lldb/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py
index 1c22ae858a0..0c2c884cf6c 100644
--- a/lldb/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py
+++ b/lldb/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py
@@ -2,9 +2,10 @@
Test that we obey thread conditioned breakpoints.
"""
+import lldb_shared
+
import os, time
import re
-import unittest2
import lldb, lldbutil
from lldbtest import *
@@ -59,10 +60,3 @@ class ThreadSpecificBreakTestCase(TestBase):
next_stop_state = process.GetState()
self.assertTrue (next_stop_state == lldb.eStateExited, "We should have not hit the breakpoint again.")
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/tty/TestTerminal.py b/lldb/test/functionalities/tty/TestTerminal.py
index e346e1cd0cd..79cc264ab15 100644
--- a/lldb/test/functionalities/tty/TestTerminal.py
+++ b/lldb/test/functionalities/tty/TestTerminal.py
@@ -2,8 +2,10 @@
Test lldb command aliases.
"""
-import os, time
+import lldb_shared
+
import unittest2
+import os, time
import lldb
from lldbtest import *
import lldbutil
@@ -33,10 +35,3 @@ class LaunchInTerminalTestCase(TestBase):
self.assertTrue(error.Success(), "Make sure launch happened successfully in a terminal window")
# Running in synchronous mode our process should have run and already exited by the time target.Launch() returns
self.assertTrue(process.GetState() == lldb.eStateExited)
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
-
diff --git a/lldb/test/functionalities/type_completion/TestTypeCompletion.py b/lldb/test/functionalities/type_completion/TestTypeCompletion.py
index 0e11ff67e3a..57952182a26 100644
--- a/lldb/test/functionalities/type_completion/TestTypeCompletion.py
+++ b/lldb/test/functionalities/type_completion/TestTypeCompletion.py
@@ -2,8 +2,9 @@
Check that types only get completed when necessary.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -111,9 +112,3 @@ class TypeCompletionTestCase(TestBase):
string = field0.GetType().GetPointeeType()
self.assertTrue(string.IsValid(), 'std::string should be valid')
self.assertTrue(string.IsTypeComplete(), 'std::string should now be complete')
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/type_lookup/TestTypeLookup.py b/lldb/test/functionalities/type_lookup/TestTypeLookup.py
index 2a75656b9ab..4e27a02d4e5 100644
--- a/lldb/test/functionalities/type_lookup/TestTypeLookup.py
+++ b/lldb/test/functionalities/type_lookup/TestTypeLookup.py
@@ -2,8 +2,9 @@
Test type lookup command.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import datetime
@@ -38,9 +39,3 @@ class TypeLookupTestCase(TestBase):
self.expect('type lookup NSURL', substrs=['NSURL'])
self.expect('type lookup NSArray', substrs=['NSArray'])
self.expect('type lookup NSObject', substrs=['NSObject', 'isa'])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py b/lldb/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py
index 16b44857ac1..2d557f1b9d0 100644
--- a/lldb/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py
+++ b/lldb/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py
@@ -2,8 +2,9 @@
Test that we can backtrace correctly with 'noreturn' functions on the stack
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -71,10 +72,3 @@ class NoreturnUnwind(TestBase):
if thread.GetFrameAtIndex (main_frame_number).GetFunctionName() != "main":
self.fail("Did not find main() above func_a().")
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/unwind/sigtramp/TestSigtrampUnwind.py b/lldb/test/functionalities/unwind/sigtramp/TestSigtrampUnwind.py
index 9aec735baca..fe375b422ec 100644
--- a/lldb/test/functionalities/unwind/sigtramp/TestSigtrampUnwind.py
+++ b/lldb/test/functionalities/unwind/sigtramp/TestSigtrampUnwind.py
@@ -2,8 +2,9 @@
Test that we can backtrace correctly with 'sigtramp' functions on the stack
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -76,9 +77,3 @@ class SigtrampUnwind(TestBase):
if found_main == False:
self.fail("Unable to find main() in backtrace.")
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/unwind/standard/TestStandardUnwind.py b/lldb/test/functionalities/unwind/standard/TestStandardUnwind.py
index cf147380b0d..58f7db04be1 100644
--- a/lldb/test/functionalities/unwind/standard/TestStandardUnwind.py
+++ b/lldb/test/functionalities/unwind/standard/TestStandardUnwind.py
@@ -10,8 +10,10 @@ file up and generate a test case from it in run time (with name test_standard_un
after escaping some special characters).
"""
-import os, time
+import lldb_shared
+
import unittest2
+import os, time
import lldb
from lldbtest import *
import lldbutil
@@ -139,9 +141,3 @@ for f in test_source_files:
test_function_dwarf.__name__ = test_name
setattr(StandardUnwindTest, test_function_dwarf.__name__, test_function_dwarf)
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/value_md5_crash/TestValueMD5Crash.py b/lldb/test/functionalities/value_md5_crash/TestValueMD5Crash.py
index 2f735871008..9a51c5875a6 100644
--- a/lldb/test/functionalities/value_md5_crash/TestValueMD5Crash.py
+++ b/lldb/test/functionalities/value_md5_crash/TestValueMD5Crash.py
@@ -2,8 +2,9 @@
Verify that the hash computing logic for ValueObject's values can't crash us.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -47,9 +48,3 @@ class ValueMD5CrashTestCase(TestBase):
v = value.GetValue()
# if we are here, instead of crashed, the test succeeded
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py b/lldb/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py
index 624dc567aab..d784faa24c7 100644
--- a/lldb/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py
+++ b/lldb/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py
@@ -2,9 +2,10 @@
Test lldb watchpoint that uses '-s size' to watch a pointed location with size.
"""
+import lldb_shared
+
import os, time
import re
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -92,10 +93,3 @@ class HelloWatchLocationTestCase(TestBase):
substrs = ['hit_count = 1'])
self.runCmd("thread backtrace all")
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py b/lldb/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py
index 267f61c09eb..ee92815f77a 100644
--- a/lldb/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py
+++ b/lldb/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py
@@ -2,8 +2,9 @@
Test my first lldb watchpoint.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -79,10 +80,3 @@ class HelloWatchpointTestCase(TestBase):
# The hit count should now be 1.
self.expect("watchpoint list -v",
substrs = ['hit_count = 1'])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py b/lldb/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
index e1bd0ddc074..024791ae76d 100644
--- a/lldb/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
+++ b/lldb/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
@@ -2,8 +2,9 @@
Test that lldb watchpoint works for multiple threads.
"""
+import lldb_shared
+
import os, time
-import unittest2
import re
import lldb
from lldbtest import *
@@ -132,10 +133,3 @@ class WatchpointForMultipleThreadsTestCase(TestBase):
continue
else:
self.fail("The stop reason should be either break or watchpoint")
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py b/lldb/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
index d13c89ce667..3401976d797 100644
--- a/lldb/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
+++ b/lldb/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
@@ -1,6 +1,7 @@
"""Test stepping over watchpoints."""
-import unittest2
+import lldb_shared
+
import lldb
import lldbutil
from lldbtest import *
@@ -103,9 +104,3 @@ class TestStepOverWatchpoint(TestBase):
self.assertTrue(stop_reason == lldb.eStopReasonPlanComplete,
STOPPED_DUE_TO_STEP_IN)
self.assertTrue(watchpoint_hit, "Watchpoint never hit.")
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/watchpoint/variable_out_of_scope/TestWatchedVarHitWhenInScope.py b/lldb/test/functionalities/watchpoint/variable_out_of_scope/TestWatchedVarHitWhenInScope.py
index 2c4b3e1142e..b2161369ded 100644
--- a/lldb/test/functionalities/watchpoint/variable_out_of_scope/TestWatchedVarHitWhenInScope.py
+++ b/lldb/test/functionalities/watchpoint/variable_out_of_scope/TestWatchedVarHitWhenInScope.py
@@ -2,8 +2,10 @@
Test that a variable watchpoint should only hit when in scope.
"""
-import os, time
+import lldb_shared
+
import unittest2
+import os, time
import lldb
from lldbtest import *
import lldbutil
@@ -77,10 +79,3 @@ class WatchedVariableHitWhenInScopeTestCase(TestBase):
# The hit count should now be 1.
self.expect("watchpoint list -v",
substrs = ['hit_count = 1'])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py b/lldb/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py
index cc0523085e2..cfa6a10bc25 100644
--- a/lldb/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py
+++ b/lldb/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py
@@ -2,8 +2,9 @@
Test watchpoint list, enable, disable, and delete commands.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -308,10 +309,3 @@ class WatchpointCommandsTestCase(TestBase):
# The hit count should be 1.
self.expect("watchpoint list -v",
substrs = ['hit_count = 1'])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py b/lldb/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py
index 2d269fd4d36..a7b9d4c0ea8 100644
--- a/lldb/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py
+++ b/lldb/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py
@@ -2,8 +2,9 @@
Test 'watchpoint command'.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -134,10 +135,3 @@ class WatchpointLLDBCommandTestCase(TestBase):
# be 'exited'.
self.expect("process status",
substrs = ['exited'])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py b/lldb/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py
index 79566fbd9e9..6bd8b93343e 100644
--- a/lldb/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py
+++ b/lldb/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py
@@ -2,8 +2,9 @@
Test 'watchpoint command'.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -82,10 +83,3 @@ class WatchpointPythonCommandTestCase(TestBase):
# The watchpoint command "forced" our global variable 'cookie' to become 777.
self.expect("frame variable --show-globals cookie",
substrs = ['(int32_t)', 'cookie = 777'])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py b/lldb/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py
index 726b80f1ed4..5b66e653bcb 100644
--- a/lldb/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py
+++ b/lldb/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py
@@ -2,8 +2,9 @@
Test watchpoint modify command to set condition on a watchpoint.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -73,10 +74,3 @@ class WatchpointConditionCmdTestCase(TestBase):
# The hit count should now be 2.
self.expect("watchpoint list -v",
substrs = ['hit_count = 5'])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py b/lldb/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py
index 307be3a50f1..821062d939a 100644
--- a/lldb/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py
+++ b/lldb/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py
@@ -1,7 +1,8 @@
"""Test that adding, deleting and modifying watchpoints sends the appropriate events."""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
import lldbutil
from lldbtest import *
@@ -84,9 +85,3 @@ class TestWatchpointEvents (TestBase):
print "Found an event I didn't expect: ", event
self.assertTrue (not found_event, "Only one event per change.")
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py b/lldb/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py
index 96ed6433df7..2a340dad255 100644
--- a/lldb/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py
+++ b/lldb/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py
@@ -2,8 +2,9 @@
Test displayed value of a vector variable while doing watchpoint operations
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -42,9 +43,3 @@ class TestValueOfVectorVariableTestCase(TestBase):
# Value of a vector variable should be displayed correctly
self.expect("watchpoint set variable global_vector", WATCHPOINT_CREATED,
substrs = ['new value: (1, 2, 3, 4)'])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py b/lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
index eaa05e83390..cdfd435b2ad 100644
--- a/lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
+++ b/lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
@@ -2,8 +2,9 @@
Test lldb watchpoint that uses 'watchpoint set -w write -s size' to watch a pointed location with size.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -82,10 +83,3 @@ class WatchLocationUsingWatchpointSetTestCase(TestBase):
substrs = ['hit_count = 1'])
self.runCmd("thread backtrace all")
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py b/lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py
index 9683c88fce9..f7e7bcff702 100644
--- a/lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py
+++ b/lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py
@@ -2,8 +2,9 @@
Test error cases for the 'watchpoint set' command to make sure it errors out when necessary.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -62,10 +63,3 @@ class WatchpointSetErrorTestCase(TestBase):
# Wrong size parameter is an error.
self.expect("watchpoint set variable -s -128", error=True,
substrs = ['invalid enumeration value'])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
OpenPOWER on IntegriCloud