1; Create a case that produces a simple diagnostic. 2; RUN: echo foo > %t.in 3; CHECK: bar 4 5; Run without and with -color. In the former case, FileCheck should suppress 6; color in its diagnostics because stderr is a file. 7; RUN: %ProtectFileCheckOutput not FileCheck %s < %t.in 2> %t.no-color 8; RUN: %ProtectFileCheckOutput not FileCheck -color %s < %t.in 2> %t.color 9 10; Check whether color was produced. 11; RUN: FileCheck -check-prefix NO-COLOR %s < %t.no-color 12; RUN: FileCheck -check-prefix COLOR %s < %t.color 13 14; Make sure our NO-COLOR and COLOR patterns are sane: they don't match the 15; opposite cases. 16; RUN: not FileCheck -check-prefix COLOR %s < %t.no-color 17; RUN: not FileCheck -check-prefix NO-COLOR %s < %t.color 18 19; I don't know of a good way to check for ANSI color codes, so just make sure 20; some new characters show up where those codes should appear. 21; NO-COLOR: : error: CHECK: expected string not found in input 22; COLOR: : {{.+}}error: {{.+}}CHECK: expected string not found in input 23