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

Ben Boeckel ben.boeckel at kitware.com
Wed Jul 2 08:13:00 EDT 2014


On Tue, Jul 01, 2014 at 16:01:48 -0400, Steve Dougherty wrote:
> When I glance at ctest output, even if all tests passed, my eye catches
> "failed" before noticing the other things, which gives me a start.
> 
> To make this less likely to happen this colors the test summary green
> if all tests succeeded and red if not.
> 
> Although I have attempted to edit the test regular expressions so that
> they still pass, I'm missing something about matching escape codes,
> and a third of them fail. From LastTest.log:

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).

--Ben



More information about the cmake-developers mailing list