; Check when color is enabled.

; REQUIRES: ansi-escapes

; Create a case that produces a simple diagnostic.
; RUN: echo foo > %t.in
; CHECK: bar

; Run without and with -color.  In the former case, FileCheck should suppress
; color in its diagnostics because stderr is a file.
; RUN: %ProtectFileCheckOutput not FileCheck %s < %t.in 2>&1 | \
; RUN:   %{reveal-ansi-escapes} > %t.no-color
; RUN: %ProtectFileCheckOutput not FileCheck -color %s < %t.in 2>&1 | \
; RUN:   %{reveal-ansi-escapes} > %t.color

; Check whether color was produced.
; DEFINE: %{no-color} = FileCheck -check-prefix=NO-COLOR %s
; DEFINE: %{color} = FileCheck -check-prefix=COLOR %s
; RUN: %{no-color} < %t.no-color
; RUN: %{color} < %t.color

; Make sure our NO-COLOR and COLOR patterns are sane: they don't match the
; opposite cases.
; RUN: not %{no-color} < %t.color
; RUN: not %{color} < %t.no-color

; The goal here is not to check the exact details of how colors are used.  We
; just check whether colors are enabled at all.
; NO-COLOR: : error: CHECK: expected string not found in input
; COLOR: <bold-red>error:
