Test-suite results colorization.
[sbcl.git] / tests / colorize-control-codes.lisp
diff --git a/tests/colorize-control-codes.lisp b/tests/colorize-control-codes.lisp
new file mode 100644 (file)
index 0000000..8bd1592
--- /dev/null
@@ -0,0 +1,11 @@
+(defun ascii-color (color)
+  (ecase color
+    (:red 31)
+    (:green 32)))
+
+(defun %output-colored-text (text color &key bold)
+  (format t "~c[~a~:[~;;1~]m~a~c[0m"
+          #\Esc
+          (ascii-color color)
+          bold
+          text #\Esc))