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

Brad King brad.king at kitware.com
Thu Jul 10 10:13:58 EDT 2014


On 07/09/2014 04:30 PM, Steve Dougherty wrote:
> 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.

It will have to go through the log API because HANDLER_OUTPUT does
not always go to std::cout.  It looks like cmCTest needs to expose
a way to determine whether 'StreamOut == &std::cout'.  If so, then
you could flush cout, write to stdout with cmsysTerminal_cfprintf,
and then fflush(stdout).

> 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?

cmsysTerminal is in a separate KWSys library that we import to
the Source/kwsys directory.  If something were to be shared then
it would have to stay in that library.  Some refactoring of
cfprintf may be needed to fix this issue too:

 http://www.cmake.org/Bug/view.php?id=12991#c28687

Note that because color in Windows consoles requires state changes
instead of using escape sequences it is not possible to achieve a
single atomic write with color.

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

Unless the numbers are really big I do not see how this summary
line can be very long.

-Brad




More information about the cmake-developers mailing list