196263Sobrien# Copyright (c) 2007 The NetBSD Foundation, Inc.
296263Sobrien# All rights reserved.
3169689Skan#
4169689Skan# Redistribution and use in source and binary forms, with or without
5169689Skan# modification, are permitted provided that the following conditions
696263Sobrien# are met:
796263Sobrien# 1. Redistributions of source code must retain the above copyright
896263Sobrien#    notice, this list of conditions and the following disclaimer.
996263Sobrien# 2. Redistributions in binary form must reproduce the above copyright
1096263Sobrien#    notice, this list of conditions and the following disclaimer in the
1196263Sobrien#    documentation and/or other materials provided with the distribution.
1296263Sobrien#
1396263Sobrien# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
1496263Sobrien# CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
1596263Sobrien# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
1696263Sobrien# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1796263Sobrien# IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
1896263Sobrien# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1996263Sobrien# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
2096263Sobrien# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2196263Sobrien# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
22169689Skan# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
23169689Skan# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
2496263Sobrien# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2596263Sobrien
2696263Sobrienatf_test_case vflag
2796263Sobrienvflag_head()
2896263Sobrien{
2996263Sobrien    atf_set "descr" "Tests that the -v flag works correctly to set" \
3096263Sobrien                    "configuration variables"
3196263Sobrien}
3296263Sobrienvflag_body()
3396263Sobrien{
3496263Sobrien    for h in $(get_helpers); do
3596263Sobrien        atf_check -s eq:0 -o ignore -e ignore ${h} -s $(atf_get_srcdir) \
36117395Skan            -r resfile config_unset
3796263Sobrien        atf_check -s eq:0 -o ignore -e empty grep 'passed' resfile
3896263Sobrien
3996263Sobrien        atf_check -s eq:0 -o ignore -e ignore ${h} -s $(atf_get_srcdir) \
40117395Skan            -r resfile -v 'test=' config_empty
41117395Skan        atf_check -s eq:0 -o ignore -e empty grep 'passed' resfile
4296263Sobrien
4396263Sobrien        atf_check -s eq:0 -o ignore -e ignore ${h} -s $(atf_get_srcdir) \
4496263Sobrien            -r resfile -v 'test=foo' config_value
4596263Sobrien        atf_check -s eq:0 -o ignore -e empty grep 'passed' resfile
4696263Sobrien
4796263Sobrien        atf_check -s eq:0 -o ignore -e ignore -x ${h} -s $(atf_get_srcdir) \
4896263Sobrien            -r resfile -v \'test=foo bar\' config_multi_value
4996263Sobrien        atf_check -s eq:0 -o ignore -e empty grep 'passed' resfile
5096263Sobrien    done
5196263Sobrien}
52117395Skan
5396263Sobrienatf_init_test_cases()
5496263Sobrien{
5596263Sobrien    atf_add_test_case vflag
56117395Skan}
5796263Sobrien
58117395Skan# vim: syntax=sh:expandtab:shiftwidth=4:softtabstop=4
59146895Skan