Lines Matching +full:foo +full:- +full:bar

26 # The Atf_Check and Atf-Shell variables are set by atf-sh.
32 echo "Running [atf-check $*] against [${cmd}]"
42 atf_fail "atf-check failed"
50 echo "Running [atf-check $*] against [${cmd}]"
60 atf_fail "atf-check succeeded but should fail"
67 atf_set "descr" "Tests for the -s option using the 'eq' and 'ne' qualifiers"
71 h_pass "true" -s eq:0
72 h_pass "false" -s ne:0
73 h_pass "exit 255" -s eq:255
74 h_pass "exit 0" -s ne:255
76 h_fail "exit 256" -s eq:256
77 h_fail "exit -1" -s eq:-1
78 h_fail "true" -s ne:256
79 h_fail "true" -s ne:-1
85 atf_set "descr" "Tests for the -s option using the 'exit' qualifier"
89 h_pass 'true' -s exit:0
90 h_pass 'false' -s not-exit:0
91 h_pass 'exit 255' -s exit:255
92 h_pass 'exit 0' -s not-exit:255
94 h_fail 'exit 256' -s exit:256
95 h_fail 'exit -1' -s exit:-1
96 h_fail 'true' -s not-exit:256
97 h_fail 'true' -s not-exit:-1
99 h_pass 'true' -s exit
100 h_pass 'false' -s exit
101 if ${Atf_Check} -s exit -x 'kill $$'; then
109 atf_set "descr" "Tests for the -s option using the 'ignore' qualifier"
113 h_pass 'true' -s ignore
114 h_pass 'false' -s ignore
115 if ${Atf_Check} -s ignored -x 'kill $$'; then
123 atf_set "descr" "Tests for the -s option using the 'signal' qualifier"
127 ${Atf_Check} -s signal:hup -x 'kill -1 $$' || atf_fail "Signal not detected"
128 ${Atf_Check} -s signal:sighup -x 'kill -1 $$' || atf_fail "Signal not" \
130 ${Atf_Check} -s signal:1 -x 'kill -1 $$' || atf_fail "Signal not detected"
131 ${Atf_Check} -s signal -x 'kill -1 $$' || atf_fail "Signal not detected"
133 ${Atf_Check} -s not-signal:kill -x 'kill -9 $$' && \
134 atf_fail "not-signal:kill matched kill -9"
135 ${Atf_Check} -s not-signal:kill -x 'kill -1 $$' || \
136 atf_fail "not-signal:kill did not match kill -1"
138 h_fail 'true' -s signal
139 h_fail 'false' -s signal
145 atf_set "descr" "Tests for the -x option"
149 ${Atf_Check} -s ne:0 -o ignore -e ignore "echo foo 2>&1" || \
150 atf_fail "Shell command succeeded without -x"
152 ${Atf_Check} -e inline:"foo\n" -x "echo foo 1>&2" || \
153 atf_fail "Cannot run command with -x"
155 ${Atf_Check} -o inline:"foo\n" -x echo foo || \
156 atf_fail "Using -x does not respect all provided arguments"
162 atf_set "descr" "Tests for the -o option using the 'empty' argument"
166 h_pass "true" -o empty
167 h_fail "echo foo" -o empty
173 atf_set "descr" "Tests for the -o option using the 'ignore' argument"
177 h_pass "true" -o ignore
178 h_pass "echo foo" -o ignore
184 atf_set "descr" "Tests for the -o option using the 'file:' argument"
189 h_pass "true" -o file:empty
191 echo foo >text
192 h_pass "echo foo" -o file:text
193 h_fail "echo bar" -o file:text
196 h_pass "cat bin" -o file:bin
202 atf_set "descr" "Tests for the -o option using the 'inline:' argument"
206 h_pass "true" -o inline:
207 h_pass "echo foo bar" -o inline:"foo bar\n"
208 h_pass "printf 'foo bar'" -o inline:"foo bar"
209 h_pass "printf '\t\n\t\n'" -o inline:"\t\n\t\n"
210 h_pass "printf '\a\b\033\f\n\r\t\v'" -o inline:"\a\b\e\f\n\r\t\v"
211 h_pass "printf '\011\022\033\012'" -o inline:"\011\022\033\012"
213 h_fail "echo foo bar" -o inline:"foo bar"
214 h_fail "echo -n foo bar" -o inline:"foo bar\n"
220 atf_set "descr" "Tests for the -o option using the 'match:' argument"
224 h_pass "printf no-newline" -o "match:^no-newline"
225 h_pass "echo line1; echo foo bar" -o "match:^foo"
226 h_pass "echo foo bar" -o "match:o b"
227 h_fail "echo foo bar" -o "match:baz"
228 h_fail "echo foo bar" -o "match:^bar"
234 atf_set "descr" "Tests for the -o option using the 'save:' argument"
238 h_pass "echo foo" -o save:out
239 echo foo >exp
240 cmp -s out exp || atf_fail "Saved output does not match expected results"
246 atf_set "descr" "Tests for multiple occurrences of the -o option"
250 h_pass "echo foo bar" -o match:foo -o match:bar
251 h_pass "echo foo; echo bar" -o match:foo -o match:bar
252 h_fail "echo foo baz" -o match:bar -o match:foo
253 h_fail "echo foo; echo baz" -o match:bar -o match:foo
259 atf_set "descr" "Tests for negated occurrences of the -o option"
263 h_fail "echo foo" -o empty
264 h_pass "echo foo" -o not-empty
266 h_pass "echo foo bar" -o match:foo
267 h_fail "echo foo bar" -o not-match:foo
273 atf_set "descr" "Tests for the -e option using the 'empty' argument"
277 h_pass "true 1>&2" -e empty
278 h_fail "echo foo 1>&2" -e empty
284 atf_set "descr" "Tests for the -e option using the 'ignore' argument"
288 h_pass "true 1>&2" -e ignore
289 h_pass "echo foo 1>&2" -e ignore
295 atf_set "descr" "Tests for the -e option using the 'file:' argument"
300 h_pass "true 1>&2" -e file:empty
302 echo foo >text
303 h_pass "echo foo 1>&2" -e file:text
304 h_fail "echo bar 1>&2" -e file:text
307 h_pass "cat bin 1>&2" -e file:bin
313 atf_set "descr" "Tests for the -e option using the 'inline:' argument"
317 h_pass "true 1>&2" -e inline:
318 h_pass "echo foo bar 1>&2" -e inline:"foo bar\n"
319 h_pass "printf 'foo bar' 1>&2" -e inline:"foo bar"
320 h_pass "printf '\t\n\t\n' 1>&2" -e inline:"\t\n\t\n"
321 h_pass "printf '\a\b\033\f\n\r\t\v' 1>&2" -e inline:"\a\b\e\f\n\r\t\v"
322 h_pass "printf '\011\022\033\012' 1>&2" -e inline:"\011\022\033\012"
324 h_fail "echo foo bar 1>&2" -e inline:"foo bar"
325 h_fail "echo -n foo bar 1>&2" -e inline:"foo bar\n"
331 atf_set "descr" "Tests for the -e option using the 'save:' argument"
335 h_pass "echo foo 1>&2" -e save:out
336 echo foo >exp
337 cmp -s out exp || atf_fail "Saved output does not match expected results"
343 atf_set "descr" "Tests for the -e option using the 'match:' argument"
347 h_pass "printf no-newline 1>&2" -e "match:^no-newline"
348 h_pass "echo line1 1>&2; echo foo bar 1>&2" -e "match:^foo"
349 h_pass "echo foo bar 1>&2" -e "match:o b"
350 h_fail "echo foo bar 1>&2" -e "match:baz"
351 h_fail "echo foo bar 1>&2" -e "match:^bar"
357 atf_set "descr" "Tests for multiple occurrences of the -e option"
361 h_pass "echo foo bar 1>&2" -e match:foo -e match:bar
362 h_pass "echo foo 1>&2; echo bar 1>&2" -e match:foo -e match:bar
363 h_fail "echo foo baz 1>&2" -e match:bar -e match:foo
364 h_fail "echo foo 1>&2; echo baz 1>&2" -e match:bar -e match:foo
370 atf_set "descr" "Tests for negated occurrences of the -e option"
374 h_fail "echo foo 1>&2" -e empty
375 h_pass "echo foo 1>&2" -e not-empty
377 h_pass "echo foo bar 1>&2" -e match:foo
378 h_fail "echo foo bar 1>&2" -e not-match:foo
388 echo "hello" | ${Atf_Check} -o match:"hello" cat || \
389 atf_fail "atf-check does not seem to respect stdin"
395 atf_set "descr" "Tests that atf-check doesn't care about unusual umasks"
402 atf_fail "atf-check failed with umask $mask"