[cmake-developers] [RFCv2] ctest: color test summary output

Steve Dougherty sdougherty at barracuda.com
Wed Jul 9 16:30:26 EDT 2014


On 07/02/2014 09:24 AM, Brad King wrote:
> On 07/02/2014 08:13 AM, Ben Boeckel wrote:
>> Colors should only be output if we're outputting to a TTY. Pipes or
>> redirections should not be colored (they'll only confuse those who don't
>> recognize the escape sequences). CMake also has color routines already,
>> but I don't know off-hand how accessible they are from CTest code (i.e.,
>> might be static functions).
> 
> Look for uses of "cmsysTerminal_cfprintf" as an example.
> See its declaration in "Source/kwsys/Terminal.h.in" also.

I've attached an implementation that uses cmsysTerminal_cfprintf.

Is it acceptable to decouple outputting this line from cmCTest::Log? Currently
cmCTestLog is a macro that uses cmCTest::Log, which uses C++ ostreams.

Would it be better to move the color logic and manipulation to something shared
between Log and cmsysTerminal_cfprintf, and add a Log that can use color?

Is it preferable to keep the user-facing string on one line, or break it up for
line length?

===========================================================



DISCLAIMER:
This e-mail and any attachments to it contain confidential and proprietary material of Barracuda, its affiliates or agents, and is solely for the use of the intended recipient. Any review, use, disclosure, distribution or copying of this transmittal is prohibited except by or on behalf of the intended recipient. If you have received this transmittal in error, please notify the sender and destroy this e-mail and any attachments and all copies, whether electronic or printed.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-color-test-summary-output.patch
Type: text/x-patch
Size: 1524 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20140709/a0e6127a/attachment-0002.bin>


More information about the cmake-developers mailing list