aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/lit/tests/shtest-not.py
blob: b42769ffd938301f5d3552c80a244112f803b8d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# Check the not command

# RUN: not %{lit} -a -v %{inputs}/shtest-not \
# RUN: | FileCheck -match-full-lines %s
#
# END.

# Make sure not and env commands are included in printed commands.

# CHECK: -- Testing: 17 tests{{.*}}

# CHECK: FAIL: shtest-not :: exclamation-args-nested-none.txt {{.*}}
# CHECK: ! ! !
# CHECK: # executed command: ! ! !
# CHECK: # | Error: '!' requires a subcommand
# CHECK: # error: command failed with exit status: {{.*}}

# CHECK: FAIL: shtest-not :: exclamation-args-none.txt {{.*}}
# CHECK: !
# CHECK: # executed command: !
# CHECK: # | Error: '!' requires a subcommand
# CHECK: # error: command failed with exit status: {{.*}}

# CHECK: FAIL: shtest-not :: exclamation-calls-external.txt {{.*}}

# CHECK: ! [[PYTHON:.*]] fail.py
# CHECK: # executed command: ! [[PYTHON_BARE:.*]] fail.py
# CHECK: ! ! [[PYTHON]] pass.py
# CHECK: # executed command: ! ! [[PYTHON_BARE]] pass.py
# CHECK: ! ! ! [[PYTHON]] fail.py
# CHECK: # executed command: ! ! ! [[PYTHON_BARE]] fail.py
# CHECK: ! ! ! ! [[PYTHON]] pass.py
# CHECK: # executed command: ! ! ! ! [[PYTHON_BARE]] pass.py

# CHECK: ! [[PYTHON]] pass.py
# CHECK: # executed command: ! [[PYTHON_BARE]] pass.py
# CHECK: # error: command failed with exit status: {{.*}}

# CHECK: FAIL: shtest-not :: not-args-last-is-crash.txt {{.*}}
# CHECK: not --crash
# CHECK: # executed command: not --crash
# CHECK: # | Error: 'not' requires a subcommand
# CHECK: # error: command failed with exit status: {{.*}}

# CHECK: FAIL: shtest-not :: not-args-nested-none.txt {{.*}}
# CHECK: not not not
# CHECK: # executed command: not not not
# CHECK: # | Error: 'not' requires a subcommand
# CHECK: # error: command failed with exit status: {{.*}}

# CHECK: FAIL: shtest-not :: not-args-none.txt {{.*}}
# CHECK: not
# CHECK: # executed command: not
# CHECK: # | Error: 'not' requires a subcommand
# CHECK: # error: command failed with exit status: {{.*}}

# CHECK: FAIL: shtest-not :: not-calls-cd.txt {{.*}}
# CHECK: not not cd foobar
# CHECK: # executed command: not not cd foobar
# CHECK: not --crash cd foobar
# CHECK: # executed command: not --crash cd foobar
# CHECK: # | Error: 'not --crash' cannot call 'cd'
# CHECK: # error: command failed with exit status: {{.*}}

# CHECK: FAIL: shtest-not :: not-calls-colon.txt {{.*}}
# CHECK: not not : foobar
# CHECK: # executed command: not not : foobar
# CHECK: not --crash :
# CHECK: # executed command: not --crash :
# CHECK: # | Error: 'not --crash' cannot call ':'
# CHECK: # error: command failed with exit status: {{.*}}

# CHECK: FAIL: shtest-not :: not-calls-diff-with-crash.txt {{.*}}
# CHECK: not --crash diff -u {{.*}}
# CHECK: # executed command: not --crash diff -u {{.*}}
# CHECK-NOT: # executed command: {{.*}}
# CHECK-NOT: {{[Ee]rror}}
# CHECK: # error: command failed with exit status: {{.*}}
# CHECK-NOT: # executed command: {{.*}}
# CHECK-NOT: {{[Ee]rror}}

# CHECK: FAIL: shtest-not :: not-calls-diff.txt {{.*}}
# CHECK: not diff {{.*}}
# CHECK: # executed command: not diff {{.*}}
# CHECK: not not not diff {{.*}}
# CHECK: # executed command: not not not diff {{.*}}
# CHECK: not not not not not diff {{.*}}
# CHECK: # executed command: not not not not not diff {{.*}}
# CHECK: diff {{.*}}
# CHECK: # executed command: diff {{.*}}
# CHECK: not not diff {{.*}}
# CHECK: # executed command: not not diff {{.*}}
# CHECK: not not not not diff {{.*}}
# CHECK: # executed command: not not not not diff {{.*}}
# CHECK: not diff {{.*}}
# CHECK: # executed command: not diff {{.*}}
# CHECK-NOT: # executed command: {{.*}}

# CHECK: FAIL: shtest-not :: not-calls-echo.txt {{.*}}
# CHECK: not not echo hello world
# CHECK: # executed command: not not echo hello world
# CHECK: not --crash echo hello world
# CHECK: # executed command: not --crash echo hello world
# CHECK: # | Error: 'not --crash' cannot call 'echo'
# CHECK: # error: command failed with exit status: {{.*}}

# CHECK: FAIL: shtest-not :: not-calls-env-builtin.txt {{.*}}
# CHECK: not --crash env -u FOO BAR=3 rm {{.*}}.no-such-file
# CHECK: # executed command: not --crash env -u FOO BAR=3 rm {{.+}}.no-such-file{{.*}}
# CHECK: # | Error: 'env' cannot call 'rm'
# CHECK: # error: command failed with exit status: {{.*}}

# CHECK: FAIL: shtest-not :: not-calls-export.txt {{.*}}
# CHECK: not not export FOO=1
# CHECK: # executed command: not not export FOO=1
# CHECK: not --crash export BAZ=3
# CHECK: # executed command: not --crash export BAZ=3
# CHECK: # | Error: 'not --crash' cannot call 'export'
# CHECK: # error: command failed with exit status: {{.*}}


# CHECK: PASS: shtest-not :: not-calls-external.txt {{.*}}

# CHECK: not [[PYTHON]] fail.py
# CHECK: # executed command: not [[PYTHON_BARE]] fail.py
# CHECK: not not [[PYTHON]] pass.py
# CHECK: # executed command: not not [[PYTHON_BARE]] pass.py
# CHECK: not not not [[PYTHON]] fail.py
# CHECK: # executed command: not not not [[PYTHON_BARE]] fail.py
# CHECK: not not not not [[PYTHON]] pass.py
# CHECK: # executed command: not not not not [[PYTHON_BARE]] pass.py

# CHECK: not not --crash [[PYTHON]] pass.py
# CHECK: # executed command: not not --crash [[PYTHON_BARE]] pass.py
# CHECK: not not --crash [[PYTHON]] fail.py
# CHECK: # executed command: not not --crash [[PYTHON_BARE]] fail.py
# CHECK: not not --crash not [[PYTHON]] pass.py
# CHECK: # executed command: not not --crash not [[PYTHON_BARE]] pass.py
# CHECK: not not --crash not [[PYTHON]] fail.py
# CHECK: # executed command: not not --crash not [[PYTHON_BARE]] fail.py

# CHECK: env not [[PYTHON]] fail.py | {{.*}}
# CHECK: # executed command: env not [[PYTHON_BARE]] fail.py
# CHECK: not env [[PYTHON]] fail.py | {{.*}}
# CHECK: # executed command: not env [[PYTHON_BARE]] fail.py
# CHECK: env FOO=1 not [[PYTHON]] fail.py | {{.*}}
# CHECK: # executed command: env FOO=1 not [[PYTHON_BARE]] fail.py
# CHECK: not env FOO=1 BAR=1 [[PYTHON]] fail.py | {{.*}}
# CHECK: # executed command: not env FOO=1 BAR=1 [[PYTHON_BARE]] fail.py
# CHECK: env FOO=1 BAR=1 not env -u FOO BAR=2 [[PYTHON]] fail.py | {{.*}}
# CHECK: # executed command: env FOO=1 BAR=1 not env -u FOO BAR=2 [[PYTHON_BARE]] fail.py
# CHECK: not env FOO=1 BAR=1 not env -u FOO -u BAR [[PYTHON]] pass.py | {{.*}}
# CHECK: # executed command: not env FOO=1 BAR=1 not env -u FOO -u BAR [[PYTHON_BARE]] pass.py
# CHECK: not not env FOO=1 env FOO=2 BAR=1 [[PYTHON]] pass.py | {{.*}}
# CHECK: # executed command: not not env FOO=1 env FOO=2 BAR=1 [[PYTHON_BARE]] pass.py
# CHECK: env FOO=1 -u BAR env -u FOO BAR=1 not not [[PYTHON]] pass.py | {{.*}}
# CHECK: # executed command: env FOO=1 -u BAR env -u FOO BAR=1 not not [[PYTHON_BARE]] pass.py

# CHECK: not env FOO=1 BAR=1 env FOO=2 BAR=2 not --crash [[PYTHON]] pass.py | {{.*}}
# CHECK: # executed command: not env FOO=1 BAR=1 env FOO=2 BAR=2 not --crash [[PYTHON_BARE]] pass.py
# CHECK: not env FOO=1 BAR=1 not --crash not [[PYTHON]] pass.py | {{.*}}
# CHECK: # executed command: not env FOO=1 BAR=1 not --crash not [[PYTHON_BARE]] pass.py
# CHECK: not not --crash env -u BAR not env -u FOO BAR=1 [[PYTHON]] pass.py | {{.*}}
# CHECK: # executed command: not not --crash env -u BAR not env -u FOO BAR=1 [[PYTHON_BARE]] pass.py


# CHECK: FAIL: shtest-not :: not-calls-fail2.txt {{.*}}
# CHECK-NEXT: {{.*}} TEST 'shtest-not :: not-calls-fail2.txt' FAILED {{.*}}
# CHECK-NEXT: Exit Code: 1

# CHECK: FAIL: shtest-not :: not-calls-mkdir.txt {{.*}}
# CHECK: not mkdir {{.*}}
# CHECK: # executed command: not mkdir {{.*}}
# CHECK: not --crash mkdir foobar
# CHECK: # executed command: not --crash mkdir foobar
# CHECK: # | Error: 'not --crash' cannot call 'mkdir'
# CHECK: # error: command failed with exit status: {{.*}}

# CHECK: FAIL: shtest-not :: not-calls-rm.txt {{.*}}
# CHECK: not rm {{.*}}
# CHECK: # executed command: not rm {{.*}}
# CHECK: not --crash rm foobar
# CHECK: # executed command: not --crash rm foobar
# CHECK: # | Error: 'not --crash' cannot call 'rm'
# CHECK: # error: command failed with exit status: {{.*}}

# CHECK: Total Discovered Tests: 17
# CHECK: Passed:  1 {{\([0-9]*\.[0-9]*%\)}}
# CHECK: Failed: 16 {{\([0-9]*\.[0-9]*%\)}}
# CHECK-NOT: {{.}}