diff options
author | Sylvain Joubert <joubert.sy@gmail.com> | 2018-11-07 15:33:28 (GMT) |
---|---|---|
committer | Sylvain Joubert <joubert.sy@gmail.com> | 2018-11-09 17:57:41 (GMT) |
commit | ffdec37a197499929e2cbc4fa825f5bf9b7d0f26 (patch) | |
tree | f4edf6259f1f08fdd64849e8cdae50909c7a7cf0 /Source/cmCTest.h | |
parent | 48bc74710d4ddcf62e3dcf69e3400e4060a2bdc1 (diff) | |
download | CMake-ffdec37a197499929e2cbc4fa825f5bf9b7d0f26.zip CMake-ffdec37a197499929e2cbc4fa825f5bf9b7d0f26.tar.gz CMake-ffdec37a197499929e2cbc4fa825f5bf9b7d0f26.tar.bz2 |
CTest: Add colored output on tests summary where supported
- Number of passed/failed tests is colored according to the whole outcome
- Individual listed tested are colored according to their completion status:
* Disabled: blue
* Failed: red
* Not Run: yellow
Diffstat (limited to 'Source/cmCTest.h')
-rw-r--r-- | Source/cmCTest.h | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/Source/cmCTest.h b/Source/cmCTest.h index 1ee002a..427049d 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -405,6 +405,19 @@ public: void Log(int logType, const char* file, int line, const char* msg, bool suppress = false); + /** Color values */ + enum class Color + { + CLEAR_COLOR = 0, + RED = 31, + GREEN = 32, + YELLOW = 33, + BLUE = 34 + }; + + /** Get color code characters for a specific color */ + std::string GetColorCode(Color color) const; + /** Get the version of dart server */ int GetDartVersion() { return this->DartVersion; } int GetDropSiteCDash() { return this->DropSiteCDash; } @@ -575,8 +588,16 @@ private: bool HandleCommandLineArguments(size_t& i, std::vector<std::string>& args, std::string& errormsg); +#if !defined(_WIN32) /** returns true iff the console supports progress output */ - bool ProgressOutputSupportedByConsole() const; + static bool ConsoleIsNotDumb(); +#endif + + /** returns true iff the console supports progress output */ + static bool ProgressOutputSupportedByConsole(); + + /** returns true iff the console supports colored output */ + static bool ColoredOutputSupportedByConsole(); /** handle the -S -SP and -SR arguments */ void HandleScriptArguments(size_t& i, std::vector<std::string>& args, @@ -625,6 +646,7 @@ private: int OutputLogFileLastTag; bool OutputTestOutputOnTestFailure; + bool OutputColorCode; std::map<std::string, std::string> Definitions; }; |