Daniel Dunbar | 38d3798 | 2013-01-31 22:15:20 +0000 | [diff] [blame] | 1 | # Check the internal shell handling component of the ShTest format. |
| 2 | # |
| 3 | # RUN: not %{lit} -j 1 -v %{inputs}/shtest-shell > %t.out |
Reid Kleckner | 125c74b | 2017-07-28 16:24:18 +0000 | [diff] [blame] | 4 | # FIXME: Temporarily dump test output so we can debug failing tests on |
| 5 | # buildbots. |
| 6 | # RUN: cat %t.out |
Daniel Dunbar | 1934108 | 2016-06-07 16:13:40 +0000 | [diff] [blame] | 7 | # RUN: FileCheck --input-file %t.out %s |
Daniel Dunbar | 38d3798 | 2013-01-31 22:15:20 +0000 | [diff] [blame] | 8 | # |
| 9 | # END. |
| 10 | |
| 11 | # CHECK: -- Testing: |
| 12 | |
Reid Kleckner | 8252892 | 2018-03-26 18:05:12 +0000 | [diff] [blame] | 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 |
| 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 Yi | cfb08e9 | 2017-12-01 09:54:27 +0000 | [diff] [blame] | 28 | |
Joel E. Denny | 31b3739 | 2018-05-31 00:55:32 +0000 | [diff] [blame] | 29 | # 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 Yi | cfb08e9 | 2017-12-01 09:54:27 +0000 | [diff] [blame] | 37 | # 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 Moroz | 975eaca | 2018-01-09 18:23:34 +0000 | [diff] [blame] | 97 | # CHECK: FAIL: shtest-shell :: diff-r-error-0.txt |
| 98 | # CHECK: *** TEST 'shtest-shell :: diff-r-error-0.txt' FAILED *** |
Dmitri Gribenko | 60e52f5 | 2019-02-28 10:58:13 +0000 | [diff] [blame] | 99 | # CHECK: $ "diff" "-r" |
Max Moroz | 975eaca | 2018-01-09 18:23:34 +0000 | [diff] [blame] | 100 | # 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 Gribenko | 60e52f5 | 2019-02-28 10:58:13 +0000 | [diff] [blame] | 107 | # CHECK: $ "diff" "-r" |
Max Moroz | 975eaca | 2018-01-09 18:23:34 +0000 | [diff] [blame] | 108 | # 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 Gribenko | 60e52f5 | 2019-02-28 10:58:13 +0000 | [diff] [blame] | 117 | # CHECK: $ "diff" "-r" |
Max Moroz | 975eaca | 2018-01-09 18:23:34 +0000 | [diff] [blame] | 118 | # 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 Gribenko | 60e52f5 | 2019-02-28 10:58:13 +0000 | [diff] [blame] | 124 | # CHECK: $ "diff" "-r" |
Max Moroz | 975eaca | 2018-01-09 18:23:34 +0000 | [diff] [blame] | 125 | # 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 Gribenko | 60e52f5 | 2019-02-28 10:58:13 +0000 | [diff] [blame] | 131 | # CHECK: $ "diff" "-r" |
Max Moroz | 975eaca | 2018-01-09 18:23:34 +0000 | [diff] [blame] | 132 | # 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 Gribenko | 60e52f5 | 2019-02-28 10:58:13 +0000 | [diff] [blame] | 138 | # CHECK: $ "diff" "-r" |
Max Moroz | 975eaca | 2018-01-09 18:23:34 +0000 | [diff] [blame] | 139 | # 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 Gribenko | 60e52f5 | 2019-02-28 10:58:13 +0000 | [diff] [blame] | 145 | # CHECK: $ "diff" "-r" |
Max Moroz | 975eaca | 2018-01-09 18:23:34 +0000 | [diff] [blame] | 146 | # 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 Dunbar | 38d3798 | 2013-01-31 22:15:20 +0000 | [diff] [blame] | 152 | # CHECK: FAIL: shtest-shell :: error-0.txt |
| 153 | # CHECK: *** TEST 'shtest-shell :: error-0.txt' FAILED *** |
Daniel Dunbar | 591838d | 2016-06-02 23:49:42 +0000 | [diff] [blame] | 154 | # CHECK: $ "not-a-real-command" |
| 155 | # CHECK: # command stderr: |
Daniel Dunbar | 38d3798 | 2013-01-31 22:15:20 +0000 | [diff] [blame] | 156 | # CHECK: 'not-a-real-command': command not found |
Daniel Dunbar | 591838d | 2016-06-02 23:49:42 +0000 | [diff] [blame] | 157 | # CHECK: error: command failed with exit status: 127 |
Daniel Dunbar | 38d3798 | 2013-01-31 22:15:20 +0000 | [diff] [blame] | 158 | # 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. Denny | fc01dd2 | 2018-05-31 03:40:37 +0000 | [diff] [blame] | 164 | # CHECK: shell parser error on: ': \'RUN: at line 3\'; echo "missing quote' |
Daniel Dunbar | 38d3798 | 2013-01-31 22:15:20 +0000 | [diff] [blame] | 165 | # 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 Yi | cfb08e9 | 2017-12-01 09:54:27 +0000 | [diff] [blame] | 172 | # 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 Dunbar | 38d3798 | 2013-01-31 22:15:20 +0000 | [diff] [blame] | 196 | # CHECK: PASS: shtest-shell :: redirects.txt |
Ying Yi | cfb08e9 | 2017-12-01 09:54:27 +0000 | [diff] [blame] | 197 | |
| 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 Guelton | 54be909 | 2019-02-28 19:16:17 +0000 | [diff] [blame^] | 227 | # CHECK: PASS: shtest-shell :: rm-unicode-0.txt |
Daniel Dunbar | 38d3798 | 2013-01-31 22:15:20 +0000 | [diff] [blame] | 228 | # CHECK: PASS: shtest-shell :: sequencing-0.txt |
| 229 | # CHECK: XFAIL: shtest-shell :: sequencing-1.txt |
Ying Yi | cfb08e9 | 2017-12-01 09:54:27 +0000 | [diff] [blame] | 230 | # CHECK: PASS: shtest-shell :: valid-shell.txt |
Joel E. Denny | 31b3739 | 2018-05-31 00:55:32 +0000 | [diff] [blame] | 231 | # CHECK: Failing Tests (27) |