summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/tools/lldb-mi
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2018-03-15 13:47:09 +0000
committerPavel Labath <labath@google.com>2018-03-15 13:47:09 +0000
commit107052ff9ded599519445833d755628703027801 (patch)
treeffb1645cdd59e8a980cc33a5908377e4c9bf430d /lldb/packages/Python/lldbsuite/test/tools/lldb-mi
parentdfc7eb490aab97f2fc93963bd0884ee30ceb257b (diff)
downloadbcm5719-llvm-107052ff9ded599519445833d755628703027801.tar.gz
bcm5719-llvm-107052ff9ded599519445833d755628703027801.zip
Next batch of test-tree-cleaning changes
Summary: The changes here fall into several categories. - some tests were redirecting inferior stdout/err to a file. For these I make sure we use an absolute path for the file. I also create a lldbutil.read_file_on_target helper function to encapsulate the differences between reading a file locally and remotely. - some tests were redirecting the pexpect I/O into a file. For these I use a python StringIO object to avoid creating a file altogether. - the TestSettings inferior was creating a file. Here, I make sure the inferior is launched with pwd=build-dir so that the files end up created there. - lldb-mi --log (used by some tests) creates a log file in PWD without the ability say differently. To make this work I make sure to run lldb-mi with PWD=build_dir. This in turn necessitated a couple of changes in other lldb-mi tests, which were using relative paths to access the source tree. Reviewers: aprantl Subscribers: ki.stfu, mehdi_amini, lldb-commits Differential Revision: https://reviews.llvm.org/D44159 llvm-svn: 327625
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/tools/lldb-mi')
-rw-r--r--lldb/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiFile.py2
-rw-r--r--lldb/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py2
-rw-r--r--lldb/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py4
-rw-r--r--lldb/packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py2
4 files changed, 5 insertions, 5 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiFile.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiFile.py
index dfe639cfa65..b650eb89d81 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiFile.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiFile.py
@@ -59,7 +59,7 @@ class MiFileTestCase(lldbmi_testcase.MiTestCaseBase):
# Test that -file-exec-and-symbols works for relative path
import os
- path = os.path.relpath(self.myexe)
+ path = os.path.relpath(self.myexe, self.getBuildDir())
self.runCmd("-file-exec-and-symbols %s" % path)
self.expect("\^done")
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py
index 4ca40630c38..068e968fb78 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py
@@ -44,7 +44,7 @@ class MiTestCaseBase(Base):
def spawnLldbMi(self, args=None):
import pexpect
self.child = pexpect.spawn("%s --interpreter %s" % (
- self.lldbMiExec, args if args else ""))
+ self.lldbMiExec, args if args else ""), cwd=self.getBuildDir())
self.child.setecho(True)
self.mylog = self.getBuildArtifact("child.log")
self.child.logfile_read = open(self.mylog, "w")
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
index 8bdebb8028e..6766e80b1ee 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
@@ -94,7 +94,7 @@ class MiStartupOptionsTestCase(lldbmi_testcase.MiTestCaseBase):
"""Test that 'lldb-mi --interpreter %s' loads executable which is specified via relative path."""
# Prepare path to executable
- path = os.path.relpath(self.myexe)
+ path = os.path.relpath(self.myexe, self.getBuildDir())
self.spawnLldbMi(args="%s" % path)
# Test that the executable is loaded when file was specified using
@@ -258,7 +258,7 @@ class MiStartupOptionsTestCase(lldbmi_testcase.MiTestCaseBase):
def test_lldbmi_log_option(self):
"""Test that 'lldb-mi --log' creates a log file in the current directory."""
- logDirectory = "."
+ logDirectory = self.getBuildDir()
self.spawnLldbMi(args="%s --log" % self.myexe)
# Test that the executable is loaded when file was specified
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py
index 5df03eda32e..bf329fbacd5 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py
@@ -47,7 +47,7 @@ class MiSyntaxTestCase(lldbmi_testcase.MiTestCaseBase):
"""Test that 'lldb-mi --interpreter' handles complicated strings."""
# Create an alias for myexe
- complicated_myexe = "C--mpl-x file's`s @#$%^&*()_+-={}[]| name"
+ complicated_myexe = self.getBuildArtifact("C--mpl-x file's`s @#$%^&*()_+-={}[]| name")
os.symlink(self.myexe, complicated_myexe)
self.addTearDownHook(lambda: os.unlink(complicated_myexe))
OpenPOWER on IntegriCloud