866b001ea5
Initial import of the Automated Testing Framework, version 0.3, a project that provides a framework to easily implement test cases for the NetBSD operating system and some tools to run them and generate reports with the results. Note that this is just the framework (libraries and tools), which is and will be maintained externally. The tests themselves will come later, will be put under the 'tests' hierarchy and will be managed exclusively under the NetBSD CVS tree given that they are tied to the operating system. The work done until version 0.1 was sponsored by the Google Summer of Code 2007 program and mentored by martin@.
87 lines
2.9 KiB
Bash
87 lines
2.9 KiB
Bash
#
|
|
# Automated Testing Framework (atf)
|
|
#
|
|
# Copyright (c) 2007 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
|
|
# documentation and/or other materials provided with the distribution.
|
|
# 3. All advertising materials mentioning features or use of this
|
|
# software must display the following acknowledgement:
|
|
# This product includes software developed by the NetBSD
|
|
# Foundation, Inc. and its contributors.
|
|
# 4. Neither the name of The NetBSD Foundation nor the names of its
|
|
# contributors may be used to endorse or promote products derived
|
|
# from this software without specific prior written permission.
|
|
#
|
|
# 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.
|
|
#
|
|
|
|
#
|
|
# File: atf.init.subr
|
|
#
|
|
# Initialization for a test program. A verbatim copy of this file is
|
|
# stuck at the very beginning of each test program, so it has to be
|
|
# kept as simple as possible to minimize the possible need of rebuilding
|
|
# a huge amount of test programs, which could happen after modifying
|
|
# this file.
|
|
#
|
|
|
|
Prog_Name=${0##*/}
|
|
|
|
#
|
|
# _atf_find_in_path program
|
|
#
|
|
# Looks for a program in the path and prints the full path to it or
|
|
# nothing if it could not be found. It also returns true in case of
|
|
# success.
|
|
#
|
|
_atf_find_in_path()
|
|
{
|
|
_prog="${1}"
|
|
|
|
_oldifs=${IFS}
|
|
IFS=:
|
|
for _dir in ${PATH}
|
|
do
|
|
if [ -x ${_dir}/${_prog} ]; then
|
|
IFS=${_oldifs}
|
|
echo ${_dir}/${_prog}
|
|
return 0
|
|
fi
|
|
done
|
|
IFS=${_oldifs}
|
|
|
|
return 1
|
|
}
|
|
|
|
#
|
|
# Look for atf-config to deduce where the atf.*.subr files are stored
|
|
# in the system.
|
|
#
|
|
Atf_Config=`_atf_find_in_path atf-config`
|
|
if [ -z "${Atf_Config}" ]; then
|
|
echo "${Prog_Name}: ERROR: Cannot locate atf-config in PATH" 1>&2
|
|
exit 128
|
|
fi
|
|
Atf_Pkgdatadir=`${Atf_Config} -t atf_pkgdatadir`
|
|
|
|
# vim: syntax=sh:expandtab:shiftwidth=4:softtabstop=4
|