Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / utils / lit / tests / shtest-shell.py
blob86851194880620baafd9460feb0c108fba513121
1 # Check the internal shell handling component of the ShTest format.
3 # RUN: not %{lit} -v %{inputs}/shtest-shell > %t.out
4 # FIXME: Temporarily dump test output so we can debug failing tests on
5 # buildbots.
6 # RUN: cat %t.out
7 # RUN: FileCheck --input-file %t.out %s
9 # Test again in non-UTF shell to catch potential errors with python 2 seen
10 # on stdout-encoding.txt
11 # RUN: env PYTHONIOENCODING=ascii not %{lit} -a %{inputs}/shtest-shell > %t.ascii.out
12 # FIXME: Temporarily dump test output so we can debug failing tests on
13 # buildbots.
14 # RUN: cat %t.ascii.out
15 # RUN: FileCheck --input-file %t.ascii.out %s
17 # END.
19 # CHECK: -- Testing:
21 # CHECK: FAIL: shtest-shell :: cat-error-0.txt
22 # CHECK: *** TEST 'shtest-shell :: cat-error-0.txt' FAILED ***
23 # CHECK: cat -b temp1.txt
24 # CHECK: # .---command stderr{{-*}}
25 # CHECK: # | Unsupported: 'cat': option -b not recognized
26 # CHECK: # error: command failed with exit status: 1
27 # CHECK: ***
29 # CHECK: FAIL: shtest-shell :: cat-error-1.txt
30 # CHECK: *** TEST 'shtest-shell :: cat-error-1.txt' FAILED ***
31 # CHECK: cat temp1.txt
32 # CHECK: # .---command stderr{{-*}}
33 # CHECK: # | [Errno 2] No such file or directory: 'temp1.txt'
34 # CHECK: # error: command failed with exit status: 1
35 # CHECK: ***
37 # CHECK: FAIL: shtest-shell :: colon-error.txt
38 # CHECK: *** TEST 'shtest-shell :: colon-error.txt' FAILED ***
39 # CHECK: :
40 # CHECK: # .---command stderr{{-*}}
41 # CHECK: # | Unsupported: ':' cannot be part of a pipeline
42 # CHECK: # error: command failed with exit status: 127
43 # CHECK: ***
45 # CHECK: PASS: shtest-shell :: continuations.txt
47 # CHECK: PASS: shtest-shell :: dev-null.txt
49 # CHECK: FAIL: shtest-shell :: diff-b.txt
50 # CHECK: *** TEST 'shtest-shell :: diff-b.txt' FAILED ***
51 # CHECK: diff -b {{[^"]*}}.0 {{[^"]*}}.1
52 # CHECK: # .---command stdout{{-*}}
53 # CHECK: # | {{.*}}1,2
54 # CHECK-NEXT: # | f o o
55 # CHECK-NEXT: # | ! b a r
56 # CHECK-NEXT: # | ---
57 # CHECK-NEXT: # | f o o
58 # CHECK-NEXT: # | ! bar
59 # CHECK-NEXT: # `---{{-*}}
60 # CHECK-NEXT: # error: command failed with exit status: 1
61 # CHECK: ***
64 # CHECK: FAIL: shtest-shell :: diff-encodings.txt
65 # CHECK: *** TEST 'shtest-shell :: diff-encodings.txt' FAILED ***
67 # CHECK: diff -u diff-in.bin diff-in.bin
68 # CHECK-NEXT: # executed command: diff -u diff-in.bin diff-in.bin
69 # CHECK-NOT: error
71 # CHECK: diff -u diff-in.utf16 diff-in.bin && false || true
72 # CHECK-NEXT: # executed command: diff -u diff-in.utf16 diff-in.bin
73 # CHECK-NEXT: # .---command stdout{{-*}}
74 # CHECK-NEXT: # | ---
75 # CHECK-NEXT: # | +++
76 # CHECK-NEXT: # | @@
77 # CHECK-NEXT: # | {{.f.o.o.$}}
78 # CHECK-NEXT: # | {{-.b.a.r.$}}
79 # CHECK-NEXT: # | {{\+.b.a.r.}}
80 # CHECK-NEXT: # | {{.b.a.z.$}}
81 # CHECK-NEXT: # `---{{-*}}
82 # CHECK-NEXT: # error: command failed with exit status: 1
83 # CHECK-NEXT: # executed command: true
85 # CHECK: diff -u diff-in.utf8 diff-in.bin && false || true
86 # CHECK-NEXT: # executed command: diff -u diff-in.utf8 diff-in.bin
87 # CHECK-NEXT: # .---command stdout{{-*}}
88 # CHECK-NEXT: # | ---
89 # CHECK-NEXT: # | +++
90 # CHECK-NEXT: # | @@
91 # CHECK-NEXT: # | -foo
92 # CHECK-NEXT: # | -bar
93 # CHECK-NEXT: # | -baz
94 # CHECK-NEXT: # | {{\+.f.o.o.$}}
95 # CHECK-NEXT: # | {{\+.b.a.r.}}
96 # CHECK-NEXT: # | {{\+.b.a.z.$}}
97 # CHECK-NEXT: # `---{{-*}}
98 # CHECK-NEXT: # error: command failed with exit status: 1
99 # CHECK-NEXT: # executed command: true
101 # CHECK: diff -u diff-in.bin diff-in.utf8 && false || true
102 # CHECK-NEXT: # executed command: diff -u diff-in.bin diff-in.utf8
103 # CHECK-NEXT: # .---command stdout{{-*}}
104 # CHECK-NEXT: # | ---
105 # CHECK-NEXT: # | +++
106 # CHECK-NEXT: # | @@
107 # CHECK-NEXT: # | {{-.f.o.o.$}}
108 # CHECK-NEXT: # | {{-.b.a.r.}}
109 # CHECK-NEXT: # | {{-.b.a.z.$}}
110 # CHECK-NEXT: # | +foo
111 # CHECK-NEXT: # | +bar
112 # CHECK-NEXT: # | +baz
113 # CHECK-NEXT: # `---{{-*}}
114 # CHECK-NEXT: # error: command failed with exit status: 1
115 # CHECK-NEXT: # executed command: true
117 # CHECK: cat diff-in.bin | diff -u - diff-in.bin
118 # CHECK-NOT: error
120 # CHECK: cat diff-in.bin | diff -u diff-in.bin -
121 # CHECK-NOT: error
123 # CHECK: cat diff-in.bin | diff -u diff-in.utf16 - && false || true
124 # CHECK-NEXT: # executed command: cat diff-in.bin
125 # CHECK-NEXT: # executed command: diff -u diff-in.utf16 -
126 # CHECK-NEXT: # .---command stdout{{-*}}
127 # CHECK-NEXT: # | ---
128 # CHECK-NEXT: # | +++
129 # CHECK-NEXT: # | @@
130 # CHECK-NEXT: # | {{.f.o.o.$}}
131 # CHECK-NEXT: # | {{-.b.a.r.$}}
132 # CHECK-NEXT: # | {{\+.b.a.r.}}
133 # CHECK-NEXT: # | {{.b.a.z.$}}
134 # CHECK-NEXT: # `---{{-*}}
135 # CHECK-NEXT: # error: command failed with exit status: 1
136 # CHECK-NEXT: # executed command: true
138 # CHECK: cat diff-in.bin | diff -u diff-in.utf8 - && false || true
139 # CHECK-NEXT: # executed command: cat diff-in.bin
140 # CHECK-NEXT: # executed command: diff -u diff-in.utf8 -
141 # CHECK-NEXT: # .---command stdout{{-*}}
142 # CHECK-NEXT: # | ---
143 # CHECK-NEXT: # | +++
144 # CHECK-NEXT: # | @@
145 # CHECK-NEXT: # | -foo
146 # CHECK-NEXT: # | -bar
147 # CHECK-NEXT: # | -baz
148 # CHECK-NEXT: # | {{\+.f.o.o.$}}
149 # CHECK-NEXT: # | {{\+.b.a.r.}}
150 # CHECK-NEXT: # | {{\+.b.a.z.$}}
151 # CHECK-NEXT: # `---{{-*}}
152 # CHECK-NEXT: # error: command failed with exit status: 1
153 # CHECK-NEXT: # executed command: true
155 # CHECK: cat diff-in.bin | diff -u - diff-in.utf8 && false || true
156 # CHECK-NEXT: # executed command: cat diff-in.bin
157 # CHECK-NEXT: # executed command: diff -u - diff-in.utf8
158 # CHECK-NEXT: # .---command stdout{{-*}}
159 # CHECK-NEXT: # | ---
160 # CHECK-NEXT: # | +++
161 # CHECK-NEXT: # | @@
162 # CHECK-NEXT: # | {{-.f.o.o.$}}
163 # CHECK-NEXT: # | {{-.b.a.r.}}
164 # CHECK-NEXT: # | {{-.b.a.z.$}}
165 # CHECK-NEXT: # | +foo
166 # CHECK-NEXT: # | +bar
167 # CHECK-NEXT: # | +baz
168 # CHECK-NEXT: # `---{{-*}}
169 # CHECK-NEXT: # error: command failed with exit status: 1
170 # CHECK-NEXT: # executed command: true
172 # CHECK: false
174 # CHECK: ***
177 # CHECK: FAIL: shtest-shell :: diff-error-1.txt
178 # CHECK: *** TEST 'shtest-shell :: diff-error-1.txt' FAILED ***
179 # CHECK: diff -B temp1.txt temp2.txt
180 # CHECK: # .---command stderr{{-*}}
181 # CHECK: # | Unsupported: 'diff': option -B not recognized
182 # CHECK: # error: command failed with exit status: 1
183 # CHECK: ***
185 # CHECK: FAIL: shtest-shell :: diff-error-2.txt
186 # CHECK: *** TEST 'shtest-shell :: diff-error-2.txt' FAILED ***
187 # CHECK: diff temp.txt
188 # CHECK: # .---command stderr{{-*}}
189 # CHECK: # | Error: missing or extra operand
190 # CHECK: # error: command failed with exit status: 1
191 # CHECK: ***
193 # CHECK: FAIL: shtest-shell :: diff-error-3.txt
194 # CHECK: *** TEST 'shtest-shell :: diff-error-3.txt' FAILED ***
195 # CHECK: diff temp.txt temp1.txt
196 # CHECK: # .---command stderr{{-*}}
197 # CHECK: # | Error: 'diff' command failed
198 # CHECK: error: command failed with exit status: 1
199 # CHECK: ***
201 # CHECK: FAIL: shtest-shell :: diff-error-4.txt
202 # CHECK: *** TEST 'shtest-shell :: diff-error-4.txt' FAILED ***
203 # CHECK: Exit Code: 1
204 # CHECK: # .---command stdout{{-*}}
205 # CHECK-NEXT: # | {{.*}}diff-error-4.txt.tmp
206 # CHECK-NEXT: # | {{.*}}diff-error-4.txt.tmp1
207 # CHECK-NEXT: # | {{\*+}}
208 # CHECK-NEXT: # | *** 1 ****
209 # CHECK-NEXT: # | ! hello-first
210 # CHECK-NEXT: # | --- 1 ----
211 # CHECK-NEXT: # | ! hello-second
212 # CHECK-NEXT: # `---{{-*}}
213 # CHECK: ***
215 # CHECK: FAIL: shtest-shell :: diff-error-5.txt
216 # CHECK: *** TEST 'shtest-shell :: diff-error-5.txt' FAILED ***
217 # CHECK: diff
218 # CHECK: # .---command stderr{{-*}}
219 # CHECK: # | Error: missing or extra operand
220 # CHECK: # error: command failed with exit status: 1
221 # CHECK: ***
223 # CHECK: FAIL: shtest-shell :: diff-error-6.txt
224 # CHECK: *** TEST 'shtest-shell :: diff-error-6.txt' FAILED ***
225 # CHECK: diff
226 # CHECK: # .---command stderr{{-*}}
227 # CHECK: # | Error: missing or extra operand
228 # CHECK: # error: command failed with exit status: 1
229 # CHECK: ***
232 # CHECK: FAIL: shtest-shell :: diff-pipes.txt
234 # CHECK: *** TEST 'shtest-shell :: diff-pipes.txt' FAILED ***
236 # CHECK: diff {{[^ ]*}}.foo {{.*}}.foo | FileCheck {{.*}}
237 # CHECK-NOT: note
238 # CHECK-NOT: error
240 # CHECK: diff -u {{.*}}.foo {{.*}}.bar | FileCheck {{.*}} && false || true
241 # CHECK-NEXT: # executed command: diff -u {{.+}}.foo{{.*}} {{.+}}.bar{{.*}}
242 # CHECK-NEXT: # note: command had no output on stdout or stderr
243 # CHECK-NEXT: # error: command failed with exit status: 1
244 # CHECK-NEXT: # executed command: FileCheck
245 # CHECK-NEXT: # executed command: true
247 # CHECK: cat {{.*}}.foo | diff -u - {{.*}}.foo
248 # CHECK-NOT: note
249 # CHECK-NOT: error
251 # CHECK: cat {{.*}}.foo | diff -u {{.*}}.foo -
252 # CHECK-NOT: note
253 # CHECK-NOT: error
255 # CHECK: cat {{.*}}.bar | diff -u {{.*}}.foo - && false || true
256 # CHECK-NEXT: # executed command: cat {{.+}}.bar{{.*}}
257 # CHECK-NEXT: # executed command: diff -u {{.+}}.foo{{.*}} -
258 # CHECK-NEXT: # .---command stdout{{-*}}
259 # CHECK: # | @@
260 # CHECK-NEXT: # | -foo
261 # CHECK-NEXT: # | +bar
262 # CHECK-NEXT: # `---{{-*}}
263 # CHECK-NEXT: # error: command failed with exit status: 1
264 # CHECK-NEXT: # executed command: true
266 # CHECK: cat {{.*}}.bar | diff -u - {{.*}}.foo && false || true
267 # CHECK-NEXT: # executed command: cat {{.+}}.bar{{.*}}
268 # CHECK-NEXT: # executed command: diff -u - {{.+}}.foo{{.*}}
269 # CHECK-NEXT: # .---command stdout{{-*}}
270 # CHECK: # | @@
271 # CHECK-NEXT: # | -bar
272 # CHECK-NEXT: # | +foo
273 # CHECK-NEXT: # `---{{-*}}
274 # CHECK-NEXT: # error: command failed with exit status: 1
275 # CHECK-NEXT: # executed command: true
277 # CHECK: cat {{.*}}.foo | diff - {{.*}}.foo | FileCheck {{.*}}
278 # CHECK-NOT: note
279 # CHECK-NOT: error
281 # CHECK: cat {{.*}}.bar | diff -u {{.*}}.foo - | FileCheck {{.*}}
282 # CHECK-NEXT: # executed command: cat {{.+}}.bar{{.*}}
283 # CHECK-NEXT: # executed command: diff -u {{.+}}.foo{{.*}} -
284 # CHECK-NEXT: note: command had no output on stdout or stderr
285 # CHECK-NEXT: error: command failed with exit status: 1
286 # CHECK-NEXT: # executed command: FileCheck
287 # CHECK-NEXT: # executed command: true
289 # CHECK: false
291 # CHECK: ***
294 # CHECK: FAIL: shtest-shell :: diff-r-error-0.txt
295 # CHECK: *** TEST 'shtest-shell :: diff-r-error-0.txt' FAILED ***
296 # CHECK: diff -r
297 # CHECK: # .---command stdout{{-*}}
298 # CHECK: # | Only in {{.*}}dir1: dir1unique
299 # CHECK: # | Only in {{.*}}dir2: dir2unique
300 # CHECK: # error: command failed with exit status: 1
302 # CHECK: FAIL: shtest-shell :: diff-r-error-1.txt
303 # CHECK: *** TEST 'shtest-shell :: diff-r-error-1.txt' FAILED ***
304 # CHECK: diff -r
305 # CHECK: # .---command stdout{{-*}}
306 # CHECK: # | *** {{.*}}dir1{{.*}}subdir{{.*}}f01
307 # CHECK: # | --- {{.*}}dir2{{.*}}subdir{{.*}}f01
308 # CHECK: # | ! 12345
309 # CHECK: # | ! 00000
310 # CHECK: # error: command failed with exit status: 1
312 # CHECK: FAIL: shtest-shell :: diff-r-error-2.txt
313 # CHECK: *** TEST 'shtest-shell :: diff-r-error-2.txt' FAILED ***
314 # CHECK: diff -r
315 # CHECK: # .---command stdout{{-*}}
316 # CHECK: # | Only in {{.*}}dir2: extrafile
317 # CHECK: # error: command failed with exit status: 1
319 # CHECK: FAIL: shtest-shell :: diff-r-error-3.txt
320 # CHECK: *** TEST 'shtest-shell :: diff-r-error-3.txt' FAILED ***
321 # CHECK: diff -r
322 # CHECK: # .---command stdout{{-*}}
323 # CHECK: # | Only in {{.*}}dir1: extra_subdir
324 # CHECK: # error: command failed with exit status: 1
326 # CHECK: FAIL: shtest-shell :: diff-r-error-4.txt
327 # CHECK: *** TEST 'shtest-shell :: diff-r-error-4.txt' FAILED ***
328 # CHECK: diff -r
329 # CHECK: # .---command stdout{{-*}}
330 # CHECK: # | File {{.*}}dir1{{.*}}extra_subdir is a directory while file {{.*}}dir2{{.*}}extra_subdir is a regular file
331 # CHECK: # error: command failed with exit status: 1
333 # CHECK: FAIL: shtest-shell :: diff-r-error-5.txt
334 # CHECK: *** TEST 'shtest-shell :: diff-r-error-5.txt' FAILED ***
335 # CHECK: diff -r
336 # CHECK: # .---command stdout{{-*}}
337 # CHECK: # | Only in {{.*}}dir1: extra_subdir
338 # CHECK: # error: command failed with exit status: 1
340 # CHECK: FAIL: shtest-shell :: diff-r-error-6.txt
341 # CHECK: *** TEST 'shtest-shell :: diff-r-error-6.txt' FAILED ***
342 # CHECK: diff -r
343 # CHECK: # .---command stdout{{-*}}
344 # CHECK: # | File {{.*}}dir1{{.*}}extra_file is a regular empty file while file {{.*}}dir2{{.*}}extra_file is a directory
345 # CHECK: # error: command failed with exit status: 1
347 # CHECK: FAIL: shtest-shell :: diff-r-error-7.txt
348 # CHECK: *** TEST 'shtest-shell :: diff-r-error-7.txt' FAILED ***
349 # CHECK: diff -r - {{.*}}
350 # CHECK: # .---command stderr{{-*}}
351 # CHECK: # | Error: cannot recursively compare '-'
352 # CHECK: # error: command failed with exit status: 1
354 # CHECK: FAIL: shtest-shell :: diff-r-error-8.txt
355 # CHECK: *** TEST 'shtest-shell :: diff-r-error-8.txt' FAILED ***
356 # CHECK: diff -r {{.*}} -
357 # CHECK: # .---command stderr{{-*}}
358 # CHECK: # | Error: cannot recursively compare '-'
359 # CHECK: # error: command failed with exit status: 1
361 # CHECK: PASS: shtest-shell :: diff-r.txt
364 # CHECK: FAIL: shtest-shell :: diff-strip-trailing-cr.txt
366 # CHECK: *** TEST 'shtest-shell :: diff-strip-trailing-cr.txt' FAILED ***
368 # CHECK: diff -u diff-in.dos diff-in.unix && false || true
369 # CHECK-NEXT: # executed command: diff -u diff-in.dos diff-in.unix
370 # CHECK-NEXT: # .---command stdout{{-*}}
371 # CHECK: # | @@
372 # CHECK-NEXT: # | -In this file, the
373 # CHECK-NEXT: # | -sequence "\r\n"
374 # CHECK-NEXT: # | -terminates lines.
375 # CHECK-NEXT: # | +In this file, the
376 # CHECK-NEXT: # | +sequence "\n"
377 # CHECK-NEXT: # | +terminates lines.
378 # CHECK-NEXT: # `---{{-*}}
379 # CHECK-NEXT: # error: command failed with exit status: 1
380 # CHECK-NEXT: # executed command: true
382 # CHECK: diff -u diff-in.unix diff-in.dos && false || true
383 # CHECK-NEXT: # executed command: diff -u diff-in.unix diff-in.dos
384 # CHECK-NEXT: # .---command stdout{{-*}}
385 # CHECK: # | @@
386 # CHECK-NEXT: # | -In this file, the
387 # CHECK-NEXT: # | -sequence "\n"
388 # CHECK-NEXT: # | -terminates lines.
389 # CHECK-NEXT: # | +In this file, the
390 # CHECK-NEXT: # | +sequence "\r\n"
391 # CHECK-NEXT: # | +terminates lines.
392 # CHECK-NEXT: # `---{{-*}}
393 # CHECK-NEXT: # error: command failed with exit status: 1
394 # CHECK-NEXT: # executed command: true
396 # CHECK: diff -u --strip-trailing-cr diff-in.dos diff-in.unix && false || true
397 # CHECK-NEXT: executed command: diff -u --strip-trailing-cr diff-in.dos diff-in.unix
398 # CHECK-NEXT: # .---command stdout{{-*}}
399 # CHECK: # | @@
400 # CHECK-NEXT: # | In this file, the
401 # CHECK-NEXT: # | -sequence "\r\n"
402 # CHECK-NEXT: # | +sequence "\n"
403 # CHECK-NEXT: # | terminates lines.
404 # CHECK-NEXT: # `---{{-*}}
405 # CHECK-NEXT: # error: command failed with exit status: 1
406 # CHECK-NEXT: # executed command: true
408 # CHECK: diff -u --strip-trailing-cr diff-in.unix diff-in.dos && false || true
409 # CHECK-NEXT: # executed command: diff -u --strip-trailing-cr diff-in.unix diff-in.dos
410 # CHECK-NEXT: # .---command stdout{{-*}}
411 # CHECK: # | @@
412 # CHECK-NEXT: # | In this file, the
413 # CHECK-NEXT: # | -sequence "\n"
414 # CHECK-NEXT: # | +sequence "\r\n"
415 # CHECK-NEXT: # | terminates lines.
416 # CHECK-NEXT: # `---{{-*}}
417 # CHECK-NEXT: # error: command failed with exit status: 1
418 # CHECK-NEXT: # executed command: true
420 # CHECK: false
422 # CHECK: ***
425 # CHECK: FAIL: shtest-shell :: diff-unified.txt
427 # CHECK: *** TEST 'shtest-shell :: diff-unified.txt' FAILED ***
429 # CHECK: diff -u {{.*}}.foo {{.*}}.bar && false || true
430 # CHECK-NEXT: # executed command: diff -u {{.+}}.foo{{.*}} {{.+}}.bar{{.*}}
431 # CHECK-NEXT: # .---command stdout{{-*}}
432 # CHECK: # | @@ {{.*}} @@
433 # CHECK-NEXT: # | 3
434 # CHECK-NEXT: # | 4
435 # CHECK-NEXT: # | 5
436 # CHECK-NEXT: # | -6 foo
437 # CHECK-NEXT: # | +6 bar
438 # CHECK-NEXT: # | 7
439 # CHECK-NEXT: # | 8
440 # CHECK-NEXT: # | 9
441 # CHECK-NEXT: # `---{{-*}}
442 # CHECK-NEXT: # error: command failed with exit status: 1
443 # CHECK-NEXT: # executed command: true
445 # CHECK: diff -U 2 {{.*}}.foo {{.*}}.bar && false || true
446 # CHECK-NEXT: # executed command: diff -U 2 {{.+}}.foo{{.*}} {{.+}}.bar{{.*}}
447 # CHECK-NEXT: # .---command stdout{{-*}}
448 # CHECK: # | @@ {{.*}} @@
449 # CHECK-NEXT: # | 4
450 # CHECK-NEXT: # | 5
451 # CHECK-NEXT: # | -6 foo
452 # CHECK-NEXT: # | +6 bar
453 # CHECK-NEXT: # | 7
454 # CHECK-NEXT: # | 8
455 # CHECK-NEXT: # `---{{-*}}
456 # CHECK-NEXT: # error: command failed with exit status: 1
457 # CHECK-NEXT: # executed command: true
459 # CHECK: diff -U4 {{.*}}.foo {{.*}}.bar && false || true
460 # CHECK-NEXT: # executed command: diff -U4 {{.+}}.foo{{.*}} {{.+}}.bar{{.*}}
461 # CHECK-NEXT: # .---command stdout{{-*}}
462 # CHECK: # | @@ {{.*}} @@
463 # CHECK-NEXT: # | 2
464 # CHECK-NEXT: # | 3
465 # CHECK-NEXT: # | 4
466 # CHECK-NEXT: # | 5
467 # CHECK-NEXT: # | -6 foo
468 # CHECK-NEXT: # | +6 bar
469 # CHECK-NEXT: # | 7
470 # CHECK-NEXT: # | 8
471 # CHECK-NEXT: # | 9
472 # CHECK-NEXT: # | 10
473 # CHECK-NEXT: # `---{{-*}}
474 # CHECK-NEXT: # error: command failed with exit status: 1
475 # CHECK-NEXT: # executed command: true
477 # CHECK: diff -U0 {{.*}}.foo {{.*}}.bar && false || true
478 # CHECK-NEXT: # executed command: diff -U0 {{.+}}.foo{{.*}} {{.+}}.bar{{.*}}
479 # CHECK-NEXT: # .---command stdout{{-*}}
480 # CHECK: # | @@ {{.*}} @@
481 # CHECK-NEXT: # | -6 foo
482 # CHECK-NEXT: # | +6 bar
483 # CHECK-NEXT: # `---{{-*}}
484 # CHECK-NEXT: # error: command failed with exit status: 1
485 # CHECK-NEXT: # executed command: true
487 # CHECK: diff -U 30.1 {{.*}} {{.*}} && false || true
488 # CHECK: # executed command: diff -U 30.1 {{.*}} {{.*}}
489 # CHECK: # .---command stderr{{-*}}
490 # CHECK: # | Error: invalid '-U' argument: 30.1
491 # CHECK: # error: command failed with exit status: 1
492 # CHECK: # executed command: true
494 # CHECK: diff -U-1 {{.*}} {{.*}} && false || true
495 # CHECK: # executed command: diff -U-1 {{.*}} {{.*}}
496 # CHECK: # .---command stderr{{-*}}
497 # CHECK: # | Error: invalid '-U' argument: -1
498 # CHECK: # error: command failed with exit status: 1
499 # CHECK: # executed command: true
501 # CHECK: false
503 # CHECK: ***
506 # CHECK: FAIL: shtest-shell :: diff-w.txt
507 # CHECK: *** TEST 'shtest-shell :: diff-w.txt' FAILED ***
508 # CHECK: diff -w {{.*}}.0 {{.*}}.1
509 # CHECK: # .---command stdout{{-*}}
510 # CHECK: # | {{\*+}} 1,3
511 # CHECK-NEXT: # | foo
512 # CHECK-NEXT: # | bar
513 # CHECK-NEXT: # | ! baz
514 # CHECK-NEXT: # | ---
515 # CHECK-NEXT: # | foo
516 # CHECK-NEXT: # | bar
517 # CHECK-NEXT: # | ! bat
518 # CHECK-NEXT: # `---{{-*}}
519 # CHECK-NEXT: # error: command failed with exit status: 1
520 # CHECK: ***
522 # CHECK: FAIL: shtest-shell :: echo-at-redirect-stderr.txt
523 # CHECK: *** TEST 'shtest-shell :: echo-at-redirect-stderr.txt' FAILED ***
524 # CHECK: @echo 2> {{.*}}
525 # CHECK: # executed command: @echo
526 # CHECK: # .---command stderr{{-*}}
527 # CHECK: # | stdin and stderr redirects not supported for @echo
528 # CHECK: error: command failed with exit status:
530 # CHECK: FAIL: shtest-shell :: echo-at-redirect-stdin.txt
531 # CHECK: *** TEST 'shtest-shell :: echo-at-redirect-stdin.txt' FAILED ***
532 # CHECK: @echo < {{.*}}
533 # CHECK: # executed command: @echo
534 # CHECK: # .---command stderr{{-*}}
535 # CHECK: # | stdin and stderr redirects not supported for @echo
536 # CHECK: error: command failed with exit status:
538 # CHECK: FAIL: shtest-shell :: echo-redirect-stderr.txt
539 # CHECK: *** TEST 'shtest-shell :: echo-redirect-stderr.txt' FAILED ***
540 # CHECK: echo 2> {{.*}}
541 # CHECK: # executed command: echo
542 # CHECK: # .---command stderr{{-*}}
543 # CHECK: # | stdin and stderr redirects not supported for echo
544 # CHECK: error: command failed with exit status:
546 # CHECK: FAIL: shtest-shell :: echo-redirect-stdin.txt
547 # CHECK: *** TEST 'shtest-shell :: echo-redirect-stdin.txt' FAILED ***
548 # CHECK: echo < {{.*}}
549 # CHECK: # executed command: echo
550 # CHECK: # .---command stderr{{-*}}
551 # CHECK: # | stdin and stderr redirects not supported for echo
552 # CHECK: error: command failed with exit status:
554 # CHECK: FAIL: shtest-shell :: error-0.txt
555 # CHECK: *** TEST 'shtest-shell :: error-0.txt' FAILED ***
556 # CHECK: not-a-real-command
557 # CHECK: # .---command stderr{{-*}}
558 # CHECK: # | 'not-a-real-command': command not found
559 # CHECK: # error: command failed with exit status: 127
560 # CHECK: ***
562 # FIXME: The output here sucks.
564 # CHECK: UNRESOLVED: shtest-shell :: error-1.txt
565 # CHECK-NEXT: *** TEST 'shtest-shell :: error-1.txt' FAILED ***
566 # CHECK-NEXT: Exit Code: 1
567 # CHECK-EMPTY:
568 # CHECK-NEXT: Command Output (stdout):
569 # CHECK-NEXT: --
570 # CHECK-NEXT: # shell parser error on RUN: at line 3: echo "missing quote
571 # CHECK-EMPTY:
572 # CHECK-NEXT: --
573 # CHECK-EMPTY:
574 # CHECK-NEXT: ***
576 # CHECK: FAIL: shtest-shell :: error-2.txt
577 # CHECK: *** TEST 'shtest-shell :: error-2.txt' FAILED ***
578 # CHECK: Unsupported redirect:
579 # CHECK: ***
581 # CHECK: FAIL: shtest-shell :: mkdir-error-0.txt
582 # CHECK: *** TEST 'shtest-shell :: mkdir-error-0.txt' FAILED ***
583 # CHECK: mkdir -p temp | rm -rf temp
584 # CHECK: # .---command stderr{{-*}}
585 # CHECK: # | Unsupported: 'mkdir' cannot be part of a pipeline
586 # CHECK: # error: command failed with exit status: 127
587 # CHECK: ***
589 # CHECK: FAIL: shtest-shell :: mkdir-error-1.txt
590 # CHECK: *** TEST 'shtest-shell :: mkdir-error-1.txt' FAILED ***
591 # CHECK: mkdir -p -m 777 temp
592 # CHECK: # .---command stderr{{-*}}
593 # CHECK: # | Unsupported: 'mkdir': option -m not recognized
594 # CHECK: # error: command failed with exit status: 127
595 # CHECK: ***
597 # CHECK: FAIL: shtest-shell :: mkdir-error-2.txt
598 # CHECK: *** TEST 'shtest-shell :: mkdir-error-2.txt' FAILED ***
599 # CHECK: mkdir -p
600 # CHECK: # .---command stderr{{-*}}
601 # CHECK: # | Error: 'mkdir' is missing an operand
602 # CHECK: # error: command failed with exit status: 127
603 # CHECK: ***
605 # CHECK: PASS: shtest-shell :: redirects.txt
607 # CHECK: FAIL: shtest-shell :: rm-error-0.txt
608 # CHECK: *** TEST 'shtest-shell :: rm-error-0.txt' FAILED ***
609 # CHECK: rm -rf temp | echo "hello"
610 # CHECK: # .---command stderr{{-*}}
611 # CHECK: # | Unsupported: 'rm' cannot be part of a pipeline
612 # CHECK: # error: command failed with exit status: 127
613 # CHECK: ***
615 # CHECK: FAIL: shtest-shell :: rm-error-1.txt
616 # CHECK: *** TEST 'shtest-shell :: rm-error-1.txt' FAILED ***
617 # CHECK: rm -f -v temp
618 # CHECK: # .---command stderr{{-*}}
619 # CHECK: # | Unsupported: 'rm': option -v not recognized
620 # CHECK: # error: command failed with exit status: 127
621 # CHECK: ***
623 # CHECK: FAIL: shtest-shell :: rm-error-2.txt
624 # CHECK: *** TEST 'shtest-shell :: rm-error-2.txt' FAILED ***
625 # CHECK: rm -r hello
626 # CHECK: # .---command stderr{{-*}}
627 # CHECK: # | Error: 'rm' command failed
628 # CHECK: # error: command failed with exit status: 1
629 # CHECK: ***
631 # CHECK: FAIL: shtest-shell :: rm-error-3.txt
632 # CHECK: *** TEST 'shtest-shell :: rm-error-3.txt' FAILED ***
633 # CHECK: Exit Code: 1
634 # CHECK: ***
636 # CHECK: PASS: shtest-shell :: rm-unicode-0.txt
637 # CHECK: PASS: shtest-shell :: sequencing-0.txt
638 # CHECK: XFAIL: shtest-shell :: sequencing-1.txt
640 # CHECK: FAIL: shtest-shell :: stdout-encoding.txt
641 # CHECK: *** TEST 'shtest-shell :: stdout-encoding.txt' FAILED ***
642 # CHECK: cat diff-in.bin
643 # CHECK: # .---command stdout{{-*}}
644 # CHECK-NEXT: # | {{.f.o.o.$}}
645 # CHECK-NEXT: # | {{.b.a.r.}}
646 # CHECK-NEXT: # | {{.b.a.z.$}}
647 # CHECK-NEXT: # `---{{-*}}
648 # CHECK-NOT: error
649 # CHECK: false
650 # CHECK: ***
652 # CHECK: PASS: shtest-shell :: valid-shell.txt
653 # CHECK: Unresolved Tests (1)
654 # CHECK: Failed Tests (38)