blob: cef3728dd004d1ed654780e508defac8bc5b3cb7 [file] [log] [blame]
Daniel Dunbar38d37982013-01-31 22:15:20 +00001# Check the internal shell handling component of the ShTest format.
2#
3# RUN: not %{lit} -j 1 -v %{inputs}/shtest-shell > %t.out
Reid Kleckner125c74b2017-07-28 16:24:18 +00004# FIXME: Temporarily dump test output so we can debug failing tests on
5# buildbots.
6# RUN: cat %t.out
Joel E. Denny57046e82019-10-12 18:51:51 +00007# RUN: FileCheck --input-file %t.out %s
Daniel Dunbar38d37982013-01-31 22:15:20 +00008#
9# END.
10
11# CHECK: -- Testing:
12
Reid Kleckner82528922018-03-26 18:05:12 +000013# CHECK: FAIL: shtest-shell :: cat-error-0.txt
14# CHECK: *** TEST 'shtest-shell :: cat-error-0.txt' FAILED ***
15# CHECK: $ "cat" "-b" "temp1.txt"
16# CHECK: # command stderr:
17# CHECK: Unsupported: 'cat': option -b not recognized
18# CHECK: error: command failed with exit status: 1
19# CHECK: ***
20
21# CHECK: FAIL: shtest-shell :: cat-error-1.txt
22# CHECK: *** TEST 'shtest-shell :: cat-error-1.txt' FAILED ***
23# CHECK: $ "cat" "temp1.txt"
24# CHECK: # command stderr:
25# CHECK: [Errno 2] No such file or directory: 'temp1.txt'
26# CHECK: error: command failed with exit status: 1
27# CHECK: ***
Ying Yicfb08e92017-12-01 09:54:27 +000028
Joel E. Denny31b37392018-05-31 00:55:32 +000029# CHECK: FAIL: shtest-shell :: colon-error.txt
30# CHECK: *** TEST 'shtest-shell :: colon-error.txt' FAILED ***
31# CHECK: $ ":"
32# CHECK: # command stderr:
33# CHECK: Unsupported: ':' cannot be part of a pipeline
34# CHECK: error: command failed with exit status: 127
35# CHECK: ***
36
Joel E. Dennyf095b8c2019-10-16 17:21:24 +000037
38# CHECK: FAIL: shtest-shell :: diff-encodings.txt
39# CHECK: *** TEST 'shtest-shell :: diff-encodings.txt' FAILED ***
40
41# CHECK: $ "diff" "-u" "diff-in.bin" "diff-in.bin"
42# CHECK-NOT: error
43
44# CHECK: $ "diff" "-u" "diff-in.utf16" "diff-in.bin"
45# CHECK: # command output:
46# CHECK-NEXT: ---
47# CHECK-NEXT: +++
48# CHECK-NEXT: @@
49# CHECK-NEXT: {{^ .f.o.o.$}}
50# CHECK-NEXT: {{^-.b.a.r.$}}
51# CHECK-NEXT: {{^\+.b.a.r..}}
52# CHECK-NEXT: {{^ .b.a.z.$}}
53# CHECK: error: command failed with exit status: 1
54# CHECK: $ "true"
55
56# CHECK: $ "diff" "-u" "diff-in.utf8" "diff-in.bin"
57# CHECK: # command output:
58# CHECK-NEXT: ---
59# CHECK-NEXT: +++
60# CHECK-NEXT: @@
61# CHECK-NEXT: -foo
62# CHECK-NEXT: -bar
63# CHECK-NEXT: -baz
64# CHECK-NEXT: {{^\+.f.o.o.$}}
65# CHECK-NEXT: {{^\+.b.a.r..}}
66# CHECK-NEXT: {{^\+.b.a.z.$}}
67# CHECK: error: command failed with exit status: 1
68# CHECK: $ "true"
69
70# CHECK: $ "diff" "-u" "diff-in.bin" "diff-in.utf8"
71# CHECK: # command output:
72# CHECK-NEXT: ---
73# CHECK-NEXT: +++
74# CHECK-NEXT: @@
75# CHECK-NEXT: {{^\-.f.o.o.$}}
76# CHECK-NEXT: {{^\-.b.a.r..}}
77# CHECK-NEXT: {{^\-.b.a.z.$}}
78# CHECK-NEXT: +foo
79# CHECK-NEXT: +bar
80# CHECK-NEXT: +baz
81# CHECK: error: command failed with exit status: 1
82# CHECK: $ "true"
83
84# CHECK: $ "false"
85
86# CHECK: ***
87
88
Joel E. Dennye96e2d32019-10-17 14:43:42 +000089# CHECK: FAIL: shtest-shell :: diff-error-0.txt
90# CHECK: *** TEST 'shtest-shell :: diff-error-0.txt' FAILED ***
91# CHECK: $ "diff" "diff-error-0.txt" "diff-error-0.txt"
92# CHECK: # command stderr:
93# CHECK: Unsupported: 'diff' cannot be part of a pipeline
94# CHECK: error: command failed with exit status: 127
95# CHECK: ***
96
Ying Yicfb08e92017-12-01 09:54:27 +000097# CHECK: FAIL: shtest-shell :: diff-error-1.txt
98# CHECK: *** TEST 'shtest-shell :: diff-error-1.txt' FAILED ***
99# CHECK: $ "diff" "-B" "temp1.txt" "temp2.txt"
100# CHECK: # command stderr:
101# CHECK: Unsupported: 'diff': option -B not recognized
Joel E. Dennye96e2d32019-10-17 14:43:42 +0000102# CHECK: error: command failed with exit status: 127
Ying Yicfb08e92017-12-01 09:54:27 +0000103# CHECK: ***
104
105# CHECK: FAIL: shtest-shell :: diff-error-2.txt
106# CHECK: *** TEST 'shtest-shell :: diff-error-2.txt' FAILED ***
107# CHECK: $ "diff" "temp.txt"
108# CHECK: # command stderr:
Joel E. Dennye96e2d32019-10-17 14:43:42 +0000109# CHECK: Error: missing or extra operand
110# CHECK: error: command failed with exit status: 127
Ying Yicfb08e92017-12-01 09:54:27 +0000111# CHECK: ***
112
113# CHECK: FAIL: shtest-shell :: diff-error-3.txt
114# CHECK: *** TEST 'shtest-shell :: diff-error-3.txt' FAILED ***
115# CHECK: $ "diff" "temp.txt" "temp1.txt"
116# CHECK: # command stderr:
117# CHECK: Error: 'diff' command failed
118# CHECK: error: command failed with exit status: 1
119# CHECK: ***
120
121# CHECK: FAIL: shtest-shell :: diff-error-4.txt
122# CHECK: *** TEST 'shtest-shell :: diff-error-4.txt' FAILED ***
123# CHECK: Exit Code: 1
124# CHECK: # command output:
125# CHECK: diff-error-4.txt.tmp
126# CHECK: diff-error-4.txt.tmp1
127# CHECK: *** 1 ****
128# CHECK: ! hello-first
129# CHECK: --- 1 ----
130# CHECK: ! hello-second
131# CHECK: ***
132
133# CHECK: FAIL: shtest-shell :: diff-error-5.txt
134# CHECK: *** TEST 'shtest-shell :: diff-error-5.txt' FAILED ***
135# CHECK: $ "diff"
136# CHECK: # command stderr:
Joel E. Dennye96e2d32019-10-17 14:43:42 +0000137# CHECK: Error: missing or extra operand
138# CHECK: error: command failed with exit status: 127
Ying Yicfb08e92017-12-01 09:54:27 +0000139# CHECK: ***
140
141# CHECK: FAIL: shtest-shell :: diff-error-6.txt
142# CHECK: *** TEST 'shtest-shell :: diff-error-6.txt' FAILED ***
143# CHECK: $ "diff"
144# CHECK: # command stderr:
Joel E. Dennye96e2d32019-10-17 14:43:42 +0000145# CHECK: Error: missing or extra operand
146# CHECK: error: command failed with exit status: 127
Ying Yicfb08e92017-12-01 09:54:27 +0000147# CHECK: ***
148
Max Moroz975eaca2018-01-09 18:23:34 +0000149# CHECK: FAIL: shtest-shell :: diff-r-error-0.txt
150# CHECK: *** TEST 'shtest-shell :: diff-r-error-0.txt' FAILED ***
Dmitri Gribenko60e52f52019-02-28 10:58:13 +0000151# CHECK: $ "diff" "-r"
Max Moroz975eaca2018-01-09 18:23:34 +0000152# CHECK: # command output:
153# CHECK: Only in {{.*}}dir1: dir1unique
154# CHECK: Only in {{.*}}dir2: dir2unique
155# CHECK: error: command failed with exit status: 1
156
157# CHECK: FAIL: shtest-shell :: diff-r-error-1.txt
158# CHECK: *** TEST 'shtest-shell :: diff-r-error-1.txt' FAILED ***
Dmitri Gribenko60e52f52019-02-28 10:58:13 +0000159# CHECK: $ "diff" "-r"
Max Moroz975eaca2018-01-09 18:23:34 +0000160# CHECK: # command output:
161# CHECK: *** {{.*}}dir1{{.*}}subdir{{.*}}f01
162# CHECK: --- {{.*}}dir2{{.*}}subdir{{.*}}f01
163# CHECK: 12345
164# CHECK: 00000
165# CHECK: error: command failed with exit status: 1
166
167# CHECK: FAIL: shtest-shell :: diff-r-error-2.txt
168# CHECK: *** TEST 'shtest-shell :: diff-r-error-2.txt' FAILED ***
Dmitri Gribenko60e52f52019-02-28 10:58:13 +0000169# CHECK: $ "diff" "-r"
Max Moroz975eaca2018-01-09 18:23:34 +0000170# CHECK: # command output:
171# CHECK: Only in {{.*}}dir2: extrafile
172# CHECK: error: command failed with exit status: 1
173
174# CHECK: FAIL: shtest-shell :: diff-r-error-3.txt
175# CHECK: *** TEST 'shtest-shell :: diff-r-error-3.txt' FAILED ***
Dmitri Gribenko60e52f52019-02-28 10:58:13 +0000176# CHECK: $ "diff" "-r"
Max Moroz975eaca2018-01-09 18:23:34 +0000177# CHECK: # command output:
178# CHECK: Only in {{.*}}dir1: extra_subdir
179# CHECK: error: command failed with exit status: 1
180
181# CHECK: FAIL: shtest-shell :: diff-r-error-4.txt
182# CHECK: *** TEST 'shtest-shell :: diff-r-error-4.txt' FAILED ***
Dmitri Gribenko60e52f52019-02-28 10:58:13 +0000183# CHECK: $ "diff" "-r"
Max Moroz975eaca2018-01-09 18:23:34 +0000184# CHECK: # command output:
185# CHECK: File {{.*}}dir1{{.*}}extra_subdir is a directory while file {{.*}}dir2{{.*}}extra_subdir is a regular file
186# CHECK: error: command failed with exit status: 1
187
188# CHECK: FAIL: shtest-shell :: diff-r-error-5.txt
189# CHECK: *** TEST 'shtest-shell :: diff-r-error-5.txt' FAILED ***
Dmitri Gribenko60e52f52019-02-28 10:58:13 +0000190# CHECK: $ "diff" "-r"
Max Moroz975eaca2018-01-09 18:23:34 +0000191# CHECK: # command output:
192# CHECK: Only in {{.*}}dir1: extra_subdir
193# CHECK: error: command failed with exit status: 1
194
195# CHECK: FAIL: shtest-shell :: diff-r-error-6.txt
196# CHECK: *** TEST 'shtest-shell :: diff-r-error-6.txt' FAILED ***
Dmitri Gribenko60e52f52019-02-28 10:58:13 +0000197# CHECK: $ "diff" "-r"
Max Moroz975eaca2018-01-09 18:23:34 +0000198# CHECK: # command output:
199# CHECK: File {{.*}}dir1{{.*}}extra_file is a regular empty file while file {{.*}}dir2{{.*}}extra_file is a directory
200# CHECK: error: command failed with exit status: 1
201
202# CHECK: PASS: shtest-shell :: diff-r.txt
203
Joel E. Denny26224192019-10-16 17:21:57 +0000204
205# CHECK: FAIL: shtest-shell :: diff-strip-trailing-cr.txt
206
207# CHECK: *** TEST 'shtest-shell :: diff-strip-trailing-cr.txt' FAILED ***
208
209# CHECK: $ "diff" "-u" "diff-in.dos" "diff-in.unix"
210# CHECK: # command output:
211# CHECK: @@
212# CHECK-NEXT: -In this file, the
213# CHECK-NEXT: -sequence "\r\n"
214# CHECK-NEXT: -terminates lines.
215# CHECK-NEXT: +In this file, the
216# CHECK-NEXT: +sequence "\n"
217# CHECK-NEXT: +terminates lines.
218# CHECK: error: command failed with exit status: 1
219# CHECK: $ "true"
220
221# CHECK: $ "diff" "-u" "diff-in.unix" "diff-in.dos"
222# CHECK: # command output:
223# CHECK: @@
224# CHECK-NEXT: -In this file, the
225# CHECK-NEXT: -sequence "\n"
226# CHECK-NEXT: -terminates lines.
227# CHECK-NEXT: +In this file, the
228# CHECK-NEXT: +sequence "\r\n"
229# CHECK-NEXT: +terminates lines.
230# CHECK: error: command failed with exit status: 1
231# CHECK: $ "true"
232
233# CHECK: $ "diff" "-u" "--strip-trailing-cr" "diff-in.dos" "diff-in.unix"
234# CHECK: # command output:
235# CHECK: @@
236# CHECK-NEXT: In this file, the
237# CHECK-NEXT: -sequence "\r\n"
238# CHECK-NEXT: +sequence "\n"
239# CHECK-NEXT: terminates lines.
240# CHECK: error: command failed with exit status: 1
241# CHECK: $ "true"
242
243# CHECK: $ "diff" "-u" "--strip-trailing-cr" "diff-in.unix" "diff-in.dos"
244# CHECK: # command output:
245# CHECK: @@
246# CHECK-NEXT: In this file, the
247# CHECK-NEXT: -sequence "\n"
248# CHECK-NEXT: +sequence "\r\n"
249# CHECK-NEXT: terminates lines.
250# CHECK: error: command failed with exit status: 1
251# CHECK: $ "true"
252
253# CHECK: $ "false"
254
255# CHECK: ***
256
257
Joel E. Dennye96e2d32019-10-17 14:43:42 +0000258# CHECK: FAIL: shtest-shell :: diff-unified-error-0.txt
259# CHECK: *** TEST 'shtest-shell :: diff-unified-error-0.txt' FAILED ***
260# CHECK: $ "diff" "-U" "30.1" "{{[^"]*}}" "{{[^"]*}}"
261# CHECK: # command stderr:
262# CHECK: Error: invalid '-U' argument: 30.1
263# CHECK: error: command failed with exit status: 127
264# CHECK: ***
265
266# CHECK: FAIL: shtest-shell :: diff-unified-error-1.txt
267# CHECK: *** TEST 'shtest-shell :: diff-unified-error-1.txt' FAILED ***
268# CHECK: $ "diff" "-U-1" "{{[^"]*}}" "{{[^"]*}}"
269# CHECK: # command stderr:
270# CHECK: Error: invalid '-U' argument: -1
271# CHECK: error: command failed with exit status: 127
272# CHECK: ***
273
274
Joel E. Denny7e385bd2019-10-14 19:59:30 +0000275# CHECK: FAIL: shtest-shell :: diff-unified.txt
276
277# CHECK: *** TEST 'shtest-shell :: diff-unified.txt' FAILED ***
278
279# CHECK: $ "diff" "-u" "{{[^"]*}}.foo" "{{[^"]*}}.bar"
280# CHECK: # command output:
281# CHECK: @@ {{.*}} @@
282# CHECK-NEXT: 3
283# CHECK-NEXT: 4
284# CHECK-NEXT: 5
285# CHECK-NEXT: -6 foo
286# CHECK-NEXT: +6 bar
287# CHECK-NEXT: 7
288# CHECK-NEXT: 8
289# CHECK-NEXT: 9
290# CHECK-EMPTY:
291# CHECK-NEXT: error: command failed with exit status: 1
292# CHECK-NEXT: $ "true"
293
294# CHECK: $ "diff" "-U" "2" "{{[^"]*}}.foo" "{{[^"]*}}.bar"
295# CHECK: # command output:
296# CHECK: @@ {{.*}} @@
297# CHECK-NEXT: 4
298# CHECK-NEXT: 5
299# CHECK-NEXT: -6 foo
300# CHECK-NEXT: +6 bar
301# CHECK-NEXT: 7
302# CHECK-NEXT: 8
303# CHECK-EMPTY:
304# CHECK-NEXT: error: command failed with exit status: 1
305# CHECK-NEXT: $ "true"
306
307# CHECK: $ "diff" "-U4" "{{[^"]*}}.foo" "{{[^"]*}}.bar"
308# CHECK: # command output:
309# CHECK: @@ {{.*}} @@
310# CHECK-NEXT: 2
311# CHECK-NEXT: 3
312# CHECK-NEXT: 4
313# CHECK-NEXT: 5
314# CHECK-NEXT: -6 foo
315# CHECK-NEXT: +6 bar
316# CHECK-NEXT: 7
317# CHECK-NEXT: 8
318# CHECK-NEXT: 9
319# CHECK-NEXT: 10
320# CHECK-EMPTY:
321# CHECK-NEXT: error: command failed with exit status: 1
322# CHECK-NEXT: $ "true"
323
324# CHECK: $ "diff" "-U0" "{{[^"]*}}.foo" "{{[^"]*}}.bar"
325# CHECK: # command output:
326# CHECK: @@ {{.*}} @@
327# CHECK-NEXT: -6 foo
328# CHECK-NEXT: +6 bar
329# CHECK-EMPTY:
330# CHECK-NEXT: error: command failed with exit status: 1
331# CHECK-NEXT: $ "true"
332
333# CHECK: $ "false"
334
335# CHECK: ***
336
337
Daniel Dunbar38d37982013-01-31 22:15:20 +0000338# CHECK: FAIL: shtest-shell :: error-0.txt
339# CHECK: *** TEST 'shtest-shell :: error-0.txt' FAILED ***
Daniel Dunbar591838d2016-06-02 23:49:42 +0000340# CHECK: $ "not-a-real-command"
341# CHECK: # command stderr:
Daniel Dunbar38d37982013-01-31 22:15:20 +0000342# CHECK: 'not-a-real-command': command not found
Daniel Dunbar591838d2016-06-02 23:49:42 +0000343# CHECK: error: command failed with exit status: 127
Daniel Dunbar38d37982013-01-31 22:15:20 +0000344# CHECK: ***
345
346# FIXME: The output here sucks.
347#
348# CHECK: FAIL: shtest-shell :: error-1.txt
349# CHECK: *** TEST 'shtest-shell :: error-1.txt' FAILED ***
Joel E. Dennyfc01dd22018-05-31 03:40:37 +0000350# CHECK: shell parser error on: ': \'RUN: at line 3\'; echo "missing quote'
Daniel Dunbar38d37982013-01-31 22:15:20 +0000351# CHECK: ***
352
353# CHECK: FAIL: shtest-shell :: error-2.txt
354# CHECK: *** TEST 'shtest-shell :: error-2.txt' FAILED ***
355# CHECK: Unsupported redirect:
356# CHECK: ***
357
Ying Yicfb08e92017-12-01 09:54:27 +0000358# CHECK: FAIL: shtest-shell :: mkdir-error-0.txt
359# CHECK: *** TEST 'shtest-shell :: mkdir-error-0.txt' FAILED ***
360# CHECK: $ "mkdir" "-p" "temp"
361# CHECK: # command stderr:
362# CHECK: Unsupported: 'mkdir' cannot be part of a pipeline
363# CHECK: error: command failed with exit status: 127
364# CHECK: ***
365
366# CHECK: FAIL: shtest-shell :: mkdir-error-1.txt
367# CHECK: *** TEST 'shtest-shell :: mkdir-error-1.txt' FAILED ***
368# CHECK: $ "mkdir" "-p" "-m" "777" "temp"
369# CHECK: # command stderr:
370# CHECK: Unsupported: 'mkdir': option -m not recognized
371# CHECK: error: command failed with exit status: 127
372# CHECK: ***
373
374# CHECK: FAIL: shtest-shell :: mkdir-error-2.txt
375# CHECK: *** TEST 'shtest-shell :: mkdir-error-2.txt' FAILED ***
376# CHECK: $ "mkdir" "-p"
377# CHECK: # command stderr:
378# CHECK: Error: 'mkdir' is missing an operand
379# CHECK: error: command failed with exit status: 127
380# CHECK: ***
381
Daniel Dunbar38d37982013-01-31 22:15:20 +0000382# CHECK: PASS: shtest-shell :: redirects.txt
Ying Yicfb08e92017-12-01 09:54:27 +0000383
384# CHECK: FAIL: shtest-shell :: rm-error-0.txt
385# CHECK: *** TEST 'shtest-shell :: rm-error-0.txt' FAILED ***
386# CHECK: $ "rm" "-rf" "temp"
387# CHECK: # command stderr:
388# CHECK: Unsupported: 'rm' cannot be part of a pipeline
389# CHECK: error: command failed with exit status: 127
390# CHECK: ***
391
392# CHECK: FAIL: shtest-shell :: rm-error-1.txt
393# CHECK: *** TEST 'shtest-shell :: rm-error-1.txt' FAILED ***
394# CHECK: $ "rm" "-f" "-v" "temp"
395# CHECK: # command stderr:
396# CHECK: Unsupported: 'rm': option -v not recognized
397# CHECK: error: command failed with exit status: 127
398# CHECK: ***
399
400# CHECK: FAIL: shtest-shell :: rm-error-2.txt
401# CHECK: *** TEST 'shtest-shell :: rm-error-2.txt' FAILED ***
402# CHECK: $ "rm" "-r" "hello"
403# CHECK: # command stderr:
404# CHECK: Error: 'rm' command failed
405# CHECK: error: command failed with exit status: 1
406# CHECK: ***
407
408# CHECK: FAIL: shtest-shell :: rm-error-3.txt
409# CHECK: *** TEST 'shtest-shell :: rm-error-3.txt' FAILED ***
410# CHECK: Exit Code: 1
411# CHECK: ***
412
Serge Guelton54be9092019-02-28 19:16:17 +0000413# CHECK: PASS: shtest-shell :: rm-unicode-0.txt
Daniel Dunbar38d37982013-01-31 22:15:20 +0000414# CHECK: PASS: shtest-shell :: sequencing-0.txt
415# CHECK: XFAIL: shtest-shell :: sequencing-1.txt
Joel E. Denny27fdf8a2019-10-18 12:53:45 -0400416
417# CHECK: FAIL: shtest-shell :: stdout-encoding.txt
418# CHECK: *** TEST 'shtest-shell :: stdout-encoding.txt' FAILED ***
419# CHECK: $ "cat" "diff-in.bin"
420# CHECK: # command output:
421# CHECK-NEXT: {{^.f.o.o.$}}
422# CHECK-NEXT: {{^.b.a.r..}}
423# CHECK-NEXT: {{^.b.a.z.$}}
424# CHECK-NOT: error
425# CHECK: $ "false"
426# CHECK: ***
427
Ying Yicfb08e92017-12-01 09:54:27 +0000428# CHECK: PASS: shtest-shell :: valid-shell.txt
Joel E. Denny27fdf8a2019-10-18 12:53:45 -0400429# CHECK: Failing Tests (33)