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
|
#! /usr/bin/atf-sh
atf_test_case atf_check
atf_check_head() {
atf_set "descr" "Test atf_check in atf-sh works"
}
atf_check_body() {
# Check for silent output
atf_check -s exit:0 -o empty -e empty true
# Check for silent output and failure
atf_check -s exit:1 -o empty -e empty false
# Check for known stdout and silent stderr
echo foo >expout
atf_check -s exit:0 -o file:expout -e empty echo foo
# Generate a file for later inspection
atf_check -s exit:0 -o save:stdout -e empty ls
# Or just do the match along the way
atf_check -s exit:0 -o match:"^stdout$" -e empty ls
}
atf_init_test_cases() {
atf_add_test_case atf_check
}
# vim: syntax=sh:expandtab:shiftwidth=4:softtabstop=4
|