summaryrefslogtreecommitdiffstats
path: root/lldb/test/lang/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/test/lang/cpp')
-rw-r--r--lldb/test/lang/cpp/bool/TestCPPBool.py6
-rw-r--r--lldb/test/lang/cpp/breakpoint-commands/TestCPPBreakpointCommands.py11
-rw-r--r--lldb/test/lang/cpp/call-function/TestCallCPPFunction.py6
-rw-r--r--lldb/test/lang/cpp/chained-calls/TestCppChainedCalls.py6
-rw-r--r--lldb/test/lang/cpp/char1632_t/TestChar1632T.py9
-rw-r--r--lldb/test/lang/cpp/class_static/TestStaticVariables.py10
-rw-r--r--lldb/test/lang/cpp/class_types/TestClassTypes.py9
-rw-r--r--lldb/test/lang/cpp/class_types/TestClassTypesDisassembly.py9
-rw-r--r--lldb/test/lang/cpp/diamond/TestDiamond.py6
-rw-r--r--lldb/test/lang/cpp/dynamic-value/TestCppValueCast.py11
-rw-r--r--lldb/test/lang/cpp/dynamic-value/TestDynamicValue.py10
-rw-r--r--lldb/test/lang/cpp/enum_types/TestCPP11EnumTypes.py8
-rw-r--r--lldb/test/lang/cpp/exceptions/TestCPPExceptionBreakpoints.py10
-rw-r--r--lldb/test/lang/cpp/global_operators/TestCppGlobalOperators.py7
-rw-r--r--lldb/test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py6
-rw-r--r--lldb/test/lang/cpp/namespace/TestNamespace.py9
-rw-r--r--lldb/test/lang/cpp/nsimport/TestCppNsImport.py7
-rw-r--r--lldb/test/lang/cpp/overloaded-functions/TestOverloadedFunctions.py6
-rw-r--r--lldb/test/lang/cpp/rdar12991846/TestRdar12991846.py10
-rw-r--r--lldb/test/lang/cpp/rvalue-references/TestRvalueReferences.py6
-rw-r--r--lldb/test/lang/cpp/scope/TestCppScope.py6
-rw-r--r--lldb/test/lang/cpp/signed_types/TestSignedTypes.py10
-rw-r--r--lldb/test/lang/cpp/static_members/TestCPPStaticMembers.py11
-rw-r--r--lldb/test/lang/cpp/static_methods/TestCPPStaticMethods.py6
-rw-r--r--lldb/test/lang/cpp/stl/TestSTL.py11
-rw-r--r--lldb/test/lang/cpp/stl/TestStdCXXDisassembly.py11
-rw-r--r--lldb/test/lang/cpp/this/TestCPPThis.py6
-rw-r--r--lldb/test/lang/cpp/unique-types/TestUniqueTypes.py10
-rw-r--r--lldb/test/lang/cpp/unsigned_types/TestUnsignedTypes.py10
-rw-r--r--lldb/test/lang/cpp/wchar_t/TestCxxWCharT.py9
30 files changed, 42 insertions, 210 deletions
diff --git a/lldb/test/lang/cpp/bool/TestCPPBool.py b/lldb/test/lang/cpp/bool/TestCPPBool.py
index 913821733c1..0724fc56251 100644
--- a/lldb/test/lang/cpp/bool/TestCPPBool.py
+++ b/lldb/test/lang/cpp/bool/TestCPPBool.py
@@ -24,9 +24,3 @@ class CPPBoolTestCase(TestBase):
self.expect("expression -- my_bool = true",
startstr = "(bool) $1 = true")
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/lang/cpp/breakpoint-commands/TestCPPBreakpointCommands.py b/lldb/test/lang/cpp/breakpoint-commands/TestCPPBreakpointCommands.py
index a8b69ded6d4..867bfed4d7f 100644
--- a/lldb/test/lang/cpp/breakpoint-commands/TestCPPBreakpointCommands.py
+++ b/lldb/test/lang/cpp/breakpoint-commands/TestCPPBreakpointCommands.py
@@ -2,8 +2,9 @@
Test lldb breakpoint command for CPP methods & functions in a namespace.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
@@ -79,11 +80,3 @@ class CPPBreakpointCommandsTestCase(TestBase):
a_out_module,
nested_comp_unit)
self.assertTrue (plain_method_break.GetNumLocations() == 1)
-
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/lang/cpp/call-function/TestCallCPPFunction.py b/lldb/test/lang/cpp/call-function/TestCallCPPFunction.py
index 6adbcd6f790..bba23992c3c 100644
--- a/lldb/test/lang/cpp/call-function/TestCallCPPFunction.py
+++ b/lldb/test/lang/cpp/call-function/TestCallCPPFunction.py
@@ -31,9 +31,3 @@ class CallCPPFunctionTestCase(TestBase):
self.expect("expression -- a_function_to_call()",
startstr = "(int) $0 = 0")
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/lang/cpp/chained-calls/TestCppChainedCalls.py b/lldb/test/lang/cpp/chained-calls/TestCppChainedCalls.py
index a6cf56cd6f6..fa9338ab51b 100644
--- a/lldb/test/lang/cpp/chained-calls/TestCppChainedCalls.py
+++ b/lldb/test/lang/cpp/chained-calls/TestCppChainedCalls.py
@@ -71,9 +71,3 @@ class TestCppChainedCalls(TestBase):
test_result = frame.EvaluateExpression("get(t) && get(t)")
self.assertTrue(test_result.IsValid() and test_result.GetValue() == "true", "get(t) && get(t) = true")
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/lang/cpp/char1632_t/TestChar1632T.py b/lldb/test/lang/cpp/char1632_t/TestChar1632T.py
index f604c34516d..7392f79bce7 100644
--- a/lldb/test/lang/cpp/char1632_t/TestChar1632T.py
+++ b/lldb/test/lang/cpp/char1632_t/TestChar1632T.py
@@ -3,8 +3,9 @@
Test that the C++11 support for char16_t and char32_t works correctly.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -85,9 +86,3 @@ class Char1632TestCase(TestBase):
# Check that we can run expressions that return charN_t
self.expect("expression u'a'",substrs = ['(char16_t) $',"61 u'a'"])
self.expect("expression U'a'",substrs = ['(char32_t) $',"61 U'a'"])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/lang/cpp/class_static/TestStaticVariables.py b/lldb/test/lang/cpp/class_static/TestStaticVariables.py
index 88aeb72a799..c9182fe69d7 100644
--- a/lldb/test/lang/cpp/class_static/TestStaticVariables.py
+++ b/lldb/test/lang/cpp/class_static/TestStaticVariables.py
@@ -2,8 +2,9 @@
Test display and Python APIs on file and class static variables.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -115,10 +116,3 @@ class StaticVariableTestCase(TestBase):
val = frame.FindValue("hello_world", lldb.eValueTypeVariableLocal)
self.DebugSBValue(val)
self.assertTrue(val.GetName() == 'hello_world')
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/lang/cpp/class_types/TestClassTypes.py b/lldb/test/lang/cpp/class_types/TestClassTypes.py
index 2e9353b5b65..6d737e04c99 100644
--- a/lldb/test/lang/cpp/class_types/TestClassTypes.py
+++ b/lldb/test/lang/cpp/class_types/TestClassTypes.py
@@ -1,7 +1,8 @@
"""Test breakpoint on a class constructor; and variable list the this object."""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
import lldbutil
from lldbtest import *
@@ -210,9 +211,3 @@ class ClassTypesTestCase(TestBase):
self.assertTrue (frame.IsValid(), "Got a valid frame.")
self.assertTrue ("C::C" in frame.name, "Constructor name includes class name.")
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/lang/cpp/class_types/TestClassTypesDisassembly.py b/lldb/test/lang/cpp/class_types/TestClassTypesDisassembly.py
index 866b100cbf5..031c2b352e9 100644
--- a/lldb/test/lang/cpp/class_types/TestClassTypesDisassembly.py
+++ b/lldb/test/lang/cpp/class_types/TestClassTypesDisassembly.py
@@ -2,8 +2,9 @@
Test the lldb disassemble command on each call frame when stopped on C's ctor.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -89,9 +90,3 @@ class IterateFrameAndDisassembleTestCase(TestBase):
# We should be stopped on the ctor function of class C.
# self.expect("thread backtrace", BACKTRACE_DISPLAYED_CORRECTLY,
# substrs = ['C::C'])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/lang/cpp/diamond/TestDiamond.py b/lldb/test/lang/cpp/diamond/TestDiamond.py
index 6c9f6e4a32a..f4222ebedfe 100644
--- a/lldb/test/lang/cpp/diamond/TestDiamond.py
+++ b/lldb/test/lang/cpp/diamond/TestDiamond.py
@@ -39,9 +39,3 @@ class CPPTestDiamondInheritance(TestBase):
# Some compilers (for example GCC 4.4.7 and 4.6.1) emit multiple locations for the statement with the ternary
# operator in the test program, while others emit only 1.
lldbutil.run_break_set_by_file_and_line (self, "main.cpp", line, num_expected_locations=-1, loc_exact=False)
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/lang/cpp/dynamic-value/TestCppValueCast.py b/lldb/test/lang/cpp/dynamic-value/TestCppValueCast.py
index 431f19f7ae4..f46bad7dd9c 100644
--- a/lldb/test/lang/cpp/dynamic-value/TestCppValueCast.py
+++ b/lldb/test/lang/cpp/dynamic-value/TestCppValueCast.py
@@ -2,9 +2,11 @@
Test lldb Python API SBValue::Cast(SBType) for C++ types.
"""
+import lldb_shared
+
+import unittest2
import os, time
import re
-import unittest2
import lldb, lldbutil
from lldbtest import *
@@ -122,10 +124,3 @@ class CppValueCastTestCase(TestBase):
b_member_val = instanceB.GetChildMemberWithName('m_b_val')
self.DebugSBValue(b_member_val)
self.assertTrue(b_member_val.GetValueAsUnsigned(error, 0) == 36)
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/lang/cpp/dynamic-value/TestDynamicValue.py b/lldb/test/lang/cpp/dynamic-value/TestDynamicValue.py
index f7f9e67a014..3ef4193a917 100644
--- a/lldb/test/lang/cpp/dynamic-value/TestDynamicValue.py
+++ b/lldb/test/lang/cpp/dynamic-value/TestDynamicValue.py
@@ -2,9 +2,10 @@
Use lldb Python API to test dynamic values in C++
"""
+import lldb_shared
+
import os, time
import re
-import unittest2
import lldb, lldbutil
from lldbtest import *
@@ -217,10 +218,3 @@ class DynamicValueTestCase(TestBase):
contained_b_static_addr = int (contained_b_static.GetValue(), 16)
self.assertTrue (contained_b_addr < contained_b_static_addr)
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/lang/cpp/enum_types/TestCPP11EnumTypes.py b/lldb/test/lang/cpp/enum_types/TestCPP11EnumTypes.py
index e8072efa8b2..c0fb3103892 100644
--- a/lldb/test/lang/cpp/enum_types/TestCPP11EnumTypes.py
+++ b/lldb/test/lang/cpp/enum_types/TestCPP11EnumTypes.py
@@ -1,7 +1,8 @@
"""Look up enum type information and check for correct display."""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -105,8 +106,3 @@ class CPP11EnumTypesTestCase(TestBase):
self.expect("frame variable day", 'check for valid enumeration value',
substrs = [enum_value])
lldbutil.continue_to_breakpoint (self.process(), bkpt)
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/lang/cpp/exceptions/TestCPPExceptionBreakpoints.py b/lldb/test/lang/cpp/exceptions/TestCPPExceptionBreakpoints.py
index cc6805e8dc1..51135c7a0a1 100644
--- a/lldb/test/lang/cpp/exceptions/TestCPPExceptionBreakpoints.py
+++ b/lldb/test/lang/cpp/exceptions/TestCPPExceptionBreakpoints.py
@@ -2,8 +2,9 @@
Test lldb exception breakpoint command for CPP.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
import lldbutil
from lldbtest import *
@@ -60,10 +61,3 @@ class CPPBreakpointTestCase(TestBase):
self.assertTrue (frame_functions.count ("throws_exception_on_even(int)") == 0, "At catch our throw function is off the stack")
self.assertTrue (frame_functions.count ("intervening_function(int)") == 0, "At catch our intervening function is off the stack")
self.assertTrue (frame_functions.count ("catches_exception(int)") == 1, "At catch our catch function is on the stack")
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/lang/cpp/global_operators/TestCppGlobalOperators.py b/lldb/test/lang/cpp/global_operators/TestCppGlobalOperators.py
index 6299116d19a..68ff52eb4d1 100644
--- a/lldb/test/lang/cpp/global_operators/TestCppGlobalOperators.py
+++ b/lldb/test/lang/cpp/global_operators/TestCppGlobalOperators.py
@@ -52,10 +52,3 @@ class TestCppGlobalOperators(TestBase):
test_result = frame.EvaluateExpression("operator==(s2, s3)")
self.assertTrue(test_result.IsValid() and test_result.GetValue() == "false", "operator==(s2, s3) = false")
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py b/lldb/test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py
index 931f546c777..2764f311667 100644
--- a/lldb/test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py
+++ b/lldb/test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py
@@ -63,9 +63,3 @@ class TestCppIncompleteTypes(TestBase):
# Get frame for current thread
return thread.GetSelectedFrame()
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/lang/cpp/namespace/TestNamespace.py b/lldb/test/lang/cpp/namespace/TestNamespace.py
index fd598813e83..08825c41af5 100644
--- a/lldb/test/lang/cpp/namespace/TestNamespace.py
+++ b/lldb/test/lang/cpp/namespace/TestNamespace.py
@@ -2,8 +2,9 @@
Test the printing of anonymous and named namespace variables.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -106,9 +107,3 @@ class NamespaceTestCase(TestBase):
self.expect("p variadic_sum",
patterns = ['\(anonymous namespace\)::variadic_sum\(int, ...\)'])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/lang/cpp/nsimport/TestCppNsImport.py b/lldb/test/lang/cpp/nsimport/TestCppNsImport.py
index 076356dd162..3411959aaa1 100644
--- a/lldb/test/lang/cpp/nsimport/TestCppNsImport.py
+++ b/lldb/test/lang/cpp/nsimport/TestCppNsImport.py
@@ -98,10 +98,3 @@ class TestCppNsImport(TestBase):
# Test function inside namespace
test_result = frame.EvaluateExpression("fun_var")
self.assertTrue(test_result.IsValid() and test_result.GetValueAsSigned() == 5, "fun_var = 5")
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/lang/cpp/overloaded-functions/TestOverloadedFunctions.py b/lldb/test/lang/cpp/overloaded-functions/TestOverloadedFunctions.py
index 38cec0f472e..7eff685abca 100644
--- a/lldb/test/lang/cpp/overloaded-functions/TestOverloadedFunctions.py
+++ b/lldb/test/lang/cpp/overloaded-functions/TestOverloadedFunctions.py
@@ -34,9 +34,3 @@ class CPPStaticMethodsTestCase(TestBase):
self.expect("expression -- Static()",
startstr = "(int) $1 = 1")
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/lang/cpp/rdar12991846/TestRdar12991846.py b/lldb/test/lang/cpp/rdar12991846/TestRdar12991846.py
index 23bf8a122c6..4ac48e1866b 100644
--- a/lldb/test/lang/cpp/rdar12991846/TestRdar12991846.py
+++ b/lldb/test/lang/cpp/rdar12991846/TestRdar12991846.py
@@ -3,8 +3,10 @@
Test that the expression parser returns proper Unicode strings.
"""
-import os, time
+import lldb_shared
+
import unittest2
+import os, time
import lldb
from lldbtest import *
import lldbutil
@@ -79,9 +81,3 @@ class Rdar12991846TestCase(TestBase):
if expr == 2: self.expect('expression u"hello"', substrs = ['hello'])
if expr == 3: self.expect('expression U"hello"', substrs = ['hello'])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/lang/cpp/rvalue-references/TestRvalueReferences.py b/lldb/test/lang/cpp/rvalue-references/TestRvalueReferences.py
index ea9d135a224..2f62be57910 100644
--- a/lldb/test/lang/cpp/rvalue-references/TestRvalueReferences.py
+++ b/lldb/test/lang/cpp/rvalue-references/TestRvalueReferences.py
@@ -47,9 +47,3 @@ class RvalueReferencesTestCase(TestBase):
def set_breakpoint(self, line):
lldbutil.run_break_set_by_file_and_line (self, "main.cpp", line, num_expected_locations=1, loc_exact=True)
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/lang/cpp/scope/TestCppScope.py b/lldb/test/lang/cpp/scope/TestCppScope.py
index 4d5ea8bf62b..f984eed86e4 100644
--- a/lldb/test/lang/cpp/scope/TestCppScope.py
+++ b/lldb/test/lang/cpp/scope/TestCppScope.py
@@ -65,9 +65,3 @@ class TestCppScopes(TestBase):
value = frame.EvaluateExpression(name)
assert_value = global_variables_assert[name]
self.assertTrue(value.IsValid() and value.GetValueAsSigned() == assert_value, name + " = " + str(assert_value))
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/lang/cpp/signed_types/TestSignedTypes.py b/lldb/test/lang/cpp/signed_types/TestSignedTypes.py
index 9c1f6838efd..8ae2e22c52b 100644
--- a/lldb/test/lang/cpp/signed_types/TestSignedTypes.py
+++ b/lldb/test/lang/cpp/signed_types/TestSignedTypes.py
@@ -2,9 +2,10 @@
Test that variables with signed types display correctly.
"""
+import lldb_shared
+
import os, time
import re
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -55,10 +56,3 @@ class UnsignedTypesTestCase(TestBase):
substrs = ["(int) the_signed_int = 99",
"(long) the_signed_long = 99",
"(long long) the_signed_long_long = 99"])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/lang/cpp/static_members/TestCPPStaticMembers.py b/lldb/test/lang/cpp/static_members/TestCPPStaticMembers.py
index de85a574899..f221a1a5bb1 100644
--- a/lldb/test/lang/cpp/static_members/TestCPPStaticMembers.py
+++ b/lldb/test/lang/cpp/static_members/TestCPPStaticMembers.py
@@ -1,6 +1,10 @@
"""
Tests that C++ member and static variables have correct layout and scope.
"""
+
+import lldb_shared
+
+import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -51,10 +55,3 @@ class CPPStaticMembersTestCase(TestBase):
def set_breakpoint(self, line):
lldbutil.run_break_set_by_file_and_line (self, "main.cpp", line, num_expected_locations=1, loc_exact=False)
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/lang/cpp/static_methods/TestCPPStaticMethods.py b/lldb/test/lang/cpp/static_methods/TestCPPStaticMethods.py
index c44af758c72..4887a69788d 100644
--- a/lldb/test/lang/cpp/static_methods/TestCPPStaticMethods.py
+++ b/lldb/test/lang/cpp/static_methods/TestCPPStaticMethods.py
@@ -34,9 +34,3 @@ class CPPStaticMethodsTestCase(TestBase):
self.expect("expression -- my_a.getMemberValue()",
startstr = "(int) $1 = 3")
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/lang/cpp/stl/TestSTL.py b/lldb/test/lang/cpp/stl/TestSTL.py
index b74009fbefd..e32652602f8 100644
--- a/lldb/test/lang/cpp/stl/TestSTL.py
+++ b/lldb/test/lang/cpp/stl/TestSTL.py
@@ -2,8 +2,10 @@
Test some expressions involving STL data types.
"""
-import os, time
+import lldb_shared
+
import unittest2
+import os, time
import lldb
import lldbutil
from lldbtest import *
@@ -112,10 +114,3 @@ class STLTestCase(TestBase):
# Check that both entries of the dictionary have 'True' as the value.
self.assertTrue(all(expected_types.values()))
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/lang/cpp/stl/TestStdCXXDisassembly.py b/lldb/test/lang/cpp/stl/TestStdCXXDisassembly.py
index abcc3004a4a..dad5bf21eca 100644
--- a/lldb/test/lang/cpp/stl/TestStdCXXDisassembly.py
+++ b/lldb/test/lang/cpp/stl/TestStdCXXDisassembly.py
@@ -2,8 +2,10 @@
Test the lldb disassemble command on lib stdc++.
"""
-import os, time
+import lldb_shared
+
import unittest2
+import os, time
import lldb
from lldbtest import *
import lldbutil
@@ -104,10 +106,3 @@ class StdCXXDisassembleTestCase(TestBase):
else:
# This entry is not a Code entry. Reset SA = None.
SA = None
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/lang/cpp/this/TestCPPThis.py b/lldb/test/lang/cpp/this/TestCPPThis.py
index e4b5d615121..4c99845b31a 100644
--- a/lldb/test/lang/cpp/this/TestCPPThis.py
+++ b/lldb/test/lang/cpp/this/TestCPPThis.py
@@ -51,9 +51,3 @@ class CPPThisTestCase(TestBase):
def set_breakpoint(self, line):
lldbutil.run_break_set_by_file_and_line (self, "main.cpp", line, num_expected_locations=1, loc_exact=False)
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/lang/cpp/unique-types/TestUniqueTypes.py b/lldb/test/lang/cpp/unique-types/TestUniqueTypes.py
index c251563228a..a1c9f25d31b 100644
--- a/lldb/test/lang/cpp/unique-types/TestUniqueTypes.py
+++ b/lldb/test/lang/cpp/unique-types/TestUniqueTypes.py
@@ -2,7 +2,8 @@
Test that template instaniations of std::vector<long> and <short> in the same module have the correct types.
"""
-import unittest2
+import lldb_shared
+
import lldb
import lldbutil
from lldbtest import *
@@ -57,10 +58,3 @@ class UniqueTypesTestCase(TestBase):
continue
self.expect(x, "Expect type 'short'", exe=False,
substrs = ['short'])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/lang/cpp/unsigned_types/TestUnsignedTypes.py b/lldb/test/lang/cpp/unsigned_types/TestUnsignedTypes.py
index d49d3b8f4df..a2c8ff75f04 100644
--- a/lldb/test/lang/cpp/unsigned_types/TestUnsignedTypes.py
+++ b/lldb/test/lang/cpp/unsigned_types/TestUnsignedTypes.py
@@ -2,9 +2,10 @@
Test that variables with unsigned types display correctly.
"""
+import lldb_shared
+
import os, time
import re
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -49,10 +50,3 @@ class UnsignedTypesTestCase(TestBase):
"(unsigned long) the_unsigned_long = 99",
"(unsigned long long) the_unsigned_long_long = 99",
"(uint32_t) the_uint32 = 99"])
-
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
diff --git a/lldb/test/lang/cpp/wchar_t/TestCxxWCharT.py b/lldb/test/lang/cpp/wchar_t/TestCxxWCharT.py
index 2438873b515..d2b3ab91ba3 100644
--- a/lldb/test/lang/cpp/wchar_t/TestCxxWCharT.py
+++ b/lldb/test/lang/cpp/wchar_t/TestCxxWCharT.py
@@ -3,8 +3,9 @@
Test that C++ supports wchar_t correctly.
"""
+import lldb_shared
+
import os, time
-import unittest2
import lldb
from lldbtest import *
import lldbutil
@@ -69,9 +70,3 @@ class CxxWCharTTestCase(TestBase):
self.expect('frame variable wchar_zero', substrs=["L'\\0'"])
self.expect('expression wchar_zero', substrs=["L'\\0'"])
-
-if __name__ == '__main__':
- import atexit
- lldb.SBDebugger.Initialize()
- atexit.register(lambda: lldb.SBDebugger.Terminate())
- unittest2.main()
OpenPOWER on IntegriCloud