# Copyright (c) 2008 The NetBSD Foundation, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
#
# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
# CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# The Atf_Check and Atf-Shell variables are set by atf-sh.
{
echo "Running [atf-check $*] against [${cmd}]"
#! ${Atf_Shell}
${cmd}
EOF
atf_fail "atf-check failed"
fi
}
{
echo "Running [atf-check $*] against [${cmd}]"
#! ${Atf_Shell}
${cmd}
EOF
atf_fail "atf-check succeeded but should fail"
fi
}
{
atf_set "descr" "Tests for the -s option using the 'eq' and 'ne' qualifiers"
}
{
}
{
atf_set "descr" "Tests for the -s option using the 'exit' qualifier"
}
{
atf_fail "Signal detected as clean exit"
fi
}
{
atf_set "descr" "Tests for the -s option using the 'ignore' qualifier"
}
{
atf_fail "Signal not ignored"
fi
}
{
atf_set "descr" "Tests for the -s option using the 'signal' qualifier"
}
{
"detected"
atf_fail "not-signal:kill matched kill -9"
atf_fail "not-signal:kill did not match kill -1"
}
{
atf_set "descr" "Tests for the -x option"
}
{
atf_fail "Shell command succeeded without -x"
atf_fail "Cannot run command with -x"
atf_fail "Using -x does not respect all provided arguments"
}
{
atf_set "descr" "Tests for the -o option using the 'empty' argument"
}
{
}
{
atf_set "descr" "Tests for the -o option using the 'ignore' argument"
}
{
}
{
atf_set "descr" "Tests for the -o option using the 'file:' argument"
}
{
}
{
atf_set "descr" "Tests for the -o option using the 'inline:' argument"
}
{
}
{
atf_set "descr" "Tests for the -o option using the 'match:' argument"
}
{
}
{
atf_set "descr" "Tests for the -o option using the 'save:' argument"
}
{
}
{
atf_set "descr" "Tests for multiple occurrences of the -o option"
}
{
}
{
atf_set "descr" "Tests for negated occurrences of the -o option"
}
{
}
{
atf_set "descr" "Tests for the -e option using the 'empty' argument"
}
{
}
{
atf_set "descr" "Tests for the -e option using the 'ignore' argument"
}
{
}
{
atf_set "descr" "Tests for the -e option using the 'file:' argument"
}
{
}
{
atf_set "descr" "Tests for the -e option using the 'inline:' argument"
}
{
}
{
atf_set "descr" "Tests for the -e option using the 'save:' argument"
}
{
}
{
atf_set "descr" "Tests for the -e option using the 'match:' argument"
}
{
}
{
atf_set "descr" "Tests for multiple occurrences of the -e option"
}
{
}
{
atf_set "descr" "Tests for negated occurrences of the -e option"
}
{
}
{
atf_set "descr" "Tests that stdin is preserved"
}
{
atf_fail "atf-check does not seem to respect stdin"
}
{
"too restrictive"
}
{
umask 0222
atf_fail "atf-check returned 0 but it should have failed"
"current umask"
}
{
}
# vim: syntax=sh:expandtab:shiftwidth=4:softtabstop=4