summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/lldbtest.py
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2017-03-03 13:49:38 +0000
committerPavel Labath <labath@google.com>2017-03-03 13:49:38 +0000
commit4438bf749874c933c37b564ceb75581e9352ed5f (patch)
tree95f97df231b005e568895db32905df8908f90c41 /lldb/packages/Python/lldbsuite/test/lldbtest.py
parentbc58f9aa7bf2dfcb47af356d2fa05978e16e5a86 (diff)
downloadbcm5719-llvm-4438bf749874c933c37b564ceb75581e9352ed5f.tar.gz
bcm5719-llvm-4438bf749874c933c37b564ceb75581e9352ed5f.zip
test: shorten test trace file names
Make sure we don't generate extremely long file names for test trace log file, as this can cause path-too-long errors. As the compilers in the android ndk are deeply nested, it's very easy to trigger these. I chose to output at most 4 path components -- this should keep the full path for common cases like /usr/bin/gcc with room to spare, and should be enough to uniquely identify the compiler for more deeply nested cases. llvm-svn: 296870
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lldbtest.py')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lldbtest.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index f4f12a76a3b..078f1e83f53 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -1119,8 +1119,11 @@ class Base(unittest2.TestCase):
compiler = compiler[2:]
if os.path.altsep is not None:
compiler = compiler.replace(os.path.altsep, os.path.sep)
- components.extend(
- [x for x in compiler.split(os.path.sep) if x != ""])
+ path_components = [x for x in compiler.split(os.path.sep) if x != ""]
+
+ # Add at most 4 path components to avoid generating very long
+ # filenames
+ components.extend(path_components[-4:])
elif c == 'a':
components.append(self.getArchitecture())
elif c == 'm':
OpenPOWER on IntegriCloud