blob: 71e3d5dd9d6c3be739e9dffb24eb38b7e46d6f71 [file] [log] [blame]
Joel E. Dennye1af89a2018-12-18 00:01:39 +00001; RUN: echo ciao > %t.good
2; RUN: echo world >> %t.good
3
4; RUN: echo hello > %t.err
5; RUN: echo world >> %t.err
6
7; RUN: echo 'CHECK: ciao' > %t.check
8; RUN: echo 'CHECK-NEXT: world' >> %t.check
9
10;--------------------------------------------------
11; unknown value
12;--------------------------------------------------
13
14; RUN: not FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
15; RUN: -match-full-lines -dump-input=foobar 2>&1 \
16; RUN: | FileCheck %s -match-full-lines -check-prefix=BADVAL
17
18; No positional arg.
19; RUN: not FileCheck -dump-input=foobar 2>&1 \
20; RUN: | FileCheck %s -match-full-lines -check-prefix=BADVAL
21
Joel E. Dennyc0102bb2018-12-18 01:17:28 +000022BADVAL: FileCheck{{.*}}: for the -dump-input option: Cannot find option named 'foobar'!
Joel E. Dennye1af89a2018-12-18 00:01:39 +000023
24;--------------------------------------------------
25; help
26;--------------------------------------------------
27
28; Appended to normal command line.
29; RUN: FileCheck -input-file %t.err -color %t.check -dump-input=help \
30; RUN: | FileCheck %s -check-prefix=HELP
31
32; No positional arg.
33; RUN: FileCheck -dump-input=help | FileCheck %s -check-prefix=HELP
34
35HELP-NOT: {{.}}
36HELP: The following description was requested by -dump-input=help
37HELP: try{{.*}}-color
38HELP-NOT: {{.}}
39
40;--------------------------------------------------
41; never
42;--------------------------------------------------
43
44; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
45; RUN: -match-full-lines -dump-input=never 2>&1 \
46; RUN: | FileCheck %s -match-full-lines -check-prefix=CHECK-NODUMP -allow-empty
47
48; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
49; RUN: -match-full-lines -dump-input=never 2>&1 \
50; RUN: | FileCheck %s -match-full-lines -check-prefix=CHECK-NODUMP
51
52;--------------------------------------------------
53; default: never
54;--------------------------------------------------
55
56; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
57; RUN: -match-full-lines 2>&1 \
58; RUN: | FileCheck %s -match-full-lines -check-prefix=CHECK-NODUMP -allow-empty
59
60; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
61; RUN: -match-full-lines 2>&1 \
62; RUN: | FileCheck %s -match-full-lines -check-prefix=CHECK-NODUMP
63
64;--------------------------------------------------
65; fail
66;--------------------------------------------------
67
68; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
69; RUN: -match-full-lines -dump-input=fail 2>&1 \
70; RUN: | FileCheck %s -match-full-lines -check-prefix=CHECK-NODUMP -allow-empty
71
72; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
73; RUN: -match-full-lines -dump-input=fail 2>&1 \
74; RUN: | FileCheck %s -match-full-lines -check-prefix=CHECK-ERR
75
76;--------------------------------------------------
77; -dump-input-on-failure
78;--------------------------------------------------
79
80; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
81; RUN: -match-full-lines -dump-input-on-failure 2>&1 \
82; RUN: | FileCheck %s -match-full-lines -check-prefix=CHECK-NODUMP -allow-empty
83
84; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
85; RUN: -match-full-lines -dump-input-on-failure 2>&1 \
86; RUN: | FileCheck %s -match-full-lines -check-prefix=CHECK-ERR
87
88; RUN: env FILECHECK_DUMP_INPUT_ON_FAILURE=1 \
89; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
90; RUN: -match-full-lines 2>&1 \
91; RUN: | FileCheck %s -match-full-lines -check-prefix=CHECK-NODUMP -allow-empty
92
93; RUN: env FILECHECK_DUMP_INPUT_ON_FAILURE=1 \
94; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
95; RUN: -match-full-lines 2>&1 \
96; RUN: | FileCheck %s -match-full-lines -check-prefix=CHECK-ERR
97
98;--------------------------------------------------
99; always
100;--------------------------------------------------
101
102; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
103; RUN: -match-full-lines -dump-input=always -v 2>&1 \
104; RUN: | FileCheck %s -match-full-lines -check-prefix=CHECK-GOOD
105
106; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
107; RUN: -match-full-lines -dump-input=always 2>&1 \
108; RUN: | FileCheck %s -match-full-lines -check-prefix=CHECK-ERR
109
110; END.
111
112; CHECK-GOOD: Full input was:
113; CHECK-GOOD-NEXT: <<<<<<
114; CHECK-GOOD-NEXT: 1: ciao
Joel E. Dennycf38e312018-12-18 00:03:03 +0000115; CHECK-GOOD-NEXT: check:1 ^~~~
Joel E. Dennye1af89a2018-12-18 00:01:39 +0000116; CHECK-GOOD-NEXT: 2: world
Joel E. Dennycf38e312018-12-18 00:03:03 +0000117; CHECK-GOOD-NEXT: next:2 ^~~~~
Joel E. Dennye1af89a2018-12-18 00:01:39 +0000118; CHECK-GOOD-NEXT: >>>>>>
119
120; CHECK-ERR: Full input was:
121; CHECK-ERR-NEXT: <<<<<<
122; CHECK-ERR-NEXT: 1: hello
123; CHECK-ERR-NEXT: check:1 X~~~~
124; CHECK-ERR-NEXT: 2: world
125; CHECK-ERR-NEXT: check:1 ~~~~~ error: no match found
126; CHECK-ERR-NEXT: >>>>>>
127
128; CHECK-NODUMP-NOT: <<<<<<