summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2017-03-20 16:07:17 +0000
committerPavel Labath <labath@google.com>2017-03-20 16:07:17 +0000
commit6b42b3b7a3577d3d61a6d7552f147b6d2afef737 (patch)
tree2df801d85807b5f7d4baff65e17296ec64b78f0f /lldb/packages/Python
parent5d59a4ee19cfe1580932fb5315c1bad5cb8ef767 (diff)
downloadbcm5719-llvm-6b42b3b7a3577d3d61a6d7552f147b6d2afef737.tar.gz
bcm5719-llvm-6b42b3b7a3577d3d61a6d7552f147b6d2afef737.zip
Fix remote test suite directory creation
r298203 make SBPlatform::MakeDirectory less recursive, which breaks the test suite creation of test directory hierarchy creation on the remote target. Since the function was never fully recursive, and the name does not imply recursiveness, I fix the problem by modifying the test runner to do the recursion manually. I also make the runner complain more loudly when it fails to create the directory -- previously it just printed the error to stdout and caused most of the tests to hang, which is not very helpful in diagnosing the problem. llvm-svn: 298261
Diffstat (limited to 'lldb/packages/Python')
-rw-r--r--lldb/packages/Python/lldbsuite/test/dotest.py11
-rw-r--r--lldb/packages/Python/lldbsuite/test/lldbtest.py49
2 files changed, 33 insertions, 27 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py
index aa0c2ff9334..a6bb01ea608 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest.py
@@ -1147,8 +1147,15 @@ def run_suite():
if configuration.lldb_platform_working_dir:
print("Setting remote platform working directory to '%s'..." %
(configuration.lldb_platform_working_dir))
- lldb.remote_platform.SetWorkingDirectory(
- configuration.lldb_platform_working_dir)
+ error = lldb.remote_platform.MakeDirectory(
+ configuration.lldb_platform_working_dir, 448) # 448 = 0o700
+ if error.Fail():
+ raise Exception("making remote directory '%s': %s" % (
+ remote_test_dir, error))
+
+ if not lldb.remote_platform.SetWorkingDirectory(
+ configuration.lldb_platform_working_dir):
+ raise Exception("failed to set working directory '%s'" % remote_test_dir)
lldb.DBG.SetSelectedPlatform(lldb.remote_platform)
else:
lldb.remote_platform = None
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index a4aa02e86a1..bc0fb1b686a 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -692,31 +692,30 @@ class Base(unittest2.TestCase):
if not lldb.remote_platform or not configuration.lldb_platform_working_dir:
return
- remote_test_dir = lldbutil.join_remote_paths(
- configuration.lldb_platform_working_dir,
- self.getArchitecture(),
- str(self.test_number),
- self.mydir)
- error = lldb.remote_platform.MakeDirectory(
- remote_test_dir, 448) # 448 = 0o700
- if error.Success():
- lldb.remote_platform.SetWorkingDirectory(remote_test_dir)
-
- # This function removes all files from the current working directory while leaving
- # the directories in place. The cleaup is required to reduce the disk space required
- # by the test suit while leaving the directories untached is neccessary because
- # sub-directories might belong to an other test
- def clean_working_directory():
- # TODO: Make it working on Windows when we need it for remote debugging support
- # TODO: Replace the heuristic to remove the files with a logic what collects the
- # list of files we have to remove during test runs.
- shell_cmd = lldb.SBPlatformShellCommand(
- "rm %s/*" % remote_test_dir)
- lldb.remote_platform.Run(shell_cmd)
- self.addTearDownHook(clean_working_directory)
- else:
- print("error: making remote directory '%s': %s" % (
- remote_test_dir, error))
+ components = [str(self.test_number)] + self.mydir.split(os.path.sep)
+ remote_test_dir = configuration.lldb_platform_working_dir
+ for c in components:
+ remote_test_dir = lldbutil.join_remote_paths(remote_test_dir, c)
+ error = lldb.remote_platform.MakeDirectory(
+ remote_test_dir, 448) # 448 = 0o700
+ if error.Fail():
+ raise Exception("making remote directory '%s': %s" % (
+ remote_test_dir, error))
+
+ lldb.remote_platform.SetWorkingDirectory(remote_test_dir)
+
+ # This function removes all files from the current working directory while leaving
+ # the directories in place. The cleaup is required to reduce the disk space required
+ # by the test suit while leaving the directories untached is neccessary because
+ # sub-directories might belong to an other test
+ def clean_working_directory():
+ # TODO: Make it working on Windows when we need it for remote debugging support
+ # TODO: Replace the heuristic to remove the files with a logic what collects the
+ # list of files we have to remove during test runs.
+ shell_cmd = lldb.SBPlatformShellCommand(
+ "rm %s/*" % remote_test_dir)
+ lldb.remote_platform.Run(shell_cmd)
+ self.addTearDownHook(clean_working_directory)
def setUp(self):
"""Fixture for unittest test case setup.
OpenPOWER on IntegriCloud