Files
clang-p2996/llvm/utils/lit/tests
Henrik G. Olsson 828783177f Reland "[llvm-lit] Process ANSI color codes in test output when forma… (#108107)
…tting" (#108104)"

This recommits 0f56ba13bf (reverted by
6007ad79af). In the original patch
llvm/utils/lit/tests/escape-color.py failed on Windows because it diffed
llvm-lit output with a file containing '\n' newlines rather than '\r\n'.
This issue is avoided by calling 'diff --strip-trailing-cr'.

Original description below:
Test output that carried color across newlines previously resulted in
the formatting around the output also being colored. Detect the current
ANSI color and reset it when printing formatting, and then reapply it.
As an added bonus an unterminated color code is also detected,
preventing it from leaking out into the rest of the terminal.

Fixes #106633
2024-09-11 16:39:28 -07:00
..