[Lldb-commits] [PATCH] Limit the length of the file name of the log file for tests

Tamas Berghammer tberghammer at google.com
Thu Mar 12 03:26:41 PDT 2015


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D8252

Files:
  lldb/trunk/test/lldbtest.py

Index: lldb/trunk/test/lldbtest.py
===================================================================
--- lldb/trunk/test/lldbtest.py
+++ lldb/trunk/test/lldbtest.py
@@ -1333,8 +1333,11 @@
         if compiler[1] == ':':
             compiler = compiler[2:]
 
-        fname = os.path.join(dname, "%s-%s-%s-%s.log" % (prefix, self.getArchitecture(), "_".join(compiler.split(os.path.sep)), self.id()))
-        with open(fname, "w") as f:
+        fname = "%s-%s-%s-%s.log" % (prefix, self.getArchitecture(), "_".join(compiler.split(os.path.sep)), self.id())
+        if len(fname) > 255:
+            fname = "%s-%s-%s-%s.log" % (prefix, self.getArchitecture(), compiler.split(os.path.sep)[-1], self.id())
+        pname = os.path.join(dname, fname)
+        with open(pname, "w") as f:
             import datetime
             print >> f, "Session info generated @", datetime.datetime.now().ctime()
             print >> f, self.session.getvalue()

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8252.21812.patch
Type: text/x-patch
Size: 951 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150312/2831335e/attachment.bin>


More information about the lldb-commits mailing list