TestMultithreaded improvements
These tests link against host lldb API. Compiler's target triple must match liblldb triple. Instead of naively skipping i386, I added a check of the liblldb arch against the compiler target arch. This is useful for 32 bit API builds (planned for Windows) Since remote is disabled, we can assume the os is the same. Also, removed skipIfLinuxClang because it's passing llvm-svn: 236396
This commit is contained in:
parent
8983031b5e
commit
026137628f
|
@ -15,23 +15,18 @@ class SBBreakpointCallbackCase(TestBase):
|
||||||
self.lib_dir = os.environ["LLDB_LIB_DIR"]
|
self.lib_dir = os.environ["LLDB_LIB_DIR"]
|
||||||
self.implib_dir = os.environ["LLDB_IMPLIB_DIR"]
|
self.implib_dir = os.environ["LLDB_IMPLIB_DIR"]
|
||||||
self.inferior = 'inferior_program'
|
self.inferior = 'inferior_program'
|
||||||
if self.getArchitecture() != "i386":
|
if self.getLldbArchitecture() == self.getArchitecture():
|
||||||
self.buildProgram('inferior.cpp', self.inferior)
|
self.buildProgram('inferior.cpp', self.inferior)
|
||||||
self.addTearDownHook(lambda: os.remove(self.inferior))
|
self.addTearDownHook(lambda: os.remove(self.inferior))
|
||||||
|
|
||||||
@unittest2.expectedFailure("llvm.org/pr16000: SBBreakpoint.SetCallback() does nothing")
|
|
||||||
@skipIfi386
|
|
||||||
@skipIfRemote
|
@skipIfRemote
|
||||||
@skipIfLinuxClang # buildbot clang version unable to use libstdc++ with c++11
|
|
||||||
@skipIfNoSBHeaders
|
@skipIfNoSBHeaders
|
||||||
def test_breakpoint_callback(self):
|
def test_breakpoint_callback(self):
|
||||||
"""Test the that SBBreakpoint callback is invoked when a breakpoint is hit. """
|
"""Test the that SBBreakpoint callback is invoked when a breakpoint is hit. """
|
||||||
self.build_and_test('driver.cpp test_breakpoint_callback.cpp',
|
self.build_and_test('driver.cpp test_breakpoint_callback.cpp',
|
||||||
'test_breakpoint_callback')
|
'test_breakpoint_callback')
|
||||||
|
|
||||||
@skipIfi386
|
|
||||||
@skipIfRemote
|
@skipIfRemote
|
||||||
@skipIfLinuxClang # buildbot clang version unable to use libstdc++ with c++11
|
|
||||||
@skipIfNoSBHeaders
|
@skipIfNoSBHeaders
|
||||||
@expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["x86_64"])
|
@expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["x86_64"])
|
||||||
def test_sb_api_listener_event_description(self):
|
def test_sb_api_listener_event_description(self):
|
||||||
|
@ -40,9 +35,7 @@ class SBBreakpointCallbackCase(TestBase):
|
||||||
'test_listener_event_description')
|
'test_listener_event_description')
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@skipIfi386
|
|
||||||
@skipIfRemote
|
@skipIfRemote
|
||||||
@skipIfLinuxClang # buildbot clang version unable to use libstdc++ with c++11
|
|
||||||
@skipIfNoSBHeaders
|
@skipIfNoSBHeaders
|
||||||
@expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["x86_64"])
|
@expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["x86_64"])
|
||||||
def test_sb_api_listener_event_process_state(self):
|
def test_sb_api_listener_event_process_state(self):
|
||||||
|
@ -54,9 +47,7 @@ class SBBreakpointCallbackCase(TestBase):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@skipIfi386
|
|
||||||
@skipIfRemote
|
@skipIfRemote
|
||||||
@skipIfLinuxClang # buildbot clang version unable to use libstdc++ with c++11
|
|
||||||
@skipIfNoSBHeaders
|
@skipIfNoSBHeaders
|
||||||
@expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["x86_64"])
|
@expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["x86_64"])
|
||||||
def test_sb_api_listener_resume(self):
|
def test_sb_api_listener_resume(self):
|
||||||
|
@ -67,6 +58,14 @@ class SBBreakpointCallbackCase(TestBase):
|
||||||
|
|
||||||
def build_and_test(self, sources, test_name, args = None):
|
def build_and_test(self, sources, test_name, args = None):
|
||||||
""" Build LLDB test from sources, and run expecting 0 exit code """
|
""" Build LLDB test from sources, and run expecting 0 exit code """
|
||||||
|
|
||||||
|
# These tests link against host lldb API.
|
||||||
|
# Compiler's target triple must match liblldb triple
|
||||||
|
# because remote is disabled, we can assume that the os is the same
|
||||||
|
# still need to check architecture
|
||||||
|
if self.getLldbArchitecture() != self.getArchitecture():
|
||||||
|
self.skipTest("This test is only run if the target arch is the same as the lldb binary arch")
|
||||||
|
|
||||||
self.buildDriver(sources, test_name)
|
self.buildDriver(sources, test_name)
|
||||||
self.addTearDownHook(lambda: os.remove(test_name))
|
self.addTearDownHook(lambda: os.remove(test_name))
|
||||||
|
|
||||||
|
|
|
@ -1425,6 +1425,30 @@ class Base(unittest2.TestCase):
|
||||||
arch = 'x86_64'
|
arch = 'x86_64'
|
||||||
return arch
|
return arch
|
||||||
|
|
||||||
|
def getLldbArchitecture(self):
|
||||||
|
"""Returns the architecture of the lldb binary."""
|
||||||
|
if not hasattr(self, 'lldbArchitecture'):
|
||||||
|
|
||||||
|
# spawn local process
|
||||||
|
command = [
|
||||||
|
self.lldbHere,
|
||||||
|
"-o",
|
||||||
|
"file " + self.lldbHere,
|
||||||
|
"-o",
|
||||||
|
"quit"
|
||||||
|
]
|
||||||
|
|
||||||
|
output = check_output(command)
|
||||||
|
str = output.decode("utf-8");
|
||||||
|
|
||||||
|
for line in str.splitlines():
|
||||||
|
m = re.search("Current executable set to '.*' \\((.*)\\)\\.", line)
|
||||||
|
if m:
|
||||||
|
self.lldbArchitecture = m.group(1)
|
||||||
|
break
|
||||||
|
|
||||||
|
return self.lldbArchitecture
|
||||||
|
|
||||||
def getCompiler(self):
|
def getCompiler(self):
|
||||||
"""Returns the compiler in effect the test suite is running with."""
|
"""Returns the compiler in effect the test suite is running with."""
|
||||||
module = builder_module()
|
module = builder_module()
|
||||||
|
|
Loading…
Reference in New Issue