[LLVMdev] Getting FileCheck's colored output through lit (& possibly ninja)

David Blaikie dblaikie at gmail.com
Mon Apr 7 13:16:30 PDT 2014


So I manage to get clang's colored output through ninja simply by
force (CMAKE_CXX_FLAGS=-fcolor-diagnostics), which isn't ideal (if I
were to pipe ninja's output to a file it'd still have color escapes,
etc) but it works.

But I haven't found a similar solution for FileCheck & I'm wondering
has anyone already solved this problem for themselves - if so, how?

if not, how should we solve this problem?

Some strawmen:

Introduce a flag to FileCheck to force colors on. Have lit pass this
when lit detects it's wired to a color-compatible terminal (this still
wouldn't work for the ninja build - either special case that, or get
upstream fixes to have ninja pretend to be a color-compatible
terminal?). How/where do we pass the flag, then? Would that require
replacing every FileCheck usage with %FileCheck and having lit do the
replacement? Or are there less intrusive alias options?

If ninja can be taught to pretend to be color-compatible, then perhaps
lit can do the same thing. In that case FileCheck would need no
modifications.



More information about the llvm-dev mailing list