@@ -42,33 +42,32 @@ BADVAL: {{F|f}}ile{{C|c}}heck{{.*}}: for the --dump-input option: Cannot find op
42
42
; RUN: %ProtectFileCheckOutput FileCheck -dump-input=help \
43
43
; RUN: | FileCheck %s -check-prefix=HELP
44
44
45
- HELP-NOT: {{.}}
46
- HELP: The following description was requested by -dump-input=help
47
- HELP: try{{.*}}-color
48
- HELP-NOT: {{.}}
49
-
50
45
;--------------------------------------------------
51
46
; Check -dump-input=never.
52
47
;
53
48
; Include the case without -v, which isn't covered elsewhere.
54
49
;--------------------------------------------------
55
50
51
+ ; FileCheck success, no -v => no dump, no trace.
56
52
; RUN: %ProtectFileCheckOutput \
57
53
; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
58
54
; RUN: -match-full-lines -dump-input=never 2>&1 \
59
55
; RUN: | FileCheck %s -match-full-lines -allow-empty \
60
56
; RUN: -check-prefixes=NOTRACE,NODUMP
61
57
58
+ ; FileCheck fail, no -v => no dump, no trace.
62
59
; RUN: %ProtectFileCheckOutput \
63
60
; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
64
61
; RUN: -match-full-lines -dump-input=never 2>&1 \
65
62
; RUN: | FileCheck %s -match-full-lines -check-prefixes=NOTRACE,ERR,NODUMP
66
63
64
+ ; FileCheck success, -v => no dump, trace.
67
65
; RUN: %ProtectFileCheckOutput \
68
66
; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
69
67
; RUN: -match-full-lines -dump-input=never -v 2>&1 \
70
68
; RUN: | FileCheck %s -match-full-lines -check-prefixes=TRACE,NODUMP
71
69
70
+ ; FileCheck fail, -v => no dump, trace.
72
71
; RUN: %ProtectFileCheckOutput \
73
72
; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
74
73
; RUN: -match-full-lines -dump-input=never -v 2>&1 \
@@ -78,11 +77,13 @@ HELP-NOT: {{.}}
78
77
; Check no -dump-input, which defaults to never.
79
78
;--------------------------------------------------
80
79
80
+ ; FileCheck success, -v => no dump, trace.
81
81
; RUN: %ProtectFileCheckOutput \
82
82
; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
83
83
; RUN: -match-full-lines -v 2>&1 \
84
84
; RUN: | FileCheck %s -match-full-lines -check-prefixes=TRACE,NODUMP
85
85
86
+ ; FileCheck fail, -v => no dump, trace.
86
87
; RUN: %ProtectFileCheckOutput \
87
88
; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
88
89
; RUN: -match-full-lines -v 2>&1 \
@@ -94,23 +95,27 @@ HELP-NOT: {{.}}
94
95
; Include the case without -v, which isn't covered elsewhere.
95
96
;--------------------------------------------------
96
97
98
+ ; FileCheck success, no -v => no dump, no trace.
97
99
; RUN: %ProtectFileCheckOutput \
98
100
; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
99
101
; RUN: -match-full-lines -dump-input=fail 2>&1 \
100
102
; RUN: | FileCheck %s -match-full-lines -allow-empty \
101
103
; RUN: -check-prefixes=NOTRACE,NODUMP
102
104
105
+ ; FileCheck fail, no -v => dump, no trace.
103
106
; RUN: %ProtectFileCheckOutput \
104
107
; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
105
108
; RUN: -match-full-lines -dump-input=fail 2>&1 \
106
109
; RUN: | FileCheck %s -match-full-lines -check-prefixes=NOTRACE,ERR,DUMP-ERR
107
110
111
+ ; FileCheck success, -v => no dump, no trace.
108
112
; RUN: %ProtectFileCheckOutput \
109
113
; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
110
114
; RUN: -match-full-lines -dump-input=fail -v 2>&1 \
111
115
; RUN: | FileCheck %s -match-full-lines -allow-empty \
112
116
; RUN: -check-prefixes=NOTRACE,NODUMP
113
117
118
+ ; FileCheck fail, -v => dump, no trace.
114
119
; RUN: %ProtectFileCheckOutput \
115
120
; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
116
121
; RUN: -match-full-lines -dump-input=fail -v 2>&1 \
@@ -121,24 +126,32 @@ HELP-NOT: {{.}}
121
126
; Check -dump-input-on-failure.
122
127
;--------------------------------------------------
123
128
129
+ ; Command-line option.
130
+
131
+ ; FileCheck success, -v => no dump, no trace.
124
132
; RUN: %ProtectFileCheckOutput \
125
133
; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
126
134
; RUN: -match-full-lines -dump-input-on-failure -v 2>&1 \
127
135
; RUN: | FileCheck %s -match-full-lines -allow-empty \
128
136
; RUN: -check-prefixes=NOTRACE,NODUMP
129
137
138
+ ; FileCheck fail, -v => dump, no trace.
130
139
; RUN: %ProtectFileCheckOutput \
131
140
; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
132
141
; RUN: -match-full-lines -dump-input-on-failure -v 2>&1 \
133
142
; RUN: | FileCheck %s -match-full-lines \
134
143
; RUN: -check-prefixes=NOTRACE,ERR,DUMP-ERR,DUMP-ERR-V
135
144
145
+ ; FILECHECK_DUMP_INPUT_ON_FAILURE=1.
146
+
147
+ ; FileCheck success, -v => no dump, no trace.
136
148
; RUN: %ProtectFileCheckOutput FILECHECK_DUMP_INPUT_ON_FAILURE=1 \
137
149
; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
138
150
; RUN: -match-full-lines -v 2>&1 \
139
151
; RUN: | FileCheck %s -match-full-lines -allow-empty \
140
152
; RUN: -check-prefixes=NOTRACE,NODUMP
141
153
154
+ ; FileCheck fail, -v => dump, no trace.
142
155
; RUN: %ProtectFileCheckOutput FILECHECK_DUMP_INPUT_ON_FAILURE=1 \
143
156
; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
144
157
; RUN: -match-full-lines -v 2>&1 \
@@ -149,23 +162,105 @@ HELP-NOT: {{.}}
149
162
; Check -dump-input=always.
150
163
;--------------------------------------------------
151
164
165
+ ; FileCheck success, -v => dump, no trace.
152
166
; RUN: %ProtectFileCheckOutput \
153
167
; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
154
168
; RUN: -match-full-lines -dump-input=always -v 2>&1 \
155
169
; RUN: | FileCheck %s -match-full-lines -check-prefixes=NOTRACE,DUMP-OK
156
170
171
+ ; FileCheck fail, -v => dump, no trace.
157
172
; RUN: %ProtectFileCheckOutput \
158
173
; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
159
174
; RUN: -match-full-lines -dump-input=always -v 2>&1 \
160
175
; RUN: | FileCheck %s -match-full-lines \
161
176
; RUN: -check-prefixes=NOTRACE,ERR,DUMP-ERR,DUMP-ERR-V
162
177
178
+ ;--------------------------------------------------
179
+ ; Check multiple -dump-input options.
180
+ ;
181
+ ; This ocurrs most commonly when a test author specifies -dump-input on a
182
+ ; specific FileCheck call while a test runner specifies -dump-input in
183
+ ; FILECHECK_OPTS, but check the behavior generally.
184
+ ;
185
+ ; "help" has precedence, and then the most verbose value wins. The most
186
+ ; common combinations involve "fail" and "always", so test those the most.
187
+ ;--------------------------------------------------
188
+
189
+ ;- - - - - - - - - - - - - - - - - - - - - - - - -
190
+ ; Check duplicate.
191
+ ;- - - - - - - - - - - - - - - - - - - - - - - - -
192
+
193
+ ; fail, fail => fail (FileCheck fail => dump)
194
+ ; RUN: %ProtectFileCheckOutput \
195
+ ; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
196
+ ; RUN: -match-full-lines -dump-input=fail -dump-input=fail -v \
197
+ ; RUN: 2>&1 \
198
+ ; RUN: | FileCheck %s -match-full-lines \
199
+ ; RUN: -check-prefixes=NOTRACE,ERR,DUMP-ERR,DUMP-ERR-V
200
+
201
+ ;- - - - - - - - - - - - - - - - - - - - - - - - -
202
+ ; Check precedence.
203
+ ;- - - - - - - - - - - - - - - - - - - - - - - - -
204
+
205
+ ; help, always => help
206
+ ; RUN: %ProtectFileCheckOutput \
207
+ ; RUN: FileCheck -input-file %t.err -color %t.check \
208
+ ; RUN: -dump-input=help -dump-input=always \
209
+ ; RUN: | FileCheck %s -check-prefix=HELP
210
+
211
+ ; always, fail => always (FileCheck success => dump)
212
+ ; RUN: %ProtectFileCheckOutput \
213
+ ; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
214
+ ; RUN: -match-full-lines -dump-input=always -dump-input=fail \
215
+ ; RUN: -v 2>&1 \
216
+ ; RUN: | FileCheck %s -match-full-lines -check-prefixes=NOTRACE,DUMP-OK
217
+
218
+ ; fail, never => fail (FileCheck fail => dump)
219
+ ; RUN: %ProtectFileCheckOutput \
220
+ ; RUN: not FileCheck -input-file %t.err %t.check -check-prefix=CHECK \
221
+ ; RUN: -match-full-lines -dump-input=fail -dump-input=never -v \
222
+ ; RUN: 2>&1 \
223
+ ; RUN: | FileCheck %s -match-full-lines \
224
+ ; RUN: -check-prefixes=NOTRACE,ERR,DUMP-ERR,DUMP-ERR-V
225
+
226
+ ;- - - - - - - - - - - - - - - - - - - - - - - - -
227
+ ; Check that order doesn't matter.
228
+ ;- - - - - - - - - - - - - - - - - - - - - - - - -
229
+
230
+ ; fail, always => always (FileCheck success => dump)
231
+ ; RUN: %ProtectFileCheckOutput \
232
+ ; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
233
+ ; RUN: -match-full-lines -dump-input=fail -dump-input=always \
234
+ ; RUN: -v 2>&1 \
235
+ ; RUN: | FileCheck %s -match-full-lines -check-prefixes=NOTRACE,DUMP-OK
236
+
237
+ ;- - - - - - - - - - - - - - - - - - - - - - - - -
238
+ ; Check that FILECHECK_OPTS isn't handled differently.
239
+ ;- - - - - - - - - - - - - - - - - - - - - - - - -
240
+
241
+ ; always, fail => always (FileCheck success => dump)
242
+ ; RUN: %ProtectFileCheckOutput FILECHECK_OPTS=-dump-input=always \
243
+ ; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
244
+ ; RUN: -match-full-lines -dump-input=fail -v 2>&1 \
245
+ ; RUN: | FileCheck %s -match-full-lines -check-prefixes=NOTRACE,DUMP-OK
246
+
247
+ ; fail, always => always (FileCheck success => dump)
248
+ ; RUN: %ProtectFileCheckOutput FILECHECK_OPTS=-dump-input=fail \
249
+ ; RUN: FileCheck -input-file %t.good %t.check -check-prefix=CHECK \
250
+ ; RUN: -match-full-lines -dump-input=always -v 2>&1 \
251
+ ; RUN: | FileCheck %s -match-full-lines -check-prefixes=NOTRACE,DUMP-OK
252
+
163
253
; END.
164
254
165
255
;--------------------------------------------------
166
- ; Check the output for all cases that actually process directives .
256
+ ; Check the output.
167
257
;--------------------------------------------------
168
258
259
+ ; HELP-NOT: {{.}}
260
+ ; HELP: The following description was requested by -dump-input=help
261
+ ; HELP: try{{.*}}-color
262
+ ; HELP-NOT: {{.}}
263
+
169
264
; Trace is sometimes suppressed.
170
265
; TRACE: {{.*}}remark:{{.*}}
171
266
; NOTRACE-NOT: remark:
0 commit comments