From 4438bf749874c933c37b564ceb75581e9352ed5f Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Fri, 3 Mar 2017 13:49:38 +0000 Subject: 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 --- lldb/packages/Python/lldbsuite/test/lldbtest.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lldb/packages/Python/lldbsuite') 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': -- cgit v1.2.3