[PATCH] D44040: Add test for lldb-mi interpreter

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 6 15:27:27 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL326847: Add test for lldb-mi interpreter (authored by adrian, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D44040?vs=136899&id=137282#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D44040

Files:
  lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiCliSupport.py
  lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py


Index: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py
===================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py
@@ -36,6 +36,25 @@
         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.
Index: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiCliSupport.py
===================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiCliSupport.py
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiCliSupport.py
@@ -34,6 +34,26 @@
         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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44040.137282.patch
Type: text/x-patch
Size: 3145 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180306/0d28311a/attachment.bin>


More information about the llvm-commits mailing list