1 # Check the internal shell handling component of the ShTest format.
3 # RUN: not %{lit} -j 1 -v %{inputs}/shtest-shell > %t.out
4 # FIXME: Temporarily dump test output so we can debug failing tests on
7 # RUN: FileCheck --input-file %t.out %s
13 # 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
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
29 # CHECK: FAIL: shtest-shell :: colon-error.txt
30 # CHECK: *** TEST 'shtest-shell :: colon-error.txt' FAILED ***
32 # CHECK: # command stderr:
33 # CHECK: Unsupported: ':' cannot be part of a pipeline
34 # CHECK: error: command failed with exit status: 127
38 # CHECK: FAIL: shtest-shell :: diff-encodings.txt
39 # CHECK: *** TEST 'shtest-shell :: diff-encodings.txt' FAILED ***
41 # CHECK: $ "diff" "-u" "diff-in.bin" "diff-in.bin"
44 # CHECK: $ "diff" "-u" "diff-in.utf16" "diff-in.bin"
45 # CHECK: # command output:
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
56 # CHECK: $ "diff" "-u" "diff-in.utf8" "diff-in.bin"
57 # CHECK: # command output:
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
70 # CHECK: $ "diff" "-u" "diff-in.bin" "diff-in.utf8"
71 # CHECK: # command output:
75 # CHECK-NEXT: {{^\-.f.o.o.$}}
76 # CHECK-NEXT: {{^\-.b.a.r..}}
77 # CHECK-NEXT: {{^\-.b.a.z.$}}
81 # CHECK: error: command failed with exit status: 1
89 # 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
97 # 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
102 # CHECK: error: command failed with exit status: 127
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:
109 # CHECK: Error: missing or extra operand
110 # CHECK: error: command failed with exit status: 127
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
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
128 # CHECK: ! hello-first
130 # CHECK: ! hello-second
133 # CHECK: FAIL: shtest-shell :: diff-error-5.txt
134 # CHECK: *** TEST 'shtest-shell :: diff-error-5.txt' FAILED ***
136 # CHECK: # command stderr:
137 # CHECK: Error: missing or extra operand
138 # CHECK: error: command failed with exit status: 127
141 # CHECK: FAIL: shtest-shell :: diff-error-6.txt
142 # CHECK: *** TEST 'shtest-shell :: diff-error-6.txt' FAILED ***
144 # CHECK: # command stderr:
145 # CHECK: Error: missing or extra operand
146 # CHECK: error: command failed with exit status: 127
149 # CHECK: FAIL: shtest-shell :: diff-r-error-0.txt
150 # CHECK: *** TEST 'shtest-shell :: diff-r-error-0.txt' FAILED ***
151 # CHECK: $ "diff" "-r"
152 # CHECK: # command output:
153 # CHECK: Only in {{.*}}dir1: dir1unique
154 # CHECK: Only in {{.*}}dir2: dir2unique
155 # CHECK: error: command failed with exit status: 1
157 # CHECK: FAIL: shtest-shell :: diff-r-error-1.txt
158 # CHECK: *** TEST 'shtest-shell :: diff-r-error-1.txt' FAILED ***
159 # CHECK: $ "diff" "-r"
160 # CHECK: # command output:
161 # CHECK: *** {{.*}}dir1{{.*}}subdir{{.*}}f01
162 # CHECK: --- {{.*}}dir2{{.*}}subdir{{.*}}f01
165 # CHECK: error: command failed with exit status: 1
167 # CHECK: FAIL: shtest-shell :: diff-r-error-2.txt
168 # CHECK: *** TEST 'shtest-shell :: diff-r-error-2.txt' FAILED ***
169 # CHECK: $ "diff" "-r"
170 # CHECK: # command output:
171 # CHECK: Only in {{.*}}dir2: extrafile
172 # CHECK: error: command failed with exit status: 1
174 # CHECK: FAIL: shtest-shell :: diff-r-error-3.txt
175 # CHECK: *** TEST 'shtest-shell :: diff-r-error-3.txt' FAILED ***
176 # CHECK: $ "diff" "-r"
177 # CHECK: # command output:
178 # CHECK: Only in {{.*}}dir1: extra_subdir
179 # CHECK: error: command failed with exit status: 1
181 # CHECK: FAIL: shtest-shell :: diff-r-error-4.txt
182 # CHECK: *** TEST 'shtest-shell :: diff-r-error-4.txt' FAILED ***
183 # CHECK: $ "diff" "-r"
184 # 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
188 # CHECK: FAIL: shtest-shell :: diff-r-error-5.txt
189 # CHECK: *** TEST 'shtest-shell :: diff-r-error-5.txt' FAILED ***
190 # CHECK: $ "diff" "-r"
191 # CHECK: # command output:
192 # CHECK: Only in {{.*}}dir1: extra_subdir
193 # CHECK: error: command failed with exit status: 1
195 # CHECK: FAIL: shtest-shell :: diff-r-error-6.txt
196 # CHECK: *** TEST 'shtest-shell :: diff-r-error-6.txt' FAILED ***
197 # CHECK: $ "diff" "-r"
198 # 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
202 # CHECK: PASS: shtest-shell :: diff-r.txt
205 # CHECK: FAIL: shtest-shell :: diff-strip-trailing-cr.txt
207 # CHECK: *** TEST 'shtest-shell :: diff-strip-trailing-cr.txt' FAILED ***
209 # CHECK: $ "diff" "-u" "diff-in.dos" "diff-in.unix"
210 # CHECK: # command output:
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
221 # CHECK: $ "diff" "-u" "diff-in.unix" "diff-in.dos"
222 # CHECK: # command output:
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
233 # CHECK: $ "diff" "-u" "--strip-trailing-cr" "diff-in.dos" "diff-in.unix"
234 # CHECK: # command output:
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
243 # CHECK: $ "diff" "-u" "--strip-trailing-cr" "diff-in.unix" "diff-in.dos"
244 # CHECK: # command output:
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
258 # 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
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
275 # CHECK: FAIL: shtest-shell :: diff-unified.txt
277 # CHECK: *** TEST 'shtest-shell :: diff-unified.txt' FAILED ***
279 # CHECK: $ "diff" "-u" "{{[^"]*}}.foo" "{{[^"]*}}.bar"
280 # CHECK: # command output:
281 # CHECK: @@ {{.*}} @@
291 # CHECK-NEXT: error: command failed with exit status: 1
292 # CHECK-NEXT: $ "true"
294 # CHECK: $ "diff" "-U" "2" "{{[^"]*}}.foo" "{{[^"]*}}.bar"
295 # CHECK: # command output:
296 # CHECK: @@ {{.*}} @@
304 # CHECK-NEXT: error: command failed with exit status: 1
305 # CHECK-NEXT: $ "true"
307 # CHECK: $ "diff" "-U4" "{{[^"]*}}.foo" "{{[^"]*}}.bar"
308 # CHECK: # command output:
309 # CHECK: @@ {{.*}} @@
321 # CHECK-NEXT: error: command failed with exit status: 1
322 # CHECK-NEXT: $ "true"
324 # CHECK: $ "diff" "-U0" "{{[^"]*}}.foo" "{{[^"]*}}.bar"
325 # CHECK: # command output:
326 # CHECK: @@ {{.*}} @@
330 # CHECK-NEXT: error: command failed with exit status: 1
331 # CHECK-NEXT: $ "true"
338 # CHECK: FAIL: shtest-shell :: error-0.txt
339 # CHECK: *** TEST 'shtest-shell :: error-0.txt' FAILED ***
340 # CHECK: $ "not-a-real-command"
341 # CHECK: # command stderr:
342 # CHECK: 'not-a-real-command': command not found
343 # CHECK: error: command failed with exit status: 127
346 # FIXME: The output here sucks.
348 # CHECK: FAIL: shtest-shell :: error-1.txt
349 # CHECK: *** TEST 'shtest-shell :: error-1.txt' FAILED ***
350 # CHECK: shell parser error on: ': \'RUN: at line 3\'; echo "missing quote'
353 # CHECK: FAIL: shtest-shell :: error-2.txt
354 # CHECK: *** TEST 'shtest-shell :: error-2.txt' FAILED ***
355 # CHECK: Unsupported redirect:
358 # 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
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
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
382 # CHECK: PASS: shtest-shell :: redirects.txt
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
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
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
408 # CHECK: FAIL: shtest-shell :: rm-error-3.txt
409 # CHECK: *** TEST 'shtest-shell :: rm-error-3.txt' FAILED ***
410 # CHECK: Exit Code: 1
413 # CHECK: PASS: shtest-shell :: rm-unicode-0.txt
414 # CHECK: PASS: shtest-shell :: sequencing-0.txt
415 # CHECK: XFAIL: shtest-shell :: sequencing-1.txt
416 # CHECK: PASS: shtest-shell :: valid-shell.txt
417 # CHECK: Failing Tests (32)