[Lldb-commits] [lldb] r231918 - Move MiInterpreterExecTestCase to test/tools/lldb-mi/interpreter folder (MI)

Ilia K ki.stfu at gmail.com
Wed Mar 11 05:28:49 PDT 2015


Author: ki.stfu
Date: Wed Mar 11 07:28:48 2015
New Revision: 231918

URL: http://llvm.org/viewvc/llvm-project?rev=231918&view=rev
Log:
Move MiInterpreterExecTestCase to test/tools/lldb-mi/interpreter folder (MI)


Added:
    lldb/trunk/test/tools/lldb-mi/interpreter/
    lldb/trunk/test/tools/lldb-mi/interpreter/Makefile
    lldb/trunk/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py
      - copied, changed from r231917, lldb/trunk/test/tools/lldb-mi/TestMiInterpreterExec.py
    lldb/trunk/test/tools/lldb-mi/interpreter/main.cpp
Removed:
    lldb/trunk/test/tools/lldb-mi/TestMiInterpreterExec.py

Removed: lldb/trunk/test/tools/lldb-mi/TestMiInterpreterExec.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/TestMiInterpreterExec.py?rev=231917&view=auto
==============================================================================
--- lldb/trunk/test/tools/lldb-mi/TestMiInterpreterExec.py (original)
+++ lldb/trunk/test/tools/lldb-mi/TestMiInterpreterExec.py (removed)
@@ -1,211 +0,0 @@
-"""
-Test lldb-mi -interpreter-exec command.
-"""
-
-import lldbmi_testcase
-from lldbtest import *
-import unittest2
-
-class MiInterpreterExecTestCase(lldbmi_testcase.MiTestCaseBase):
-
-    mydir = TestBase.compute_mydir(__file__)
-
-    @lldbmi_test
-    @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
-    def test_lldbmi_target_create(self):
-        """Test that 'lldb-mi --interpreter' can create target by 'target create' command."""
-
-        self.spawnLldbMi(args = None)
-
-        # Test that "target create" loads executable
-        self.runCmd("-interpreter-exec console \"target create \\\"%s\\\"\"" % self.myexe)
-        self.expect("\^done")
-
-        # Test that executable was loaded properly
-        self.runCmd("-break-insert -f main")
-        self.expect("\^done,bkpt={number=\"1\"")
-        self.runCmd("-exec-run")
-        self.expect("\^running")
-        self.expect("\*stopped,reason=\"breakpoint-hit\"")
-
-    @lldbmi_test
-    @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
-    @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
-    @skipIfLinux # llvm.org/pr22841: lldb-mi tests fail on all Linux buildbots
-    def test_lldbmi_breakpoint_set(self):
-        """Test that 'lldb-mi --interpreter' can set breakpoint by 'breakpoint set' command."""
-
-        self.spawnLldbMi(args = None)
-
-        # Load executable
-        self.runCmd("-file-exec-and-symbols %s" % self.myexe)
-        self.expect("\^done")
-
-        # Test that "breakpoint set" sets a breakpoint
-        self.runCmd("-interpreter-exec console \"breakpoint set --name main\"")
-        self.expect("\^done")
-
-        # Test that breakpoint was set properly
-        self.runCmd("-exec-run")
-        self.expect("\^running")
-        self.expect("\*stopped,reason=\"breakpoint-hit\"")
-
-    @lldbmi_test
-    @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
-    @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
-    @skipIfLinux # llvm.org/pr22841: lldb-mi tests fail on all Linux buildbots
-    def test_lldbmi_settings_set_target_run_args_before(self):
-        """Test that 'lldb-mi --interpreter' can set target arguments by 'setting set target.run-args' command before than target was created."""
-
-        self.spawnLldbMi(args = None)
-
-        # Test that "settings set target.run-args" passes arguments to executable
-        #FIXME: "--arg1 \"2nd arg\" third_arg fourth=\"4th arg\"" causes an error
-        self.runCmd("-interpreter-exec console \"setting set target.run-args arg1\"")
-        self.expect("\^done")
-
-        # Load executable
-        self.runCmd("-file-exec-and-symbols %s" % self.myexe)
-        self.expect("\^done")
-
-        # Run
-        self.runCmd("-exec-run")
-        self.expect("\^running")
-
-        # Test that arguments were passed properly
-        self.expect("~\"argc=2\\\\r\\\\n\"")
-
-    @lldbmi_test
-    @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
-    @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
-    @skipIfLinux # llvm.org/pr22841: lldb-mi tests fail on all Linux buildbots
-    def test_lldbmi_settings_set_target_run_args_after(self):
-        """Test that 'lldb-mi --interpreter' can set target arguments by 'setting set target.run-args' command after than target was created."""
-
-        self.spawnLldbMi(args = None)
-
-        # Load executable
-        self.runCmd("-file-exec-and-symbols %s" % self.myexe)
-        self.expect("\^done")
-
-        # Test that "settings set target.run-args" passes arguments to executable
-        #FIXME: "--arg1 \"2nd arg\" third_arg fourth=\"4th arg\"" causes an error
-        self.runCmd("-interpreter-exec console \"setting set target.run-args arg1\"")
-        self.expect("\^done")
-
-        # Run
-        self.runCmd("-exec-run")
-        self.expect("\^running")
-
-        # Test that arguments were passed properly
-        self.expect("~\"argc=2\\\\r\\\\n\"")
-
-    @lldbmi_test
-    @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
-    @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
-    @skipIfLinux # llvm.org/pr22841: lldb-mi tests fail on all Linux buildbots
-    def test_lldbmi_process_launch(self):
-        """Test that 'lldb-mi --interpreter' can launch process by "process launch" command."""
-
-        self.spawnLldbMi(args = None)
-
-        # Load executable
-        self.runCmd("-file-exec-and-symbols %s" % self.myexe)
-        self.expect("\^done")
-
-        # Set breakpoint
-        self.runCmd("-break-insert -f main")
-        self.expect("\^done,bkpt={number=\"1\"")
-
-        # Test that "process launch" launches executable
-        self.runCmd("-interpreter-exec console \"process launch\"")
-        self.expect("\^done")
-
-        # Test that breakpoint hit
-        self.expect("\*stopped,reason=\"breakpoint-hit\"")
-
-    @lldbmi_test
-    @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
-    @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
-    @skipIfLinux # llvm.org/pr22841: lldb-mi tests fail on all Linux buildbots
-    def test_lldbmi_thread_step_in(self):
-        """Test that 'lldb-mi --interpreter' can step in by "thread step-in" command."""
-
-        self.spawnLldbMi(args = None)
-
-        # Load executable
-        self.runCmd("-file-exec-and-symbols %s" % self.myexe)
-        self.expect("\^done")
-
-        # Run to main
-        self.runCmd("-break-insert -f main")
-        self.expect("\^done,bkpt={number=\"1\"")
-        self.runCmd("-exec-run")
-        self.expect("\^running")
-        self.expect("\*stopped,reason=\"breakpoint-hit\"")
-
-        # Test that "thread step-in" steps into (or not) printf depending on debug info
-        # Note that message is different in Darwin and Linux:
-        # Darwin: "*stopped,reason=\"end-stepping-range\",frame={addr=\"0x[0-9a-f]+\",func=\"main\",args=[{name=\"argc\",value=\"1\"},{name=\"argv\",value="0x[0-9a-f]+\"}],file=\"main.cpp\",fullname=\".+main.cpp\",line=\"\d\"},thread-id=\"1\",stopped-threads=\"all\"
-        # Linux:  "*stopped,reason=\"end-stepping-range\",frame={addr="0x[0-9a-f]+\",func=\"__printf\",args=[{name=\"format\",value=\"0x[0-9a-f]+\"}],file=\"printf.c\",fullname=\".+printf.c\",line="\d+"},thread-id=\"1\",stopped-threads=\"all\"
-        self.runCmd("-interpreter-exec console \"thread step-in\"")
-        self.expect("\^done")
-        it = self.expect([ "~\"argc=1\\\\r\\\\n\"",
-                           "\*stopped,reason=\"end-stepping-range\".+func=\"((?!main).)+\"" ])
-        if it == 0:
-            self.expect("\*stopped,reason=\"end-stepping-range\".+func=\"main\"")
-
-    @lldbmi_test
-    @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
-    @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
-    @skipIfLinux # llvm.org/pr22841: lldb-mi tests fail on all Linux buildbots
-    def test_lldbmi_thread_step_over(self):
-        """Test that 'lldb-mi --interpreter' can step over by "thread step-over" command."""
-
-        self.spawnLldbMi(args = None)
-
-        # Load executable
-        self.runCmd("-file-exec-and-symbols %s" % self.myexe)
-        self.expect("\^done")
-
-        # Run to main
-        self.runCmd("-break-insert -f main")
-        self.expect("\^done,bkpt={number=\"1\"")
-        self.runCmd("-exec-run")
-        self.expect("\^running")
-        self.expect("\*stopped,reason=\"breakpoint-hit\"")
-
-        # Test that "thread step-over" steps over
-        self.runCmd("-interpreter-exec console \"thread step-over\"")
-        self.expect("\^done")
-        self.expect("~\"argc=1\\\\r\\\\n\"")
-        self.expect("\*stopped,reason=\"end-stepping-range\"")
-
-    @lldbmi_test
-    @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
-    @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
-    @skipIfLinux # llvm.org/pr22841: lldb-mi tests fail on all Linux buildbots
-    def test_lldbmi_thread_continue(self):
-        """Test that 'lldb-mi --interpreter' can continue execution by "thread continue" command."""
-
-        self.spawnLldbMi(args = None)
-
-        # Load executable
-        self.runCmd("-file-exec-and-symbols %s" % self.myexe)
-        self.expect("\^done")
-
-        # Run to main
-        self.runCmd("-break-insert -f main")
-        self.expect("\^done,bkpt={number=\"1\"")
-        self.runCmd("-exec-run")
-        self.expect("\^running")
-        self.expect("\*stopped,reason=\"breakpoint-hit\"")
-
-        # Test that "thread continue" continues execution
-        self.runCmd("-interpreter-exec console \"thread continue\"")
-        self.expect("\^done")
-        self.expect("~\"argc=1\\\\r\\\\n")
-        self.expect("\*stopped,reason=\"exited-normally\"")
-
-if __name__ == '__main__':
-    unittest2.main()

Added: lldb/trunk/test/tools/lldb-mi/interpreter/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/interpreter/Makefile?rev=231918&view=auto
==============================================================================
--- lldb/trunk/test/tools/lldb-mi/interpreter/Makefile (added)
+++ lldb/trunk/test/tools/lldb-mi/interpreter/Makefile Wed Mar 11 07:28:48 2015
@@ -0,0 +1,5 @@
+LEVEL = ../../../make
+
+CXX_SOURCES := main.cpp
+
+include $(LEVEL)/Makefile.rules

Copied: lldb/trunk/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py (from r231917, lldb/trunk/test/tools/lldb-mi/TestMiInterpreterExec.py)
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py?p2=lldb/trunk/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py&p1=lldb/trunk/test/tools/lldb-mi/TestMiInterpreterExec.py&r1=231917&r2=231918&rev=231918&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-mi/TestMiInterpreterExec.py (original)
+++ lldb/trunk/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py Wed Mar 11 07:28:48 2015
@@ -2,6 +2,10 @@
 Test lldb-mi -interpreter-exec command.
 """
 
+# adjust path for lldbmi_testcase.py
+import sys, os.path
+sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
+
 import lldbmi_testcase
 from lldbtest import *
 import unittest2

Added: lldb/trunk/test/tools/lldb-mi/interpreter/main.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/interpreter/main.cpp?rev=231918&view=auto
==============================================================================
--- lldb/trunk/test/tools/lldb-mi/interpreter/main.cpp (added)
+++ lldb/trunk/test/tools/lldb-mi/interpreter/main.cpp Wed Mar 11 07:28:48 2015
@@ -0,0 +1,17 @@
+//===-- main.cpp ------------------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <cstdio>
+
+int
+main(int argc, char const *argv[])
+{
+    printf("argc=%d\n", argc);
+    return 0;
+}





More information about the lldb-commits mailing list