Home | History | Annotate | Download | only in tests
      1 # Check the internal shell handling component of the ShTest format.
      2 #
      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
      5 # buildbots.
      6 # RUN: cat %t.out
      7 # RUN: FileCheck --input-file %t.out %s
      8 #
      9 # END.
     10 
     11 # CHECK: -- Testing:
     12 
     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: ***
     28 
     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 
     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 
     97 # CHECK: FAIL: shtest-shell :: diff-r-error-0.txt
     98 # CHECK: *** TEST 'shtest-shell :: diff-r-error-0.txt' FAILED ***
     99 # CEHCK: $ "diff" "-r" 
    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 ***
    107 # CEHCK: $ "diff" "-r" 
    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 ***
    117 # CEHCK: $ "diff" "-r" 
    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 ***
    124 # CEHCK: $ "diff" "-r" 
    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 ***
    131 # CEHCK: $ "diff" "-r" 
    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 ***
    138 # CEHCK: $ "diff" "-r" 
    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 ***
    145 # CEHCK: $ "diff" "-r" 
    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 
    152 # CHECK: FAIL: shtest-shell :: error-0.txt
    153 # CHECK: *** TEST 'shtest-shell :: error-0.txt' FAILED ***
    154 # CHECK: $ "not-a-real-command"
    155 # CHECK: # command stderr:
    156 # CHECK: 'not-a-real-command': command not found
    157 # CHECK: error: command failed with exit status: 127
    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 ***
    164 # CHECK: shell parser error on: ': \'RUN: at line 3\'; echo "missing quote'
    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 
    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 
    196 # CHECK: PASS: shtest-shell :: redirects.txt
    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 
    227 # CHECK: PASS: shtest-shell :: sequencing-0.txt
    228 # CHECK: XFAIL: shtest-shell :: sequencing-1.txt
    229 # CHECK: PASS: shtest-shell :: valid-shell.txt
    230 # CHECK: Failing Tests (27)
    231