Update every test to import `lldb_shared`.

This is necessary in order to allow third party modules to be
located under lldb/third_party rather than under the test
folder directly.

Since we're already touching every test file anyway, we also
go ahead and delete the unittest2 import and main block wherever
possible.  The ability to run a test as a standalone file has
already been broken for some time, and if we decide we want this
back, we should use unittest instead of unittest2.

A few places could not have the import of unittest2 removed,because
they depend on the unittest2.expectedFailure or skip decorators.
Removing all those was orthogonal in spirit to the purpose of this
CL, so the import of unittest2 remains in those files that were
using it for its test decorators.  Those can be addressed
separately.

llvm-svn: 251055
This commit is contained in:
Zachary Turner 2015-10-22 20:06:20 +00:00
parent bd832d5131
commit 77db4a8552
396 changed files with 775 additions and 2791 deletions

View File

@ -2,8 +2,9 @@
Verify the default cache line size for android targets Verify the default cache line size for android targets
""" """
import lldb_shared
import os import os
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -33,9 +34,3 @@ class DefaultCacheLineSizeTestCase(TestBase):
# Run to completion. # Run to completion.
process.Continue() process.Continue()
self.assertEqual(process.GetState(), lldb.eStateExited, PROCESS_EXITED) self.assertEqual(process.GetState(), lldb.eStateExited, PROCESS_EXITED)
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -6,7 +6,6 @@ should compile and link with the LLDB framework."""
import lldb_shared import lldb_shared
import os, re import os, re
import unittest2
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -87,9 +86,3 @@ class SBDirCheckerCase(TestBase):
'stop reason = breakpoint']) 'stop reason = breakpoint'])
self.runCmd('frame variable') self.runCmd('frame variable')
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -3,7 +3,6 @@
import lldb_shared import lldb_shared
import os, re import os, re
import unittest2
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
import lldb import lldb
@ -46,9 +45,3 @@ class TestMultipleSimultaneousDebuggers(TestBase):
else: else:
with open(os.devnull, 'w') as fnull: with open(os.devnull, 'w') as fnull:
check_call([self.driver_exe, self.inferior_exe], env=env, stdout=fnull, stderr=fnull) check_call([self.driver_exe, self.inferior_exe], env=env, stdout=fnull, stderr=fnull)
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -3,7 +3,6 @@
import lldb_shared import lldb_shared
import os, re import os, re
import unittest2
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
import subprocess import subprocess
@ -91,9 +90,3 @@ class SBBreakpointCallbackCase(TestBase):
def build_program(self, sources, program): def build_program(self, sources, program):
return self.buildDriver(sources, program) return self.buildDriver(sources, program)
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test some ARM instruction emulation. Test some ARM instruction emulation.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
@ -49,10 +50,3 @@ class ARMEmulationTestCase(TestBase):
print output print output
self.assertTrue (success, 'Emulation test succeeded.') self.assertTrue (success, 'Emulation test succeeded.')
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test lldb data formatter subsystem. Test lldb data formatter subsystem.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbbench import * from lldbbench import *
import lldbutil import lldbutil
@ -61,9 +62,3 @@ class TestBenchmarkContinue(BenchBase):
lldbutil_sw.stop() lldbutil_sw.stop()
print "runCmd: %s\nlldbutil: %s" % (runCmd_sw,lldbutil_sw) print "runCmd: %s\nlldbutil: %s" % (runCmd_sw,lldbutil_sw)
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -1,7 +1,8 @@
"""Disassemble lldb's Driver::MainLoop() functions comparing lldb against gdb.""" """Disassemble lldb's Driver::MainLoop() functions comparing lldb against gdb."""
import lldb_shared
import os, sys import os, sys
import unittest2
import lldb import lldb
from lldbbench import * from lldbbench import *
@ -151,10 +152,3 @@ class DisassembleDriverMainLoop(BenchBase):
if self.TraceOn(): if self.TraceOn():
print "gdb disassembly benchmark:", str(self.stopwatch) print "gdb disassembly benchmark:", str(self.stopwatch)
self.child = None self.child = None
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
inferior and traverses the stack for thread0 to arrive at frame with function inferior and traverses the stack for thread0 to arrive at frame with function
'MainLoop'. It is important to specify an lldb executable as the inferior.""" 'MainLoop'. It is important to specify an lldb executable as the inferior."""
import lldb_shared
import os, sys import os, sys
import unittest2
import lldb import lldb
from lldbbench import * from lldbbench import *
@ -66,10 +67,3 @@ class AttachThenDisassemblyBench(BenchBase):
with self.stopwatch: with self.stopwatch:
# Disassemble the function. # Disassemble the function.
self.runCmd("disassemble -f") self.runCmd("disassemble -f")
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -1,7 +1,8 @@
"""Disassemble lldb's Driver::MainLoop() functions comparing Xcode 4.1 vs. 4.2's gdb.""" """Disassemble lldb's Driver::MainLoop() functions comparing Xcode 4.1 vs. 4.2's gdb."""
import lldb_shared
import os, sys import os, sys
import unittest2
import lldb import lldb
from lldbbench import * from lldbbench import *
@ -90,10 +91,3 @@ class XCode41Vs42GDBDisassembly(BenchBase):
if self.TraceOn(): if self.TraceOn():
print "gdb disassembly benchmark:", str(self.stopwatch) print "gdb disassembly benchmark:", str(self.stopwatch)
self.child = None self.child = None
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -1,7 +1,8 @@
"""Test lldb's expression evaluations and collect statistics.""" """Test lldb's expression evaluations and collect statistics."""
import lldb_shared
import os, sys import os, sys
import unittest2
import lldb import lldb
from lldbbench import * from lldbbench import *
@ -68,10 +69,3 @@ class ExpressionEvaluationCase(BenchBase):
pass pass
self.child = None self.child = None
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -1,7 +1,8 @@
"""Test evaluating expressions repeatedly comparing lldb against gdb.""" """Test evaluating expressions repeatedly comparing lldb against gdb."""
import lldb_shared
import os, sys import os, sys
import unittest2
import lldb import lldb
from lldbbench import * from lldbbench import *
@ -126,10 +127,3 @@ class RepeatedExprsCase(BenchBase):
if self.TraceOn(): if self.TraceOn():
print "gdb expression benchmark:", str(self.stopwatch) print "gdb expression benchmark:", str(self.stopwatch)
self.child = None self.child = None
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -1,7 +1,8 @@
"""Test lldb's response time for 'frame variable' command.""" """Test lldb's response time for 'frame variable' command."""
import lldb_shared
import os, sys import os, sys
import unittest2
import lldb import lldb
from lldbbench import * from lldbbench import *
@ -72,10 +73,3 @@ class FrameVariableResponseBench(BenchBase):
# The test is about to end and if we come to here, the child process has # The test is about to end and if we come to here, the child process has
# been terminated. Mark it so. # been terminated. Mark it so.
self.child = None self.child = None
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -1,7 +1,8 @@
"""Test lldb's startup delays creating a target, setting a breakpoint, and run to breakpoint stop.""" """Test lldb's startup delays creating a target, setting a breakpoint, and run to breakpoint stop."""
import lldb_shared
import os, sys import os, sys
import unittest2
import lldb import lldb
from lldbbench import * from lldbbench import *
@ -82,10 +83,3 @@ class StartupDelaysBench(BenchBase):
# The test is about to end and if we come to here, the child process has # The test is about to end and if we come to here, the child process has
# been terminated. Mark it so. # been terminated. Mark it so.
self.child = None self.child = None
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -1,7 +1,8 @@
"""Test lldb's stepping speed.""" """Test lldb's stepping speed."""
import lldb_shared
import os, sys import os, sys
import unittest2
import lldb import lldb
from lldbbench import * from lldbbench import *
@ -59,10 +60,3 @@ class RunHooksThenSteppingsBench(BenchBase):
pass pass
self.child = None self.child = None
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -1,7 +1,8 @@
"""Test lldb's stepping speed.""" """Test lldb's stepping speed."""
import lldb_shared
import os, sys import os, sys
import unittest2
import lldb import lldb
from lldbbench import * from lldbbench import *
@ -71,10 +72,3 @@ class SteppingSpeedBench(BenchBase):
pass pass
self.child = None self.child = None
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -1,7 +1,8 @@
"""Benchmark the turnaround time starting a debugger and run to the breakpont with lldb vs. gdb.""" """Benchmark the turnaround time starting a debugger and run to the breakpont with lldb vs. gdb."""
import lldb_shared
import os, sys import os, sys
import unittest2
import lldb import lldb
from lldbbench import * from lldbbench import *
@ -116,10 +117,3 @@ class CompileRunToBreakpointBench(BenchBase):
self.gdb_avg = self.stopwatch.avg() self.gdb_avg = self.stopwatch.avg()
self.child = None self.child = None
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,13 +2,10 @@
Test that the lldb driver's batch mode works correctly. Test that the lldb driver's batch mode works correctly.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
try:
import pexpect
except:
pexpect = None
from lldbtest import * from lldbtest import *
class DriverBatchModeTest (TestBase): class DriverBatchModeTest (TestBase):
@ -31,6 +28,7 @@ class DriverBatchModeTest (TestBase):
self.source = 'main.c' self.source = 'main.c'
def expect_string (self, string): def expect_string (self, string):
import pexpect
"""This expects for "string", with timeout & EOF being test fails.""" """This expects for "string", with timeout & EOF being test fails."""
try: try:
self.child.expect_exact(string) self.child.expect_exact(string)
@ -40,6 +38,7 @@ class DriverBatchModeTest (TestBase):
self.fail ("Timed out waiting for '%s'"%(string)) self.fail ("Timed out waiting for '%s'"%(string))
def batch_mode (self): def batch_mode (self):
import pexpect
exe = os.path.join(os.getcwd(), "a.out") exe = os.path.join(os.getcwd(), "a.out")
prompt = "(lldb) " prompt = "(lldb) "

View File

@ -2,7 +2,8 @@
Test calling std::String member functions. Test calling std::String member functions.
""" """
import unittest2 import lldb_shared
import lldb import lldb
import lldbutil import lldbutil
from lldbtest import * from lldbtest import *
@ -38,9 +39,3 @@ class ExprCommandCallFunctionTestCase(TestBase):
# const char *, and thus don't invoke the Summary formatter. # const char *, and thus don't invoke the Summary formatter.
self.expect("print str.c_str()", self.expect("print str.c_str()",
substrs = ['Hello world']) substrs = ['Hello world'])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,7 +2,8 @@
Test calling a function, stopping in the call, continue and gather the result on stop. Test calling a function, stopping in the call, continue and gather the result on stop.
""" """
import unittest2 import lldb_shared
import lldb import lldb
import lldbutil import lldbutil
from lldbtest import * from lldbtest import *
@ -41,9 +42,3 @@ class ExprCommandCallStopContinueTestCase(TestBase):
self.expect ("thread list", self.expect ("thread list",
substrs = ['stop reason = User Expression thread plan', substrs = ['stop reason = User Expression thread plan',
r'Completed expression: (Five) $0 = (number = 5, name = "five")']) r'Completed expression: (Five) $0 = (number = 5, name = "five")'])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -7,7 +7,8 @@ Note:
""" """
import unittest2 import lldb_shared
import lldb import lldb
import lldbutil import lldbutil
from lldbtest import * from lldbtest import *
@ -47,10 +48,3 @@ class ExprCommandCallUserDefinedFunction(TestBase):
# Test function with pointer paramter # Test function with pointer paramter
self.expect("exp stringCompare((const char*) \"Hello world\")", substrs = ['$4 = true']) self.expect("exp stringCompare((const char*) \"Hello world\")", substrs = ['$4 = true'])
self.expect("exp stringCompare((const char*) \"Hellworld\")", substrs = ['$5 = false']) self.expect("exp stringCompare((const char*) \"Hellworld\")", substrs = ['$5 = false'])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,7 +2,8 @@
Test calling a function that hits a signal set to auto-restart, make sure the call completes. Test calling a function that hits a signal set to auto-restart, make sure the call completes.
""" """
import unittest2 import lldb_shared
import lldb import lldb
import lldbutil import lldbutil
from lldbtest import * from lldbtest import *
@ -134,9 +135,3 @@ class ExprCommandThatRestartsTestCase(TestBase):
frame = self.thread.GetFrameAtIndex(0) frame = self.thread.GetFrameAtIndex(0)
self.assertTrue (frame.GetPC() == self.orig_frame_pc, "Continuing returned to the place we started.") self.assertTrue (frame.GetPC() == self.orig_frame_pc, "Continuing returned to the place we started.")
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,7 +2,8 @@
Test calling a function that throws an ObjC exception, make sure that it doesn't propagate the exception. Test calling a function that throws an ObjC exception, make sure that it doesn't propagate the exception.
""" """
import unittest2 import lldb_shared
import lldb import lldb
import lldbutil import lldbutil
from lldbtest import * from lldbtest import *
@ -107,9 +108,3 @@ class ExprCommandWithThrowTestCase(TestBase):
self.assertTrue (value.IsValid() and value.GetError().Success() == False) self.assertTrue (value.IsValid() and value.GetError().Success() == False)
self.check_after_call() self.check_after_call()
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -1,4 +1,5 @@
import unittest2 import lldb_shared
import lldb import lldb
import lldbutil import lldbutil
from lldbtest import * from lldbtest import *
@ -64,9 +65,3 @@ class ExprCharTestCase(TestBase):
@expectedFailureWindows("llvm.org/pr21765") @expectedFailureWindows("llvm.org/pr21765")
def test_unsigned_char(self): def test_unsigned_char(self):
self.do_test(dictionary={'CFLAGS_EXTRAS': '-funsigned-char'}) self.do_test(dictionary={'CFLAGS_EXTRAS': '-funsigned-char'})
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -1,7 +1,8 @@
"""Test that we are able to evaluate expressions when the inferior is blocked in a syscall""" """Test that we are able to evaluate expressions when the inferior is blocked in a syscall"""
import lldb_shared
import os import os
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -77,9 +78,3 @@ class ExprSyscallTestCase(TestBase):
self.assertEqual(process.GetState(), lldb.eStateExited) self.assertEqual(process.GetState(), lldb.eStateExited)
self.assertEqual(process.GetExitStatus(), 0) self.assertEqual(process.GetExitStatus(), 0)
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,7 +2,8 @@
Test using LLDB data formatters with frozen objects coming from the expression parser. Test using LLDB data formatters with frozen objects coming from the expression parser.
""" """
import unittest2 import lldb_shared
import lldb import lldb
import lldbutil import lldbutil
from lldbtest import * from lldbtest import *
@ -162,9 +163,3 @@ class ExprFormattersTestCase(TestBase):
self.assertTrue(a_data.GetUnsignedInt32(error, 8) == 3, 'numbers[2] == 3') self.assertTrue(a_data.GetUnsignedInt32(error, 8) == 3, 'numbers[2] == 3')
self.assertTrue(a_data.GetUnsignedInt32(error, 12) == 4, 'numbers[3] == 4') self.assertTrue(a_data.GetUnsignedInt32(error, 12) == 4, 'numbers[3] == 4')
self.assertTrue(a_data.GetUnsignedInt32(error, 16) == 5, 'numbers[4] == 5') self.assertTrue(a_data.GetUnsignedInt32(error, 16) == 5, 'numbers[4] == 5')
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -4,8 +4,9 @@ valobj.AddressOf() returns None when an address is
expected in a SyntheticChildrenProvider expected in a SyntheticChildrenProvider
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
import lldbutil import lldbutil
from lldbtest import * from lldbtest import *
@ -72,10 +73,3 @@ class Issue11581TestCase(TestBase):
"load_address = ", "load_address = ",
hex(addr)[2:].rstrip("L"), hex(addr)[2:].rstrip("L"),
str(addr)]) str(addr)])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -7,8 +7,9 @@ o test_expr_options:
Test expression command options. Test expression command options.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
import lldbutil import lldbutil
from lldbtest import * from lldbtest import *
@ -71,9 +72,3 @@ class ExprOptionsTestCase(TestBase):
val = frame.EvaluateExpression('foo != nullptr', options) val = frame.EvaluateExpression('foo != nullptr', options)
self.assertTrue(val.IsValid()) self.assertTrue(val.IsValid())
self.assertFalse(val.GetError().Success()) self.assertFalse(val.GetError().Success())
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,7 +2,8 @@
Test that we can p *objcObject Test that we can p *objcObject
""" """
import unittest2 import lldb_shared
import lldb import lldb
import lldbutil import lldbutil
from lldbtest import * from lldbtest import *
@ -45,9 +46,3 @@ class PersistObjCPointeeType(TestBase):
'_sc_name6 = nil', '_sc_name6 = nil',
'_sc_name7 = nil', '_sc_name7 = nil',
'_sc_name8 = nil']) '_sc_name8 = nil'])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,7 +2,8 @@
Test that we can have persistent pointer variables Test that we can have persistent pointer variables
""" """
import unittest2 import lldb_shared
import lldb import lldb
import lldbutil import lldbutil
from lldbtest import * from lldbtest import *
@ -36,9 +37,3 @@ class PersistentPtrUpdateTestCase(TestBase):
self.runCmd("continue") self.runCmd("continue")
self.expect("expr $foo", substrs=['$foo','0x0']) self.expect("expr $foo", substrs=['$foo','0x0'])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test that nested persistent types work. Test that nested persistent types work.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
@ -36,9 +37,3 @@ class NestedPersistentTypesTestCase(TestBase):
self.expect("expression $my_bar.end.b", self.expect("expression $my_bar.end.b",
substrs = ['(int)', '5']) substrs = ['(int)', '5'])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test that lldb persistent types works correctly. Test that lldb persistent types works correctly.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
@ -52,10 +53,3 @@ class PersistenttypesTestCase(TestBase):
self.expect("expression struct A { int x; int y; }; struct { struct A a; int z; } object; object.a.y = 1; object.z = 3; object.a.x = 2; object", self.expect("expression struct A { int x; int y; }; struct { struct A a; int z; } object; object.a.y = 1; object.z = 3; object.a.x = 2; object",
substrs = ['x = 2', 'y = 1', 'z = 3']) substrs = ['x = 2', 'y = 1', 'z = 3'])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test that lldb persistent variables works correctly. Test that lldb persistent variables works correctly.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
@ -49,9 +50,3 @@ class PersistentVariablesTestCase(TestBase):
self.expect("expression (long)$4", self.expect("expression (long)$4",
startstr = "(long) $6 = -2") startstr = "(long) $6 = -2")
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,7 +2,8 @@
Test that the po command acts correctly. Test that the po command acts correctly.
""" """
import unittest2 import lldb_shared
import lldb import lldb
import lldbutil import lldbutil
from lldbtest import * from lldbtest import *
@ -56,10 +57,3 @@ class PoVerbosityTestCase(TestBase):
self.expect("expr -O -v -- 22", self.expect("expr -O -v -- 22",
substrs = ['(int) $', ' = 22']) substrs = ['(int) $', ' = 22'])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test the robustness of lldb expression parser. Test the robustness of lldb expression parser.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
@ -34,10 +35,3 @@ class Radar8638051TestCase(TestBase):
self.expect("expression &val", self.expect("expression &val",
startstr = "(int *) $2 = ") startstr = "(int *) $2 = ")
# (int *) $2 = 0x.... # (int *) $2 = 0x....
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
The evaluating printf(...) after break stop and then up a stack frame. The evaluating printf(...) after break stop and then up a stack frame.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -37,10 +38,3 @@ class Radar9531204TestCase(TestBase):
# This does not currently. # This does not currently.
self.runCmd('expression (int)printf("argc is: %d.\\n", argc)') self.runCmd('expression (int)printf("argc is: %d.\\n", argc)')
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test example snippets from the lldb 'help expression' output. Test example snippets from the lldb 'help expression' output.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -36,10 +37,3 @@ class Radar9673644TestCase(TestBase):
substrs = ["'f'"]) substrs = ["'f'"])
# runCmd: expr char c[] = "foo"; c[0] # runCmd: expr char c[] = "foo"; c[0]
# output: (char) $0 = 'f' # output: (char) $0 = 'f'
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -11,8 +11,11 @@ o test_expr_commands_can_handle_quotes:
Throw some expression commands with quotes at lldb. Throw some expression commands with quotes at lldb.
""" """
import os, time import lldb_shared
import unittest2 import unittest2
import os, time
import lldb import lldb
import lldbutil import lldbutil
from lldbtest import * from lldbtest import *
@ -243,9 +246,3 @@ class BasicExprCommandsTestCase(TestBase):
self.expect('print_hi', self.expect('print_hi',
substrs = ['(int) $', substrs = ['(int) $',
'6']) '6'])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test some more expression commands. Test some more expression commands.
""" """
import lldb_shared
import os import os
import unittest2
import lldb import lldb
import lldbutil import lldbutil
from lldbtest import * from lldbtest import *
@ -55,10 +56,3 @@ class ExprCommands2TestCase(TestBase):
self.expect("expression $4 + 1", self.expect("expression $4 + 1",
startstr = "(int) $5 = 24") startstr = "(int) $5 = 24")
# (int) $5 = 6 # (int) $5 = 6
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,7 +2,8 @@
Test calling a function that waits a while, and make sure the timeout option to expr works. Test calling a function that waits a while, and make sure the timeout option to expr works.
""" """
import unittest2 import lldb_shared
import lldb import lldb
import lldbutil import lldbutil
from lldbtest import * from lldbtest import *
@ -87,10 +88,3 @@ class ExprCommandWithTimeoutsTestCase(TestBase):
value = frame.EvaluateExpression ("wait_a_while (1000)", options) value = frame.EvaluateExpression ("wait_a_while (1000)", options)
self.assertTrue(value.IsValid()) self.assertTrue(value.IsValid())
self.assertTrue (value.GetError().Success() == True) self.assertTrue (value.GetError().Success() == True)
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -4,7 +4,8 @@ Regression test for <rdar://problem/8981098>:
The expression parser's type search only looks in the current compilation unit for types. The expression parser's type search only looks in the current compilation unit for types.
""" """
import unittest2 import lldb_shared
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -34,10 +35,3 @@ class ObjCTypeQueryTestCase(TestBase):
self.expect("expression (NSArray*)array_token", self.expect("expression (NSArray*)array_token",
substrs = ['(NSArray *) $0 = 0x']) substrs = ['(NSArray *) $0 = 0x'])
# (NSArray *) $0 = 0x00007fff70118398 # (NSArray *) $0 = 0x00007fff70118398
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test some lldb command abbreviations and aliases for proper resolution. Test some lldb command abbreviations and aliases for proper resolution.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -96,11 +97,3 @@ class AbbreviationsTestCase(TestBase):
#self.runCmd("se cl prompt") #self.runCmd("se cl prompt")
#self.expect("set sh prompt", #self.expect("set sh prompt",
# startstr = 'prompt (string) = "(lldb) "') # startstr = 'prompt (string) = "(lldb) "')
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -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. many commands remain available even after we add/delete commands in the future.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -33,11 +34,3 @@ class CommonShortSpellingsTestCase(TestBase):
command_interpreter.ResolveCommand(short, result) command_interpreter.ResolveCommand(short, result)
self.assertTrue(result.Succeeded()) self.assertTrue(result.Succeeded())
self.assertEqual(long, result.GetOutput()) self.assertEqual(long, result.GetOutput())
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -1,7 +1,8 @@
"""Test breaking inside functions defined within a BSD archive file libfoo.a.""" """Test breaking inside functions defined within a BSD archive file libfoo.a."""
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -52,10 +53,3 @@ class BSDArchivesTestCase(TestBase):
substrs = ['(int) arg = 2']) substrs = ['(int) arg = 2'])
self.expect("frame variable __b_global", VARIABLES_DISPLAYED_CORRECTLY, self.expect("frame variable __b_global", VARIABLES_DISPLAYED_CORRECTLY,
substrs = ['(int) __b_global = 2']) substrs = ['(int) __b_global = 2'])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test that ASan memory history provider returns correct stack traces Test that ASan memory history provider returns correct stack traces
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -102,9 +103,3 @@ class AsanTestCase(TestBase):
self.expect("memory history 'another_pointer'", self.expect("memory history 'another_pointer'",
substrs = [ substrs = [
'Memory allocated at', 'a.out`f1', 'main.c:%d' % self.line_malloc2]) '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()

View File

@ -2,8 +2,9 @@
Test the AddressSanitizer runtime support for report breakpoint and data extraction. Test the AddressSanitizer runtime support for report breakpoint and data extraction.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -78,9 +79,3 @@ class AsanTestReportDataCase(TestBase):
s = s.GetData() s = s.GetData()
data2 = json.loads(s) data2 = json.loads(s)
self.assertEqual(data, data2) self.assertEqual(data, data2)
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test process attach/resume. Test process attach/resume.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -66,9 +67,3 @@ class AttachResumeTestCase(TestBase):
# make sure to detach while in running state (r204759) # make sure to detach while in running state (r204759)
self.runCmd("detach") self.runCmd("detach")
lldbutil.expect_state_changes(self, listener, [lldb.eStateDetached]) lldbutil.expect_state_changes(self, listener, [lldb.eStateDetached])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test whether a process started by lldb has no extra file descriptors open. Test whether a process started by lldb has no extra file descriptors open.
""" """
import lldb_shared
import os import os
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -70,10 +71,3 @@ class AvoidsFdLeakTestCase(TestBase):
self.assertTrue(process2.GetState() == lldb.eStateExited, "Process should have exited.") self.assertTrue(process2.GetState() == lldb.eStateExited, "Process should have exited.")
self.assertTrue(process2.GetExitStatus() == 0, self.assertTrue(process2.GetExitStatus() == 0,
"Process returned non-zero status. Were incorrect file descriptors passed?") "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()

View File

@ -2,8 +2,9 @@
Test that backticks without a target should work (not infinite looping). Test that backticks without a target should work (not infinite looping).
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
@ -16,9 +17,3 @@ class BackticksWithNoTargetTestCase(TestBase):
"""A simple test of backticks without a target.""" """A simple test of backticks without a target."""
self.expect("print `1+2-3`", self.expect("print `1+2-3`",
substrs = [' = 0']) substrs = [' = 0'])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test lldb breakpoint command add/list/delete. Test lldb breakpoint command add/list/delete.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -201,9 +202,3 @@ class BreakpointCommandTestCase(TestBase):
# Now remove 'output-2.txt' # Now remove 'output-2.txt'
os.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()

View File

@ -2,9 +2,10 @@
Test that you can set breakpoint commands successfully with the Python API's: Test that you can set breakpoint commands successfully with the Python API's:
""" """
import lldb_shared
import os import os
import re import re
import unittest2
import lldb, lldbutil import lldb, lldbutil
import sys import sys
from lldbtest import * from lldbtest import *
@ -89,10 +90,3 @@ print 'Hit breakpoint'")
self.assertTrue(os.path.isfile("output2.txt"), self.assertTrue(os.path.isfile("output2.txt"),
"'output2.txt' exists due to breakpoint command for breakpoint function.") "'output2.txt' exists due to breakpoint command for breakpoint function.")
self.RemoveTempFile("output2.txt") self.RemoveTempFile("output2.txt")
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test _regexp-break command which uses regular expression matching to dispatch to other built in breakpoint commands. Test _regexp-break command which uses regular expression matching to dispatch to other built in breakpoint commands.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -46,10 +47,3 @@ class RegexpBreakCommandTestCase(TestBase):
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
substrs = ['stopped', substrs = ['stopped',
'stop reason = breakpoint']) 'stop reason = breakpoint'])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,9 +2,10 @@
Test breakpoint conditions with 'breakpoint modify -c <expr> id'. Test breakpoint conditions with 'breakpoint modify -c <expr> id'.
""" """
import lldb_shared
import os, time import os, time
import re import re
import unittest2
import lldb, lldbutil import lldb, lldbutil
from lldbtest import * from lldbtest import *
@ -172,10 +173,3 @@ class BreakpointConditionsTestCase(TestBase):
self.assertTrue(breakpoint.GetHitCount() == 1) self.assertTrue(breakpoint.GetHitCount() == 1)
process.Continue() process.Continue()
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test lldb breakpoint ids. Test lldb breakpoint ids.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -46,10 +47,3 @@ class BreakpointIDTestCase(TestBase):
self.expect ("breakpoint enable 2.*", self.expect ("breakpoint enable 2.*",
patterns = [ ".* breakpoints enabled."] ) patterns = [ ".* breakpoints enabled."] )
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,9 +2,10 @@
Test breakpoint ignore count features. Test breakpoint ignore count features.
""" """
import lldb_shared
import os, time import os, time
import re import re
import unittest2
import lldb, lldbutil import lldb, lldbutil
from lldbtest import * from lldbtest import *
@ -130,10 +131,3 @@ class BreakpointIgnoreCountTestCase(TestBase):
self.assertTrue(breakpoint.GetHitCount() == 3) self.assertTrue(breakpoint.GetHitCount() == 3)
process.Continue() process.Continue()
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test breakpoint commands for a breakpoint ID with multiple locations. Test breakpoint commands for a breakpoint ID with multiple locations.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -83,10 +84,3 @@ class BreakpointLocationsTestCase(TestBase):
patterns = ["1\.1: .+ unresolved, hit count = 0 +Options: disabled", patterns = ["1\.1: .+ unresolved, hit count = 0 +Options: disabled",
"1\.2: .+ resolved, hit count = 1", "1\.2: .+ resolved, hit count = 1",
"1\.3: .+ 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()

View File

@ -2,8 +2,9 @@
Test breakpoint command for different options. Test breakpoint command for different options.
""" """
import lldb_shared
import os import os
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -88,9 +89,3 @@ class BreakpointOptionsTestCase(TestBase):
# We should exit. # We should exit.
self.expect("process status", "Process exited successfully", self.expect("process status", "Process exited successfully",
patterns = ["^Process [0-9]+ exited with status = 0"]) patterns = ["^Process [0-9]+ exited with status = 0"])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -1,8 +1,9 @@
""" """
Test breakpoint command with AT_comp_dir set to symbolic link. Test breakpoint command with AT_comp_dir set to symbolic link.
""" """
import lldb_shared
import os import os
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -58,10 +59,3 @@ class CompDirSymLinkTestCase(TestBase):
exe = os.path.join(os.getcwd(), _EXE_NAME) exe = os.path.join(os.getcwd(), _EXE_NAME)
self.runCmd('file ' + exe, CURRENT_EXECUTABLE_SET) self.runCmd('file ' + exe, CURRENT_EXECUTABLE_SET)
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,6 +2,8 @@
Test continue from a breakpoint when there is a breakpoint on the next instruction also. Test continue from a breakpoint when there is a breakpoint on the next instruction also.
""" """
import lldb_shared
import unittest2 import unittest2
import lldb, lldbutil import lldb, lldbutil
from lldbtest import * from lldbtest import *
@ -61,10 +63,3 @@ class ConsecutiveBreakpoitsTestCase(TestBase):
# Run the process until termination # Run the process until termination
process.Continue() process.Continue()
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test lldb breakpoint ids. Test lldb breakpoint ids.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -57,11 +58,3 @@ class TestCPPBreakpointLocations(TestBase):
for bp_dict in bp_dicts: for bp_dict in bp_dicts:
self.verify_breakpoint_locations(target, bp_dict) self.verify_breakpoint_locations(target, bp_dict)
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,9 +2,10 @@
Test that you can set breakpoint and hit the C++ language exception breakpoint Test that you can set breakpoint and hit the C++ language exception breakpoint
""" """
import lldb_shared
import os import os
import re import re
import unittest2
import lldb, lldbutil import lldb, lldbutil
import sys import sys
from lldbtest import * from lldbtest import *
@ -42,9 +43,3 @@ class TestCPPExceptionBreakpoint (TestBase):
thread_list = lldbutil.get_threads_stopped_at_breakpoint (process, exception_bkpt) thread_list = lldbutil.get_threads_stopped_at_breakpoint (process, exception_bkpt)
self.assertTrue (len(thread_list) == 1, "One thread stopped at the exception breakpoint.") 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()

View File

@ -2,8 +2,9 @@
Test breakpoint commands set before we have a target Test breakpoint commands set before we have a target
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -62,9 +63,3 @@ class BreakpointInDummyTarget (TestBase):
# Stopped again. # Stopped again.
self.expect("thread backtrace", STOPPED_DUE_TO_BREAKPOINT, self.expect("thread backtrace", STOPPED_DUE_TO_BREAKPOINT,
substrs = ["stop reason = breakpoint 2."]) substrs = ["stop reason = breakpoint 2."])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -3,8 +3,9 @@ Test that inlined breakpoints (breakpoint set on a file/line included from
another source file) works correctly. another source file) works correctly.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -52,10 +53,3 @@ class InlinedBreakpointsTestCase(TestBase):
substrs = ['stopped', substrs = ['stopped',
'stop reason = breakpoint', 'stop reason = breakpoint',
'basic_type.cpp:%d' % self.line]) 'basic_type.cpp:%d' % self.line])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -3,8 +3,9 @@ Test that objective-c constant strings are generated correctly by the expression
parser. parser.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -89,9 +90,3 @@ class TestObjCBreakpoints(TestBase):
# Check breakpoints again, this time using the symbol table only # Check breakpoints again, this time using the symbol table only
self.check_category_breakpoints() self.check_category_breakpoints()
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test the command history mechanism Test the command history mechanism
""" """
import lldb_shared
import os import os
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
@ -63,10 +64,3 @@ class CommandHistoryTestCase(TestBase):
self.expect ("command history -c 1 -e 3 -s 5",error=True, inHistory=True, 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']) 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()

View File

@ -2,8 +2,9 @@
Test lldb 'commands regex' command which allows the user to create a regular expression command. Test lldb 'commands regex' command which allows the user to create a regular expression command.
""" """
import lldb_shared
import os import os
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
@ -51,9 +52,3 @@ class CommandRegexTestCase(TestBase):
child.sendline('Help__') child.sendline('Help__')
child.expect_exact("error: 'Help__' is not a valid command") child.expect_exact("error: 'Help__' is not a valid command")
child.expect_exact(prompt) child.expect_exact(prompt)
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test lldb Python commands. Test lldb Python commands.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
@ -137,10 +138,3 @@ class CmdPythonTestCase(TestBase):
self.runCmd('command script add -f bug11569 bug11569') self.runCmd('command script add -f bug11569 bug11569')
# This should not crash. # This should not crash.
self.runCmd('bug11569', check=False) self.runCmd('bug11569', check=False)
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -1,7 +1,8 @@
"""Test custom import command to import files by path.""" """Test custom import command to import files by path."""
import lldb_shared
import os, sys, time import os, sys, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
@ -68,10 +69,3 @@ class ImportTestCase(TestBase):
substrs = ['barutil says', 'bar told me', 'hello']) substrs = ['barutil says', 'bar told me', 'hello'])
self.expect("foobarcmd hello", self.expect("foobarcmd hello",
substrs = ['foobar says', 'hello']) substrs = ['foobar says', 'hello'])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -1,7 +1,8 @@
"""Check that we handle an ImportError in a special way when command script importing files.""" """Check that we handle an ImportError in a special way when command script importing files."""
import lldb_shared
import os, sys, time import os, sys, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
@ -26,9 +27,3 @@ class Rdar12586188TestCase(TestBase):
error=True, substrs = ['raise ImportError("I do not want to be imported")']) error=True, substrs = ['raise ImportError("I do not want to be imported")'])
self.expect("command script import ./fail212586188.py --allow-reload", self.expect("command script import ./fail212586188.py --allow-reload",
error=True, substrs = ['raise ValueError("I do not want to be imported")']) 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()

View File

@ -4,8 +4,9 @@ Test that lldb command "command source" works correctly.
See also http://llvm.org/viewvc/llvm-project?view=rev&revision=109673. See also http://llvm.org/viewvc/llvm-project?view=rev&revision=109673.
""" """
import lldb_shared
import os, sys import os, sys
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
@ -31,10 +32,3 @@ class CommandSourceTestCase(TestBase):
self.expect(result.GetOutput(), "script my.date() runs successfully", self.expect(result.GetOutput(), "script my.date() runs successfully",
exe=False, exe=False,
substrs = [str(datetime.date.today())]) substrs = [str(datetime.date.today())])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test the lldb command line completion mechanism. Test the lldb command line completion mechanism.
""" """
import lldb_shared
import os import os
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
@ -318,10 +319,3 @@ class CommandLineCompletionTestCase(TestBase):
else: else:
self.expect(from_child, msg=COMPLETION_MSG(str_input, p), exe=False, self.expect(from_child, msg=COMPLETION_MSG(str_input, p), exe=False,
patterns = [p]) patterns = [p])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,9 +2,10 @@
Test conditionally break on a function and inspect its variables. Test conditionally break on a function and inspect its variables.
""" """
import lldb_shared
import os, time import os, time
import re import re
import unittest2
import lldb, lldbutil import lldb, lldbutil
from lldbtest import * from lldbtest import *
@ -128,11 +129,3 @@ class ConditionalBreakTestCase(TestBase):
self.runCmd("frame select 1") self.runCmd("frame select 1")
self.expect("frame info", "The immediate caller should be a()", self.expect("frame info", "The immediate caller should be a()",
substrs = ["a.out`a"]) substrs = ["a.out`a"])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test lldb data formatter subsystem. Test lldb data formatter subsystem.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import datetime import datetime
@ -67,10 +68,3 @@ class DataFormatterBoolRefPtr(TestBase):
substrs = ['YES']) substrs = ['YES'])
self.expect('frame variable no', self.expect('frame variable no',
substrs = ['NO']) substrs = ['NO'])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test lldb data formatter subsystem. Test lldb data formatter subsystem.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -53,9 +54,3 @@ class CompactVectorsFormattingTestCase(TestBase):
'(vSInt16) valueS16 = (1, 0, 4, 0, 0, 1, 0, 4)', '(vSInt16) valueS16 = (1, 0, 4, 0, 0, 1, 0, 4)',
'(vSInt32) valueS32 = (4, 3, 2, 1)', '(vSInt32) valueS32 = (4, 3, 2, 1)',
'(vBool32) valueBool32 = (0, 1, 0, 1)']) '(vBool32) valueBool32 = (0, 1, 0, 1)'])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test lldb data formatter subsystem. Test lldb data formatter subsystem.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -280,10 +281,3 @@ class AdvDataFormatterTestCase(TestBase):
'o_2']) 'o_2'])
self.expect('frame variable a_long_guy --show-all-children', matching=False, self.expect('frame variable a_long_guy --show-all-children', matching=False,
substrs = ['...']) substrs = ['...'])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test lldb data formatter subsystem. Test lldb data formatter subsystem.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -321,9 +322,3 @@ class CategoriesDataFormatterTestCase(TestBase):
self.expect('frame variable r2', self.expect('frame variable r2',
substrs = ['w = 9', substrs = ['w = 9',
'h = 16']) 'h = 16'])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test lldb data formatter subsystem. Test lldb data formatter subsystem.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil 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 --format hex", substrs = ['(int) iAmInt = 0x00000001'])
self.expect("frame variable iAmInt", matching=False, substrs = ['(int) iAmInt = 0x00000001']) self.expect("frame variable iAmInt", matching=False, substrs = ['(int) iAmInt = 0x00000001'])
self.expect("frame variable iAmInt", substrs = ['(int) iAmInt = 1']) 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()

View File

@ -2,8 +2,9 @@
Test lldb data formatter subsystem. Test lldb data formatter subsystem.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -75,10 +76,3 @@ class DataFormatterDisablingTestCase(TestBase):
# last check - our cleanup will re-enable everything # last check - our cleanup will re-enable everything
self.runCmd('type category disable *') self.runCmd('type category disable *')
self.expect('type category list', substrs = ['system','disabled']) self.expect('type category list', substrs = ['system','disabled'])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test lldb data formatter subsystem. Test lldb data formatter subsystem.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -60,9 +61,3 @@ class EnumFormatTestCase(TestBase):
'(int) y = Case45', '(int) y = Case45',
'(int) z = 43' '(int) z = 43'
]); ]);
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test lldb data formatter subsystem. Test lldb data formatter subsystem.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -62,10 +63,3 @@ class GlobalsDataFormatterTestCase(TestBase):
self.expect("target variable g_point_pointer", self.expect("target variable g_point_pointer",
substrs = ['(Point *) g_point_pointer =']) substrs = ['(Point *) g_point_pointer ='])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test lldb data formatter subsystem. Test lldb data formatter subsystem.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -117,10 +118,3 @@ class NamedSummariesDataFormatterTestCase(TestBase):
self.expect("frame variable first",matching=False, self.expect("frame variable first",matching=False,
substrs = ['FirstAndFriends: x=12', substrs = ['FirstAndFriends: x=12',
'y=34']) 'y=34'])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -3,8 +3,9 @@
Test lldb data formatter subsystem. Test lldb data formatter subsystem.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import datetime import datetime
@ -459,9 +460,3 @@ class ObjCDataFormatterTestCase(TestBase):
self.runCmd("continue") self.runCmd("continue")
self.expect("frame variable _cmd",substrs = ['setAtoms:']) self.expect("frame variable _cmd",substrs = ['setAtoms:'])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -3,8 +3,9 @@
Test lldb data formatter subsystem. Test lldb data formatter subsystem.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import datetime import datetime
@ -102,10 +103,3 @@ class NSStringDataFormatterTestCase(TestBase):
self.expect('po strwithNULs2', substrs=['a very much boring task to write']) self.expect('po strwithNULs2', substrs=['a very much boring task to write'])
self.expect('expr [strwithNULs2 length]', substrs=['52']) self.expect('expr [strwithNULs2 length]', substrs=['52'])
self.expect('frame variable strwithNULs2', substrs=['@"a very much boring task to write\\0a string this way!!']) 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()

View File

@ -2,8 +2,9 @@
Test lldb data formatter subsystem. Test lldb data formatter subsystem.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import datetime import datetime
@ -85,10 +86,3 @@ class DataFormatterOneIsSingularTestCase(TestBase):
substrs = ['1 byte']) substrs = ['1 byte'])
self.expect('frame variable immutableData', matching=False, self.expect('frame variable immutableData', matching=False,
substrs = ['1 bytes']) substrs = ['1 bytes'])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test lldb data formatter subsystem. Test lldb data formatter subsystem.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -52,10 +53,3 @@ class PtrToArrayDataFormatterTestCase(TestBase):
substrs = ['01 00 00 00 02 00 00 00 03 00 00 00']) substrs = ['01 00 00 00 02 00 00 00 03 00 00 00'])
self.expect('p *(int (*)[3])foo', matching=False, self.expect('p *(int (*)[3])foo', matching=False,
substrs = ['0x000000030000000200000001']) substrs = ['0x000000030000000200000001'])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test lldb data formatter subsystem. Test lldb data formatter subsystem.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil 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('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('F') != -1, 'could not find F in output')
self.assertTrue(str_cast.find("4 = '\\0'") != -1, 'could not find item 4 == 0') 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()

View File

@ -2,8 +2,9 @@
Test lldb data formatter subsystem. Test lldb data formatter subsystem.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -165,10 +166,3 @@ class ScriptDataFormatterTestCase(TestBase):
self.expect("frame variable array", self.expect("frame variable array",
substrs = ['Python summary']) substrs = ['Python summary'])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test lldb data formatter subsystem. Test lldb data formatter subsystem.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -170,10 +171,3 @@ class SkipSummaryDataFormatterTestCase(TestBase):
substrs = ['(DeepData_5) data2.m_child4.m_child2.m_child2 = {', substrs = ['(DeepData_5) data2.m_child4.m_child2.m_child2 = {',
'm_some_text = "Just a test"', 'm_some_text = "Just a test"',
'}']) '}'])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test lldb data formatter subsystem. Test lldb data formatter subsystem.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -343,10 +344,3 @@ class SmartArrayDataFormatterTestCase(TestBase):
substrs = ['intarr = arr = ', substrs = ['intarr = arr = ',
'09 00 00 00', '09 00 00 00',
'....,07 00 00 00']) '....,07 00 00 00'])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test lldb data formatter subsystem. Test lldb data formatter subsystem.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil 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("frame variable ils", substrs = ['[4] = "surprise it is a long string!! yay!!"'])
self.expect('image list', substrs = self.getLibcPlusPlusLibs()) self.expect('image list', substrs = self.getLibcPlusPlusLibs())
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test lldb data formatter subsystem. Test lldb data formatter subsystem.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -61,9 +62,3 @@ class LibcxxIteratorDataFormatterTestCase(TestBase):
self.expect('frame variable svI', substrs = ['item = "hello"']) self.expect('frame variable svI', substrs = ['item = "hello"'])
self.expect('expr 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()

View File

@ -2,8 +2,9 @@
Test lldb data formatter subsystem. Test lldb data formatter subsystem.
""" """
import lldb_shared
import os, time, re import os, time, re
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil 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(0).GetValueAsUnsigned(0) == 3141, "uniqued list[0] == 3141")
self.assertTrue(countingList.GetChildAtIndex(1).GetValueAsUnsigned(0) == 3142, "uniqued list[1] == 3142") 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()

View File

@ -3,8 +3,9 @@ Test that the debugger handles loops in std::list (which can appear as a result
corruption). corruption).
""" """
import lldb_shared
import os, time, re import os, time, re
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -48,9 +49,3 @@ class LibcxxListDataFormatterTestCase(TestBase):
# Run to completion. # Run to completion.
process.Continue() process.Continue()
self.assertEqual(process.GetState(), lldb.eStateExited, PROCESS_EXITED) self.assertEqual(process.GetState(), lldb.eStateExited, PROCESS_EXITED)
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test lldb data formatter subsystem. Test lldb data formatter subsystem.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -293,9 +294,3 @@ class LibcxxMapDataFormatterTestCase(TestBase):
self.expect('frame variable ss', self.expect('frame variable ss',
substrs = ['size=0', substrs = ['size=0',
'{}']) '{}'])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test lldb data formatter subsystem. Test lldb data formatter subsystem.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -293,9 +294,3 @@ class LibcxxMultiMapDataFormatterTestCase(TestBase):
self.expect('frame variable ss', self.expect('frame variable ss',
substrs = ['size=0', substrs = ['size=0',
'{}']) '{}'])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test lldb data formatter subsystem. Test lldb data formatter subsystem.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -64,9 +65,3 @@ class LibcxxMultiSetDataFormatterTestCase(TestBase):
self.expect("frame variable ss[2]",substrs = [' = "b"']) self.expect("frame variable ss[2]",substrs = [' = "b"'])
lldbutil.continue_to_breakpoint(self.process(), bkpt) 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"']) 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()

View File

@ -2,8 +2,9 @@
Test lldb data formatter subsystem. Test lldb data formatter subsystem.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -64,9 +65,3 @@ class LibcxxSetDataFormatterTestCase(TestBase):
self.expect("frame variable ss[2]",substrs = [' = "b"']) self.expect("frame variable ss[2]",substrs = [' = "b"'])
lldbutil.continue_to_breakpoint(self.process(), bkpt) 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"']) 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()

View File

@ -3,8 +3,9 @@
Test lldb data formatter subsystem. Test lldb data formatter subsystem.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil 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) Q = "quite a long std::strin with lots of info inside it"',
'(std::__1::string) IHaveEmbeddedZeros = "a\\0b\\0c\\0d"', '(std::__1::string) IHaveEmbeddedZeros = "a\\0b\\0c\\0d"',
'(std::__1::wstring) IHaveEmbeddedZerosToo = L"hello world!\\0てざ ル゜䋨ミ㠧槊 きゅへ狦穤襩 じゃ馩リョ 䤦監"']) '(std::__1::wstring) IHaveEmbeddedZerosToo = L"hello world!\\0てざ ル゜䋨ミ㠧槊 きゅへ狦穤襩 じゃ馩リョ 䤦監"'])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test lldb data formatter subsystem. Test lldb data formatter subsystem.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -70,9 +71,3 @@ class LibcxxUnorderedDataFormatterTestCase(TestBase):
def look_for_content_and_continue(self, var_name, patterns): def look_for_content_and_continue(self, var_name, patterns):
self.expect( ("frame variable %s" % var_name), patterns=patterns) self.expect( ("frame variable %s" % var_name), patterns=patterns)
self.runCmd("continue") self.runCmd("continue")
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

View File

@ -2,8 +2,9 @@
Test lldb data formatter subsystem. Test lldb data formatter subsystem.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -53,9 +54,3 @@ class LibcxxVBoolDataFormatterTestCase(TestBase):
self.expect("expr vBool", self.expect("expr vBool",
substrs = ['size=49','[0] = false','[1] = true','[18] = false','[27] = true','[36] = false','[47] = true','[48] = true']) 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()

View File

@ -2,8 +2,9 @@
Test lldb data formatter subsystem. Test lldb data formatter subsystem.
""" """
import lldb_shared
import os, time import os, time
import unittest2
import lldb import lldb
from lldbtest import * from lldbtest import *
import lldbutil import lldbutil
@ -175,9 +176,3 @@ class LibcxxVectorDataFormatterTestCase(TestBase):
self.expect("frame variable strings", self.expect("frame variable strings",
substrs = ['vector has 0 items']) substrs = ['vector has 0 items'])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()

Some files were not shown because too many files have changed in this diff Show More