blob: d1fcaefc8cdfde341b05f85c2be8c114852e6708 [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. Denny30497482019-10-12 18:52:46 +000037# CHECK: FAIL: shtest-shell :: diff-error-0.txt
38# CHECK: *** TEST 'shtest-shell :: diff-error-0.txt' FAILED ***
39# CHECK: $ "diff" "diff-error-0.txt" "diff-error-0.txt"
40# CHECK: # command stderr:
41# CHECK: Unsupported: 'diff' cannot be part of a pipeline
42# CHECK: error: command failed with exit status: 127
43# CHECK: ***
44
Ying Yicfb08e92017-12-01 09:54:27 +000045# CHECK: FAIL: shtest-shell :: diff-error-1.txt
46# CHECK: *** TEST 'shtest-shell :: diff-error-1.txt' FAILED ***
47# CHECK: $ "diff" "-B" "temp1.txt" "temp2.txt"
48# CHECK: # command stderr:
49# CHECK: Unsupported: 'diff': option -B not recognized
Joel E. Denny30497482019-10-12 18:52:46 +000050# CHECK: error: command failed with exit status: 127
Ying Yicfb08e92017-12-01 09:54:27 +000051# CHECK: ***
52
53# CHECK: FAIL: shtest-shell :: diff-error-2.txt
54# CHECK: *** TEST 'shtest-shell :: diff-error-2.txt' FAILED ***
55# CHECK: $ "diff" "temp.txt"
56# CHECK: # command stderr:
Joel E. Denny30497482019-10-12 18:52:46 +000057# CHECK: Error: missing or extra operand
58# CHECK: error: command failed with exit status: 127
Ying Yicfb08e92017-12-01 09:54:27 +000059# CHECK: ***
60
61# CHECK: FAIL: shtest-shell :: diff-error-3.txt
62# CHECK: *** TEST 'shtest-shell :: diff-error-3.txt' FAILED ***
63# CHECK: $ "diff" "temp.txt" "temp1.txt"
64# CHECK: # command stderr:
65# CHECK: Error: 'diff' command failed
66# CHECK: error: command failed with exit status: 1
67# CHECK: ***
68
69# CHECK: FAIL: shtest-shell :: diff-error-4.txt
70# CHECK: *** TEST 'shtest-shell :: diff-error-4.txt' FAILED ***
71# CHECK: Exit Code: 1
72# CHECK: # command output:
73# CHECK: diff-error-4.txt.tmp
74# CHECK: diff-error-4.txt.tmp1
75# CHECK: *** 1 ****
76# CHECK: ! hello-first
77# CHECK: --- 1 ----
78# CHECK: ! hello-second
79# CHECK: ***
80
81# CHECK: FAIL: shtest-shell :: diff-error-5.txt
82# CHECK: *** TEST 'shtest-shell :: diff-error-5.txt' FAILED ***
83# CHECK: $ "diff"
84# CHECK: # command stderr:
Joel E. Denny30497482019-10-12 18:52:46 +000085# CHECK: Error: missing or extra operand
86# CHECK: error: command failed with exit status: 127
Ying Yicfb08e92017-12-01 09:54:27 +000087# CHECK: ***
88
89# CHECK: FAIL: shtest-shell :: diff-error-6.txt
90# CHECK: *** TEST 'shtest-shell :: diff-error-6.txt' FAILED ***
91# CHECK: $ "diff"
92# CHECK: # command stderr:
Joel E. Denny30497482019-10-12 18:52:46 +000093# CHECK: Error: missing or extra operand
94# CHECK: error: command failed with exit status: 127
Ying Yicfb08e92017-12-01 09:54:27 +000095# CHECK: ***
96
Max Moroz975eaca2018-01-09 18:23:34 +000097# CHECK: FAIL: shtest-shell :: diff-r-error-0.txt
98# CHECK: *** TEST 'shtest-shell :: diff-r-error-0.txt' FAILED ***
Dmitri Gribenko60e52f52019-02-28 10:58:13 +000099# CHECK: $ "diff" "-r"
Max Moroz975eaca2018-01-09 18:23:34 +0000100# CHECK: # command output:
101# CHECK: Only in {{.*}}dir1: dir1unique
102# CHECK: Only in {{.*}}dir2: dir2unique
103# CHECK: error: command failed with exit status: 1
104
105# CHECK: FAIL: shtest-shell :: diff-r-error-1.txt
106# CHECK: *** TEST 'shtest-shell :: diff-r-error-1.txt' FAILED ***
Dmitri Gribenko60e52f52019-02-28 10:58:13 +0000107# CHECK: $ "diff" "-r"
Max Moroz975eaca2018-01-09 18:23:34 +0000108# CHECK: # command output:
109# CHECK: *** {{.*}}dir1{{.*}}subdir{{.*}}f01
110# CHECK: --- {{.*}}dir2{{.*}}subdir{{.*}}f01
111# CHECK: 12345
112# CHECK: 00000
113# CHECK: error: command failed with exit status: 1
114
115# CHECK: FAIL: shtest-shell :: diff-r-error-2.txt
116# CHECK: *** TEST 'shtest-shell :: diff-r-error-2.txt' FAILED ***
Dmitri Gribenko60e52f52019-02-28 10:58:13 +0000117# CHECK: $ "diff" "-r"
Max Moroz975eaca2018-01-09 18:23:34 +0000118# CHECK: # command output:
119# CHECK: Only in {{.*}}dir2: extrafile
120# CHECK: error: command failed with exit status: 1
121
122# CHECK: FAIL: shtest-shell :: diff-r-error-3.txt
123# CHECK: *** TEST 'shtest-shell :: diff-r-error-3.txt' FAILED ***
Dmitri Gribenko60e52f52019-02-28 10:58:13 +0000124# CHECK: $ "diff" "-r"
Max Moroz975eaca2018-01-09 18:23:34 +0000125# CHECK: # command output:
126# CHECK: Only in {{.*}}dir1: extra_subdir
127# CHECK: error: command failed with exit status: 1
128
129# CHECK: FAIL: shtest-shell :: diff-r-error-4.txt
130# CHECK: *** TEST 'shtest-shell :: diff-r-error-4.txt' FAILED ***
Dmitri Gribenko60e52f52019-02-28 10:58:13 +0000131# CHECK: $ "diff" "-r"
Max Moroz975eaca2018-01-09 18:23:34 +0000132# CHECK: # command output:
133# CHECK: File {{.*}}dir1{{.*}}extra_subdir is a directory while file {{.*}}dir2{{.*}}extra_subdir is a regular file
134# CHECK: error: command failed with exit status: 1
135
136# CHECK: FAIL: shtest-shell :: diff-r-error-5.txt
137# CHECK: *** TEST 'shtest-shell :: diff-r-error-5.txt' FAILED ***
Dmitri Gribenko60e52f52019-02-28 10:58:13 +0000138# CHECK: $ "diff" "-r"
Max Moroz975eaca2018-01-09 18:23:34 +0000139# CHECK: # command output:
140# CHECK: Only in {{.*}}dir1: extra_subdir
141# CHECK: error: command failed with exit status: 1
142
143# CHECK: FAIL: shtest-shell :: diff-r-error-6.txt
144# CHECK: *** TEST 'shtest-shell :: diff-r-error-6.txt' FAILED ***
Dmitri Gribenko60e52f52019-02-28 10:58:13 +0000145# CHECK: $ "diff" "-r"
Max Moroz975eaca2018-01-09 18:23:34 +0000146# CHECK: # command output:
147# CHECK: File {{.*}}dir1{{.*}}extra_file is a regular empty file while file {{.*}}dir2{{.*}}extra_file is a directory
148# CHECK: error: command failed with exit status: 1
149
150# CHECK: PASS: shtest-shell :: diff-r.txt
151
Joel E. Denny7e385bd2019-10-14 19:59:30 +0000152# CHECK: FAIL: shtest-shell :: diff-unified-error-0.txt
153# CHECK: *** TEST 'shtest-shell :: diff-unified-error-0.txt' FAILED ***
154# CHECK: $ "diff" "-U" "30.1" "{{[^"]*}}" "{{[^"]*}}"
155# CHECK: # command stderr:
156# CHECK: Error: invalid '-U' argument: 30.1
157# CHECK: error: command failed with exit status: 127
158# CHECK: ***
159
160# CHECK: FAIL: shtest-shell :: diff-unified-error-1.txt
161# CHECK: *** TEST 'shtest-shell :: diff-unified-error-1.txt' FAILED ***
162# CHECK: $ "diff" "-U-1" "{{[^"]*}}" "{{[^"]*}}"
163# CHECK: # command stderr:
164# CHECK: Error: invalid '-U' argument: -1
165# CHECK: error: command failed with exit status: 127
166# CHECK: ***
167
168
169# CHECK: FAIL: shtest-shell :: diff-unified.txt
170
171# CHECK: *** TEST 'shtest-shell :: diff-unified.txt' FAILED ***
172
173# CHECK: $ "diff" "-u" "{{[^"]*}}.foo" "{{[^"]*}}.bar"
174# CHECK: # command output:
175# CHECK: @@ {{.*}} @@
176# CHECK-NEXT: 3
177# CHECK-NEXT: 4
178# CHECK-NEXT: 5
179# CHECK-NEXT: -6 foo
180# CHECK-NEXT: +6 bar
181# CHECK-NEXT: 7
182# CHECK-NEXT: 8
183# CHECK-NEXT: 9
184# CHECK-EMPTY:
185# CHECK-NEXT: error: command failed with exit status: 1
186# CHECK-NEXT: $ "true"
187
188# CHECK: $ "diff" "-U" "2" "{{[^"]*}}.foo" "{{[^"]*}}.bar"
189# CHECK: # command output:
190# CHECK: @@ {{.*}} @@
191# CHECK-NEXT: 4
192# CHECK-NEXT: 5
193# CHECK-NEXT: -6 foo
194# CHECK-NEXT: +6 bar
195# CHECK-NEXT: 7
196# CHECK-NEXT: 8
197# CHECK-EMPTY:
198# CHECK-NEXT: error: command failed with exit status: 1
199# CHECK-NEXT: $ "true"
200
201# CHECK: $ "diff" "-U4" "{{[^"]*}}.foo" "{{[^"]*}}.bar"
202# CHECK: # command output:
203# CHECK: @@ {{.*}} @@
204# CHECK-NEXT: 2
205# CHECK-NEXT: 3
206# CHECK-NEXT: 4
207# CHECK-NEXT: 5
208# CHECK-NEXT: -6 foo
209# CHECK-NEXT: +6 bar
210# CHECK-NEXT: 7
211# CHECK-NEXT: 8
212# CHECK-NEXT: 9
213# CHECK-NEXT: 10
214# CHECK-EMPTY:
215# CHECK-NEXT: error: command failed with exit status: 1
216# CHECK-NEXT: $ "true"
217
218# CHECK: $ "diff" "-U0" "{{[^"]*}}.foo" "{{[^"]*}}.bar"
219# CHECK: # command output:
220# CHECK: @@ {{.*}} @@
221# CHECK-NEXT: -6 foo
222# CHECK-NEXT: +6 bar
223# CHECK-EMPTY:
224# CHECK-NEXT: error: command failed with exit status: 1
225# CHECK-NEXT: $ "true"
226
227# CHECK: $ "false"
228
229# CHECK: ***
230
231
Daniel Dunbar38d37982013-01-31 22:15:20 +0000232# CHECK: FAIL: shtest-shell :: error-0.txt
233# CHECK: *** TEST 'shtest-shell :: error-0.txt' FAILED ***
Daniel Dunbar591838d2016-06-02 23:49:42 +0000234# CHECK: $ "not-a-real-command"
235# CHECK: # command stderr:
Daniel Dunbar38d37982013-01-31 22:15:20 +0000236# CHECK: 'not-a-real-command': command not found
Daniel Dunbar591838d2016-06-02 23:49:42 +0000237# CHECK: error: command failed with exit status: 127
Daniel Dunbar38d37982013-01-31 22:15:20 +0000238# CHECK: ***
239
240# FIXME: The output here sucks.
241#
242# CHECK: FAIL: shtest-shell :: error-1.txt
243# CHECK: *** TEST 'shtest-shell :: error-1.txt' FAILED ***
Joel E. Dennyfc01dd22018-05-31 03:40:37 +0000244# CHECK: shell parser error on: ': \'RUN: at line 3\'; echo "missing quote'
Daniel Dunbar38d37982013-01-31 22:15:20 +0000245# CHECK: ***
246
247# CHECK: FAIL: shtest-shell :: error-2.txt
248# CHECK: *** TEST 'shtest-shell :: error-2.txt' FAILED ***
249# CHECK: Unsupported redirect:
250# CHECK: ***
251
Ying Yicfb08e92017-12-01 09:54:27 +0000252# CHECK: FAIL: shtest-shell :: mkdir-error-0.txt
253# CHECK: *** TEST 'shtest-shell :: mkdir-error-0.txt' FAILED ***
254# CHECK: $ "mkdir" "-p" "temp"
255# CHECK: # command stderr:
256# CHECK: Unsupported: 'mkdir' cannot be part of a pipeline
257# CHECK: error: command failed with exit status: 127
258# CHECK: ***
259
260# CHECK: FAIL: shtest-shell :: mkdir-error-1.txt
261# CHECK: *** TEST 'shtest-shell :: mkdir-error-1.txt' FAILED ***
262# CHECK: $ "mkdir" "-p" "-m" "777" "temp"
263# CHECK: # command stderr:
264# CHECK: Unsupported: 'mkdir': option -m not recognized
265# CHECK: error: command failed with exit status: 127
266# CHECK: ***
267
268# CHECK: FAIL: shtest-shell :: mkdir-error-2.txt
269# CHECK: *** TEST 'shtest-shell :: mkdir-error-2.txt' FAILED ***
270# CHECK: $ "mkdir" "-p"
271# CHECK: # command stderr:
272# CHECK: Error: 'mkdir' is missing an operand
273# CHECK: error: command failed with exit status: 127
274# CHECK: ***
275
Daniel Dunbar38d37982013-01-31 22:15:20 +0000276# CHECK: PASS: shtest-shell :: redirects.txt
Ying Yicfb08e92017-12-01 09:54:27 +0000277
278# CHECK: FAIL: shtest-shell :: rm-error-0.txt
279# CHECK: *** TEST 'shtest-shell :: rm-error-0.txt' FAILED ***
280# CHECK: $ "rm" "-rf" "temp"
281# CHECK: # command stderr:
282# CHECK: Unsupported: 'rm' cannot be part of a pipeline
283# CHECK: error: command failed with exit status: 127
284# CHECK: ***
285
286# CHECK: FAIL: shtest-shell :: rm-error-1.txt
287# CHECK: *** TEST 'shtest-shell :: rm-error-1.txt' FAILED ***
288# CHECK: $ "rm" "-f" "-v" "temp"
289# CHECK: # command stderr:
290# CHECK: Unsupported: 'rm': option -v not recognized
291# CHECK: error: command failed with exit status: 127
292# CHECK: ***
293
294# CHECK: FAIL: shtest-shell :: rm-error-2.txt
295# CHECK: *** TEST 'shtest-shell :: rm-error-2.txt' FAILED ***
296# CHECK: $ "rm" "-r" "hello"
297# CHECK: # command stderr:
298# CHECK: Error: 'rm' command failed
299# CHECK: error: command failed with exit status: 1
300# CHECK: ***
301
302# CHECK: FAIL: shtest-shell :: rm-error-3.txt
303# CHECK: *** TEST 'shtest-shell :: rm-error-3.txt' FAILED ***
304# CHECK: Exit Code: 1
305# CHECK: ***
306
Serge Guelton54be9092019-02-28 19:16:17 +0000307# CHECK: PASS: shtest-shell :: rm-unicode-0.txt
Daniel Dunbar38d37982013-01-31 22:15:20 +0000308# CHECK: PASS: shtest-shell :: sequencing-0.txt
309# CHECK: XFAIL: shtest-shell :: sequencing-1.txt
Ying Yicfb08e92017-12-01 09:54:27 +0000310# CHECK: PASS: shtest-shell :: valid-shell.txt
Joel E. Denny7e385bd2019-10-14 19:59:30 +0000311# CHECK: Failing Tests (30)