dump-input-enable.txt
11.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
;--------------------------------------------------
; Create the check file, good input, and bad input.
;
; For both good and bad input, make sure the -v trace has at least one remark
; so we can check how trace suppression is affected by -dump-input.
;--------------------------------------------------
; RUN: echo hello > %t.good
; RUN: echo world >> %t.good
; RUN: echo hello > %t.err
; RUN: echo whirled >> %t.err
; RUN: echo 'CHECK: hello' > %t.check
; RUN: echo 'CHECK-NEXT: world' >> %t.check
;--------------------------------------------------
; Check -dump-input=<bad value>.
;--------------------------------------------------
; RUN: %ProtectFileCheckOutput \
; RUN: not FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
; RUN: -match-full-lines -dump-input=foobar 2>&1 \
; RUN: | FileCheck %s -match-full-lines -check-prefix=BADVAL
; No positional arg.
; RUN: %ProtectFileCheckOutput not FileCheck -dump-input=foobar 2>&1 \
; RUN: | FileCheck %s -match-full-lines -check-prefix=BADVAL
BADVAL: {{F|f}}ile{{C|c}}heck{{.*}}: for the --dump-input option: Cannot find option named 'foobar'!
;--------------------------------------------------
; Check -dump-input=help.
;--------------------------------------------------
; Appended to normal command line.
; RUN: %ProtectFileCheckOutput \
; RUN: FileCheck -input-file %t.err -color %t.check -dump-input=help \
; RUN: | FileCheck %s -check-prefix=HELP
; No positional arg.
; RUN: %ProtectFileCheckOutput FileCheck -dump-input=help \
; RUN: | FileCheck %s -check-prefix=HELP
;--------------------------------------------------
; Check -dump-input=never.
;
; Include the case without -v, which isn't covered elsewhere.
;--------------------------------------------------
; FileCheck success, no -v => no dump, no trace.
; RUN: %ProtectFileCheckOutput \
; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
; RUN: -match-full-lines -dump-input=never 2>&1 \
; RUN: | FileCheck %s -match-full-lines -allow-empty \
; RUN: -check-prefixes=NOTRACE,NODUMP
; FileCheck fail, no -v => no dump, no trace.
; RUN: %ProtectFileCheckOutput \
; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
; RUN: -match-full-lines -dump-input=never 2>&1 \
; RUN: | FileCheck %s -match-full-lines -check-prefixes=NOTRACE,ERR,NODUMP
; FileCheck success, -v => no dump, trace.
; RUN: %ProtectFileCheckOutput \
; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
; RUN: -match-full-lines -dump-input=never -v 2>&1 \
; RUN: | FileCheck %s -match-full-lines -check-prefixes=TRACE,NODUMP
; FileCheck fail, -v => no dump, trace.
; RUN: %ProtectFileCheckOutput \
; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
; RUN: -match-full-lines -dump-input=never -v 2>&1 \
; RUN: | FileCheck %s -match-full-lines -check-prefixes=TRACE,ERR,NODUMP
;--------------------------------------------------
; Check no -dump-input, which defaults to never.
;--------------------------------------------------
; FileCheck success, -v => no dump, trace.
; RUN: %ProtectFileCheckOutput \
; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
; RUN: -match-full-lines -v 2>&1 \
; RUN: | FileCheck %s -match-full-lines -check-prefixes=TRACE,NODUMP
; FileCheck fail, -v => no dump, trace.
; RUN: %ProtectFileCheckOutput \
; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
; RUN: -match-full-lines -v 2>&1 \
; RUN: | FileCheck %s -match-full-lines -check-prefixes=TRACE,ERR,NODUMP
;--------------------------------------------------
; Check -dump-input=fail.
;
; Include the case without -v, which isn't covered elsewhere.
;--------------------------------------------------
; FileCheck success, no -v => no dump, no trace.
; RUN: %ProtectFileCheckOutput \
; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
; RUN: -match-full-lines -dump-input=fail 2>&1 \
; RUN: | FileCheck %s -match-full-lines -allow-empty \
; RUN: -check-prefixes=NOTRACE,NODUMP
; FileCheck fail, no -v => dump, no trace.
; RUN: %ProtectFileCheckOutput \
; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
; RUN: -match-full-lines -dump-input=fail 2>&1 \
; RUN: | FileCheck %s -match-full-lines -check-prefixes=NOTRACE,ERR,DUMP-ERR
; FileCheck success, -v => no dump, no trace.
; RUN: %ProtectFileCheckOutput \
; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
; RUN: -match-full-lines -dump-input=fail -v 2>&1 \
; RUN: | FileCheck %s -match-full-lines -allow-empty \
; RUN: -check-prefixes=NOTRACE,NODUMP
; FileCheck fail, -v => dump, no trace.
; RUN: %ProtectFileCheckOutput \
; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
; RUN: -match-full-lines -dump-input=fail -v 2>&1 \
; RUN: | FileCheck %s -match-full-lines \
; RUN: -check-prefixes=NOTRACE,ERR,DUMP-ERR,DUMP-ERR-V
;--------------------------------------------------
; Check -dump-input-on-failure.
;--------------------------------------------------
; Command-line option.
; FileCheck success, -v => no dump, no trace.
; RUN: %ProtectFileCheckOutput \
; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
; RUN: -match-full-lines -dump-input-on-failure -v 2>&1 \
; RUN: | FileCheck %s -match-full-lines -allow-empty \
; RUN: -check-prefixes=NOTRACE,NODUMP
; FileCheck fail, -v => dump, no trace.
; RUN: %ProtectFileCheckOutput \
; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
; RUN: -match-full-lines -dump-input-on-failure -v 2>&1 \
; RUN: | FileCheck %s -match-full-lines \
; RUN: -check-prefixes=NOTRACE,ERR,DUMP-ERR,DUMP-ERR-V
; FILECHECK_DUMP_INPUT_ON_FAILURE=1.
; FileCheck success, -v => no dump, no trace.
; RUN: %ProtectFileCheckOutput FILECHECK_DUMP_INPUT_ON_FAILURE=1 \
; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
; RUN: -match-full-lines -v 2>&1 \
; RUN: | FileCheck %s -match-full-lines -allow-empty \
; RUN: -check-prefixes=NOTRACE,NODUMP
; FileCheck fail, -v => dump, no trace.
; RUN: %ProtectFileCheckOutput FILECHECK_DUMP_INPUT_ON_FAILURE=1 \
; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
; RUN: -match-full-lines -v 2>&1 \
; RUN: | FileCheck %s -match-full-lines \
; RUN: -check-prefixes=NOTRACE,ERR,DUMP-ERR,DUMP-ERR-V
;--------------------------------------------------
; Check -dump-input=always.
;--------------------------------------------------
; FileCheck success, -v => dump, no trace.
; RUN: %ProtectFileCheckOutput \
; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
; RUN: -match-full-lines -dump-input=always -v 2>&1 \
; RUN: | FileCheck %s -match-full-lines -check-prefixes=NOTRACE,DUMP-OK
; FileCheck fail, -v => dump, no trace.
; RUN: %ProtectFileCheckOutput \
; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
; RUN: -match-full-lines -dump-input=always -v 2>&1 \
; RUN: | FileCheck %s -match-full-lines \
; RUN: -check-prefixes=NOTRACE,ERR,DUMP-ERR,DUMP-ERR-V
;--------------------------------------------------
; Check multiple -dump-input options.
;
; This ocurrs most commonly when a test author specifies -dump-input on a
; specific FileCheck call while a test runner specifies -dump-input in
; FILECHECK_OPTS, but check the behavior generally.
;
; "help" has precedence, and then the most verbose value wins. The most
; common combinations involve "fail" and "always", so test those the most.
;--------------------------------------------------
;- - - - - - - - - - - - - - - - - - - - - - - - -
; Check duplicate.
;- - - - - - - - - - - - - - - - - - - - - - - - -
; fail, fail => fail (FileCheck fail => dump)
; RUN: %ProtectFileCheckOutput \
; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
; RUN: -match-full-lines -dump-input=fail -dump-input=fail -v \
; RUN: 2>&1 \
; RUN: | FileCheck %s -match-full-lines \
; RUN: -check-prefixes=NOTRACE,ERR,DUMP-ERR,DUMP-ERR-V
;- - - - - - - - - - - - - - - - - - - - - - - - -
; Check precedence.
;- - - - - - - - - - - - - - - - - - - - - - - - -
; help, always => help
; RUN: %ProtectFileCheckOutput \
; RUN: FileCheck -input-file %t.err -color %t.check \
; RUN: -dump-input=help -dump-input=always \
; RUN: | FileCheck %s -check-prefix=HELP
; always, fail => always (FileCheck success => dump)
; RUN: %ProtectFileCheckOutput \
; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
; RUN: -match-full-lines -dump-input=always -dump-input=fail \
; RUN: -v 2>&1 \
; RUN: | FileCheck %s -match-full-lines -check-prefixes=NOTRACE,DUMP-OK
; fail, never => fail (FileCheck fail => dump)
; RUN: %ProtectFileCheckOutput \
; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
; RUN: -match-full-lines -dump-input=fail -dump-input=never -v \
; RUN: 2>&1 \
; RUN: | FileCheck %s -match-full-lines \
; RUN: -check-prefixes=NOTRACE,ERR,DUMP-ERR,DUMP-ERR-V
;- - - - - - - - - - - - - - - - - - - - - - - - -
; Check that order doesn't matter.
;- - - - - - - - - - - - - - - - - - - - - - - - -
; fail, always => always (FileCheck success => dump)
; RUN: %ProtectFileCheckOutput \
; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
; RUN: -match-full-lines -dump-input=fail -dump-input=always \
; RUN: -v 2>&1 \
; RUN: | FileCheck %s -match-full-lines -check-prefixes=NOTRACE,DUMP-OK
;- - - - - - - - - - - - - - - - - - - - - - - - -
; Check that FILECHECK_OPTS isn't handled differently.
;- - - - - - - - - - - - - - - - - - - - - - - - -
; always, fail => always (FileCheck success => dump)
; RUN: %ProtectFileCheckOutput FILECHECK_OPTS=-dump-input=always \
; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
; RUN: -match-full-lines -dump-input=fail -v 2>&1 \
; RUN: | FileCheck %s -match-full-lines -check-prefixes=NOTRACE,DUMP-OK
; fail, always => always (FileCheck success => dump)
; RUN: %ProtectFileCheckOutput FILECHECK_OPTS=-dump-input=fail \
; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
; RUN: -match-full-lines -dump-input=always -v 2>&1 \
; RUN: | FileCheck %s -match-full-lines -check-prefixes=NOTRACE,DUMP-OK
; END.
;--------------------------------------------------
; Check the output.
;--------------------------------------------------
; HELP-NOT: {{.}}
; HELP: The following description was requested by -dump-input=help
; HELP: try{{.*}}-color
; HELP-NOT: {{.}}
; Trace is sometimes suppressed.
; TRACE: {{.*}}remark:{{.*}}
; NOTRACE-NOT: remark:
; Error diagnostics are never suppressed.
; ERR: {{.*}}error:{{.*}}
; NODUMP-NOT: <<<<<<
; DUMP-OK: Full input was:
; DUMP-OK-NEXT: <<<<<<
; DUMP-OK-NEXT: 1: hello
; DUMP-OK-NEXT: check:1 ^~~~~
; DUMP-OK-NEXT: 2: world
; DUMP-OK-NEXT: next:2 ^~~~~
; DUMP-OK-NEXT: >>>>>>
; DUMP-ERR: Full input was:
; DUMP-ERR-NEXT: <<<<<<
; DUMP-ERR-NEXT: 1: hello
; DUMP-ERR-V-NEXT: check:1 ^~~~~
; DUMP-ERR-NEXT: 2: whirled
; DUMP-ERR-NEXT: next:2 X~~~~~~ error: no match found
; DUMP-ERR-NEXT: >>>>>>