summaryrefslogtreecommitdiffstats
path: root/Source/cmCTest.cxx
diff options
context:
space:
mode:
authorMarin Baron <marin6314@gmail.com>2019-08-24 17:29:18 (GMT)
committerBrad King <brad.king@kitware.com>2019-08-26 15:04:57 (GMT)
commit074a6a8cf668e748d6749ac30e58ce07179d5da8 (patch)
tree9f2d031db326b68230e739e680ad3cb09b00764c /Source/cmCTest.cxx
parent395cbee2fce5a450d7909b218474dadbdb804d68 (diff)
downloadCMake-074a6a8cf668e748d6749ac30e58ce07179d5da8.zip
CMake-074a6a8cf668e748d6749ac30e58ce07179d5da8.tar.gz
CMake-074a6a8cf668e748d6749ac30e58ce07179d5da8.tar.bz2
CTest: Add env var CLICOLOR_FORCE to force color output
Base impl on `Source/kwsys/Terminal.c:kwsysTerminalStreamIsVT100`. This enables pipes/logs with colors.
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r--Source/cmCTest.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 866d262..ca39a7b 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -2125,6 +2125,11 @@ bool cmCTest::ColoredOutputSupportedByConsole()
return false;
#else
// On UNIX we need a non-dumb tty.
+ std::string clicolor_force;
+ if (cmSystemTools::GetEnv("CLICOLOR_FORCE", clicolor_force) &&
+ !clicolor_force.empty() && clicolor_force != "0") {
+ return true;
+ }
return ConsoleIsNotDumb();
#endif
}