blob: f947525e5916c7257a19ef357e8b9d8c393f3763 [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
Daniel Dunbar19341082016-06-07 16:13:40 +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
Ying Yicfb08e92017-12-01 09:54:27 +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
45# 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
50# CHECK: error: command failed with exit status: 127
51# 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:
57# CHECK: Error: missing or extra operand
58# CHECK: error: command failed with exit status: 127
59# 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:
85# CHECK: Error: missing or extra operand
86# CHECK: error: command failed with exit status: 127
87# 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:
93# CHECK: Error: missing or extra operand
94# CHECK: error: command failed with exit status: 127
95# 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
Daniel Dunbar38d37982013-01-31 22:15:20 +0000152# CHECK: FAIL: shtest-shell :: error-0.txt
153# CHECK: *** TEST 'shtest-shell :: error-0.txt' FAILED ***
Daniel Dunbar591838d2016-06-02 23:49:42 +0000154# CHECK: $ "not-a-real-command"
155# CHECK: # command stderr:
Daniel Dunbar38d37982013-01-31 22:15:20 +0000156# CHECK: 'not-a-real-command': command not found
Daniel Dunbar591838d2016-06-02 23:49:42 +0000157# CHECK: error: command failed with exit status: 127
Daniel Dunbar38d37982013-01-31 22:15:20 +0000158# CHECK: ***
159
160# FIXME: The output here sucks.
161#
162# CHECK: FAIL: shtest-shell :: error-1.txt
163# CHECK: *** TEST 'shtest-shell :: error-1.txt' FAILED ***
Joel E. Dennyfc01dd22018-05-31 03:40:37 +0000164# CHECK: shell parser error on: ': \'RUN: at line 3\'; echo "missing quote'
Daniel Dunbar38d37982013-01-31 22:15:20 +0000165# CHECK: ***
166
167# CHECK: FAIL: shtest-shell :: error-2.txt
168# CHECK: *** TEST 'shtest-shell :: error-2.txt' FAILED ***
169# CHECK: Unsupported redirect:
170# CHECK: ***
171
Ying Yicfb08e92017-12-01 09:54:27 +0000172# CHECK: FAIL: shtest-shell :: mkdir-error-0.txt
173# CHECK: *** TEST 'shtest-shell :: mkdir-error-0.txt' FAILED ***
174# CHECK: $ "mkdir" "-p" "temp"
175# CHECK: # command stderr:
176# CHECK: Unsupported: 'mkdir' cannot be part of a pipeline
177# CHECK: error: command failed with exit status: 127
178# CHECK: ***
179
180# CHECK: FAIL: shtest-shell :: mkdir-error-1.txt
181# CHECK: *** TEST 'shtest-shell :: mkdir-error-1.txt' FAILED ***
182# CHECK: $ "mkdir" "-p" "-m" "777" "temp"
183# CHECK: # command stderr:
184# CHECK: Unsupported: 'mkdir': option -m not recognized
185# CHECK: error: command failed with exit status: 127
186# CHECK: ***
187
188# CHECK: FAIL: shtest-shell :: mkdir-error-2.txt
189# CHECK: *** TEST 'shtest-shell :: mkdir-error-2.txt' FAILED ***
190# CHECK: $ "mkdir" "-p"
191# CHECK: # command stderr:
192# CHECK: Error: 'mkdir' is missing an operand
193# CHECK: error: command failed with exit status: 127
194# CHECK: ***
195
Daniel Dunbar38d37982013-01-31 22:15:20 +0000196# CHECK: PASS: shtest-shell :: redirects.txt
Ying Yicfb08e92017-12-01 09:54:27 +0000197
198# CHECK: FAIL: shtest-shell :: rm-error-0.txt
199# CHECK: *** TEST 'shtest-shell :: rm-error-0.txt' FAILED ***
200# CHECK: $ "rm" "-rf" "temp"
201# CHECK: # command stderr:
202# CHECK: Unsupported: 'rm' cannot be part of a pipeline
203# CHECK: error: command failed with exit status: 127
204# CHECK: ***
205
206# CHECK: FAIL: shtest-shell :: rm-error-1.txt
207# CHECK: *** TEST 'shtest-shell :: rm-error-1.txt' FAILED ***
208# CHECK: $ "rm" "-f" "-v" "temp"
209# CHECK: # command stderr:
210# CHECK: Unsupported: 'rm': option -v not recognized
211# CHECK: error: command failed with exit status: 127
212# CHECK: ***
213
214# CHECK: FAIL: shtest-shell :: rm-error-2.txt
215# CHECK: *** TEST 'shtest-shell :: rm-error-2.txt' FAILED ***
216# CHECK: $ "rm" "-r" "hello"
217# CHECK: # command stderr:
218# CHECK: Error: 'rm' command failed
219# CHECK: error: command failed with exit status: 1
220# CHECK: ***
221
222# CHECK: FAIL: shtest-shell :: rm-error-3.txt
223# CHECK: *** TEST 'shtest-shell :: rm-error-3.txt' FAILED ***
224# CHECK: Exit Code: 1
225# CHECK: ***
226
Serge Guelton54be9092019-02-28 19:16:17 +0000227# CHECK: PASS: shtest-shell :: rm-unicode-0.txt
Daniel Dunbar38d37982013-01-31 22:15:20 +0000228# CHECK: PASS: shtest-shell :: sequencing-0.txt
229# CHECK: XFAIL: shtest-shell :: sequencing-1.txt
Ying Yicfb08e92017-12-01 09:54:27 +0000230# CHECK: PASS: shtest-shell :: valid-shell.txt
Joel E. Denny31b37392018-05-31 00:55:32 +0000231# CHECK: Failing Tests (27)