blob: d86a9c661e6799e43a1b1570e9083ed971dadb20 [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. Denny30497482019-10-12 18:52:46 +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. Denny30497482019-10-12 18:52:46 +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. Denny30497482019-10-12 18:52:46 +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. Denny30497482019-10-12 18:52:46 +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. Denny30497482019-10-12 18:52:46 +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. Denny7e385bd2019-10-14 19:59:30 +0000204# CHECK: FAIL: shtest-shell :: diff-unified-error-0.txt
205# CHECK: *** TEST 'shtest-shell :: diff-unified-error-0.txt' FAILED ***
206# CHECK: $ "diff" "-U" "30.1" "{{[^"]*}}" "{{[^"]*}}"
207# CHECK: # command stderr:
208# CHECK: Error: invalid '-U' argument: 30.1
209# CHECK: error: command failed with exit status: 127
210# CHECK: ***
211
212# CHECK: FAIL: shtest-shell :: diff-unified-error-1.txt
213# CHECK: *** TEST 'shtest-shell :: diff-unified-error-1.txt' FAILED ***
214# CHECK: $ "diff" "-U-1" "{{[^"]*}}" "{{[^"]*}}"
215# CHECK: # command stderr:
216# CHECK: Error: invalid '-U' argument: -1
217# CHECK: error: command failed with exit status: 127
218# CHECK: ***
219
220
221# CHECK: FAIL: shtest-shell :: diff-unified.txt
222
223# CHECK: *** TEST 'shtest-shell :: diff-unified.txt' FAILED ***
224
225# CHECK: $ "diff" "-u" "{{[^"]*}}.foo" "{{[^"]*}}.bar"
226# CHECK: # command output:
227# CHECK: @@ {{.*}} @@
228# CHECK-NEXT: 3
229# CHECK-NEXT: 4
230# CHECK-NEXT: 5
231# CHECK-NEXT: -6 foo
232# CHECK-NEXT: +6 bar
233# CHECK-NEXT: 7
234# CHECK-NEXT: 8
235# CHECK-NEXT: 9
236# CHECK-EMPTY:
237# CHECK-NEXT: error: command failed with exit status: 1
238# CHECK-NEXT: $ "true"
239
240# CHECK: $ "diff" "-U" "2" "{{[^"]*}}.foo" "{{[^"]*}}.bar"
241# CHECK: # command output:
242# CHECK: @@ {{.*}} @@
243# CHECK-NEXT: 4
244# CHECK-NEXT: 5
245# CHECK-NEXT: -6 foo
246# CHECK-NEXT: +6 bar
247# CHECK-NEXT: 7
248# CHECK-NEXT: 8
249# CHECK-EMPTY:
250# CHECK-NEXT: error: command failed with exit status: 1
251# CHECK-NEXT: $ "true"
252
253# CHECK: $ "diff" "-U4" "{{[^"]*}}.foo" "{{[^"]*}}.bar"
254# CHECK: # command output:
255# CHECK: @@ {{.*}} @@
256# CHECK-NEXT: 2
257# CHECK-NEXT: 3
258# CHECK-NEXT: 4
259# CHECK-NEXT: 5
260# CHECK-NEXT: -6 foo
261# CHECK-NEXT: +6 bar
262# CHECK-NEXT: 7
263# CHECK-NEXT: 8
264# CHECK-NEXT: 9
265# CHECK-NEXT: 10
266# CHECK-EMPTY:
267# CHECK-NEXT: error: command failed with exit status: 1
268# CHECK-NEXT: $ "true"
269
270# CHECK: $ "diff" "-U0" "{{[^"]*}}.foo" "{{[^"]*}}.bar"
271# CHECK: # command output:
272# CHECK: @@ {{.*}} @@
273# CHECK-NEXT: -6 foo
274# CHECK-NEXT: +6 bar
275# CHECK-EMPTY:
276# CHECK-NEXT: error: command failed with exit status: 1
277# CHECK-NEXT: $ "true"
278
279# CHECK: $ "false"
280
281# CHECK: ***
282
283
Daniel Dunbar38d37982013-01-31 22:15:20 +0000284# CHECK: FAIL: shtest-shell :: error-0.txt
285# CHECK: *** TEST 'shtest-shell :: error-0.txt' FAILED ***
Daniel Dunbar591838d2016-06-02 23:49:42 +0000286# CHECK: $ "not-a-real-command"
287# CHECK: # command stderr:
Daniel Dunbar38d37982013-01-31 22:15:20 +0000288# CHECK: 'not-a-real-command': command not found
Daniel Dunbar591838d2016-06-02 23:49:42 +0000289# CHECK: error: command failed with exit status: 127
Daniel Dunbar38d37982013-01-31 22:15:20 +0000290# CHECK: ***
291
292# FIXME: The output here sucks.
293#
294# CHECK: FAIL: shtest-shell :: error-1.txt
295# CHECK: *** TEST 'shtest-shell :: error-1.txt' FAILED ***
Joel E. Dennyfc01dd22018-05-31 03:40:37 +0000296# CHECK: shell parser error on: ': \'RUN: at line 3\'; echo "missing quote'
Daniel Dunbar38d37982013-01-31 22:15:20 +0000297# CHECK: ***
298
299# CHECK: FAIL: shtest-shell :: error-2.txt
300# CHECK: *** TEST 'shtest-shell :: error-2.txt' FAILED ***
301# CHECK: Unsupported redirect:
302# CHECK: ***
303
Ying Yicfb08e92017-12-01 09:54:27 +0000304# CHECK: FAIL: shtest-shell :: mkdir-error-0.txt
305# CHECK: *** TEST 'shtest-shell :: mkdir-error-0.txt' FAILED ***
306# CHECK: $ "mkdir" "-p" "temp"
307# CHECK: # command stderr:
308# CHECK: Unsupported: 'mkdir' cannot be part of a pipeline
309# CHECK: error: command failed with exit status: 127
310# CHECK: ***
311
312# CHECK: FAIL: shtest-shell :: mkdir-error-1.txt
313# CHECK: *** TEST 'shtest-shell :: mkdir-error-1.txt' FAILED ***
314# CHECK: $ "mkdir" "-p" "-m" "777" "temp"
315# CHECK: # command stderr:
316# CHECK: Unsupported: 'mkdir': option -m not recognized
317# CHECK: error: command failed with exit status: 127
318# CHECK: ***
319
320# CHECK: FAIL: shtest-shell :: mkdir-error-2.txt
321# CHECK: *** TEST 'shtest-shell :: mkdir-error-2.txt' FAILED ***
322# CHECK: $ "mkdir" "-p"
323# CHECK: # command stderr:
324# CHECK: Error: 'mkdir' is missing an operand
325# CHECK: error: command failed with exit status: 127
326# CHECK: ***
327
Daniel Dunbar38d37982013-01-31 22:15:20 +0000328# CHECK: PASS: shtest-shell :: redirects.txt
Ying Yicfb08e92017-12-01 09:54:27 +0000329
330# CHECK: FAIL: shtest-shell :: rm-error-0.txt
331# CHECK: *** TEST 'shtest-shell :: rm-error-0.txt' FAILED ***
332# CHECK: $ "rm" "-rf" "temp"
333# CHECK: # command stderr:
334# CHECK: Unsupported: 'rm' cannot be part of a pipeline
335# CHECK: error: command failed with exit status: 127
336# CHECK: ***
337
338# CHECK: FAIL: shtest-shell :: rm-error-1.txt
339# CHECK: *** TEST 'shtest-shell :: rm-error-1.txt' FAILED ***
340# CHECK: $ "rm" "-f" "-v" "temp"
341# CHECK: # command stderr:
342# CHECK: Unsupported: 'rm': option -v not recognized
343# CHECK: error: command failed with exit status: 127
344# CHECK: ***
345
346# CHECK: FAIL: shtest-shell :: rm-error-2.txt
347# CHECK: *** TEST 'shtest-shell :: rm-error-2.txt' FAILED ***
348# CHECK: $ "rm" "-r" "hello"
349# CHECK: # command stderr:
350# CHECK: Error: 'rm' command failed
351# CHECK: error: command failed with exit status: 1
352# CHECK: ***
353
354# CHECK: FAIL: shtest-shell :: rm-error-3.txt
355# CHECK: *** TEST 'shtest-shell :: rm-error-3.txt' FAILED ***
356# CHECK: Exit Code: 1
357# CHECK: ***
358
Serge Guelton54be9092019-02-28 19:16:17 +0000359# CHECK: PASS: shtest-shell :: rm-unicode-0.txt
Daniel Dunbar38d37982013-01-31 22:15:20 +0000360# CHECK: PASS: shtest-shell :: sequencing-0.txt
361# CHECK: XFAIL: shtest-shell :: sequencing-1.txt
Ying Yicfb08e92017-12-01 09:54:27 +0000362# CHECK: PASS: shtest-shell :: valid-shell.txt
Joel E. Dennyf095b8c2019-10-16 17:21:24 +0000363# CHECK: Failing Tests (31)