about summary refs log tree commit diff homepage
path: root/tools
diff options
context:
space:
mode:
authorDan Liew <daniel.liew@imperial.ac.uk>2014-07-04 17:59:38 +0100
committerDan Liew <daniel.liew@imperial.ac.uk>2014-09-15 01:49:27 +0100
commit9612737e9592e87661d41066919baca51f41037e (patch)
tree0fe752ae821965dc64b51d61e5b4c477534380b5 /tools
parent9955e50eb6e2c66d00faa719845b401dcf6bc94f (diff)
downloadklee-9612737e9592e87661d41066919baca51f41037e.tar.gz
Taught klee_warning(), klee_error() etc... to emit coloured text output.
Also use bold green text when KLEE finishes. This is done by taking
advantage of llvm::raw_ostream's nice API for controlling the console
text colour.
Diffstat (limited to 'tools')
-rw-r--r--tools/klee/main.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp
index 4411f73a..dcaa458a 100644
--- a/tools/klee/main.cpp
+++ b/tools/klee/main.cpp
@@ -1529,7 +1529,18 @@ int main(int argc, char **argv, char **envp) {
         << handler->getNumPathsExplored() << "\n";
   stats << "KLEE: done: generated tests = " 
         << handler->getNumTestCases() << "\n";
+
+  bool useColors = llvm::errs().is_displayed();
+  if (useColors)
+    llvm::errs().changeColor(llvm::raw_ostream::GREEN,
+                             /*bold=*/true,
+                             /*bg=*/false);
+
   llvm::errs() << stats.str();
+
+  if (useColors)
+    llvm::errs().resetColor();
+
   handler->getInfoStream() << stats.str();
 
   BufferPtr.take();