diff options
Diffstat (limited to 'packages/Python/lldbsuite/test/tools/lldb-mi')
5 files changed, 32 insertions, 12 deletions
| diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py b/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py index ccd7eba8bfe31..848bd3852393f 100644 --- a/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py +++ b/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py @@ -18,6 +18,7 @@ class MiInterpreterExecTestCase(lldbmi_testcase.MiTestCaseBase):      @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. +    @skipIfDarwin      def test_lldbmi_target_create(self):          """Test that 'lldb-mi --interpreter' can create target by 'target create' command.""" @@ -39,6 +40,7 @@ class MiInterpreterExecTestCase(lldbmi_testcase.MiTestCaseBase):      @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. +    @skipIfDarwin      def test_lldbmi_target_list(self):          """Test that 'lldb-mi --interpreter' can list targets by 'target list' command.""" @@ -58,6 +60,7 @@ class MiInterpreterExecTestCase(lldbmi_testcase.MiTestCaseBase):      @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. +    @skipIfDarwin      def test_lldbmi_breakpoint_set(self):          """Test that 'lldb-mi --interpreter' can set breakpoint by 'breakpoint set' command.""" @@ -82,6 +85,7 @@ class MiInterpreterExecTestCase(lldbmi_testcase.MiTestCaseBase):      @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread races      @expectedFlakeyLinux(bugnumber="llvm.org/pr25470")      @skipIfRemote   # We do not currently support remote debugging via the MI. +    @skipIfDarwin      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.""" @@ -115,6 +119,7 @@ class MiInterpreterExecTestCase(lldbmi_testcase.MiTestCaseBase):      @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. +    @skipIfDarwin      def test_lldbmi_process_launch(self):          """Test that 'lldb-mi --interpreter' can launch process by "process launch" command.""" @@ -138,6 +143,7 @@ class MiInterpreterExecTestCase(lldbmi_testcase.MiTestCaseBase):      @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. +    @skipIfDarwin      def test_lldbmi_thread_step_in(self):          """Test that 'lldb-mi --interpreter' can step in by "thread step-in" command.""" @@ -170,6 +176,7 @@ class MiInterpreterExecTestCase(lldbmi_testcase.MiTestCaseBase):      @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. +    @skipIfDarwin      def test_lldbmi_thread_step_over(self):          """Test that 'lldb-mi --interpreter' can step over by "thread step-over" command.""" @@ -196,6 +203,7 @@ class MiInterpreterExecTestCase(lldbmi_testcase.MiTestCaseBase):      @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread races      @expectedFlakeyLinux("llvm.org/pr25470")      @skipIfRemote   # We do not currently support remote debugging via the MI. +    @skipIfDarwin      def test_lldbmi_thread_continue(self):          """Test that 'lldb-mi --interpreter' can continue execution by "thread continue" command.""" diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py b/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py index 7b6ee55b250e1..59a5b324465fa 100644 --- a/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py +++ b/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py @@ -40,7 +40,7 @@ class MiTestCaseBase(Base):                  pass          Base.tearDown(self) -    def spawnLldbMi(self, args=None): +    def spawnLldbMi(self, exe=None, args=None, preconfig=True):          import pexpect          self.child = pexpect.spawn("%s --interpreter %s" % (              self.lldbMiExec, args if args else ""), cwd=self.getBuildDir()) @@ -49,6 +49,14 @@ class MiTestCaseBase(Base):          self.child.logfile_read = open(self.mylog, "w")          # wait until lldb-mi has started up and is ready to go          self.expect(self.child_prompt, exactly=True) +        if preconfig: +            self.runCmd("settings set symbols.enable-external-lookup false") +            self.expect("\^done") +            self.expect(self.child_prompt, exactly=True) +        if exe: +            self.runCmd("-file-exec-and-symbols \"%s\"" % exe) +            # Testcases expect to be able to match output of this command, +            # see test_lldbmi_specialchars.      def runCmd(self, cmd):          self.child.sendline(cmd) diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py b/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py index 467952db7eba0..b78f4762ddf96 100644 --- a/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py +++ b/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py @@ -22,7 +22,7 @@ class MiStartupOptionsTestCase(lldbmi_testcase.MiTestCaseBase):      def test_lldbmi_executable_option_file(self):          """Test that 'lldb-mi --interpreter %s' loads executable file.""" -        self.spawnLldbMi(args="%s" % self.myexe) +        self.spawnLldbMi(exe=self.myexe)          # Test that the executable is loaded when file was specified          self.expect("-file-exec-and-symbols \"%s\"" % self.myexe) @@ -52,7 +52,7 @@ class MiStartupOptionsTestCase(lldbmi_testcase.MiTestCaseBase):          # Prepare path to executable          path = "unknown_file" -        self.spawnLldbMi(args="%s" % path) +        self.spawnLldbMi(exe=path)          # Test that the executable isn't loaded when unknown file was specified          self.expect("-file-exec-and-symbols \"%s\"" % path) @@ -71,7 +71,7 @@ class MiStartupOptionsTestCase(lldbmi_testcase.MiTestCaseBase):          """Test that 'lldb-mi --interpreter %s' loads executable which is specified via absolute path."""          # Prepare path to executable -        self.spawnLldbMi(args="%s" % self.myexe) +        self.spawnLldbMi(exe=self.myexe)          # Test that the executable is loaded when file was specified using          # absolute path @@ -95,7 +95,7 @@ class MiStartupOptionsTestCase(lldbmi_testcase.MiTestCaseBase):          # Prepare path to executable          path = os.path.relpath(self.myexe, self.getBuildDir()) -        self.spawnLldbMi(args="%s" % path) +        self.spawnLldbMi(exe=path)          # Test that the executable is loaded when file was specified using          # relative path @@ -119,7 +119,7 @@ class MiStartupOptionsTestCase(lldbmi_testcase.MiTestCaseBase):          # Prepare path to executable          path = "unknown_dir" + self.myexe -        self.spawnLldbMi(args="%s" % path) +        self.spawnLldbMi(exe=path)          # Test that the executable isn't loaded when file was specified using          # unknown path @@ -237,7 +237,11 @@ class MiStartupOptionsTestCase(lldbmi_testcase.MiTestCaseBase):          # Prepared source file          sourceFile = self.copyScript("start_script_error") -        self.spawnLldbMi(args="--source %s" % sourceFile) +        self.spawnLldbMi(args="--source %s" % sourceFile, preconfig=False) + +        # After 'settings set symbols.enable-external-lookup false' +        self.expect("settings set symbols.enable-external-lookup false") +        self.expect("\^done")          # After '-file-exec-and-symbols a.out'          self.expect("-file-exec-and-symbols %s" % self.myexe) @@ -259,7 +263,7 @@ class MiStartupOptionsTestCase(lldbmi_testcase.MiTestCaseBase):          """Test that 'lldb-mi --log' creates a log file in the current directory."""          logDirectory = self.getBuildDir() -        self.spawnLldbMi(args="%s --log" % self.myexe) +        self.spawnLldbMi(exe=self.myexe, args="--log")          # Test that the executable is loaded when file was specified          self.expect("-file-exec-and-symbols \"%s\"" % self.myexe) @@ -296,9 +300,8 @@ class MiStartupOptionsTestCase(lldbmi_testcase.MiTestCaseBase):          import tempfile          logDirectory = tempfile.gettempdir() -        self.spawnLldbMi( -            args="%s --log --log-dir=%s" % -            (self.myexe, logDirectory)) +        self.spawnLldbMi(exe=self.myexe, +            args="--log --log-dir=%s" % logDirectory)          # Test that the executable is loaded when file was specified          self.expect("-file-exec-and-symbols \"%s\"" % self.myexe) diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/start_script_error b/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/start_script_error index d834e7407c570..a1c581b08e0e2 100644 --- a/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/start_script_error +++ b/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/start_script_error @@ -1,2 +1,3 @@ +settings set symbols.enable-external-lookup false  -file-exec-and-symbols a.out  -break-ins -f main diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py b/packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py index 50a94b53a18b3..74d194e6dee28 100644 --- a/packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py +++ b/packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py @@ -53,7 +53,7 @@ class MiSyntaxTestCase(lldbmi_testcase.MiTestCaseBase):          os.symlink(self.myexe, complicated_myexe)          self.addTearDownHook(lambda: os.unlink(complicated_myexe)) -        self.spawnLldbMi(args="\"%s\"" % complicated_myexe) +        self.spawnLldbMi(exe=complicated_myexe)          # Test that the executable was loaded          self.expect( | 
