Skip to content

Commit

Permalink
Add test for lldb-mi interpreter
Browse files Browse the repository at this point in the history
Test that "lldb-mi --interpreter" can interpret "target list" CLI command.

Patch by Alex Polyakov!

Differential Revision: https://reviews.llvm.org/D44040

llvm-svn: 326847
  • Loading branch information
adrian-prantl committed Mar 6, 2018
1 parent 5701606 commit bff272f
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
Expand Up @@ -34,6 +34,26 @@ def test_lldbmi_target_create(self):
self.expect("\^running")
self.expect("\*stopped,reason=\"breakpoint-hit\"")

@skipIfRemote # We do not currently support remote debugging via the MI.
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows.
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races.
def test_lldbmi_target_list(self):
"""Test that 'lldb-mi --interpreter' can list targets by 'target list' command."""

self.spawnLldbMi(args=None)

# Test that initially there are no targets.
self.runCmd("target list")
self.expect(r"~\"No targets.\\n\"")
self.expect("\^done")

# Add target.
self.runCmd("-file-exec-and-symbols %s" % self.myexe)

# Test that "target list" lists added target.
self.runCmd("target list")
self.expect(r"~\"Current targets:\\n\* target #0: %s" % self.myexe)

@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
@skipIfLinux # llvm.org/pr22841: lldb-mi tests fail on all Linux buildbots
Expand Down
Expand Up @@ -36,6 +36,25 @@ def test_lldbmi_target_create(self):
self.expect("\^running")
self.expect("\*stopped,reason=\"breakpoint-hit\"")

@skipIfRemote # We do not currently support remote debugging via the MI.
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows.
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races.
def test_lldbmi_target_list(self):
"""Test that 'lldb-mi --interpreter' can list targets by 'target list' command."""

self.spawnLldbMi(args=None)

# Test that initially there are no targets.
self.runCmd("-interpreter-exec console \"target list\"")
self.expect(r"~\"No targets.\\n\"")

# Add target.
self.runCmd("-file-exec-and-symbols %s" % self.myexe)

# Test that "target list" lists added target.
self.runCmd("-interpreter-exec console \"target list\"")
self.expect(r"~\"Current targets:\\n\* target #0: %s" % self.myexe)

@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
@skipIfRemote # We do not currently support remote debugging via the MI.
Expand Down

0 comments on commit bff272f

Please sign in to comment.