1246853Sdes# 2246853Sdes# Automated Testing Framework (atf) 3246853Sdes# 4246853Sdes# Copyright (c) 2007 The NetBSD Foundation, Inc. 5246853Sdes# All rights reserved. 6246853Sdes# 7246853Sdes# Redistribution and use in source and binary forms, with or without 8246853Sdes# modification, are permitted provided that the following conditions 9246853Sdes# are met: 10246853Sdes# 1. Redistributions of source code must retain the above copyright 11246853Sdes# notice, this list of conditions and the following disclaimer. 12246853Sdes# 2. Redistributions in binary form must reproduce the above copyright 13246853Sdes# notice, this list of conditions and the following disclaimer in the 14246853Sdes# documentation and/or other materials provided with the distribution. 15246853Sdes# 16246853Sdes# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND 17246853Sdes# CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, 18246853Sdes# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19246853Sdes# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20246853Sdes# IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY 21246853Sdes# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22246853Sdes# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 23246853Sdes# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24246853Sdes# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 25246853Sdes# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 26246853Sdes# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 27246853Sdes# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28246853Sdes# 29246853Sdes 30246853Sdesatf_test_case default_status 31246853Sdesdefault_status_head() 32246853Sdes{ 33246853Sdes atf_set "descr" "Verifies that test cases get the correct default" \ 34246853Sdes "status if they did not provide any" 35246853Sdes} 36246853Sdesdefault_status_body() 37246854Sdes{ 38246854Sdes h="$(atf_get_srcdir)/misc_helpers -s $(atf_get_srcdir)" 39246854Sdes atf_check -s eq:0 -o ignore -e ignore ${h} tc_pass_true 40246854Sdes atf_check -s eq:1 -o ignore -e ignore ${h} tc_pass_false 41246854Sdes atf_check -s eq:1 -o match:'failed:.*body.*non-ok exit code' -e ignore \ 42246854Sdes ${h} tc_pass_return_error 43246853Sdes atf_check -s eq:1 -o ignore -e match:'An error' ${h} tc_fail 44246853Sdes} 45246853Sdes 46246853Sdesatf_test_case missing_body 47246853Sdesmissing_body_head() 48246853Sdes{ 49246853Sdes atf_set "descr" "Verifies that test cases without a body are reported" \ 50246853Sdes "as failed" 51246853Sdes} 52246853Sdesmissing_body_body() 53246853Sdes{ 54246853Sdes h="$(atf_get_srcdir)/misc_helpers -s $(atf_get_srcdir)" 55246853Sdes atf_check -s eq:1 -o ignore -e ignore ${h} tc_missing_body 56246853Sdes} 57246853Sdes 58246853Sdesatf_init_test_cases() 59246853Sdes{ 60246853Sdes atf_add_test_case default_status 61246853Sdes atf_add_test_case missing_body 62246853Sdes} 63246853Sdes 64246853Sdes# vim: syntax=sh:expandtab:shiftwidth=4:softtabstop=4 65246853Sdes