[PATCH] D139592: [llvm-lit] Keep start/end part of the output when truncating

Andrei Elovikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 7 16:34:31 PST 2022


a.elovikov created this revision.
Herald added a subscriber: delcypher.
Herald added a project: All.
a.elovikov requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139592

Files:
  llvm/utils/lit/lit/TestRunner.py


Index: llvm/utils/lit/lit/TestRunner.py
===================================================================
--- llvm/utils/lit/lit/TestRunner.py
+++ llvm/utils/lit/lit/TestRunner.py
@@ -971,7 +971,7 @@
                 out += "# redirected output from %r:\n" % (name,)
                 data = to_string(data.decode('utf-8', errors='replace'))
                 if len(data) > 1024:
-                    out += data[:1024] + "\n...\n"
+                    out += data[:512] + "\n...\n" + data[-512:]
                     out += "note: data was truncated\n"
                 else:
                     out += data


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139592.481106.patch
Type: text/x-patch
Size: 611 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221208/1470e257/attachment.bin>


More information about the llvm-commits mailing list