+let colorize str = function
+ | Some c -> (color_to_ansi_code c) ^ str ^ color_off
+ | None -> str
+
+let status_to_color = function
+ | Pass -> Some Green_bold
+ | Fail -> Some Red_bold
+ | Skip -> Some Grey_bold
+
+let status_to_str = function
+ (* Expected to be a single character, but using string to allow unicode. *)
+ | Pass -> "✓"
+ | Fail -> "X"
+ | Skip -> "-"
+
+let status indicator info =
+ match info with
+ | "" -> indicator
+ | _ -> sprintf "%s: %s" indicator info
+
+(* TODO: Perhaps a global option whether to print non-fail info? *)
+let status_pass ?(info="") () =
+ status (color Green "P") info
+
+let status_fail ?(info="") () =
+ status (color Red "F") info
+
+let status_skip ?(info="") () =
+ (*let indicator = (color Yellow "Skip") in*)
+ let indicator = "S" in
+ status indicator info
+