Import atf-0.21:
Released on October 23rd, 2014. * Restored the atf(7) manual page to serve as a reference to all the other manual pages shipped by ATF. * Added the -s flag to atf-sh to support specifying the shell interpreter to be used. * Removed ATF_WORKDIR. The only remaining consumers have been converted to use the standard TMPDIR environment variable. As a benefit, and because Kyua forces the TMPDIR to live within the test case's work directory, any stale files left behind by ATF will be automatically cleaned up. * Documented the environment variables recognized by each component in the relevant manual pages. This information was lost with the atf-config(1) removal. * Added a new "require.diskspace" metadata property to test cases so that they can specify the minimum amount of disk space required for the test to run. * Renamed the atf-{c,c++,sh}-api(3) manual pages to atf-{c,c++,sh}(3) for discoverability purposes. Symbolic links are provided for the time being to still make the old names visible. * Issue #5: Recommend the (expected, actual) idiom for calls to the test macros in the manual pages. * Issue #7: Stopped catching unhandled exceptions in atf-c++ tests. This propagates the crash to the caller, which in turn allows it to obtain proper debugging information. In particular, Kyua should now be able to extract a stacktrace pinpointing the problem. * Issue #8: Fixed atf-c/macros_test:use test failures spotted by the clang that ships with FreeBSD 11.0-CURRENT. * Issue #12: Improved documentation of atf-sh(3) and atf-check(1) by better explaining how they relate to each other. * Issue #14: Stopped setting 'set -e' in atf-sh. This setting was initially added as a way to enable a "strict" mode in the library and to make test cases fail fast when they run unprotected commands. However, doing so in the library is surprising as the responsibility of enabling 'set -e' should be on the user's code. Also, 'set -e' introduces inconsistent behavior on subshells and users do not expect that. * Issue #15: Fixed atf_utils_{fork,wait} to support nested calls. * Issue #16: Fixed test failures (by removing a long-standing hack) on systems that lack \e support in printf(1). * Issue #19: Removed stale references to atf-config and atf-run.
This commit is contained in:
parent
9b3afb9f3c
commit
94d25974a7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/vendor/atf/dist/; revision=273869 svn path=/vendor/atf/atf-0.21/; revision=273870; tag=vendor/atf/atf-0.21
8
INSTALL
8
INSTALL
@ -153,14 +153,6 @@ script:
|
||||
library. If empty, the configure script will try to find a suitable
|
||||
interpreter for you.
|
||||
|
||||
* ATF_WORKDIR
|
||||
Possible values: empty, an absolute path.
|
||||
Default: /tmp or /var/tmp, depending on availability.
|
||||
|
||||
Specifies the directory that ATF will use to place its temporary files
|
||||
and work directories for test cases. This is just a default and can be
|
||||
overriden at run time.
|
||||
|
||||
The following flags are specific to ATF's 'configure' script:
|
||||
|
||||
* --enable-developer
|
||||
|
39
Makefile.am
39
Makefile.am
@ -1,6 +1,3 @@
|
||||
#
|
||||
# Automated Testing Framework (atf)
|
||||
#
|
||||
# Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
@ -25,7 +22,6 @@
|
||||
# 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.
|
||||
#
|
||||
|
||||
atf_aclocal_DATA =
|
||||
BUILT_SOURCES =
|
||||
@ -68,6 +64,10 @@ EXTRA_DIST += $(doc_DATA) INSTALL README
|
||||
TESTS_ENVIRONMENT = PATH=$(prefix)/bin:$${PATH} \
|
||||
PKG_CONFIG_PATH=$(prefix)/lib/pkgconfig
|
||||
|
||||
# Allow the caller to override the configuration file to passed to our
|
||||
# test runs below.
|
||||
KYUA_TEST_CONFIG_FILE = none
|
||||
|
||||
testsdir = $(exec_prefix)/tests
|
||||
pkgtestsdir = $(testsdir)/$(PACKAGE)
|
||||
|
||||
@ -75,7 +75,8 @@ PHONY_TARGETS += installcheck-kyua
|
||||
if HAVE_KYUA
|
||||
INSTALLCHECK_TARGETS += installcheck-kyua
|
||||
installcheck-kyua:
|
||||
cd $(pkgtestsdir) && $(TESTS_ENVIRONMENT) $(KYUA) test
|
||||
cd $(pkgtestsdir) && $(TESTS_ENVIRONMENT) \
|
||||
$(KYUA) --config='$(KYUA_TEST_CONFIG_FILE)' test
|
||||
endif
|
||||
|
||||
installcheck-local: $(INSTALLCHECK_TARGETS)
|
||||
@ -84,10 +85,14 @@ pkgtests_DATA = Kyuafile
|
||||
EXTRA_DIST += $(pkgtests_DATA)
|
||||
|
||||
BUILD_SH_TP = \
|
||||
echo "Creating $${dst}"; \
|
||||
echo "\#! $(bindir)/atf-sh" >$${dst}; \
|
||||
cat $${src} >>$${dst}; \
|
||||
chmod +x $${dst}
|
||||
test -d "$$(dirname "$${dst}")" || mkdir -p "$$(dirname "$${dst}")"; \
|
||||
echo "\#! $(bindir)/atf-sh" >"$${dst}"; \
|
||||
if [ -n "$${substs}" ]; then \
|
||||
cat $${src} | sed $${substs} >>"$${dst}"; \
|
||||
else \
|
||||
cat $${src} >>"$${dst}"; \
|
||||
fi; \
|
||||
chmod +x "$${dst}"
|
||||
|
||||
#
|
||||
# Custom targets.
|
||||
@ -97,14 +102,14 @@ PHONY_TARGETS += clean-all
|
||||
clean-all:
|
||||
GIT="$(GIT)" $(SH) $(srcdir)/admin/clean-all.sh
|
||||
|
||||
PHONY_TARGETS += release
|
||||
release:
|
||||
$(SH) $(srcdir)/admin/release.sh $(PACKAGE_VERSION) $(DIST_ARCHIVES)
|
||||
|
||||
PHONY_TARGETS += release-test
|
||||
release-test:
|
||||
$(SH) $(srcdir)/admin/release-test.sh $(DIST_ARCHIVES)
|
||||
|
||||
.PHONY: $(PHONY_TARGETS)
|
||||
|
||||
# TODO(jmmv): Remove after atf 0.22.
|
||||
install-data-hook:
|
||||
cd $(DESTDIR)$(man3dir) && \
|
||||
for binding in c c++ sh; do \
|
||||
rm -f "atf-$${binding}-api.3"; \
|
||||
$(LN_S) "atf-$${binding}.3" "atf-$${binding}-api.3"; \
|
||||
done
|
||||
|
||||
# vim: syntax=make:noexpandtab:shiftwidth=8:softtabstop=8
|
||||
|
507
Makefile.in
507
Makefile.in
File diff suppressed because it is too large
Load Diff
56
NEWS
56
NEWS
@ -1,6 +1,62 @@
|
||||
Major changes between releases Automated Testing Framework
|
||||
===========================================================================
|
||||
|
||||
Changes in version 0.21
|
||||
***********************
|
||||
|
||||
Released on October 23rd, 2014.
|
||||
|
||||
* Restored the atf(7) manual page to serve as a reference to all the other
|
||||
manual pages shipped by ATF.
|
||||
|
||||
* Added the -s flag to atf-sh to support specifying the shell interpreter
|
||||
to be used.
|
||||
|
||||
* Removed ATF_WORKDIR. The only remaining consumers have been converted to
|
||||
use the standard TMPDIR environment variable. As a benefit, and because
|
||||
Kyua forces the TMPDIR to live within the test case's work directory,
|
||||
any stale files left behind by ATF will be automatically cleaned up.
|
||||
|
||||
* Documented the environment variables recognized by each component in the
|
||||
relevant manual pages. This information was lost with the atf-config(1)
|
||||
removal.
|
||||
|
||||
* Added a new "require.diskspace" metadata property to test cases so that
|
||||
they can specify the minimum amount of disk space required for the test
|
||||
to run.
|
||||
|
||||
* Renamed the atf-{c,c++,sh}-api(3) manual pages to atf-{c,c++,sh}(3) for
|
||||
discoverability purposes. Symbolic links are provided for the time
|
||||
being to still make the old names visible.
|
||||
|
||||
* Issue #5: Recommend the (expected, actual) idiom for calls to the test
|
||||
macros in the manual pages.
|
||||
|
||||
* Issue #7: Stopped catching unhandled exceptions in atf-c++ tests. This
|
||||
propagates the crash to the caller, which in turn allows it to obtain
|
||||
proper debugging information. In particular, Kyua should now be able to
|
||||
extract a stacktrace pinpointing the problem.
|
||||
|
||||
* Issue #8: Fixed atf-c/macros_test:use test failures spotted by the clang
|
||||
that ships with FreeBSD 11.0-CURRENT.
|
||||
|
||||
* Issue #12: Improved documentation of atf-sh(3) and atf-check(1) by better
|
||||
explaining how they relate to each other.
|
||||
|
||||
* Issue #14: Stopped setting 'set -e' in atf-sh. This setting was
|
||||
initially added as a way to enable a "strict" mode in the library and to
|
||||
make test cases fail fast when they run unprotected commands. However,
|
||||
doing so in the library is surprising as the responsibility of enabling
|
||||
'set -e' should be on the user's code. Also, 'set -e' introduces
|
||||
inconsistent behavior on subshells and users do not expect that.
|
||||
|
||||
* Issue #15: Fixed atf_utils_{fork,wait} to support nested calls.
|
||||
|
||||
* Issue #16: Fixed test failures (by removing a long-standing hack) on
|
||||
systems that lack \e support in printf(1).
|
||||
|
||||
* Issue #19: Removed stale references to atf-config and atf-run.
|
||||
|
||||
|
||||
Changes in version 0.20
|
||||
***********************
|
||||
|
@ -1,6 +1,3 @@
|
||||
#
|
||||
# Automated Testing Framework (atf)
|
||||
#
|
||||
# Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
@ -25,7 +22,6 @@
|
||||
# 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.
|
||||
#
|
||||
|
||||
dist-hook: check-style
|
||||
PHONY_TARGETS += check-style
|
||||
|
@ -1,6 +1,3 @@
|
||||
#
|
||||
# Automated Testing Framework (atf)
|
||||
#
|
||||
# Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
@ -25,7 +22,6 @@
|
||||
# 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.
|
||||
#
|
||||
|
||||
function warn(msg) {
|
||||
print FILENAME "[" FNR "]: " msg > "/dev/stderr"
|
||||
|
@ -1,6 +1,3 @@
|
||||
#
|
||||
# Automated Testing Framework (atf)
|
||||
#
|
||||
# Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
@ -25,7 +22,6 @@
|
||||
# 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.
|
||||
#
|
||||
|
||||
function warn(msg) {
|
||||
print FILENAME "[" FNR "]: " msg > "/dev/stderr"
|
||||
|
@ -1,6 +1,3 @@
|
||||
#
|
||||
# Automated Testing Framework (atf)
|
||||
#
|
||||
# Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
@ -25,7 +22,6 @@
|
||||
# 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.
|
||||
#
|
||||
|
||||
function warn(msg) {
|
||||
print FILENAME "[" FNR "]: " msg > "/dev/stderr"
|
||||
|
@ -1,6 +1,3 @@
|
||||
#
|
||||
# Automated Testing Framework (atf)
|
||||
#
|
||||
# Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
@ -25,7 +22,6 @@
|
||||
# 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.
|
||||
#
|
||||
|
||||
function warn(msg) {
|
||||
print FILENAME "[" FNR "]: " msg > "/dev/stderr"
|
||||
|
@ -1,6 +1,3 @@
|
||||
#
|
||||
# Automated Testing Framework (atf)
|
||||
#
|
||||
# Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
@ -25,7 +22,6 @@
|
||||
# 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.
|
||||
#
|
||||
|
||||
function warn(msg) {
|
||||
print FILENAME "[" FNR "]: " msg > "/dev/stderr"
|
||||
|
@ -1,7 +1,4 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Automated Testing Framework (atf)
|
||||
#
|
||||
# Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
@ -26,7 +23,6 @@
|
||||
# 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.
|
||||
#
|
||||
|
||||
#
|
||||
# A utility to sanity check the coding style of all source files in the
|
||||
@ -100,7 +96,7 @@ find_sources() {
|
||||
\! -path "*autom4te*" -a \
|
||||
-type f -a \
|
||||
\! -name "aclocal.m4" \
|
||||
\! -name "bconfig.h" \
|
||||
\! -name "config.h" \
|
||||
\! -name "defs.h" \
|
||||
\! -name "defs.hpp" \
|
||||
\! -name "libtool.m4" \
|
||||
|
403
admin/config.guess
vendored
403
admin/config.guess
vendored
@ -1,14 +1,12 @@
|
||||
#! /bin/sh
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
|
||||
# Free Software Foundation, Inc.
|
||||
# Copyright 1992-2013 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2009-12-30'
|
||||
timestamp='2013-05-16'
|
||||
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
@ -17,26 +15,22 @@ timestamp='2009-12-30'
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
|
||||
# Originally written by Per Bothner. Please send patches (context
|
||||
# diff format) to <config-patches@gnu.org> and include a ChangeLog
|
||||
# entry.
|
||||
# the same distribution terms that you use for the rest of that
|
||||
# program. This Exception is an additional permission under section 7
|
||||
# of the GNU General Public License, version 3 ("GPLv3").
|
||||
#
|
||||
# This script attempts to guess a canonical system name similar to
|
||||
# config.sub. If it succeeds, it prints the system name on stdout, and
|
||||
# exits with 0. Otherwise, it exits with 1.
|
||||
# Originally written by Per Bothner.
|
||||
#
|
||||
# You can get the latest version of this script from:
|
||||
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
|
||||
#
|
||||
# Please send patches with a ChangeLog entry to config-patches@gnu.org.
|
||||
|
||||
|
||||
me=`echo "$0" | sed -e 's,.*/,,'`
|
||||
|
||||
@ -56,9 +50,7 @@ version="\
|
||||
GNU config.guess ($timestamp)
|
||||
|
||||
Originally written by Per Bothner.
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
|
||||
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
|
||||
Software Foundation, Inc.
|
||||
Copyright 1992-2013 Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
@ -140,12 +132,33 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
|
||||
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
|
||||
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
|
||||
|
||||
case "${UNAME_SYSTEM}" in
|
||||
Linux|GNU|GNU/*)
|
||||
# If the system lacks a compiler, then just pick glibc.
|
||||
# We could probably try harder.
|
||||
LIBC=gnu
|
||||
|
||||
eval $set_cc_for_build
|
||||
cat <<-EOF > $dummy.c
|
||||
#include <features.h>
|
||||
#if defined(__UCLIBC__)
|
||||
LIBC=uclibc
|
||||
#elif defined(__dietlibc__)
|
||||
LIBC=dietlibc
|
||||
#else
|
||||
LIBC=gnu
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
|
||||
;;
|
||||
esac
|
||||
|
||||
# Note: order is significant - the case branches are not exclusive.
|
||||
|
||||
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
*:NetBSD:*:*)
|
||||
# NetBSD (nbsd) targets should (where applicable) match one or
|
||||
# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
|
||||
# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
|
||||
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
|
||||
# switched to ELF, *-*-netbsd* would select the old
|
||||
# object file format. This provides both forward
|
||||
@ -181,7 +194,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
os=netbsd
|
||||
os=netbsd
|
||||
;;
|
||||
esac
|
||||
# The OS release
|
||||
@ -202,6 +215,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
|
||||
echo "${machine}-${os}${release}"
|
||||
exit ;;
|
||||
*:Bitrig:*:*)
|
||||
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
|
||||
echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:OpenBSD:*:*)
|
||||
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
|
||||
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
|
||||
@ -224,7 +241,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
|
||||
;;
|
||||
*5.*)
|
||||
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
|
||||
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
|
||||
;;
|
||||
esac
|
||||
# According to Compaq, /usr/sbin/psrinfo has been available on
|
||||
@ -270,7 +287,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
# A Xn.n version is an unreleased experimental baselevel.
|
||||
# 1.2 uses "1.2" for uname -r.
|
||||
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
||||
exit ;;
|
||||
# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
|
||||
exitcode=$?
|
||||
trap '' 0
|
||||
exit $exitcode ;;
|
||||
Alpha\ *:Windows_NT*:*)
|
||||
# How do we know it's Interix rather than the generic POSIX subsystem?
|
||||
# Should we change UNAME_MACHINE based on the output of uname instead
|
||||
@ -296,12 +316,12 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
echo s390-ibm-zvmoe
|
||||
exit ;;
|
||||
*:OS400:*:*)
|
||||
echo powerpc-ibm-os400
|
||||
echo powerpc-ibm-os400
|
||||
exit ;;
|
||||
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
|
||||
echo arm-acorn-riscix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
arm:riscos:*:*|arm:RISCOS:*:*)
|
||||
arm*:riscos:*:*|arm*:RISCOS:*:*)
|
||||
echo arm-unknown-riscos
|
||||
exit ;;
|
||||
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
|
||||
@ -395,23 +415,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
# MiNT. But MiNT is downward compatible to TOS, so this should
|
||||
# be no problem.
|
||||
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
|
||||
echo m68k-atari-mint${UNAME_RELEASE}
|
||||
echo m68k-atari-mint${UNAME_RELEASE}
|
||||
exit ;;
|
||||
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
|
||||
echo m68k-atari-mint${UNAME_RELEASE}
|
||||
exit ;;
|
||||
exit ;;
|
||||
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
|
||||
echo m68k-atari-mint${UNAME_RELEASE}
|
||||
echo m68k-atari-mint${UNAME_RELEASE}
|
||||
exit ;;
|
||||
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
|
||||
echo m68k-milan-mint${UNAME_RELEASE}
|
||||
exit ;;
|
||||
echo m68k-milan-mint${UNAME_RELEASE}
|
||||
exit ;;
|
||||
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
|
||||
echo m68k-hades-mint${UNAME_RELEASE}
|
||||
exit ;;
|
||||
echo m68k-hades-mint${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
|
||||
echo m68k-unknown-mint${UNAME_RELEASE}
|
||||
exit ;;
|
||||
echo m68k-unknown-mint${UNAME_RELEASE}
|
||||
exit ;;
|
||||
m68k:machten:*:*)
|
||||
echo m68k-apple-machten${UNAME_RELEASE}
|
||||
exit ;;
|
||||
@ -481,8 +501,8 @@ EOF
|
||||
echo m88k-motorola-sysv3
|
||||
exit ;;
|
||||
AViiON:dgux:*:*)
|
||||
# DG/UX returns AViiON for all architectures
|
||||
UNAME_PROCESSOR=`/usr/bin/uname -p`
|
||||
# DG/UX returns AViiON for all architectures
|
||||
UNAME_PROCESSOR=`/usr/bin/uname -p`
|
||||
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
|
||||
then
|
||||
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
|
||||
@ -495,7 +515,7 @@ EOF
|
||||
else
|
||||
echo i586-dg-dgux${UNAME_RELEASE}
|
||||
fi
|
||||
exit ;;
|
||||
exit ;;
|
||||
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
|
||||
echo m88k-dolphin-sysv3
|
||||
exit ;;
|
||||
@ -552,7 +572,7 @@ EOF
|
||||
echo rs6000-ibm-aix3.2
|
||||
fi
|
||||
exit ;;
|
||||
*:AIX:*:[456])
|
||||
*:AIX:*:[4567])
|
||||
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
|
||||
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
|
||||
IBM_ARCH=rs6000
|
||||
@ -595,52 +615,52 @@ EOF
|
||||
9000/[678][0-9][0-9])
|
||||
if [ -x /usr/bin/getconf ]; then
|
||||
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
|
||||
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
|
||||
case "${sc_cpu_version}" in
|
||||
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
|
||||
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
|
||||
532) # CPU_PA_RISC2_0
|
||||
case "${sc_kernel_bits}" in
|
||||
32) HP_ARCH="hppa2.0n" ;;
|
||||
64) HP_ARCH="hppa2.0w" ;;
|
||||
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
|
||||
case "${sc_cpu_version}" in
|
||||
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
|
||||
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
|
||||
532) # CPU_PA_RISC2_0
|
||||
case "${sc_kernel_bits}" in
|
||||
32) HP_ARCH="hppa2.0n" ;;
|
||||
64) HP_ARCH="hppa2.0w" ;;
|
||||
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
|
||||
esac ;;
|
||||
esac
|
||||
esac ;;
|
||||
esac
|
||||
fi
|
||||
if [ "${HP_ARCH}" = "" ]; then
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
|
||||
#define _HPUX_SOURCE
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#define _HPUX_SOURCE
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main ()
|
||||
{
|
||||
#if defined(_SC_KERNEL_BITS)
|
||||
long bits = sysconf(_SC_KERNEL_BITS);
|
||||
#endif
|
||||
long cpu = sysconf (_SC_CPU_VERSION);
|
||||
int main ()
|
||||
{
|
||||
#if defined(_SC_KERNEL_BITS)
|
||||
long bits = sysconf(_SC_KERNEL_BITS);
|
||||
#endif
|
||||
long cpu = sysconf (_SC_CPU_VERSION);
|
||||
|
||||
switch (cpu)
|
||||
{
|
||||
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
|
||||
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
|
||||
case CPU_PA_RISC2_0:
|
||||
#if defined(_SC_KERNEL_BITS)
|
||||
switch (bits)
|
||||
{
|
||||
case 64: puts ("hppa2.0w"); break;
|
||||
case 32: puts ("hppa2.0n"); break;
|
||||
default: puts ("hppa2.0"); break;
|
||||
} break;
|
||||
#else /* !defined(_SC_KERNEL_BITS) */
|
||||
puts ("hppa2.0"); break;
|
||||
#endif
|
||||
default: puts ("hppa1.0"); break;
|
||||
}
|
||||
exit (0);
|
||||
}
|
||||
switch (cpu)
|
||||
{
|
||||
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
|
||||
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
|
||||
case CPU_PA_RISC2_0:
|
||||
#if defined(_SC_KERNEL_BITS)
|
||||
switch (bits)
|
||||
{
|
||||
case 64: puts ("hppa2.0w"); break;
|
||||
case 32: puts ("hppa2.0n"); break;
|
||||
default: puts ("hppa2.0"); break;
|
||||
} break;
|
||||
#else /* !defined(_SC_KERNEL_BITS) */
|
||||
puts ("hppa2.0"); break;
|
||||
#endif
|
||||
default: puts ("hppa1.0"); break;
|
||||
}
|
||||
exit (0);
|
||||
}
|
||||
EOF
|
||||
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
|
||||
test -z "$HP_ARCH" && HP_ARCH=hppa
|
||||
@ -731,22 +751,22 @@ EOF
|
||||
exit ;;
|
||||
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
|
||||
echo c1-convex-bsd
|
||||
exit ;;
|
||||
exit ;;
|
||||
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
|
||||
if getsysinfo -f scalar_acc
|
||||
then echo c32-convex-bsd
|
||||
else echo c2-convex-bsd
|
||||
fi
|
||||
exit ;;
|
||||
exit ;;
|
||||
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
|
||||
echo c34-convex-bsd
|
||||
exit ;;
|
||||
exit ;;
|
||||
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
|
||||
echo c38-convex-bsd
|
||||
exit ;;
|
||||
exit ;;
|
||||
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
|
||||
echo c4-convex-bsd
|
||||
exit ;;
|
||||
exit ;;
|
||||
CRAY*Y-MP:*:*:*)
|
||||
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
|
||||
exit ;;
|
||||
@ -770,14 +790,14 @@ EOF
|
||||
exit ;;
|
||||
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
|
||||
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
||||
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
|
||||
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
|
||||
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
|
||||
exit ;;
|
||||
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
|
||||
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
|
||||
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
|
||||
exit ;;
|
||||
5000:UNIX_System_V:4.*:*)
|
||||
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
|
||||
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
|
||||
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
|
||||
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
|
||||
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
|
||||
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
|
||||
exit ;;
|
||||
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
|
||||
@ -789,30 +809,30 @@ EOF
|
||||
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:FreeBSD:*:*)
|
||||
case ${UNAME_MACHINE} in
|
||||
pc98)
|
||||
echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
|
||||
amd64)
|
||||
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
|
||||
*)
|
||||
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
|
||||
esac
|
||||
UNAME_PROCESSOR=`/usr/bin/uname -p`
|
||||
echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
|
||||
exit ;;
|
||||
i*:CYGWIN*:*)
|
||||
echo ${UNAME_MACHINE}-pc-cygwin
|
||||
exit ;;
|
||||
*:MINGW64*:*)
|
||||
echo ${UNAME_MACHINE}-pc-mingw64
|
||||
exit ;;
|
||||
*:MINGW*:*)
|
||||
echo ${UNAME_MACHINE}-pc-mingw32
|
||||
exit ;;
|
||||
i*:MSYS*:*)
|
||||
echo ${UNAME_MACHINE}-pc-msys
|
||||
exit ;;
|
||||
i*:windows32*:*)
|
||||
# uname -m includes "-pc" on this system.
|
||||
echo ${UNAME_MACHINE}-mingw32
|
||||
# uname -m includes "-pc" on this system.
|
||||
echo ${UNAME_MACHINE}-mingw32
|
||||
exit ;;
|
||||
i*:PW*:*)
|
||||
echo ${UNAME_MACHINE}-pc-pw32
|
||||
exit ;;
|
||||
*:Interix*:*)
|
||||
case ${UNAME_MACHINE} in
|
||||
case ${UNAME_MACHINE} in
|
||||
x86)
|
||||
echo i586-pc-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
@ -849,15 +869,22 @@ EOF
|
||||
exit ;;
|
||||
*:GNU:*:*)
|
||||
# the GNU system
|
||||
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
|
||||
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
|
||||
exit ;;
|
||||
*:GNU/*:*:*)
|
||||
# other systems with GNU libc and userland
|
||||
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
|
||||
exit ;;
|
||||
i*86:Minix:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-minix
|
||||
exit ;;
|
||||
aarch64:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
aarch64_be:Linux:*:*)
|
||||
UNAME_MACHINE=aarch64_be
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
alpha:Linux:*:*)
|
||||
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
|
||||
EV5) UNAME_MACHINE=alphaev5 ;;
|
||||
@ -867,52 +894,56 @@ EOF
|
||||
EV6) UNAME_MACHINE=alphaev6 ;;
|
||||
EV67) UNAME_MACHINE=alphaev67 ;;
|
||||
EV68*) UNAME_MACHINE=alphaev68 ;;
|
||||
esac
|
||||
esac
|
||||
objdump --private-headers /bin/sh | grep -q ld.so.1
|
||||
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
|
||||
if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
arc:Linux:*:* | arceb:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
arm*:Linux:*:*)
|
||||
eval $set_cc_for_build
|
||||
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
|
||||
| grep -q __ARM_EABI__
|
||||
then
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
else
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
|
||||
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
|
||||
| grep -q __ARM_PCS_VFP
|
||||
then
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
|
||||
else
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
|
||||
fi
|
||||
fi
|
||||
exit ;;
|
||||
avr32*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
cris:Linux:*:*)
|
||||
echo cris-axis-linux-gnu
|
||||
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
|
||||
exit ;;
|
||||
crisv32:Linux:*:*)
|
||||
echo crisv32-axis-linux-gnu
|
||||
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
|
||||
exit ;;
|
||||
frv:Linux:*:*)
|
||||
echo frv-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
hexagon:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
i*86:Linux:*:*)
|
||||
LIBC=gnu
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#ifdef __dietlibc__
|
||||
LIBC=dietlibc
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
|
||||
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
|
||||
echo ${UNAME_MACHINE}-pc-linux-${LIBC}
|
||||
exit ;;
|
||||
ia64:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
m32r*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
m68*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
mips:Linux:*:* | mips64:Linux:*:*)
|
||||
eval $set_cc_for_build
|
||||
@ -931,51 +962,57 @@ EOF
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
|
||||
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
|
||||
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
|
||||
;;
|
||||
or1k:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
or32:Linux:*:*)
|
||||
echo or32-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
padre:Linux:*:*)
|
||||
echo sparc-unknown-linux-gnu
|
||||
echo sparc-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
parisc64:Linux:*:* | hppa64:Linux:*:*)
|
||||
echo hppa64-unknown-linux-gnu
|
||||
echo hppa64-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
parisc:Linux:*:* | hppa:Linux:*:*)
|
||||
# Look for CPU level
|
||||
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
|
||||
PA7*) echo hppa1.1-unknown-linux-gnu ;;
|
||||
PA8*) echo hppa2.0-unknown-linux-gnu ;;
|
||||
*) echo hppa-unknown-linux-gnu ;;
|
||||
PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
|
||||
PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
|
||||
*) echo hppa-unknown-linux-${LIBC} ;;
|
||||
esac
|
||||
exit ;;
|
||||
ppc64:Linux:*:*)
|
||||
echo powerpc64-unknown-linux-gnu
|
||||
echo powerpc64-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
ppc:Linux:*:*)
|
||||
echo powerpc-unknown-linux-gnu
|
||||
echo powerpc-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
s390:Linux:*:* | s390x:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-ibm-linux
|
||||
echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
|
||||
exit ;;
|
||||
sh64*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
sh*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
sparc:Linux:*:* | sparc64:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
tile*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
vax:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-dec-linux-gnu
|
||||
echo ${UNAME_MACHINE}-dec-linux-${LIBC}
|
||||
exit ;;
|
||||
x86_64:Linux:*:*)
|
||||
echo x86_64-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
xtensa*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
i*86:DYNIX/ptx:4*:*)
|
||||
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
|
||||
@ -984,11 +1021,11 @@ EOF
|
||||
echo i386-sequent-sysv4
|
||||
exit ;;
|
||||
i*86:UNIX_SV:4.2MP:2.*)
|
||||
# Unixware is an offshoot of SVR4, but it has its own version
|
||||
# number series starting with 2...
|
||||
# I am not positive that other SVR4 systems won't match this,
|
||||
# Unixware is an offshoot of SVR4, but it has its own version
|
||||
# number series starting with 2...
|
||||
# I am not positive that other SVR4 systems won't match this,
|
||||
# I just have to hope. -- rms.
|
||||
# Use sysv4.2uw... so that sysv4* matches it.
|
||||
# Use sysv4.2uw... so that sysv4* matches it.
|
||||
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
|
||||
exit ;;
|
||||
i*86:OS/2:*:*)
|
||||
@ -1020,7 +1057,7 @@ EOF
|
||||
fi
|
||||
exit ;;
|
||||
i*86:*:5:[678]*)
|
||||
# UnixWare 7.x, OpenUNIX and OpenServer 6.
|
||||
# UnixWare 7.x, OpenUNIX and OpenServer 6.
|
||||
case `/bin/uname -X | grep "^Machine"` in
|
||||
*486*) UNAME_MACHINE=i486 ;;
|
||||
*Pentium) UNAME_MACHINE=i586 ;;
|
||||
@ -1048,13 +1085,13 @@ EOF
|
||||
exit ;;
|
||||
pc:*:*:*)
|
||||
# Left here for compatibility:
|
||||
# uname -m prints for DJGPP always 'pc', but it prints nothing about
|
||||
# the processor, so we play safe by assuming i586.
|
||||
# uname -m prints for DJGPP always 'pc', but it prints nothing about
|
||||
# the processor, so we play safe by assuming i586.
|
||||
# Note: whatever this is, it MUST be the same as what config.sub
|
||||
# prints for the "djgpp" host, or else GDB configury will decide that
|
||||
# this is a cross-build.
|
||||
echo i586-pc-msdosdjgpp
|
||||
exit ;;
|
||||
exit ;;
|
||||
Intel:Mach:3*:*)
|
||||
echo i386-pc-mach3
|
||||
exit ;;
|
||||
@ -1089,8 +1126,8 @@ EOF
|
||||
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
|
||||
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
|
||||
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
|
||||
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
|
||||
&& { echo i486-ncr-sysv4; exit; } ;;
|
||||
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
|
||||
&& { echo i486-ncr-sysv4; exit; } ;;
|
||||
NCR*:*:4.2:* | MPRAS*:*:4.2:*)
|
||||
OS_REL='.3'
|
||||
test -r /etc/.relid \
|
||||
@ -1133,10 +1170,10 @@ EOF
|
||||
echo ns32k-sni-sysv
|
||||
fi
|
||||
exit ;;
|
||||
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
|
||||
# says <Richard.M.Bartel@ccMail.Census.GOV>
|
||||
echo i586-unisys-sysv4
|
||||
exit ;;
|
||||
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
|
||||
# says <Richard.M.Bartel@ccMail.Census.GOV>
|
||||
echo i586-unisys-sysv4
|
||||
exit ;;
|
||||
*:UNIX_System_V:4*:FTX*)
|
||||
# From Gerald Hewes <hewes@openmarket.com>.
|
||||
# How about differentiating between stratus architectures? -djm
|
||||
@ -1162,11 +1199,11 @@ EOF
|
||||
exit ;;
|
||||
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
|
||||
if [ -d /usr/nec ]; then
|
||||
echo mips-nec-sysv${UNAME_RELEASE}
|
||||
echo mips-nec-sysv${UNAME_RELEASE}
|
||||
else
|
||||
echo mips-unknown-sysv${UNAME_RELEASE}
|
||||
echo mips-unknown-sysv${UNAME_RELEASE}
|
||||
fi
|
||||
exit ;;
|
||||
exit ;;
|
||||
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
|
||||
echo powerpc-be-beos
|
||||
exit ;;
|
||||
@ -1179,6 +1216,9 @@ EOF
|
||||
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
|
||||
echo i586-pc-haiku
|
||||
exit ;;
|
||||
x86_64:Haiku:*:*)
|
||||
echo x86_64-unknown-haiku
|
||||
exit ;;
|
||||
SX-4:SUPER-UX:*:*)
|
||||
echo sx4-nec-superux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
@ -1205,19 +1245,21 @@ EOF
|
||||
exit ;;
|
||||
*:Darwin:*:*)
|
||||
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
|
||||
case $UNAME_PROCESSOR in
|
||||
i386)
|
||||
eval $set_cc_for_build
|
||||
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
|
||||
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
|
||||
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
|
||||
grep IS_64BIT_ARCH >/dev/null
|
||||
then
|
||||
UNAME_PROCESSOR="x86_64"
|
||||
fi
|
||||
fi ;;
|
||||
unknown) UNAME_PROCESSOR=powerpc ;;
|
||||
esac
|
||||
eval $set_cc_for_build
|
||||
if test "$UNAME_PROCESSOR" = unknown ; then
|
||||
UNAME_PROCESSOR=powerpc
|
||||
fi
|
||||
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
|
||||
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
|
||||
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
|
||||
grep IS_64BIT_ARCH >/dev/null
|
||||
then
|
||||
case $UNAME_PROCESSOR in
|
||||
i386) UNAME_PROCESSOR=x86_64 ;;
|
||||
powerpc) UNAME_PROCESSOR=powerpc64 ;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:procnto*:*:* | *:QNX:[0123456789]*:*)
|
||||
@ -1231,7 +1273,10 @@ EOF
|
||||
*:QNX:*:4*)
|
||||
echo i386-pc-qnx
|
||||
exit ;;
|
||||
NSE-?:NONSTOP_KERNEL:*:*)
|
||||
NEO-?:NONSTOP_KERNEL:*:*)
|
||||
echo neo-tandem-nsk${UNAME_RELEASE}
|
||||
exit ;;
|
||||
NSE-*:NONSTOP_KERNEL:*:*)
|
||||
echo nse-tandem-nsk${UNAME_RELEASE}
|
||||
exit ;;
|
||||
NSR-?:NONSTOP_KERNEL:*:*)
|
||||
@ -1276,13 +1321,13 @@ EOF
|
||||
echo pdp10-unknown-its
|
||||
exit ;;
|
||||
SEI:*:*:SEIUX)
|
||||
echo mips-sei-seiux${UNAME_RELEASE}
|
||||
echo mips-sei-seiux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:DragonFly:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
|
||||
exit ;;
|
||||
*:*VMS:*:*)
|
||||
UNAME_MACHINE=`(uname -p) 2>/dev/null`
|
||||
UNAME_MACHINE=`(uname -p) 2>/dev/null`
|
||||
case "${UNAME_MACHINE}" in
|
||||
A*) echo alpha-dec-vms ; exit ;;
|
||||
I*) echo ia64-dec-vms ; exit ;;
|
||||
@ -1300,11 +1345,11 @@ EOF
|
||||
i*86:AROS:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-aros
|
||||
exit ;;
|
||||
x86_64:VMkernel:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-esx
|
||||
exit ;;
|
||||
esac
|
||||
|
||||
#echo '(No uname command or uname output not recognized.)' 1>&2
|
||||
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
|
||||
|
||||
eval $set_cc_for_build
|
||||
cat >$dummy.c <<EOF
|
||||
#ifdef _SEQUENT_
|
||||
@ -1322,11 +1367,11 @@ main ()
|
||||
#include <sys/param.h>
|
||||
printf ("m68k-sony-newsos%s\n",
|
||||
#ifdef NEWSOS4
|
||||
"4"
|
||||
"4"
|
||||
#else
|
||||
""
|
||||
""
|
||||
#endif
|
||||
); exit (0);
|
||||
); exit (0);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
286
admin/config.sub
vendored
286
admin/config.sub
vendored
@ -1,38 +1,31 @@
|
||||
#! /bin/sh
|
||||
# Configuration validation subroutine script.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
|
||||
# Free Software Foundation, Inc.
|
||||
# Copyright 1992-2013 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2009-12-31'
|
||||
timestamp='2013-04-24'
|
||||
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
# can handle that machine. It does not imply ALL GNU software can.
|
||||
#
|
||||
# This file is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
# the same distribution terms that you use for the rest of that
|
||||
# program. This Exception is an additional permission under section 7
|
||||
# of the GNU General Public License, version 3 ("GPLv3").
|
||||
|
||||
|
||||
# Please send patches to <config-patches@gnu.org>. Submit a context
|
||||
# diff and a properly formatted GNU ChangeLog entry.
|
||||
# Please send patches with a ChangeLog entry to config-patches@gnu.org.
|
||||
#
|
||||
# Configuration subroutine to validate and canonicalize a configuration type.
|
||||
# Supply the specified configuration type as an argument.
|
||||
@ -75,9 +68,7 @@ Report bugs and patches to <config-patches@gnu.org>."
|
||||
version="\
|
||||
GNU config.sub ($timestamp)
|
||||
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
|
||||
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
|
||||
Software Foundation, Inc.
|
||||
Copyright 1992-2013 Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
@ -124,13 +115,18 @@ esac
|
||||
# Here we must recognize all the valid KERNEL-OS combinations.
|
||||
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
||||
case $maybe_os in
|
||||
nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
|
||||
uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
|
||||
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
|
||||
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
|
||||
knetbsd*-gnu* | netbsd*-gnu* | \
|
||||
kopensolaris*-gnu* | \
|
||||
storm-chaos* | os2-emx* | rtmk-nova*)
|
||||
os=-$maybe_os
|
||||
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
||||
;;
|
||||
android-linux)
|
||||
os=-linux-android
|
||||
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
|
||||
;;
|
||||
*)
|
||||
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
|
||||
if [ $basic_machine != $1 ]
|
||||
@ -153,12 +149,12 @@ case $os in
|
||||
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
|
||||
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
|
||||
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
|
||||
-apple | -axis | -knuth | -cray | -microblaze)
|
||||
-apple | -axis | -knuth | -cray | -microblaze*)
|
||||
os=
|
||||
basic_machine=$1
|
||||
;;
|
||||
-bluegene*)
|
||||
os=-cnk
|
||||
-bluegene*)
|
||||
os=-cnk
|
||||
;;
|
||||
-sim | -cisco | -oki | -wec | -winbond)
|
||||
os=
|
||||
@ -174,10 +170,10 @@ case $os in
|
||||
os=-chorusos
|
||||
basic_machine=$1
|
||||
;;
|
||||
-chorusrdb)
|
||||
os=-chorusrdb
|
||||
-chorusrdb)
|
||||
os=-chorusrdb
|
||||
basic_machine=$1
|
||||
;;
|
||||
;;
|
||||
-hiux*)
|
||||
os=-hiuxwe2
|
||||
;;
|
||||
@ -222,6 +218,12 @@ case $os in
|
||||
-isc*)
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-lynx*178)
|
||||
os=-lynxos178
|
||||
;;
|
||||
-lynx*5)
|
||||
os=-lynxos5
|
||||
;;
|
||||
-lynx*)
|
||||
os=-lynxos
|
||||
;;
|
||||
@ -246,20 +248,27 @@ case $basic_machine in
|
||||
# Some are omitted here because they have special meanings below.
|
||||
1750a | 580 \
|
||||
| a29k \
|
||||
| aarch64 | aarch64_be \
|
||||
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
|
||||
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
|
||||
| am33_2.0 \
|
||||
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
|
||||
| arc | arceb \
|
||||
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
|
||||
| avr | avr32 \
|
||||
| be32 | be64 \
|
||||
| bfin \
|
||||
| c4x | clipper \
|
||||
| d10v | d30v | dlx | dsp16xx \
|
||||
| epiphany \
|
||||
| fido | fr30 | frv \
|
||||
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
||||
| hexagon \
|
||||
| i370 | i860 | i960 | ia64 \
|
||||
| ip2k | iq2000 \
|
||||
| le32 | le64 \
|
||||
| lm32 \
|
||||
| m32c | m32r | m32rle | m68000 | m68k | m88k \
|
||||
| maxq | mb | microblaze | mcore | mep | metag \
|
||||
| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
|
||||
| mips | mipsbe | mipseb | mipsel | mipsle \
|
||||
| mips16 \
|
||||
| mips64 | mips64el \
|
||||
@ -277,34 +286,45 @@ case $basic_machine in
|
||||
| mipsisa64r2 | mipsisa64r2el \
|
||||
| mipsisa64sb1 | mipsisa64sb1el \
|
||||
| mipsisa64sr71k | mipsisa64sr71kel \
|
||||
| mipsr5900 | mipsr5900el \
|
||||
| mipstx39 | mipstx39el \
|
||||
| mn10200 | mn10300 \
|
||||
| moxie \
|
||||
| mt \
|
||||
| msp430 \
|
||||
| nios | nios2 \
|
||||
| nds32 | nds32le | nds32be \
|
||||
| nios | nios2 | nios2eb | nios2el \
|
||||
| ns16k | ns32k \
|
||||
| or32 \
|
||||
| open8 \
|
||||
| or1k | or32 \
|
||||
| pdp10 | pdp11 | pj | pjl \
|
||||
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
|
||||
| powerpc | powerpc64 | powerpc64le | powerpcle \
|
||||
| pyramid \
|
||||
| rx \
|
||||
| rl78 | rx \
|
||||
| score \
|
||||
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
|
||||
| sh64 | sh64le \
|
||||
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
|
||||
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
|
||||
| spu | strongarm \
|
||||
| tahoe | thumb | tic4x | tic80 | tron \
|
||||
| spu \
|
||||
| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
|
||||
| ubicom32 \
|
||||
| v850 | v850e \
|
||||
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
|
||||
| we32k \
|
||||
| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
|
||||
| x86 | xc16x | xstormy16 | xtensa \
|
||||
| z8k | z80)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
m6811 | m68hc11 | m6812 | m68hc12 | picochip)
|
||||
# Motorola 68HC11/12.
|
||||
c54x)
|
||||
basic_machine=tic54x-unknown
|
||||
;;
|
||||
c55x)
|
||||
basic_machine=tic55x-unknown
|
||||
;;
|
||||
c6x)
|
||||
basic_machine=tic6x-unknown
|
||||
;;
|
||||
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
|
||||
basic_machine=$basic_machine-unknown
|
||||
os=-none
|
||||
;;
|
||||
@ -314,6 +334,21 @@ case $basic_machine in
|
||||
basic_machine=mt-unknown
|
||||
;;
|
||||
|
||||
strongarm | thumb | xscale)
|
||||
basic_machine=arm-unknown
|
||||
;;
|
||||
xgate)
|
||||
basic_machine=$basic_machine-unknown
|
||||
os=-none
|
||||
;;
|
||||
xscaleeb)
|
||||
basic_machine=armeb-unknown
|
||||
;;
|
||||
|
||||
xscaleel)
|
||||
basic_machine=armel-unknown
|
||||
;;
|
||||
|
||||
# We use `pc' rather than `unknown'
|
||||
# because (1) that's what they normally are, and
|
||||
# (2) the word "unknown" tends to confuse beginning users.
|
||||
@ -328,25 +363,30 @@ case $basic_machine in
|
||||
# Recognize the basic CPU types with company name.
|
||||
580-* \
|
||||
| a29k-* \
|
||||
| aarch64-* | aarch64_be-* \
|
||||
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
|
||||
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
|
||||
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
|
||||
| alphapca5[67]-* | alpha64pca5[67]-* | amd64-* | arc-* | arceb-* \
|
||||
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
|
||||
| avr-* | avr32-* \
|
||||
| be32-* | be64-* \
|
||||
| bfin-* | bs2000-* \
|
||||
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
|
||||
| c[123]* | c30-* | [cjt]90-* | c4x-* \
|
||||
| clipper-* | craynv-* | cydra-* \
|
||||
| d10v-* | d30v-* | dlx-* \
|
||||
| elxsi-* \
|
||||
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
|
||||
| h8300-* | h8500-* \
|
||||
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
|
||||
| hexagon-* \
|
||||
| i*86-* | i860-* | i960-* | ia64-* \
|
||||
| ip2k-* | iq2000-* \
|
||||
| le32-* | le64-* \
|
||||
| lm32-* \
|
||||
| m32c-* | m32r-* | m32rle-* \
|
||||
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
|
||||
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
|
||||
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
|
||||
| microblaze-* | microblazeel-* \
|
||||
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
|
||||
| mips16-* \
|
||||
| mips64-* | mips64el-* \
|
||||
@ -364,29 +404,34 @@ case $basic_machine in
|
||||
| mipsisa64r2-* | mipsisa64r2el-* \
|
||||
| mipsisa64sb1-* | mipsisa64sb1el-* \
|
||||
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
|
||||
| mipsr5900-* | mipsr5900el-* \
|
||||
| mipstx39-* | mipstx39el-* \
|
||||
| mmix-* \
|
||||
| mt-* \
|
||||
| msp430-* \
|
||||
| nios-* | nios2-* \
|
||||
| nds32-* | nds32le-* | nds32be-* \
|
||||
| nios-* | nios2-* | nios2eb-* | nios2el-* \
|
||||
| none-* | np1-* | ns16k-* | ns32k-* \
|
||||
| open8-* \
|
||||
| orion-* \
|
||||
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
|
||||
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
|
||||
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
|
||||
| pyramid-* \
|
||||
| romp-* | rs6000-* | rx-* \
|
||||
| rl78-* | romp-* | rs6000-* | rx-* \
|
||||
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
|
||||
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
|
||||
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
|
||||
| sparclite-* \
|
||||
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
|
||||
| tahoe-* | thumb-* \
|
||||
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
|
||||
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
|
||||
| tahoe-* \
|
||||
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
|
||||
| tile*-* \
|
||||
| tron-* \
|
||||
| ubicom32-* \
|
||||
| v850-* | v850e-* | vax-* \
|
||||
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
|
||||
| vax-* \
|
||||
| we32k-* \
|
||||
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
|
||||
| x86-* | x86_64-* | xc16x-* | xps100-* \
|
||||
| xstormy16-* | xtensa*-* \
|
||||
| ymp-* \
|
||||
| z8k-* | z80-*)
|
||||
@ -411,7 +456,7 @@ case $basic_machine in
|
||||
basic_machine=a29k-amd
|
||||
os=-udi
|
||||
;;
|
||||
abacus)
|
||||
abacus)
|
||||
basic_machine=abacus-unknown
|
||||
;;
|
||||
adobe68k)
|
||||
@ -428,12 +473,6 @@ case $basic_machine in
|
||||
basic_machine=a29k-none
|
||||
os=-bsd
|
||||
;;
|
||||
amd64)
|
||||
basic_machine=x86_64-pc
|
||||
;;
|
||||
amd64-*)
|
||||
basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
amdahl)
|
||||
basic_machine=580-amdahl
|
||||
os=-sysv
|
||||
@ -481,11 +520,20 @@ case $basic_machine in
|
||||
basic_machine=powerpc-ibm
|
||||
os=-cnk
|
||||
;;
|
||||
c54x-*)
|
||||
basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
c55x-*)
|
||||
basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
c6x-*)
|
||||
basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
c90)
|
||||
basic_machine=c90-cray
|
||||
os=-unicos
|
||||
;;
|
||||
cegcc)
|
||||
cegcc)
|
||||
basic_machine=arm-unknown
|
||||
os=-cegcc
|
||||
;;
|
||||
@ -517,7 +565,7 @@ case $basic_machine in
|
||||
basic_machine=craynv-cray
|
||||
os=-unicosmp
|
||||
;;
|
||||
cr16)
|
||||
cr16 | cr16-*)
|
||||
basic_machine=cr16-unknown
|
||||
os=-elf
|
||||
;;
|
||||
@ -675,7 +723,6 @@ case $basic_machine in
|
||||
i370-ibm* | ibm*)
|
||||
basic_machine=i370-ibm
|
||||
;;
|
||||
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
|
||||
i*86v32)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-sysv32
|
||||
@ -733,9 +780,13 @@ case $basic_machine in
|
||||
basic_machine=ns32k-utek
|
||||
os=-sysv
|
||||
;;
|
||||
microblaze)
|
||||
microblaze*)
|
||||
basic_machine=microblaze-xilinx
|
||||
;;
|
||||
mingw64)
|
||||
basic_machine=x86_64-pc
|
||||
os=-mingw64
|
||||
;;
|
||||
mingw32)
|
||||
basic_machine=i386-pc
|
||||
os=-mingw32
|
||||
@ -772,10 +823,18 @@ case $basic_machine in
|
||||
ms1-*)
|
||||
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
|
||||
;;
|
||||
msys)
|
||||
basic_machine=i386-pc
|
||||
os=-msys
|
||||
;;
|
||||
mvs)
|
||||
basic_machine=i370-ibm
|
||||
os=-mvs
|
||||
;;
|
||||
nacl)
|
||||
basic_machine=le32-unknown
|
||||
os=-nacl
|
||||
;;
|
||||
ncr3000)
|
||||
basic_machine=i486-ncr
|
||||
os=-sysv4
|
||||
@ -840,6 +899,12 @@ case $basic_machine in
|
||||
np1)
|
||||
basic_machine=np1-gould
|
||||
;;
|
||||
neo-tandem)
|
||||
basic_machine=neo-tandem
|
||||
;;
|
||||
nse-tandem)
|
||||
basic_machine=nse-tandem
|
||||
;;
|
||||
nsr-tandem)
|
||||
basic_machine=nsr-tandem
|
||||
;;
|
||||
@ -922,9 +987,10 @@ case $basic_machine in
|
||||
;;
|
||||
power) basic_machine=power-ibm
|
||||
;;
|
||||
ppc) basic_machine=powerpc-unknown
|
||||
ppc | ppcbe) basic_machine=powerpc-unknown
|
||||
;;
|
||||
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
ppc-* | ppcbe-*)
|
||||
basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
ppcle | powerpclittle | ppc-le | powerpc-little)
|
||||
basic_machine=powerpcle-unknown
|
||||
@ -949,7 +1015,11 @@ case $basic_machine in
|
||||
basic_machine=i586-unknown
|
||||
os=-pw32
|
||||
;;
|
||||
rdos)
|
||||
rdos | rdos64)
|
||||
basic_machine=x86_64-pc
|
||||
os=-rdos
|
||||
;;
|
||||
rdos32)
|
||||
basic_machine=i386-pc
|
||||
os=-rdos
|
||||
;;
|
||||
@ -1018,6 +1088,9 @@ case $basic_machine in
|
||||
basic_machine=i860-stratus
|
||||
os=-sysv4
|
||||
;;
|
||||
strongarm-* | thumb-*)
|
||||
basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
sun2)
|
||||
basic_machine=m68000-sun
|
||||
;;
|
||||
@ -1074,20 +1147,8 @@ case $basic_machine in
|
||||
basic_machine=t90-cray
|
||||
os=-unicos
|
||||
;;
|
||||
tic54x | c54x*)
|
||||
basic_machine=tic54x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tic55x | c55x*)
|
||||
basic_machine=tic55x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tic6x | c6x*)
|
||||
basic_machine=tic6x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tile*)
|
||||
basic_machine=tile-unknown
|
||||
basic_machine=$basic_machine-unknown
|
||||
os=-linux-gnu
|
||||
;;
|
||||
tx39)
|
||||
@ -1157,6 +1218,9 @@ case $basic_machine in
|
||||
xps | xps100)
|
||||
basic_machine=xps100-honeywell
|
||||
;;
|
||||
xscale-* | xscalee[bl]-*)
|
||||
basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
|
||||
;;
|
||||
ymp)
|
||||
basic_machine=ymp-cray
|
||||
os=-unicos
|
||||
@ -1254,11 +1318,11 @@ esac
|
||||
if [ x"$os" != x"" ]
|
||||
then
|
||||
case $os in
|
||||
# First match some system type aliases
|
||||
# that might get confused with valid system types.
|
||||
# First match some system type aliases
|
||||
# that might get confused with valid system types.
|
||||
# -solaris* is a basic system type, with this one exception.
|
||||
-auroraux)
|
||||
os=-auroraux
|
||||
-auroraux)
|
||||
os=-auroraux
|
||||
;;
|
||||
-solaris1 | -solaris1.*)
|
||||
os=`echo $os | sed -e 's|solaris1|sunos4|'`
|
||||
@ -1282,20 +1346,21 @@ case $os in
|
||||
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
|
||||
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
|
||||
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
|
||||
| -sym* | -kopensolaris* \
|
||||
| -sym* | -kopensolaris* | -plan9* \
|
||||
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
|
||||
| -aos* | -aros* \
|
||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
|
||||
| -openbsd* | -solidbsd* \
|
||||
| -bitrig* | -openbsd* | -solidbsd* \
|
||||
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
|
||||
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||
| -chorusos* | -chorusrdb* | -cegcc* \
|
||||
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
|
||||
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
|
||||
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
|
||||
| -uxpv* | -beos* | -mpeix* | -udk* \
|
||||
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
|
||||
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
|
||||
@ -1342,7 +1407,7 @@ case $os in
|
||||
-opened*)
|
||||
os=-openedition
|
||||
;;
|
||||
-os400*)
|
||||
-os400*)
|
||||
os=-os400
|
||||
;;
|
||||
-wince*)
|
||||
@ -1391,7 +1456,7 @@ case $os in
|
||||
-sinix*)
|
||||
os=-sysv4
|
||||
;;
|
||||
-tpf*)
|
||||
-tpf*)
|
||||
os=-tpf
|
||||
;;
|
||||
-triton*)
|
||||
@ -1427,17 +1492,14 @@ case $os in
|
||||
-aros*)
|
||||
os=-aros
|
||||
;;
|
||||
-kaos*)
|
||||
os=-kaos
|
||||
;;
|
||||
-zvmoe)
|
||||
os=-zvmoe
|
||||
;;
|
||||
-dicos*)
|
||||
os=-dicos
|
||||
;;
|
||||
-nacl*)
|
||||
;;
|
||||
-nacl*)
|
||||
;;
|
||||
-none)
|
||||
;;
|
||||
*)
|
||||
@ -1460,10 +1522,10 @@ else
|
||||
# system, and we'll never get to this point.
|
||||
|
||||
case $basic_machine in
|
||||
score-*)
|
||||
score-*)
|
||||
os=-elf
|
||||
;;
|
||||
spu-*)
|
||||
spu-*)
|
||||
os=-elf
|
||||
;;
|
||||
*-acorn)
|
||||
@ -1475,8 +1537,20 @@ case $basic_machine in
|
||||
arm*-semi)
|
||||
os=-aout
|
||||
;;
|
||||
c4x-* | tic4x-*)
|
||||
os=-coff
|
||||
c4x-* | tic4x-*)
|
||||
os=-coff
|
||||
;;
|
||||
hexagon-*)
|
||||
os=-elf
|
||||
;;
|
||||
tic54x-*)
|
||||
os=-coff
|
||||
;;
|
||||
tic55x-*)
|
||||
os=-coff
|
||||
;;
|
||||
tic6x-*)
|
||||
os=-coff
|
||||
;;
|
||||
# This must come before the *-dec entry.
|
||||
pdp10-*)
|
||||
@ -1496,14 +1570,11 @@ case $basic_machine in
|
||||
;;
|
||||
m68000-sun)
|
||||
os=-sunos3
|
||||
# This also exists in the configure program, but was not the
|
||||
# default.
|
||||
# os=-sunos4
|
||||
;;
|
||||
m68*-cisco)
|
||||
os=-aout
|
||||
;;
|
||||
mep-*)
|
||||
mep-*)
|
||||
os=-elf
|
||||
;;
|
||||
mips*-cisco)
|
||||
@ -1512,6 +1583,9 @@ case $basic_machine in
|
||||
mips*-*)
|
||||
os=-elf
|
||||
;;
|
||||
or1k-*)
|
||||
os=-elf
|
||||
;;
|
||||
or32-*)
|
||||
os=-coff
|
||||
;;
|
||||
@ -1530,7 +1604,7 @@ case $basic_machine in
|
||||
*-ibm)
|
||||
os=-aix
|
||||
;;
|
||||
*-knuth)
|
||||
*-knuth)
|
||||
os=-mmixware
|
||||
;;
|
||||
*-wec)
|
||||
|
758
admin/install-sh
758
admin/install-sh
@ -1,301 +1,527 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $NetBSD: install-sh.in,v 1.6 2012/01/11 13:07:31 hans Exp $
|
||||
# This script now also installs multiple files, but might choke on installing
|
||||
# multiple files with spaces in the file names.
|
||||
#
|
||||
# install - install a program, script, or datafile
|
||||
# This comes from X11R5 (mit/util/scripts/install.sh).
|
||||
|
||||
scriptversion=2011-11-20.07; # UTC
|
||||
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
# following copyright and license.
|
||||
#
|
||||
# Copyright 1991 by the Massachusetts Institute of Technology
|
||||
# Copyright (C) 1994 X Consortium
|
||||
#
|
||||
# Permission to use, copy, modify, distribute, and sell this software and its
|
||||
# documentation for any purpose is hereby granted without fee, provided that
|
||||
# the above copyright notice appear in all copies and that both that
|
||||
# copyright notice and this permission notice appear in supporting
|
||||
# documentation, and that the name of M.I.T. not be used in advertising or
|
||||
# publicity pertaining to distribution of the software without specific,
|
||||
# written prior permission. M.I.T. makes no representations about the
|
||||
# suitability of this software for any purpose. It is provided "as is"
|
||||
# without express or implied warranty.
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# Except as contained in this notice, the name of the X Consortium shall not
|
||||
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||
# ings in this Software without prior written authorization from the X Consor-
|
||||
# tium.
|
||||
#
|
||||
#
|
||||
# FSF changes to this file are in the public domain.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# 'make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch.
|
||||
|
||||
nl='
|
||||
'
|
||||
IFS=" "" $nl"
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit="${DOITPROG-}"
|
||||
|
||||
|
||||
# put in absolute paths if you don't have them in your path; or use env. vars.
|
||||
|
||||
awkprog="${AWKPROG-awk}"
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
instcmd="$cpprog"
|
||||
instflags=""
|
||||
pathcompchmodcmd="$chmodprog 755"
|
||||
chmodcmd="$chmodprog 755"
|
||||
chowncmd=""
|
||||
chgrpcmd=""
|
||||
stripcmd=""
|
||||
stripflags=""
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=""
|
||||
msrc=""
|
||||
dst=""
|
||||
dir_arg=""
|
||||
suffix=""
|
||||
suffixfmt=""
|
||||
|
||||
while [ x"$1" != x ]; do
|
||||
case $1 in
|
||||
-b) suffix=".old"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-B) suffixfmt="$2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-c) instcmd="$cpprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-m) chmodcmd="$chmodprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-m*)
|
||||
chmodcmd="$chmodprog ${1#-m}"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd="$stripprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-S) stripcmd="$stripprog"
|
||||
stripflags="-S $2 $stripflags"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-p) instflags="-p"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
*) if [ x"$msrc" = x ]
|
||||
then
|
||||
msrc="$dst"
|
||||
else
|
||||
msrc="$msrc $dst"
|
||||
fi
|
||||
src="$dst"
|
||||
dst="$1"
|
||||
shift
|
||||
continue;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ x"$dir_arg" = x ]
|
||||
then
|
||||
dstisfile=""
|
||||
if [ ! -d "$dst" ]
|
||||
then
|
||||
if [ x"$msrc" = x"$src" ]
|
||||
then
|
||||
dstisfile=true
|
||||
else
|
||||
echo "install: destination is not a directory"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
doit=${DOITPROG-}
|
||||
if test -z "$doit"; then
|
||||
doit_exec=exec
|
||||
else
|
||||
msrc="$msrc $dst"
|
||||
doit_exec=$doit
|
||||
fi
|
||||
|
||||
if [ x"$msrc" = x ]
|
||||
then
|
||||
echo "install: no destination specified"
|
||||
exit 1
|
||||
fi
|
||||
# Put in absolute file names if you don't have them in your path;
|
||||
# or use environment vars.
|
||||
|
||||
for srcarg in $msrc; do
|
||||
chgrpprog=${CHGRPPROG-chgrp}
|
||||
chmodprog=${CHMODPROG-chmod}
|
||||
chownprog=${CHOWNPROG-chown}
|
||||
cmpprog=${CMPPROG-cmp}
|
||||
cpprog=${CPPROG-cp}
|
||||
mkdirprog=${MKDIRPROG-mkdir}
|
||||
mvprog=${MVPROG-mv}
|
||||
rmprog=${RMPROG-rm}
|
||||
stripprog=${STRIPPROG-strip}
|
||||
|
||||
if [ x"$dir_arg" != x ]; then
|
||||
|
||||
dstarg="$srcarg"
|
||||
else
|
||||
dstarg="$dst"
|
||||
|
||||
# Waiting for this to be detected by the "$instcmd $srcarg $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
|
||||
if [ -f "$srcarg" ]
|
||||
then
|
||||
doinst="$instcmd $instflags"
|
||||
elif [ -d "$srcarg" ]
|
||||
then
|
||||
echo "install: $srcarg: not a regular file"
|
||||
exit 1
|
||||
elif [ "$srcarg" = "/dev/null" ]
|
||||
then
|
||||
doinst="$cpprog"
|
||||
else
|
||||
echo "install: $srcarg does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# If destination is a directory, append the input filename; if your system
|
||||
# does not like double slashes in filenames, you may need to add some logic
|
||||
|
||||
if [ -d "$dstarg" ]
|
||||
then
|
||||
dstarg="$dstarg"/`basename "$srcarg"`
|
||||
fi
|
||||
fi
|
||||
|
||||
## this sed command emulates the dirname command
|
||||
dstdir=`echo "$dstarg" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||
|
||||
# Make sure that the destination directory exists.
|
||||
# this part is taken from Noah Friedman's mkinstalldirs script
|
||||
|
||||
# Skip lots of stat calls in the usual case.
|
||||
if [ ! -d "$dstdir" ]; then
|
||||
defaultIFS='
|
||||
posix_glob='?'
|
||||
initialize_posix_glob='
|
||||
test "$posix_glob" != "?" || {
|
||||
if (set -f) 2>/dev/null; then
|
||||
posix_glob=
|
||||
else
|
||||
posix_glob=:
|
||||
fi
|
||||
}
|
||||
'
|
||||
IFS="${IFS-${defaultIFS}}"
|
||||
|
||||
oIFS="${IFS}"
|
||||
# Some sh's can't handle IFS=/ for some reason.
|
||||
IFS='%'
|
||||
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
IFS="${oIFS}"
|
||||
posix_mkdir=
|
||||
|
||||
pathcomp=''
|
||||
# Desired mode of installed file.
|
||||
mode=0755
|
||||
|
||||
while [ $# -ne 0 ] ; do
|
||||
pathcomp="${pathcomp}${1}"
|
||||
shift
|
||||
chgrpcmd=
|
||||
chmodcmd=$chmodprog
|
||||
chowncmd=
|
||||
mvcmd=$mvprog
|
||||
rmcmd="$rmprog -f"
|
||||
stripcmd=
|
||||
|
||||
if [ ! -d "${pathcomp}" ] ;
|
||||
then
|
||||
$doit $mkdirprog "${pathcomp}"
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd "${pathcomp}"; else true ; fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "${pathcomp}"; else true ; fi &&
|
||||
if [ x"$pathcompchmodcmd" != x ]; then $doit $pathcompchmodcmd "${pathcomp}"; else true ; fi
|
||||
src=
|
||||
dst=
|
||||
dir_arg=
|
||||
dst_arg=
|
||||
|
||||
else
|
||||
true
|
||||
fi
|
||||
copy_on_change=false
|
||||
no_target_directory=
|
||||
|
||||
pathcomp="${pathcomp}/"
|
||||
usage="\
|
||||
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
||||
or: $0 [OPTION]... -d DIRECTORIES...
|
||||
|
||||
In the 1st form, copy SRCFILE to DSTFILE.
|
||||
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
||||
In the 4th, create DIRECTORIES.
|
||||
|
||||
Options:
|
||||
--help display this help and exit.
|
||||
--version display version info and exit.
|
||||
|
||||
-c (ignored)
|
||||
-C install only if different (preserve the last data modification time)
|
||||
-d create directories instead of installing files.
|
||||
-g GROUP $chgrpprog installed files to GROUP.
|
||||
-m MODE $chmodprog installed files to MODE.
|
||||
-o USER $chownprog installed files to USER.
|
||||
-s $stripprog installed files.
|
||||
-t DIRECTORY install into DIRECTORY.
|
||||
-T report an error if DSTFILE is a directory.
|
||||
|
||||
Environment variables override the default commands:
|
||||
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
|
||||
RMPROG STRIPPROG
|
||||
"
|
||||
|
||||
while test $# -ne 0; do
|
||||
case $1 in
|
||||
-c) ;;
|
||||
|
||||
-C) copy_on_change=true;;
|
||||
|
||||
-d) dir_arg=true;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift;;
|
||||
|
||||
--help) echo "$usage"; exit $?;;
|
||||
|
||||
-m) mode=$2
|
||||
case $mode in
|
||||
*' '* | *' '* | *'
|
||||
'* | *'*'* | *'?'* | *'['*)
|
||||
echo "$0: invalid mode: $mode" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
shift;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift;;
|
||||
|
||||
-s) stripcmd=$stripprog;;
|
||||
|
||||
-t) dst_arg=$2
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $dst_arg in
|
||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
||||
esac
|
||||
shift;;
|
||||
|
||||
-T) no_target_directory=true;;
|
||||
|
||||
--version) echo "$0 $scriptversion"; exit $?;;
|
||||
|
||||
--) shift
|
||||
break;;
|
||||
|
||||
-*) echo "$0: invalid option: $1" >&2
|
||||
exit 1;;
|
||||
|
||||
*) break;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
||||
# When -d is used, all remaining arguments are directories to create.
|
||||
# When -t is used, the destination is already specified.
|
||||
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||
for arg
|
||||
do
|
||||
if test -n "$dst_arg"; then
|
||||
# $@ is not empty: it contains at least $arg.
|
||||
set fnord "$@" "$dst_arg"
|
||||
shift # fnord
|
||||
fi
|
||||
shift # arg
|
||||
dst_arg=$arg
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $dst_arg in
|
||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]
|
||||
then
|
||||
if [ -d "$dstarg" ]; then
|
||||
true
|
||||
else
|
||||
$doit $mkdirprog "$dstarg" &&
|
||||
if test $# -eq 0; then
|
||||
if test -z "$dir_arg"; then
|
||||
echo "$0: no input file specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
# It's OK to call 'install-sh -d' without argument.
|
||||
# This can happen when creating conditional directories.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dstarg"; else true ; fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dstarg"; else true ; fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dstarg"; else true ; fi
|
||||
fi
|
||||
if test -z "$dir_arg"; then
|
||||
do_exit='(exit $ret); exit $ret'
|
||||
trap "ret=129; $do_exit" 1
|
||||
trap "ret=130; $do_exit" 2
|
||||
trap "ret=141; $do_exit" 13
|
||||
trap "ret=143; $do_exit" 15
|
||||
|
||||
# Set umask so as not to create temps with too-generous modes.
|
||||
# However, 'strip' requires both read and write access to temps.
|
||||
case $mode in
|
||||
# Optimize common cases.
|
||||
*644) cp_umask=133;;
|
||||
*755) cp_umask=22;;
|
||||
|
||||
*[0-7])
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw='% 200'
|
||||
fi
|
||||
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
|
||||
*)
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw=,u+rw
|
||||
fi
|
||||
cp_umask=$mode$u_plus_rw;;
|
||||
esac
|
||||
fi
|
||||
|
||||
for src
|
||||
do
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $src in
|
||||
-* | [=\(\)!]) src=./$src;;
|
||||
esac
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
dst=$src
|
||||
dstdir=$dst
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
if test ! -f "$src" && test ! -d "$src"; then
|
||||
echo "$0: $src does not exist." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -z "$dst_arg"; then
|
||||
echo "$0: no destination specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
dst=$dst_arg
|
||||
|
||||
# If destination is a directory, append the input filename; won't work
|
||||
# if double slashes aren't ignored.
|
||||
if test -d "$dst"; then
|
||||
if test -n "$no_target_directory"; then
|
||||
echo "$0: $dst_arg: Is a directory" >&2
|
||||
exit 1
|
||||
fi
|
||||
dstdir=$dst
|
||||
dst=$dstdir/`basename "$src"`
|
||||
dstdir_status=0
|
||||
else
|
||||
# Prefer dirname, but fall back on a substitute if dirname fails.
|
||||
dstdir=`
|
||||
(dirname "$dst") 2>/dev/null ||
|
||||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
|
||||
X"$dst" : 'X\(//\)[^/]' \| \
|
||||
X"$dst" : 'X\(//\)$' \| \
|
||||
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
|
||||
echo X"$dst" |
|
||||
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\/\)[^/].*/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\/\)$/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\).*/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
s/.*/./; q'
|
||||
`
|
||||
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
fi
|
||||
fi
|
||||
|
||||
obsolete_mkdir_used=false
|
||||
|
||||
if test $dstdir_status != 0; then
|
||||
case $posix_mkdir in
|
||||
'')
|
||||
# Create intermediate dirs using mode 755 as modified by the umask.
|
||||
# This is like FreeBSD 'install' as of 1997-10-28.
|
||||
umask=`umask`
|
||||
case $stripcmd.$umask in
|
||||
# Optimize common cases.
|
||||
*[2367][2367]) mkdir_umask=$umask;;
|
||||
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
|
||||
|
||||
*[0-7])
|
||||
mkdir_umask=`expr $umask + 22 \
|
||||
- $umask % 100 % 40 + $umask % 20 \
|
||||
- $umask % 10 % 4 + $umask % 2
|
||||
`;;
|
||||
*) mkdir_umask=$umask,go-w;;
|
||||
esac
|
||||
|
||||
# With -d, create the new directory with the user-specified mode.
|
||||
# Otherwise, rely on $mkdir_umask.
|
||||
if test -n "$dir_arg"; then
|
||||
mkdir_mode=-m$mode
|
||||
else
|
||||
|
||||
if [ x"$dstisfile" = x ]
|
||||
then
|
||||
file=$srcarg
|
||||
else
|
||||
file=$dst
|
||||
fi
|
||||
|
||||
dstfile=`basename "$file"`
|
||||
dstfinal="$dstdir/$dstfile"
|
||||
|
||||
# Make a temp file name in the proper directory.
|
||||
|
||||
dsttmp=$dstdir/#inst.$$#
|
||||
|
||||
# Make a backup file name in the proper directory.
|
||||
case x$suffixfmt in
|
||||
*%*) suffix=`echo x |
|
||||
$awkprog -v bname="$dstfinal" -v fmt="$suffixfmt" '
|
||||
{ cnt = 0;
|
||||
do {
|
||||
sfx = sprintf(fmt, cnt++);
|
||||
name = bname sfx;
|
||||
} while (system("test -f " name) == 0);
|
||||
print sfx; }' -`;;
|
||||
x) ;;
|
||||
*) suffix="$suffixfmt";;
|
||||
esac
|
||||
dstbackup="$dstfinal$suffix"
|
||||
|
||||
# Move or copy the file name to the temp name
|
||||
|
||||
$doit $doinst $srcarg "$dsttmp" &&
|
||||
|
||||
trap "rm -f ${dsttmp}" 0 &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits
|
||||
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else true;fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else true;fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $stripflags "$dsttmp"; else true;fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else true;fi &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
|
||||
if [ x"$suffix" != x ] && [ -f "$dstfinal" ]
|
||||
then
|
||||
$doit $mvcmd "$dstfinal" "$dstbackup"
|
||||
else
|
||||
$doit $rmcmd -f "$dstfinal"
|
||||
fi &&
|
||||
$doit $mvcmd "$dsttmp" "$dstfinal"
|
||||
mkdir_mode=
|
||||
fi
|
||||
|
||||
done &&
|
||||
posix_mkdir=false
|
||||
case $umask in
|
||||
*[123567][0-7][0-7])
|
||||
# POSIX mkdir -p sets u+wx bits regardless of umask, which
|
||||
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
|
||||
;;
|
||||
*)
|
||||
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
|
||||
|
||||
if (umask $mkdir_umask &&
|
||||
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
|
||||
then
|
||||
if test -z "$dir_arg" || {
|
||||
# Check for POSIX incompatibilities with -m.
|
||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||
# other-writable bit of parent directory when it shouldn't.
|
||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||
ls_ld_tmpdir=`ls -ld "$tmpdir"`
|
||||
case $ls_ld_tmpdir in
|
||||
d????-?r-*) different_mode=700;;
|
||||
d????-?--*) different_mode=755;;
|
||||
*) false;;
|
||||
esac &&
|
||||
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
|
||||
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
|
||||
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||
}
|
||||
}
|
||||
then posix_mkdir=:
|
||||
fi
|
||||
rmdir "$tmpdir/d" "$tmpdir"
|
||||
else
|
||||
# Remove any dirs left behind by ancient mkdir implementations.
|
||||
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
|
||||
fi
|
||||
trap '' 0;;
|
||||
esac;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
if
|
||||
$posix_mkdir && (
|
||||
umask $mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
||||
)
|
||||
then :
|
||||
else
|
||||
|
||||
# The umask is ridiculous, or mkdir does not conform to POSIX,
|
||||
# or it failed possibly due to a race condition. Create the
|
||||
# directory the slow way, step by step, checking for races as we go.
|
||||
|
||||
case $dstdir in
|
||||
/*) prefix='/';;
|
||||
[-=\(\)!]*) prefix='./';;
|
||||
*) prefix='';;
|
||||
esac
|
||||
|
||||
eval "$initialize_posix_glob"
|
||||
|
||||
oIFS=$IFS
|
||||
IFS=/
|
||||
$posix_glob set -f
|
||||
set fnord $dstdir
|
||||
shift
|
||||
$posix_glob set +f
|
||||
IFS=$oIFS
|
||||
|
||||
prefixes=
|
||||
|
||||
for d
|
||||
do
|
||||
test X"$d" = X && continue
|
||||
|
||||
prefix=$prefix$d
|
||||
if test -d "$prefix"; then
|
||||
prefixes=
|
||||
else
|
||||
if $posix_mkdir; then
|
||||
(umask=$mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
||||
# Don't fail if two instances are running concurrently.
|
||||
test -d "$prefix" || exit 1
|
||||
else
|
||||
case $prefix in
|
||||
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
||||
*) qprefix=$prefix;;
|
||||
esac
|
||||
prefixes="$prefixes '$qprefix'"
|
||||
fi
|
||||
fi
|
||||
prefix=$prefix/
|
||||
done
|
||||
|
||||
if test -n "$prefixes"; then
|
||||
# Don't fail if two instances are running concurrently.
|
||||
(umask $mkdir_umask &&
|
||||
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
||||
test -d "$dstdir" || exit 1
|
||||
obsolete_mkdir_used=true
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
|
||||
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
|
||||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
|
||||
else
|
||||
|
||||
# Make a couple of temp file names in the proper directory.
|
||||
dsttmp=$dstdir/_inst.$$_
|
||||
rmtmp=$dstdir/_rm.$$_
|
||||
|
||||
# Trap to clean up those temp files at exit.
|
||||
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||
|
||||
# Copy the file name to the temp name.
|
||||
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits.
|
||||
#
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
||||
#
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
|
||||
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
|
||||
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
|
||||
|
||||
# If -C, don't bother to copy if it wouldn't change the file.
|
||||
if $copy_on_change &&
|
||||
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
|
||||
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
|
||||
|
||||
eval "$initialize_posix_glob" &&
|
||||
$posix_glob set -f &&
|
||||
set X $old && old=:$2:$4:$5:$6 &&
|
||||
set X $new && new=:$2:$4:$5:$6 &&
|
||||
$posix_glob set +f &&
|
||||
|
||||
test "$old" = "$new" &&
|
||||
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
|
||||
then
|
||||
rm -f "$dsttmp"
|
||||
else
|
||||
# Rename the file to the real destination.
|
||||
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
|
||||
|
||||
# The rename failed, perhaps because mv can't rename something else
|
||||
# to itself, or perhaps because mv is so ancient that it does not
|
||||
# support -f.
|
||||
{
|
||||
# Now remove or move aside any old file at destination location.
|
||||
# We try this two ways since rm can't unlink itself on some
|
||||
# systems and the destination file might be busy for other
|
||||
# reasons. In this case, the final cleanup might fail but the new
|
||||
# file should still install successfully.
|
||||
{
|
||||
test ! -f "$dst" ||
|
||||
$doit $rmcmd -f "$dst" 2>/dev/null ||
|
||||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
|
||||
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
|
||||
} ||
|
||||
{ echo "$0: cannot unlink or rename $dst" >&2
|
||||
(exit 1); exit 1
|
||||
}
|
||||
} &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dst"
|
||||
}
|
||||
fi || exit 1
|
||||
|
||||
trap '' 0
|
||||
fi
|
||||
done
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
|
5347
admin/ltmain.sh
5347
admin/ltmain.sh
File diff suppressed because it is too large
Load Diff
10
atf-c++.hpp
10
atf-c++.hpp
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,12 +22,11 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#if !defined(_ATF_CXX_HPP_)
|
||||
#define _ATF_CXX_HPP_
|
||||
#if !defined(ATF_CXX_HPP)
|
||||
#define ATF_CXX_HPP
|
||||
|
||||
#include <atf-c++/macros.hpp>
|
||||
#include <atf-c++/utils.hpp>
|
||||
|
||||
#endif // !defined(_ATF_CXX_HPP_)
|
||||
#endif // !defined(ATF_CXX_HPP)
|
||||
|
@ -5,7 +5,6 @@ test_suite("atf")
|
||||
atf_test_program{name="atf_c++_test"}
|
||||
atf_test_program{name="build_test"}
|
||||
atf_test_program{name="check_test"}
|
||||
atf_test_program{name="config_test"}
|
||||
atf_test_program{name="macros_test"}
|
||||
atf_test_program{name="pkg_config_test"}
|
||||
atf_test_program{name="tests_test"}
|
||||
|
@ -1,6 +1,3 @@
|
||||
#
|
||||
# Automated Testing Framework (atf)
|
||||
#
|
||||
# Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
@ -25,7 +22,6 @@
|
||||
# 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.
|
||||
#
|
||||
|
||||
ATF_CXX_LIBS = libatf-c++.la libatf-c.la
|
||||
|
||||
@ -35,25 +31,22 @@ libatf_c___la_SOURCES = atf-c++/build.cpp \
|
||||
atf-c++/build.hpp \
|
||||
atf-c++/check.cpp \
|
||||
atf-c++/check.hpp \
|
||||
atf-c++/config.cpp \
|
||||
atf-c++/config.hpp \
|
||||
atf-c++/macros.hpp \
|
||||
atf-c++/tests.cpp \
|
||||
atf-c++/tests.hpp \
|
||||
atf-c++/utils.cpp \
|
||||
atf-c++/utils.hpp
|
||||
libatf_c___la_LDFLAGS = -version-info 1:0:0
|
||||
libatf_c___la_LDFLAGS = -version-info 2:0:0
|
||||
|
||||
include_HEADERS += atf-c++.hpp
|
||||
atf_c___HEADERS = atf-c++/build.hpp \
|
||||
atf-c++/check.hpp \
|
||||
atf-c++/config.hpp \
|
||||
atf-c++/macros.hpp \
|
||||
atf-c++/tests.hpp \
|
||||
atf-c++/utils.hpp
|
||||
atf_c__dir = $(includedir)/atf-c++
|
||||
|
||||
dist_man_MANS += atf-c++/atf-c++-api.3
|
||||
dist_man_MANS += atf-c++/atf-c++.3
|
||||
|
||||
atf_aclocal_DATA += atf-c++/atf-c++.m4
|
||||
EXTRA_DIST += atf-c++/atf-c++.m4
|
||||
@ -63,12 +56,12 @@ atf_c__dirpkgconfig_DATA = atf-c++/atf-c++.pc
|
||||
CLEANFILES += atf-c++/atf-c++.pc
|
||||
EXTRA_DIST += atf-c++/atf-c++.pc.in
|
||||
atf-c++/atf-c++.pc: $(srcdir)/atf-c++/atf-c++.pc.in Makefile
|
||||
test -d atf-c++ || mkdir -p atf-c++
|
||||
$(AM_V_GEN)test -d atf-c++ || mkdir -p atf-c++; \
|
||||
sed -e 's#__ATF_VERSION__#$(PACKAGE_VERSION)#g' \
|
||||
-e 's#__CXX__#$(CXX)#g' \
|
||||
-e 's#__INCLUDEDIR__#$(includedir)#g' \
|
||||
-e 's#__LIBDIR__#$(libdir)#g' \
|
||||
<$(srcdir)/atf-c++/atf-c++.pc.in >atf-c++/atf-c++.pc.tmp
|
||||
<$(srcdir)/atf-c++/atf-c++.pc.in >atf-c++/atf-c++.pc.tmp; \
|
||||
mv atf-c++/atf-c++.pc.tmp atf-c++/atf-c++.pc
|
||||
|
||||
tests_atf_c___DATA = atf-c++/Kyuafile \
|
||||
@ -86,9 +79,6 @@ atf_c___build_test_LDADD = atf-c++/detail/libtest_helpers.la $(ATF_CXX_LIBS)
|
||||
tests_atf_c___PROGRAMS += atf-c++/check_test
|
||||
atf_c___check_test_SOURCES = atf-c++/check_test.cpp
|
||||
atf_c___check_test_LDADD = atf-c++/detail/libtest_helpers.la $(ATF_CXX_LIBS)
|
||||
tests_atf_c___PROGRAMS += atf-c++/config_test
|
||||
atf_c___config_test_SOURCES = atf-c++/config_test.cpp
|
||||
atf_c___config_test_LDADD = atf-c++/detail/libtest_helpers.la $(ATF_CXX_LIBS)
|
||||
tests_atf_c___PROGRAMS += atf-c++/macros_test
|
||||
atf_c___macros_test_SOURCES = atf-c++/macros_test.cpp
|
||||
atf_c___macros_test_LDADD = atf-c++/detail/libtest_helpers.la $(ATF_CXX_LIBS)
|
||||
@ -96,8 +86,7 @@ tests_atf_c___SCRIPTS = atf-c++/pkg_config_test
|
||||
CLEANFILES += atf-c++/pkg_config_test
|
||||
EXTRA_DIST += atf-c++/pkg_config_test.sh
|
||||
atf-c++/pkg_config_test: $(srcdir)/atf-c++/pkg_config_test.sh
|
||||
test -d atf-c++ || mkdir -p atf-c++
|
||||
@src="$(srcdir)/atf-c++/pkg_config_test.sh"; \
|
||||
$(AM_V_GEN)src="$(srcdir)/atf-c++/pkg_config_test.sh"; \
|
||||
dst="atf-c++/pkg_config_test"; $(BUILD_SH_TP)
|
||||
|
||||
tests_atf_c___PROGRAMS += atf-c++/tests_test
|
||||
|
@ -1,6 +1,3 @@
|
||||
.\"
|
||||
.\" Automated Testing Framework (atf)
|
||||
.\"
|
||||
.\" Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
@ -25,12 +22,11 @@
|
||||
.\" 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.
|
||||
.\"
|
||||
.Dd November 15, 2013
|
||||
.Dt ATF-C++-API 3
|
||||
.Dd October 13, 2014
|
||||
.Dt ATF-C++ 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm atf-c++-api ,
|
||||
.Nm atf-c++ ,
|
||||
.Nm ATF_ADD_TEST_CASE ,
|
||||
.Nm ATF_CHECK_ERRNO ,
|
||||
.Nm ATF_FAIL ,
|
||||
@ -68,13 +64,13 @@
|
||||
.Sh SYNOPSIS
|
||||
.In atf-c++.hpp
|
||||
.Fn ATF_ADD_TEST_CASE "tcs" "name"
|
||||
.Fn ATF_CHECK_ERRNO "exp_errno" "bool_expression"
|
||||
.Fn ATF_CHECK_ERRNO "expected_errno" "bool_expression"
|
||||
.Fn ATF_FAIL "reason"
|
||||
.Fn ATF_INIT_TEST_CASES "tcs"
|
||||
.Fn ATF_PASS
|
||||
.Fn ATF_REQUIRE "expression"
|
||||
.Fn ATF_REQUIRE_EQ "expression_1" "expression_2"
|
||||
.Fn ATF_REQUIRE_ERRNO "exp_errno" "bool_expression"
|
||||
.Fn ATF_REQUIRE_EQ "expected_expression" "actual_expression"
|
||||
.Fn ATF_REQUIRE_ERRNO "expected_errno" "bool_expression"
|
||||
.Fn ATF_REQUIRE_IN "element" "collection"
|
||||
.Fn ATF_REQUIRE_MATCH "regexp" "string_expression"
|
||||
.Fn ATF_REQUIRE_NOT_IN "element" "collection"
|
||||
@ -330,9 +326,8 @@ If
|
||||
.Va exitcode
|
||||
is not
|
||||
.Sq -1 ,
|
||||
.Xr atf-run 1
|
||||
will validate that the exit code of the test case matches the one provided
|
||||
in this call.
|
||||
the runtime engine will validate that the exit code of the test case
|
||||
matches the one provided in this call.
|
||||
Otherwise, the exact value will be ignored.
|
||||
.It Fn expect_fail "reason"
|
||||
Any failure (be it fatal or non-fatal) raised in this mode is recorded.
|
||||
@ -368,9 +363,8 @@ If
|
||||
.Va signo
|
||||
is not
|
||||
.Sq -1 ,
|
||||
.Xr atf-run 1
|
||||
will validate that the signal that terminated the test case matches the one
|
||||
provided in this call.
|
||||
the runtime engine will validate that the signal that terminated the test
|
||||
case matches the one provided in this call.
|
||||
Otherwise, the exact value will be ignored.
|
||||
.It Fn expect_timeout "reason"
|
||||
Expects the test case to execute for longer than its timeout.
|
||||
@ -390,6 +384,8 @@ takes an expression and raises a failure if it evaluates to false.
|
||||
.Fn ATF_REQUIRE_EQ
|
||||
takes two expressions and raises a failure if the two do not evaluate to
|
||||
the same exact value.
|
||||
The common style is to put the expected value in the first parameter and the
|
||||
actual value in the second parameter.
|
||||
.Pp
|
||||
.Fn ATF_REQUIRE_IN
|
||||
takes an element and a collection and validates that the element is present in
|
||||
@ -577,6 +573,25 @@ strings are prefixed with
|
||||
then they specify the name of the file into which to store the stdout or stderr
|
||||
of the subprocess, and no comparison is performed.
|
||||
.Ed
|
||||
.Sh ENVIRONMENT
|
||||
The following variables are recognized by
|
||||
.Nm
|
||||
but should not be overridden other than for testing purposes:
|
||||
.Pp
|
||||
.Bl -tag -width ATFXBUILDXCXXFLAGSXX -compact
|
||||
.It Va ATF_BUILD_CC
|
||||
Path to the C compiler.
|
||||
.It Va ATF_BUILD_CFLAGS
|
||||
C compiler flags.
|
||||
.It Va ATF_BUILD_CPP
|
||||
Path to the C/C++ preprocessor.
|
||||
.It Va ATF_BUILD_CPPFLAGS
|
||||
C/C++ preprocessor flags.
|
||||
.It Va ATF_BUILD_CXX
|
||||
Path to the C++ compiler.
|
||||
.It Va ATF_BUILD_CXXFLAGS
|
||||
C++ compiler flags.
|
||||
.El
|
||||
.Sh EXAMPLES
|
||||
The following shows a complete test program with a single test case that
|
||||
validates the addition operator:
|
||||
@ -590,13 +605,13 @@ ATF_TEST_CASE_HEAD(addition)
|
||||
}
|
||||
ATF_TEST_CASE_BODY(addition)
|
||||
{
|
||||
ATF_REQUIRE_EQ(0 + 0, 0);
|
||||
ATF_REQUIRE_EQ(0 + 1, 1);
|
||||
ATF_REQUIRE_EQ(1 + 0, 1);
|
||||
ATF_REQUIRE_EQ(0, 0 + 0);
|
||||
ATF_REQUIRE_EQ(1, 0 + 1);
|
||||
ATF_REQUIRE_EQ(1, 1 + 0);
|
||||
|
||||
ATF_REQUIRE_EQ(1 + 1, 2);
|
||||
ATF_REQUIRE_EQ(2, 1 + 1);
|
||||
|
||||
ATF_REQUIRE_EQ(100 + 200, 300);
|
||||
ATF_REQUIRE_EQ(300, 100 + 200);
|
||||
}
|
||||
|
||||
ATF_TEST_CASE(open_failure);
|
||||
@ -631,5 +646,4 @@ ATF_INIT_TEST_CASES(tcs)
|
||||
.Ed
|
||||
.Sh SEE ALSO
|
||||
.Xr atf-test-program 1 ,
|
||||
.Xr atf-test-case 4 ,
|
||||
.Xr atf 7
|
||||
.Xr atf-test-case 4
|
@ -1,6 +1,3 @@
|
||||
dnl
|
||||
dnl Automated Testing Framework (atf)
|
||||
dnl
|
||||
dnl Copyright 2011 Google Inc.
|
||||
dnl All rights reserved.
|
||||
dnl
|
||||
@ -28,7 +25,6 @@ dnl DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
dnl THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
dnl (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
dnl OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
dnl
|
||||
|
||||
dnl ATF_CHECK_CXX([version-spec])
|
||||
dnl
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2009 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,11 +22,10 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#include "macros.hpp"
|
||||
#include <atf-c++.hpp>
|
||||
|
||||
#include "detail/test_helpers.hpp"
|
||||
#include "atf-c++/detail/test_helpers.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Tests cases for the header file.
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2009 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,7 +22,8 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#include "atf-c++/build.hpp"
|
||||
|
||||
extern "C" {
|
||||
#include "atf-c/build.h"
|
||||
@ -33,10 +31,8 @@ extern "C" {
|
||||
#include "atf-c/utils.h"
|
||||
}
|
||||
|
||||
#include "build.hpp"
|
||||
|
||||
#include "detail/exceptions.hpp"
|
||||
#include "detail/process.hpp"
|
||||
#include "atf-c++/detail/exceptions.hpp"
|
||||
#include "atf-c++/detail/process.hpp"
|
||||
|
||||
namespace impl = atf::build;
|
||||
#define IMPL_NAME "atf::build"
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2009 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,10 +22,9 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#if !defined(_ATF_CXX_BUILD_HPP_)
|
||||
#define _ATF_CXX_BUILD_HPP_
|
||||
#if !defined(ATF_CXX_BUILD_HPP)
|
||||
#define ATF_CXX_BUILD_HPP
|
||||
|
||||
#include <string>
|
||||
|
||||
@ -54,4 +50,4 @@ process::argv_array cxx_o(const std::string&, const std::string&,
|
||||
} // namespace build
|
||||
} // namespace atf
|
||||
|
||||
#endif // !defined(_ATF_CXX_BUILD_HPP_)
|
||||
#endif // !defined(ATF_CXX_BUILD_HPP)
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2009 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,31 +22,25 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#include "atf-c++/build.hpp"
|
||||
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
|
||||
#include "../atf-c/h_build.h"
|
||||
#include <atf-c++.hpp>
|
||||
|
||||
#include "build.hpp"
|
||||
#include "config.hpp"
|
||||
#include "macros.hpp"
|
||||
extern "C" {
|
||||
#include "atf-c/h_build.h"
|
||||
}
|
||||
|
||||
#include "detail/env.hpp"
|
||||
#include "detail/process.hpp"
|
||||
#include "detail/test_helpers.hpp"
|
||||
#include "atf-c++/detail/env.hpp"
|
||||
#include "atf-c++/detail/process.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Auxiliary functions.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
namespace atf {
|
||||
namespace config {
|
||||
void __reinit(void);
|
||||
}
|
||||
}
|
||||
|
||||
template< class C >
|
||||
void
|
||||
print_col(const char* prefix, const C& c)
|
||||
@ -168,7 +159,6 @@ ATF_TEST_CASE_BODY(c_o)
|
||||
verbose_set_env("ATF_BUILD_CC", test->cc);
|
||||
verbose_set_env("ATF_BUILD_CFLAGS", test->cflags);
|
||||
verbose_set_env("ATF_BUILD_CPPFLAGS", test->cppflags);
|
||||
atf::config::__reinit();
|
||||
|
||||
atf::process::argv_array argv =
|
||||
atf::build::c_o(test->sfile, test->ofile,
|
||||
@ -190,7 +180,6 @@ ATF_TEST_CASE_BODY(cpp)
|
||||
|
||||
verbose_set_env("ATF_BUILD_CPP", test->cpp);
|
||||
verbose_set_env("ATF_BUILD_CPPFLAGS", test->cppflags);
|
||||
atf::config::__reinit();
|
||||
|
||||
atf::process::argv_array argv =
|
||||
atf::build::cpp(test->sfile, test->ofile,
|
||||
@ -213,7 +202,6 @@ ATF_TEST_CASE_BODY(cxx_o)
|
||||
verbose_set_env("ATF_BUILD_CXX", test->cxx);
|
||||
verbose_set_env("ATF_BUILD_CXXFLAGS", test->cxxflags);
|
||||
verbose_set_env("ATF_BUILD_CPPFLAGS", test->cppflags);
|
||||
atf::config::__reinit();
|
||||
|
||||
atf::process::argv_array argv =
|
||||
atf::build::cxx_o(test->sfile, test->ofile,
|
||||
@ -222,12 +210,6 @@ ATF_TEST_CASE_BODY(cxx_o)
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Tests cases for the header file.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
HEADER_TC(include, "atf-c++/build.hpp");
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Main.
|
||||
// ------------------------------------------------------------------------
|
||||
@ -241,7 +223,4 @@ ATF_INIT_TEST_CASES(tcs)
|
||||
ATF_ADD_TEST_CASE(tcs, c_o);
|
||||
ATF_ADD_TEST_CASE(tcs, cpp);
|
||||
ATF_ADD_TEST_CASE(tcs, cxx_o);
|
||||
|
||||
// Add the test cases for the header file.
|
||||
ATF_ADD_TEST_CASE(tcs, include);
|
||||
}
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,7 +22,8 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#include "atf-c++/check.hpp"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
@ -34,11 +32,9 @@ extern "C" {
|
||||
#include "atf-c/error.h"
|
||||
}
|
||||
|
||||
#include "check.hpp"
|
||||
|
||||
#include "detail/exceptions.hpp"
|
||||
#include "detail/process.hpp"
|
||||
#include "detail/sanity.hpp"
|
||||
#include "atf-c++/detail/exceptions.hpp"
|
||||
#include "atf-c++/detail/process.hpp"
|
||||
#include "atf-c++/detail/sanity.hpp"
|
||||
|
||||
namespace impl = atf::check;
|
||||
#define IMPL_NAME "atf::check"
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,10 +22,9 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#if !defined(_ATF_CXX_CHECK_HPP_)
|
||||
#define _ATF_CXX_CHECK_HPP_
|
||||
#if !defined(ATF_CXX_CHECK_HPP)
|
||||
#define ATF_CXX_CHECK_HPP
|
||||
|
||||
extern "C" {
|
||||
#include <atf-c/check.h>
|
||||
@ -132,4 +128,4 @@ check_result test_constructor(void);
|
||||
} // namespace check
|
||||
} // namespace atf
|
||||
|
||||
#endif // !defined(_ATF_CXX_CHECK_HPP_)
|
||||
#endif // !defined(ATF_CXX_CHECK_HPP)
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,7 +22,8 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#include "atf-c++/check.hpp"
|
||||
|
||||
extern "C" {
|
||||
#include <fcntl.h>
|
||||
@ -43,14 +41,11 @@ extern "C" {
|
||||
|
||||
#include <atf-c++.hpp>
|
||||
|
||||
#include "check.hpp"
|
||||
#include "config.hpp"
|
||||
#include "utils.hpp"
|
||||
|
||||
#include "detail/fs.hpp"
|
||||
#include "detail/process.hpp"
|
||||
#include "detail/test_helpers.hpp"
|
||||
#include "detail/text.hpp"
|
||||
#include "atf-c++/detail/fs.hpp"
|
||||
#include "atf-c++/detail/process.hpp"
|
||||
#include "atf-c++/detail/test_helpers.hpp"
|
||||
#include "atf-c++/detail/text.hpp"
|
||||
#include "atf-c++/utils.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Auxiliary functions.
|
||||
@ -374,7 +369,7 @@ ATF_TEST_CASE_HEAD(exec_unknown)
|
||||
ATF_TEST_CASE_BODY(exec_unknown)
|
||||
{
|
||||
std::vector< std::string > argv;
|
||||
argv.push_back(atf::config::get("atf_workdir") + "/non-existent");
|
||||
argv.push_back("/foo/bar/non-existent");
|
||||
|
||||
atf::process::argv_array argva(argv);
|
||||
std::auto_ptr< atf::check::check_result > r = atf::check::exec(argva);
|
||||
@ -382,12 +377,6 @@ ATF_TEST_CASE_BODY(exec_unknown)
|
||||
ATF_REQUIRE_EQ(r->exitcode(), 127);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Tests cases for the header file.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
HEADER_TC(include, "atf-c++/check.hpp");
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Main.
|
||||
// ------------------------------------------------------------------------
|
||||
@ -402,7 +391,4 @@ ATF_INIT_TEST_CASES(tcs)
|
||||
ATF_ADD_TEST_CASE(tcs, exec_exitstatus);
|
||||
ATF_ADD_TEST_CASE(tcs, exec_stdout_stderr);
|
||||
ATF_ADD_TEST_CASE(tcs, exec_unknown);
|
||||
|
||||
// Add the test cases for the header file.
|
||||
ATF_ADD_TEST_CASE(tcs, include);
|
||||
}
|
||||
|
@ -1,119 +0,0 @@
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
|
||||
#include <map>
|
||||
|
||||
extern "C" {
|
||||
#include "atf-c/config.h"
|
||||
}
|
||||
|
||||
#include "config.hpp"
|
||||
|
||||
#include "detail/env.hpp"
|
||||
#include "detail/sanity.hpp"
|
||||
|
||||
static std::map< std::string, std::string > m_variables;
|
||||
|
||||
//
|
||||
// Adds all predefined standard build-time variables to the m_variables
|
||||
// map, considering the values a user may have provided in the environment.
|
||||
//
|
||||
// Can only be called once during the program's lifetime.
|
||||
//
|
||||
static
|
||||
void
|
||||
init_variables(void)
|
||||
{
|
||||
PRE(m_variables.empty());
|
||||
|
||||
m_variables["atf_build_cc"] = atf_config_get("atf_build_cc");
|
||||
m_variables["atf_build_cflags"] = atf_config_get("atf_build_cflags");
|
||||
m_variables["atf_build_cpp"] = atf_config_get("atf_build_cpp");
|
||||
m_variables["atf_build_cppflags"] = atf_config_get("atf_build_cppflags");
|
||||
m_variables["atf_build_cxx"] = atf_config_get("atf_build_cxx");
|
||||
m_variables["atf_build_cxxflags"] = atf_config_get("atf_build_cxxflags");
|
||||
m_variables["atf_includedir"] = atf_config_get("atf_includedir");
|
||||
m_variables["atf_libexecdir"] = atf_config_get("atf_libexecdir");
|
||||
m_variables["atf_pkgdatadir"] = atf_config_get("atf_pkgdatadir");
|
||||
m_variables["atf_shell"] = atf_config_get("atf_shell");
|
||||
m_variables["atf_workdir"] = atf_config_get("atf_workdir");
|
||||
|
||||
POST(!m_variables.empty());
|
||||
}
|
||||
|
||||
const std::string&
|
||||
atf::config::get(const std::string& varname)
|
||||
{
|
||||
if (m_variables.empty())
|
||||
init_variables();
|
||||
|
||||
PRE(has(varname));
|
||||
return m_variables[varname];
|
||||
}
|
||||
|
||||
const std::map< std::string, std::string >&
|
||||
atf::config::get_all(void)
|
||||
{
|
||||
if (m_variables.empty())
|
||||
init_variables();
|
||||
|
||||
return m_variables;
|
||||
}
|
||||
|
||||
bool
|
||||
atf::config::has(const std::string& varname)
|
||||
{
|
||||
if (m_variables.empty())
|
||||
init_variables();
|
||||
|
||||
return m_variables.find(varname) != m_variables.end();
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
void __atf_config_reinit(void);
|
||||
}
|
||||
|
||||
namespace atf {
|
||||
namespace config {
|
||||
//
|
||||
// Auxiliary function for the t_config test program so that it can
|
||||
// revert the configuration's global status to an empty state and
|
||||
// do new tests from there on.
|
||||
//
|
||||
// Ideally this shouldn't be part of the production library... but
|
||||
// this is so small that it does not matter.
|
||||
//
|
||||
void
|
||||
__reinit(void)
|
||||
{
|
||||
__atf_config_reinit();
|
||||
m_variables.clear();
|
||||
}
|
||||
} // namespace config
|
||||
} // namespace atf
|
@ -1,75 +0,0 @@
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
|
||||
#if !defined(_ATF_CXX_CONFIG_HPP_)
|
||||
#define _ATF_CXX_CONFIG_HPP_
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
namespace atf {
|
||||
|
||||
namespace config {
|
||||
|
||||
//!
|
||||
//! \brief Gets a build-time configuration variable's value.
|
||||
//!
|
||||
//! Given the name of a build-time configuration variable, returns its
|
||||
//! textual value. The user is free to override these by setting their
|
||||
//! corresponding environment variables. Therefore always use this
|
||||
//! interface to get the value of these variables.
|
||||
//!
|
||||
//! \pre The variable must exist.
|
||||
//!
|
||||
const std::string& get(const std::string&);
|
||||
|
||||
//!
|
||||
//! \brief Returns all the build-time configuration variables.
|
||||
//!
|
||||
//! Returns a name to value map containing all build-time configuration
|
||||
//! variables.
|
||||
//!
|
||||
const std::map< std::string, std::string >& get_all(void);
|
||||
|
||||
//!
|
||||
//! \brief Checks whether a build-time configuration variable exists.
|
||||
//!
|
||||
//! Given the name of a build-time configuration variable, checks
|
||||
//! whether it is defined and returns a boolean indicating this
|
||||
//! condition. The program only has to use this function to sanity-check
|
||||
//! a variable name provided by the user. Otherwise it can assume that
|
||||
//! the variables are defined.
|
||||
//!
|
||||
bool has(const std::string&);
|
||||
|
||||
} // namespace config
|
||||
|
||||
} // namespace atf
|
||||
|
||||
#endif // !defined(_ATF_CXX_CONFIG_HPP_)
|
@ -1,227 +0,0 @@
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
|
||||
#include "config.hpp"
|
||||
#include "macros.hpp"
|
||||
|
||||
#include "detail/env.hpp"
|
||||
#include "detail/exceptions.hpp"
|
||||
#include "detail/test_helpers.hpp"
|
||||
|
||||
static const char *test_value = "env-value";
|
||||
|
||||
static struct varnames {
|
||||
const char *lc;
|
||||
const char *uc;
|
||||
bool can_be_empty;
|
||||
} all_vars[] = {
|
||||
{ "atf_build_cc", "ATF_BUILD_CC", false },
|
||||
{ "atf_build_cflags", "ATF_BUILD_CFLAGS", true },
|
||||
{ "atf_build_cpp", "ATF_BUILD_CPP", false },
|
||||
{ "atf_build_cppflags", "ATF_BUILD_CPPFLAGS", true },
|
||||
{ "atf_build_cxx", "ATF_BUILD_CXX", false },
|
||||
{ "atf_build_cxxflags", "ATF_BUILD_CXXFLAGS", true },
|
||||
{ "atf_includedir", "ATF_INCLUDEDIR", false },
|
||||
{ "atf_libexecdir", "ATF_LIBEXECDIR", false },
|
||||
{ "atf_pkgdatadir", "ATF_PKGDATADIR", false },
|
||||
{ "atf_shell", "ATF_SHELL", false },
|
||||
{ "atf_workdir", "ATF_WORKDIR", false },
|
||||
{ NULL, NULL, false }
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Auxiliary functions.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
namespace atf {
|
||||
namespace config {
|
||||
void __reinit(void);
|
||||
}
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
set_env_var(const char* name, const char* val)
|
||||
{
|
||||
try {
|
||||
atf::env::set(name, val);
|
||||
} catch (const atf::system_error&) {
|
||||
ATF_FAIL(std::string("set_env_var(") + name + ", " + val +
|
||||
") failed");
|
||||
}
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
unset_env_var(const char* name)
|
||||
{
|
||||
try {
|
||||
atf::env::unset(name);
|
||||
} catch (const atf::system_error&) {
|
||||
ATF_FAIL(std::string("unset_env_var(") + name + ") failed");
|
||||
}
|
||||
}
|
||||
|
||||
static
|
||||
size_t
|
||||
all_vars_count(void)
|
||||
{
|
||||
size_t count = 0;
|
||||
for (const struct varnames* v = all_vars; v->lc != NULL; v++)
|
||||
count++;
|
||||
return count;
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
unset_all(void)
|
||||
{
|
||||
for (const struct varnames* v = all_vars; v->lc != NULL; v++)
|
||||
unset_env_var(v->uc);
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
compare_one(const char* var, const char* expvalue)
|
||||
{
|
||||
std::cout << "Checking that " << var << " is set to " << expvalue << "\n";
|
||||
|
||||
for (const struct varnames* v = all_vars; v->lc != NULL; v++) {
|
||||
if (std::strcmp(v->lc, var) == 0)
|
||||
ATF_REQUIRE_EQ(atf::config::get(v->lc), test_value);
|
||||
else
|
||||
ATF_REQUIRE(atf::config::get(v->lc) != test_value);
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Test cases for the free functions.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
ATF_TEST_CASE(get);
|
||||
ATF_TEST_CASE_HEAD(get)
|
||||
{
|
||||
set_md_var("descr", "Tests the config::get function");
|
||||
}
|
||||
ATF_TEST_CASE_BODY(get)
|
||||
{
|
||||
// Unset all known environment variables and make sure the built-in
|
||||
// values do not match the bogus value we will use for testing.
|
||||
unset_all();
|
||||
atf::config::__reinit();
|
||||
for (const struct varnames* v = all_vars; v->lc != NULL; v++)
|
||||
ATF_REQUIRE(atf::config::get(v->lc) != test_value);
|
||||
|
||||
// Test the behavior of empty values.
|
||||
for (const struct varnames* v = all_vars; v->lc != NULL; v++) {
|
||||
unset_all();
|
||||
if (!atf::config::get(v->lc).empty()) {
|
||||
set_env_var(v->uc, "");
|
||||
atf::config::__reinit();
|
||||
if (v->can_be_empty)
|
||||
ATF_REQUIRE(atf::config::get(v->lc).empty());
|
||||
else
|
||||
ATF_REQUIRE(!atf::config::get(v->lc).empty());
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the ATF_ARCH variable is recognized.
|
||||
for (const struct varnames* v = all_vars; v->lc != NULL; v++) {
|
||||
unset_all();
|
||||
set_env_var(v->uc, test_value);
|
||||
atf::config::__reinit();
|
||||
compare_one(v->lc, test_value);
|
||||
}
|
||||
}
|
||||
|
||||
ATF_TEST_CASE(get_all);
|
||||
ATF_TEST_CASE_HEAD(get_all)
|
||||
{
|
||||
set_md_var("descr", "Tests the config::get_all function");
|
||||
}
|
||||
ATF_TEST_CASE_BODY(get_all)
|
||||
{
|
||||
atf::config::__reinit();
|
||||
|
||||
// Check that the valid variables, and only those, are returned.
|
||||
std::map< std::string, std::string > vars = atf::config::get_all();
|
||||
ATF_REQUIRE_EQ(vars.size(), all_vars_count());
|
||||
for (const struct varnames* v = all_vars; v->lc != NULL; v++)
|
||||
ATF_REQUIRE(vars.find(v->lc) != vars.end());
|
||||
}
|
||||
|
||||
ATF_TEST_CASE(has);
|
||||
ATF_TEST_CASE_HEAD(has)
|
||||
{
|
||||
set_md_var("descr", "Tests the config::has function");
|
||||
}
|
||||
ATF_TEST_CASE_BODY(has)
|
||||
{
|
||||
atf::config::__reinit();
|
||||
|
||||
// Check for all the variables that must exist.
|
||||
for (const struct varnames* v = all_vars; v->lc != NULL; v++)
|
||||
ATF_REQUIRE(atf::config::has(v->lc));
|
||||
|
||||
// Same as above, but using uppercase (which is incorrect).
|
||||
for (const struct varnames* v = all_vars; v->lc != NULL; v++)
|
||||
ATF_REQUIRE(!atf::config::has(v->uc));
|
||||
|
||||
// Check for some other variables that cannot exist.
|
||||
ATF_REQUIRE(!atf::config::has("foo"));
|
||||
ATF_REQUIRE(!atf::config::has("BAR"));
|
||||
ATF_REQUIRE(!atf::config::has("atf_foo"));
|
||||
ATF_REQUIRE(!atf::config::has("ATF_BAR"));
|
||||
ATF_REQUIRE(!atf::config::has("atf_shel"));
|
||||
ATF_REQUIRE(!atf::config::has("atf_shells"));
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Tests cases for the header file.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
HEADER_TC(include, "atf-c++/config.hpp");
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Main.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
ATF_INIT_TEST_CASES(tcs)
|
||||
{
|
||||
// Add the test cases for the free functions.
|
||||
ATF_ADD_TEST_CASE(tcs, has);
|
||||
ATF_ADD_TEST_CASE(tcs, get);
|
||||
ATF_ADD_TEST_CASE(tcs, get_all);
|
||||
|
||||
// Add the test cases for the header file.
|
||||
ATF_ADD_TEST_CASE(tcs, include);
|
||||
}
|
@ -8,5 +8,4 @@ atf_test_program{name="env_test"}
|
||||
atf_test_program{name="exceptions_test"}
|
||||
atf_test_program{name="fs_test"}
|
||||
atf_test_program{name="process_test"}
|
||||
atf_test_program{name="sanity_test"}
|
||||
atf_test_program{name="text_test"}
|
||||
|
@ -1,6 +1,3 @@
|
||||
#
|
||||
# Automated Testing Framework (atf)
|
||||
#
|
||||
# Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
@ -25,7 +22,6 @@
|
||||
# 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.
|
||||
#
|
||||
|
||||
libatf_c___la_SOURCES += atf-c++/detail/application.cpp \
|
||||
atf-c++/detail/application.hpp \
|
||||
@ -49,6 +45,7 @@ EXTRA_DIST += $(tests_atf_c___detail_DATA)
|
||||
noinst_LTLIBRARIES += atf-c++/detail/libtest_helpers.la
|
||||
atf_c___detail_libtest_helpers_la_SOURCES = atf-c++/detail/test_helpers.cpp \
|
||||
atf-c++/detail/test_helpers.hpp
|
||||
atf_c___detail_libtest_helpers_la_CPPFLAGS = -DATF_INCLUDEDIR=\"$(includedir)\"
|
||||
|
||||
tests_atf_c___detail_PROGRAMS = atf-c++/detail/application_test
|
||||
atf_c___detail_application_test_SOURCES = atf-c++/detail/application_test.cpp
|
||||
@ -74,10 +71,6 @@ tests_atf_c___detail_PROGRAMS += atf-c++/detail/process_test
|
||||
atf_c___detail_process_test_SOURCES = atf-c++/detail/process_test.cpp
|
||||
atf_c___detail_process_test_LDADD = atf-c++/detail/libtest_helpers.la $(ATF_CXX_LIBS)
|
||||
|
||||
tests_atf_c___detail_PROGRAMS += atf-c++/detail/sanity_test
|
||||
atf_c___detail_sanity_test_SOURCES = atf-c++/detail/sanity_test.cpp
|
||||
atf_c___detail_sanity_test_LDADD = atf-c++/detail/libtest_helpers.la $(ATF_CXX_LIBS)
|
||||
|
||||
tests_atf_c___detail_PROGRAMS += atf-c++/detail/text_test
|
||||
atf_c___detail_text_test_SOURCES = atf-c++/detail/text_test.cpp
|
||||
atf_c___detail_text_test_LDADD = atf-c++/detail/libtest_helpers.la $(ATF_CXX_LIBS)
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,10 +22,11 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#include "atf-c++/detail/application.hpp"
|
||||
|
||||
#if defined(HAVE_CONFIG_H)
|
||||
#include "bconfig.h"
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
extern "C" {
|
||||
@ -45,8 +43,7 @@ extern "C" {
|
||||
#include "atf-c/defs.h"
|
||||
}
|
||||
|
||||
#include "application.hpp"
|
||||
#include "sanity.hpp"
|
||||
#include "atf-c++/detail/sanity.hpp"
|
||||
|
||||
#if !defined(HAVE_VSNPRINTF_IN_STD)
|
||||
namespace std {
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,10 +22,9 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#if !defined(_ATF_CXX_APPLICATION_HPP_)
|
||||
#define _ATF_CXX_APPLICATION_HPP_
|
||||
#if !defined(ATF_CXX_DETAIL_APPLICATION_HPP)
|
||||
#define ATF_CXX_DETAIL_APPLICATION_HPP
|
||||
|
||||
#include <ostream>
|
||||
#include <set>
|
||||
@ -108,4 +104,4 @@ class app {
|
||||
} // namespace application
|
||||
} // namespace atf
|
||||
|
||||
#endif // !defined(_ATF_CXX_APPLICATION_HPP_)
|
||||
#endif // !defined(ATF_CXX_DETAIL_APPLICATION_HPP)
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2009 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,15 +22,14 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#include "atf-c++/detail/application.hpp"
|
||||
|
||||
extern "C" {
|
||||
#include <unistd.h>
|
||||
}
|
||||
|
||||
#include "application.hpp"
|
||||
|
||||
#include "../macros.hpp"
|
||||
#include <atf-c++.hpp>
|
||||
|
||||
class getopt_app : public atf::application::app {
|
||||
public:
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,10 +22,9 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#if !defined(_ATF_CXX_AUTO_ARRAY_HPP_)
|
||||
#define _ATF_CXX_AUTO_ARRAY_HPP_
|
||||
#if !defined(ATF_CXX_DETAIL_AUTO_ARRAY_HPP)
|
||||
#define ATF_CXX_DETAIL_AUTO_ARRAY_HPP
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
@ -176,4 +172,4 @@ auto_array< T >::operator auto_array_ref< T >(void)
|
||||
|
||||
} // namespace atf
|
||||
|
||||
#endif // !defined(_ATF_CXX_AUTO_ARRAY_HPP_)
|
||||
#endif // !defined(ATF_CXX_DETAIL_AUTO_ARRAY_HPP)
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,7 +22,8 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#include "atf-c++/detail/auto_array.hpp"
|
||||
|
||||
extern "C" {
|
||||
#include <sys/types.h>
|
||||
@ -33,11 +31,11 @@ extern "C" {
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <atf-c++.hpp>
|
||||
|
||||
extern "C" {
|
||||
#include "atf-c/defs.h"
|
||||
|
||||
#include "../macros.hpp"
|
||||
|
||||
#include "auto_array.hpp"
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Tests for the "auto_array" class.
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,17 +22,16 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#include "atf-c++/detail/env.hpp"
|
||||
|
||||
extern "C" {
|
||||
#include "../../atf-c/error.h"
|
||||
|
||||
#include "../../atf-c/detail/env.h"
|
||||
#include "atf-c/detail/env.h"
|
||||
#include "atf-c/error.h"
|
||||
}
|
||||
|
||||
#include "env.hpp"
|
||||
#include "exceptions.hpp"
|
||||
#include "sanity.hpp"
|
||||
#include "atf-c++/detail/exceptions.hpp"
|
||||
#include "atf-c++/detail/sanity.hpp"
|
||||
|
||||
namespace impl = atf::env;
|
||||
#define IMPL_NAME "atf::env"
|
||||
@ -50,6 +46,12 @@ impl::get(const std::string& name)
|
||||
return atf_env_get(name.c_str());
|
||||
}
|
||||
|
||||
std::string
|
||||
impl::get(const std::string& name, const std::string& default_value)
|
||||
{
|
||||
return atf_env_get_with_default(name.c_str(), default_value.c_str());
|
||||
}
|
||||
|
||||
bool
|
||||
impl::has(const std::string& name)
|
||||
{
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,10 +22,9 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#if !defined(_ATF_CXX_ENV_HPP_)
|
||||
#define _ATF_CXX_ENV_HPP_
|
||||
#if !defined(ATF_CXX_DETAIL_ENV_HPP)
|
||||
#define ATF_CXX_DETAIL_ENV_HPP
|
||||
|
||||
#include <string>
|
||||
|
||||
@ -47,6 +43,11 @@ namespace env {
|
||||
//!
|
||||
std::string get(const std::string&);
|
||||
|
||||
//!
|
||||
//! \brief Returns the value of an environment variable with a default.
|
||||
//!
|
||||
std::string get(const std::string&, const std::string&);
|
||||
|
||||
//!
|
||||
//! \brief Checks if the environment has a variable.
|
||||
//!
|
||||
@ -81,4 +82,4 @@ void unset(const std::string&);
|
||||
} // namespace env
|
||||
} // namespace atf
|
||||
|
||||
#endif // !defined(_ATF_CXX_ENV_HPP_)
|
||||
#endif // !defined(ATF_CXX_DETAIL_ENV_HPP)
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,11 +22,10 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#include "../macros.hpp"
|
||||
#include "atf-c++/detail/env.hpp"
|
||||
|
||||
#include "env.hpp"
|
||||
#include <atf-c++.hpp>
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Test cases for the free functions.
|
||||
@ -48,6 +44,19 @@ ATF_TEST_CASE_BODY(has_get)
|
||||
ATF_REQUIRE(!atf::env::has("_UNDEFINED_VARIABLE_"));
|
||||
}
|
||||
|
||||
ATF_TEST_CASE(get_with_default);
|
||||
ATF_TEST_CASE_HEAD(get_with_default)
|
||||
{
|
||||
set_md_var("descr", "Tests the get function with a default value");
|
||||
}
|
||||
ATF_TEST_CASE_BODY(get_with_default)
|
||||
{
|
||||
ATF_REQUIRE(atf::env::has("PATH"));
|
||||
ATF_REQUIRE(atf::env::get("PATH", "default value") != "default value");
|
||||
|
||||
ATF_REQUIRE_EQ(atf::env::get("_UNDEFINED_VARIABLE_", "foo bar"), "foo bar");
|
||||
}
|
||||
|
||||
ATF_TEST_CASE(set);
|
||||
ATF_TEST_CASE_HEAD(set)
|
||||
{
|
||||
@ -86,6 +95,7 @@ ATF_INIT_TEST_CASES(tcs)
|
||||
{
|
||||
// Add the test cases for the free functions.
|
||||
ATF_ADD_TEST_CASE(tcs, has_get);
|
||||
ATF_ADD_TEST_CASE(tcs, get_with_default);
|
||||
ATF_ADD_TEST_CASE(tcs, set);
|
||||
ATF_ADD_TEST_CASE(tcs, unset);
|
||||
}
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,10 +22,11 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#include "atf-c++/detail/exceptions.hpp"
|
||||
|
||||
#if defined(HAVE_CONFIG_H)
|
||||
#include "bconfig.h"
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <cstdarg>
|
||||
@ -37,11 +35,10 @@
|
||||
#include <new>
|
||||
|
||||
extern "C" {
|
||||
#include "../../atf-c/error.h"
|
||||
};
|
||||
#include "atf-c/error.h"
|
||||
}
|
||||
|
||||
#include "exceptions.hpp"
|
||||
#include "sanity.hpp"
|
||||
#include "atf-c++/detail/sanity.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// The "system_error" type.
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,10 +22,9 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#if !defined(_ATF_CXX_EXCEPTIONS_HPP_)
|
||||
#define _ATF_CXX_EXCEPTIONS_HPP_
|
||||
#if !defined(ATF_CXX_DETAIL_EXCEPTIONS_HPP)
|
||||
#define ATF_CXX_DETAIL_EXCEPTIONS_HPP
|
||||
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
@ -55,4 +51,4 @@ void throw_atf_error(struct atf_error *);
|
||||
|
||||
} // namespace atf
|
||||
|
||||
#endif // !defined(_ATF_CXX_EXCEPTIONS_HPP_)
|
||||
#endif // !defined(ATF_CXX_DETAIL_EXCEPTIONS_HPP)
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2009 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,19 +22,19 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#include "atf-c++/detail/exceptions.hpp"
|
||||
|
||||
extern "C" {
|
||||
#include "../../atf-c/error.h"
|
||||
#include "atf-c/error.h"
|
||||
}
|
||||
|
||||
#include <cstdio>
|
||||
#include <new>
|
||||
|
||||
#include "../macros.hpp"
|
||||
#include <atf-c++.hpp>
|
||||
|
||||
#include "exceptions.hpp"
|
||||
#include "sanity.hpp"
|
||||
#include "atf-c++/detail/sanity.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// The "test" error.
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,10 +22,11 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#include "atf-c++/detail/fs.hpp"
|
||||
|
||||
#if defined(HAVE_CONFIG_H)
|
||||
#include "bconfig.h"
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
extern "C" {
|
||||
@ -47,17 +45,15 @@ extern "C" {
|
||||
#include <cstring>
|
||||
|
||||
extern "C" {
|
||||
#include "../../atf-c/error.h"
|
||||
#include "atf-c/error.h"
|
||||
}
|
||||
|
||||
#include "../utils.hpp"
|
||||
|
||||
#include "exceptions.hpp"
|
||||
#include "env.hpp"
|
||||
#include "fs.hpp"
|
||||
#include "process.hpp"
|
||||
#include "sanity.hpp"
|
||||
#include "text.hpp"
|
||||
#include "atf-c++/detail/env.hpp"
|
||||
#include "atf-c++/detail/exceptions.hpp"
|
||||
#include "atf-c++/detail/process.hpp"
|
||||
#include "atf-c++/detail/sanity.hpp"
|
||||
#include "atf-c++/detail/text.hpp"
|
||||
#include "atf-c++/utils.hpp"
|
||||
|
||||
namespace impl = atf::fs;
|
||||
#define IMPL_NAME "atf::fs"
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,10 +22,9 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#if !defined(_ATF_CXX_FS_HPP_)
|
||||
#define _ATF_CXX_FS_HPP_
|
||||
#if !defined(ATF_CXX_DETAIL_FS_HPP)
|
||||
#define ATF_CXX_DETAIL_FS_HPP
|
||||
|
||||
extern "C" {
|
||||
#include <sys/types.h>
|
||||
@ -42,7 +38,7 @@ extern "C" {
|
||||
#include <string>
|
||||
|
||||
extern "C" {
|
||||
#include "../../atf-c/detail/fs.h"
|
||||
#include "atf-c/detail/fs.h"
|
||||
}
|
||||
|
||||
namespace atf {
|
||||
@ -388,4 +384,4 @@ void rmdir(const path&);
|
||||
} // namespace fs
|
||||
} // namespace atf
|
||||
|
||||
#endif // !defined(_ATF_CXX_FS_HPP_)
|
||||
#endif // !defined(ATF_CXX_DETAIL_FS_HPP)
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,7 +22,8 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#include "atf-c++/detail/fs.hpp"
|
||||
|
||||
extern "C" {
|
||||
#include <sys/types.h>
|
||||
@ -36,10 +34,9 @@ extern "C" {
|
||||
#include <cerrno>
|
||||
#include <cstdio>
|
||||
|
||||
#include "../macros.hpp"
|
||||
#include <atf-c++.hpp>
|
||||
|
||||
#include "exceptions.hpp"
|
||||
#include "fs.hpp"
|
||||
#include "atf-c++/detail/exceptions.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Auxiliary functions.
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,21 +22,20 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#include "atf-c++/detail/process.hpp"
|
||||
|
||||
extern "C" {
|
||||
#include <signal.h>
|
||||
|
||||
#include "../../atf-c/error.h"
|
||||
|
||||
#include "../../atf-c/detail/process.h"
|
||||
#include "atf-c/detail/process.h"
|
||||
#include "atf-c/error.h"
|
||||
}
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "exceptions.hpp"
|
||||
#include "process.hpp"
|
||||
#include "sanity.hpp"
|
||||
#include "atf-c++/detail/exceptions.hpp"
|
||||
#include "atf-c++/detail/sanity.hpp"
|
||||
|
||||
namespace detail = atf::process::detail;
|
||||
namespace impl = atf::process;
|
||||
@ -341,11 +337,6 @@ impl::child::stderr_fd(void)
|
||||
void
|
||||
detail::flush_streams(void)
|
||||
{
|
||||
// This is a weird hack to ensure that the output of the parent process
|
||||
// is flushed before executing a child which prevents, for example, the
|
||||
// output of the atf-run hooks to appear before the output of atf-run
|
||||
// itself.
|
||||
//
|
||||
// TODO: This should only be executed when inheriting the stdout or
|
||||
// stderr file descriptors. However, the flushing is specific to the
|
||||
// iostreams, so we cannot do it from the C library where all the process
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,25 +22,23 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#if !defined(_ATF_CXX_PROCESS_HPP_)
|
||||
#define _ATF_CXX_PROCESS_HPP_
|
||||
#if !defined(ATF_CXX_DETAIL_PROCESS_HPP)
|
||||
#define ATF_CXX_DETAIL_PROCESS_HPP
|
||||
|
||||
extern "C" {
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "../../atf-c/error.h"
|
||||
|
||||
#include "../../atf-c/detail/process.h"
|
||||
#include <atf-c/detail/process.h>
|
||||
#include <atf-c/error.h>
|
||||
}
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "auto_array.hpp"
|
||||
#include "exceptions.hpp"
|
||||
#include "fs.hpp"
|
||||
#include <atf-c++/detail/auto_array.hpp>
|
||||
#include <atf-c++/detail/exceptions.hpp>
|
||||
#include <atf-c++/detail/fs.hpp>
|
||||
|
||||
namespace atf {
|
||||
namespace process {
|
||||
@ -276,4 +271,4 @@ exec(const atf::fs::path& prog, const argv_array& argv,
|
||||
} // namespace process
|
||||
} // namespace atf
|
||||
|
||||
#endif // !defined(_ATF_CXX_PROCESS_HPP_)
|
||||
#endif // !defined(ATF_CXX_DETAIL_PROCESS_HPP)
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,15 +22,15 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#include "atf-c++/detail/process.hpp"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
#include "../macros.hpp"
|
||||
#include <atf-c++.hpp>
|
||||
|
||||
#include "process.hpp"
|
||||
#include "test_helpers.hpp"
|
||||
#include "atf-c++/detail/test_helpers.hpp"
|
||||
|
||||
// TODO: Testing the fork function is a huge task and I'm afraid of
|
||||
// copy/pasting tons of stuff from the C version. I'd rather not do that
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,13 +22,12 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#if !defined(_ATF_CXX_SANITY_HPP_)
|
||||
#define _ATF_CXX_SANITY_HPP_
|
||||
#if !defined(ATF_CXX_DETAIL_SANITY_HPP)
|
||||
#define ATF_CXX_DETAIL_SANITY_HPP
|
||||
|
||||
extern "C" {
|
||||
#include "../../atf-c/detail/sanity.h"
|
||||
#include <atf-c/detail/sanity.h>
|
||||
}
|
||||
|
||||
#endif // !defined(_ATF_CXX_SANITY_HPP_)
|
||||
#endif // !defined(ATF_CXX_DETAIL_SANITY_HPP)
|
||||
|
@ -1,41 +0,0 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2009 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.
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
|
||||
#include "../macros.hpp"
|
||||
|
||||
ATF_TEST_CASE_WITHOUT_HEAD(nothing);
|
||||
ATF_TEST_CASE_BODY(nothing)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
ATF_INIT_TEST_CASES(tcs)
|
||||
{
|
||||
ATF_ADD_TEST_CASE(tcs, nothing);
|
||||
}
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2009 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,20 +22,20 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#include "atf-c++/detail/test_helpers.hpp"
|
||||
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "../check.hpp"
|
||||
#include "../config.hpp"
|
||||
#include "../macros.hpp"
|
||||
#include <atf-c++.hpp>
|
||||
|
||||
#include "fs.hpp"
|
||||
#include "process.hpp"
|
||||
#include "test_helpers.hpp"
|
||||
#include "atf-c++/check.hpp"
|
||||
#include "atf-c++/detail/env.hpp"
|
||||
#include "atf-c++/detail/fs.hpp"
|
||||
#include "atf-c++/detail/process.hpp"
|
||||
|
||||
// Path to the directory containing the libatf-c tests, used to locate the
|
||||
// process_helpers program. If NULL (the default), the code will use a
|
||||
@ -56,7 +53,7 @@ bool
|
||||
build_check_cxx_o(const char* sfile)
|
||||
{
|
||||
std::vector< std::string > optargs;
|
||||
optargs.push_back("-I" + atf::config::get("atf_includedir"));
|
||||
optargs.push_back("-I" + atf::env::get("ATF_INCLUDEDIR", ATF_INCLUDEDIR));
|
||||
optargs.push_back("-Wall");
|
||||
optargs.push_back("-Werror");
|
||||
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2009 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,12 +22,11 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#if defined(TESTS_ATF_ATF_CXX_TEST_HELPERS_H)
|
||||
#if defined(ATF_CXX_DETAIL_TEST_HELPERS_H)
|
||||
# error "Cannot include test_helpers.hpp more than once."
|
||||
#else
|
||||
# define TESTS_ATF_ATF_CXX_TEST_HELPERS_H
|
||||
# define ATF_CXX_DETAIL_TEST_HELPERS_H
|
||||
#endif
|
||||
|
||||
#include <cstdlib>
|
||||
@ -38,9 +34,9 @@
|
||||
#include <sstream>
|
||||
#include <utility>
|
||||
|
||||
#include "../macros.hpp"
|
||||
#include "../tests.hpp"
|
||||
#include "process.hpp"
|
||||
#include <atf-c++.hpp>
|
||||
|
||||
#include <atf-c++/detail/process.hpp>
|
||||
|
||||
#define HEADER_TC(name, hdrname) \
|
||||
ATF_TEST_CASE(name); \
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,7 +22,8 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#include "atf-c++/detail/text.hpp"
|
||||
|
||||
extern "C" {
|
||||
#include <regex.h>
|
||||
@ -35,13 +33,11 @@ extern "C" {
|
||||
#include <cstring>
|
||||
|
||||
extern "C" {
|
||||
#include "../../atf-c/error.h"
|
||||
|
||||
#include "../../atf-c/detail/text.h"
|
||||
#include "atf-c/detail/text.h"
|
||||
#include "atf-c/error.h"
|
||||
}
|
||||
|
||||
#include "exceptions.hpp"
|
||||
#include "text.hpp"
|
||||
#include "atf-c++/detail/exceptions.hpp"
|
||||
|
||||
namespace impl = atf::text;
|
||||
#define IMPL_NAME "atf::text"
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,10 +22,9 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#if !defined(_ATF_CXX_TEXT_HPP_)
|
||||
#define _ATF_CXX_TEXT_HPP_
|
||||
#if !defined(ATF_CXX_DETAIL_TEXT_HPP)
|
||||
#define ATF_CXX_DETAIL_TEXT_HPP
|
||||
|
||||
extern "C" {
|
||||
#include <stdint.h>
|
||||
@ -150,4 +146,4 @@ to_type(const std::string& str)
|
||||
} // namespace text
|
||||
} // namespace atf
|
||||
|
||||
#endif // !defined(_ATF_CXX_TEXT_HPP_)
|
||||
#endif // !defined(ATF_CXX_DETAIL_TEXT_HPP)
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,15 +22,14 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#include "atf-c++/detail/text.hpp"
|
||||
|
||||
#include <cstring>
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
#include "../macros.hpp"
|
||||
|
||||
#include "text.hpp"
|
||||
#include <atf-c++.hpp>
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Test cases for the free functions.
|
||||
|
@ -27,7 +27,7 @@
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#if defined(HAVE_CONFIG_H)
|
||||
#include "bconfig.h"
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <cstdlib>
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,10 +22,9 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#if !defined(_ATF_CXX_MACROS_HPP_)
|
||||
#define _ATF_CXX_MACROS_HPP_
|
||||
#if !defined(ATF_CXX_MACROS_HPP)
|
||||
#define ATF_CXX_MACROS_HPP
|
||||
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
@ -99,21 +95,23 @@
|
||||
|
||||
#define ATF_PASS() atf::tests::tc::pass()
|
||||
|
||||
#define ATF_REQUIRE(x) \
|
||||
#define ATF_REQUIRE(expression) \
|
||||
do { \
|
||||
if (!(x)) { \
|
||||
if (!(expression)) { \
|
||||
std::ostringstream atfu_ss; \
|
||||
atfu_ss << "Line " << __LINE__ << ": " << #x << " not met"; \
|
||||
atfu_ss << "Line " << __LINE__ << ": " << #expression \
|
||||
<< " not met"; \
|
||||
atf::tests::tc::fail(atfu_ss.str()); \
|
||||
} \
|
||||
} while (false)
|
||||
|
||||
#define ATF_REQUIRE_EQ(x, y) \
|
||||
#define ATF_REQUIRE_EQ(expected, actual) \
|
||||
do { \
|
||||
if ((x) != (y)) { \
|
||||
if ((expected) != (actual)) { \
|
||||
std::ostringstream atfu_ss; \
|
||||
atfu_ss << "Line " << __LINE__ << ": " << #x << " != " << #y \
|
||||
<< " (" << (x) << " != " << (y) << ")"; \
|
||||
atfu_ss << "Line " << __LINE__ << ": " \
|
||||
<< #expected << " != " << #actual \
|
||||
<< " (" << (expected) << " != " << (actual) << ")"; \
|
||||
atf::tests::tc::fail(atfu_ss.str()); \
|
||||
} \
|
||||
} while (false)
|
||||
@ -134,69 +132,74 @@
|
||||
} \
|
||||
} while (false)
|
||||
|
||||
#define ATF_REQUIRE_THROW(e, x) \
|
||||
#define ATF_REQUIRE_THROW(expected_exception, statement) \
|
||||
do { \
|
||||
try { \
|
||||
x; \
|
||||
statement; \
|
||||
std::ostringstream atfu_ss; \
|
||||
atfu_ss << "Line " << __LINE__ << ": " #x " did not throw " \
|
||||
#e " as expected"; \
|
||||
atfu_ss << "Line " << __LINE__ \
|
||||
<< ": " #statement " did not throw " #expected_exception \
|
||||
" as expected"; \
|
||||
atf::tests::tc::fail(atfu_ss.str()); \
|
||||
} catch (const e&) { \
|
||||
} catch (const expected_exception&) { \
|
||||
} catch (const std::exception& atfu_e) { \
|
||||
std::ostringstream atfu_ss; \
|
||||
atfu_ss << "Line " << __LINE__ << ": " #x " threw an " \
|
||||
"unexpected error (not " #e "): " << atfu_e.what(); \
|
||||
atfu_ss << "Line " << __LINE__ << ": " #statement " threw an " \
|
||||
"unexpected error (not " #expected_exception "): " \
|
||||
<< atfu_e.what(); \
|
||||
atf::tests::tc::fail(atfu_ss.str()); \
|
||||
} catch (...) { \
|
||||
std::ostringstream atfu_ss; \
|
||||
atfu_ss << "Line " << __LINE__ << ": " #x " threw an " \
|
||||
"unexpected error (not " #e ")"; \
|
||||
atfu_ss << "Line " << __LINE__ << ": " #statement " threw an " \
|
||||
"unexpected error (not " #expected_exception ")"; \
|
||||
atf::tests::tc::fail(atfu_ss.str()); \
|
||||
} \
|
||||
} while (false)
|
||||
|
||||
#define ATF_REQUIRE_THROW_RE(type, regexp, x) \
|
||||
#define ATF_REQUIRE_THROW_RE(expected_exception, regexp, statement) \
|
||||
do { \
|
||||
try { \
|
||||
x; \
|
||||
statement; \
|
||||
std::ostringstream atfu_ss; \
|
||||
atfu_ss << "Line " << __LINE__ << ": " #x " did not throw " \
|
||||
#type " as expected"; \
|
||||
atfu_ss << "Line " << __LINE__ \
|
||||
<< ": " #statement " did not throw " #expected_exception \
|
||||
" as expected"; \
|
||||
atf::tests::tc::fail(atfu_ss.str()); \
|
||||
} catch (const type& e) { \
|
||||
} catch (const expected_exception& e) { \
|
||||
if (!atf::tests::detail::match(regexp, e.what())) { \
|
||||
std::ostringstream atfu_ss; \
|
||||
atfu_ss << "Line " << __LINE__ << ": " #x " threw " #type "(" \
|
||||
atfu_ss << "Line " << __LINE__ \
|
||||
<< ": " #statement " threw " #expected_exception "(" \
|
||||
<< e.what() << "), but does not match '" << regexp \
|
||||
<< "'"; \
|
||||
atf::tests::tc::fail(atfu_ss.str()); \
|
||||
} \
|
||||
} catch (const std::exception& atfu_e) { \
|
||||
std::ostringstream atfu_ss; \
|
||||
atfu_ss << "Line " << __LINE__ << ": " #x " threw an " \
|
||||
"unexpected error (not " #type "): " << atfu_e.what(); \
|
||||
atfu_ss << "Line " << __LINE__ << ": " #statement " threw an " \
|
||||
"unexpected error (not " #expected_exception "): " \
|
||||
<< atfu_e.what(); \
|
||||
atf::tests::tc::fail(atfu_ss.str()); \
|
||||
} catch (...) { \
|
||||
std::ostringstream atfu_ss; \
|
||||
atfu_ss << "Line " << __LINE__ << ": " #x " threw an " \
|
||||
"unexpected error (not " #type ")"; \
|
||||
atfu_ss << "Line " << __LINE__ << ": " #statement " threw an " \
|
||||
"unexpected error (not " #expected_exception ")"; \
|
||||
atf::tests::tc::fail(atfu_ss.str()); \
|
||||
} \
|
||||
} while (false)
|
||||
|
||||
#define ATF_CHECK_ERRNO(exp_errno, bool_expr) \
|
||||
atf::tests::tc::check_errno(__FILE__, __LINE__, exp_errno, #bool_expr, \
|
||||
bool_expr)
|
||||
#define ATF_CHECK_ERRNO(expected_errno, bool_expr) \
|
||||
atf::tests::tc::check_errno(__FILE__, __LINE__, expected_errno, \
|
||||
#bool_expr, bool_expr)
|
||||
|
||||
#define ATF_REQUIRE_ERRNO(exp_errno, bool_expr) \
|
||||
atf::tests::tc::require_errno(__FILE__, __LINE__, exp_errno, #bool_expr, \
|
||||
bool_expr)
|
||||
#define ATF_REQUIRE_ERRNO(expected_errno, bool_expr) \
|
||||
atf::tests::tc::require_errno(__FILE__, __LINE__, expected_errno, \
|
||||
#bool_expr, bool_expr)
|
||||
|
||||
#define ATF_INIT_TEST_CASES(tcs) \
|
||||
namespace atf { \
|
||||
namespace tests { \
|
||||
int run_tp(int, char* const*, \
|
||||
int run_tp(int, char**, \
|
||||
void (*)(std::vector< atf::tests::tc * >&)); \
|
||||
} \
|
||||
} \
|
||||
@ -204,7 +207,7 @@
|
||||
static void atfu_init_tcs(std::vector< atf::tests::tc * >&); \
|
||||
\
|
||||
int \
|
||||
main(int argc, char* const* argv) \
|
||||
main(int argc, char** argv) \
|
||||
{ \
|
||||
return atf::tests::run_tp(argc, argv, atfu_init_tcs); \
|
||||
} \
|
||||
@ -219,4 +222,4 @@
|
||||
(tcs).push_back(atfu_tcptr_ ## tcname); \
|
||||
} while (0);
|
||||
|
||||
#endif // !defined(_ATF_CXX_MACROS_HPP_)
|
||||
#endif // !defined(ATF_CXX_MACROS_HPP)
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,12 +22,11 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
#include <atf-c++/macros.hpp>
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
void
|
||||
atf_check_errno_semicolons(void)
|
||||
{
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,7 +22,8 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#include "atf-c++/macros.hpp"
|
||||
|
||||
extern "C" {
|
||||
#include <fcntl.h>
|
||||
@ -37,14 +35,14 @@ extern "C" {
|
||||
#include <iostream>
|
||||
#include <stdexcept>
|
||||
|
||||
#include "macros.hpp"
|
||||
#include "utils.hpp"
|
||||
#include <atf-c++.hpp>
|
||||
|
||||
#include "detail/fs.hpp"
|
||||
#include "detail/process.hpp"
|
||||
#include "detail/sanity.hpp"
|
||||
#include "detail/test_helpers.hpp"
|
||||
#include "detail/text.hpp"
|
||||
#include "atf-c++/detail/fs.hpp"
|
||||
#include "atf-c++/detail/process.hpp"
|
||||
#include "atf-c++/detail/sanity.hpp"
|
||||
#include "atf-c++/detail/test_helpers.hpp"
|
||||
#include "atf-c++/detail/text.hpp"
|
||||
#include "atf-c++/utils.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Auxiliary functions.
|
||||
@ -757,7 +755,6 @@ ATF_TEST_CASE_BODY(require_errno)
|
||||
// Tests cases for the header file.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
HEADER_TC(include, "atf-c++/macros.hpp");
|
||||
BUILD_TC(use, "macros_hpp_test.cpp",
|
||||
"Tests that the macros provided by the atf-c++/macros.hpp file "
|
||||
"do not cause syntax errors when used",
|
||||
@ -809,7 +806,6 @@ ATF_INIT_TEST_CASES(tcs)
|
||||
ATF_ADD_TEST_CASE(tcs, require_errno);
|
||||
|
||||
// Add the test cases for the header file.
|
||||
ATF_ADD_TEST_CASE(tcs, include);
|
||||
ATF_ADD_TEST_CASE(tcs, use);
|
||||
ATF_ADD_TEST_CASE(tcs, detect_unused_tests);
|
||||
}
|
||||
|
@ -1,6 +1,3 @@
|
||||
#
|
||||
# Automated Testing Framework (atf)
|
||||
#
|
||||
# Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
@ -25,7 +22,6 @@
|
||||
# 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 following tests assume that the atfc++.pc file is installed in a
|
||||
# directory that is known by pkg-config. Otherwise they will fail,
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,7 +22,12 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#include "atf-c++/tests.hpp"
|
||||
|
||||
#if defined(HAVE_CONFIG_H)
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
extern "C" {
|
||||
#include <sys/types.h>
|
||||
@ -55,20 +57,26 @@ extern "C" {
|
||||
#include "atf-c/utils.h"
|
||||
}
|
||||
|
||||
#include "tests.hpp"
|
||||
#include "atf-c++/detail/application.hpp"
|
||||
#include "atf-c++/detail/auto_array.hpp"
|
||||
#include "atf-c++/detail/env.hpp"
|
||||
#include "atf-c++/detail/exceptions.hpp"
|
||||
#include "atf-c++/detail/fs.hpp"
|
||||
#include "atf-c++/detail/sanity.hpp"
|
||||
#include "atf-c++/detail/text.hpp"
|
||||
|
||||
#include "detail/application.hpp"
|
||||
#include "detail/auto_array.hpp"
|
||||
#include "detail/env.hpp"
|
||||
#include "detail/exceptions.hpp"
|
||||
#include "detail/fs.hpp"
|
||||
#include "detail/sanity.hpp"
|
||||
#include "detail/text.hpp"
|
||||
#if defined(HAVE_GNU_GETOPT)
|
||||
# define GETOPT_POSIX "+"
|
||||
#else
|
||||
# define GETOPT_POSIX ""
|
||||
#endif
|
||||
|
||||
namespace impl = atf::tests;
|
||||
namespace detail = atf::tests::detail;
|
||||
#define IMPL_NAME "atf::tests"
|
||||
|
||||
using atf::application::usage_error;
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// The "atf_tp_writer" class.
|
||||
// ------------------------------------------------------------------------
|
||||
@ -109,6 +117,21 @@ detail::atf_tp_writer::tc_meta_data(const std::string& name,
|
||||
// Free helper functions.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
std::string Program_Name;
|
||||
|
||||
static void
|
||||
set_program_name(const char* argv0)
|
||||
{
|
||||
const std::string program_name = atf::fs::path(argv0).leaf_name();
|
||||
// Libtool workaround: if running from within the source tree (binaries
|
||||
// that are not installed yet), skip the "lt-" prefix added to files in
|
||||
// the ".libs" directory to show the real (not temporary) name.
|
||||
if (program_name.substr(0, 3) == "lt-")
|
||||
Program_Name = program_name.substr(3);
|
||||
else
|
||||
Program_Name = program_name;
|
||||
}
|
||||
|
||||
bool
|
||||
detail::match(const std::string& regexp, const std::string& str)
|
||||
{
|
||||
@ -153,14 +176,7 @@ struct impl::tc_impl {
|
||||
std::map< const atf_tc_t*, const impl::tc* >::const_iterator iter =
|
||||
cwraps.find(tc);
|
||||
INV(iter != cwraps.end());
|
||||
try {
|
||||
(*iter).second->body();
|
||||
} catch (const std::exception& e) {
|
||||
(*iter).second->fail("Caught unhandled exception: " + std::string(
|
||||
e.what()));
|
||||
} catch (...) {
|
||||
(*iter).second->fail("Caught unknown exception");
|
||||
}
|
||||
(*iter).second->body();
|
||||
}
|
||||
|
||||
static void
|
||||
@ -384,197 +400,70 @@ impl::tc::expect_timeout(const std::string& reason)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// The "tp" class.
|
||||
// Test program main code.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
class tp : public atf::application::app {
|
||||
public:
|
||||
typedef std::vector< impl::tc * > tc_vector;
|
||||
namespace {
|
||||
|
||||
private:
|
||||
static const char* m_description;
|
||||
typedef std::vector< impl::tc * > tc_vector;
|
||||
|
||||
bool m_lflag;
|
||||
atf::fs::path m_resfile;
|
||||
std::string m_srcdir_arg;
|
||||
atf::fs::path m_srcdir;
|
||||
enum tc_part { BODY, CLEANUP };
|
||||
|
||||
atf::tests::vars_map m_vars;
|
||||
|
||||
std::string specific_args(void) const;
|
||||
options_set specific_options(void) const;
|
||||
void process_option(int, const char*);
|
||||
|
||||
void (*m_add_tcs)(tc_vector&);
|
||||
tc_vector m_tcs;
|
||||
|
||||
void parse_vflag(const std::string&);
|
||||
void handle_srcdir(void);
|
||||
|
||||
tc_vector init_tcs(void);
|
||||
|
||||
enum tc_part {
|
||||
BODY,
|
||||
CLEANUP,
|
||||
};
|
||||
|
||||
void list_tcs(void);
|
||||
impl::tc* find_tc(tc_vector, const std::string&);
|
||||
static std::pair< std::string, tc_part > process_tcarg(const std::string&);
|
||||
int run_tc(const std::string&);
|
||||
|
||||
public:
|
||||
tp(void (*)(tc_vector&));
|
||||
~tp(void);
|
||||
|
||||
int main(void);
|
||||
};
|
||||
|
||||
const char* tp::m_description =
|
||||
"This is an independent atf test program.";
|
||||
|
||||
tp::tp(void (*add_tcs)(tc_vector&)) :
|
||||
app(m_description, "atf-test-program(1)"),
|
||||
m_lflag(false),
|
||||
m_resfile("/dev/stdout"),
|
||||
m_srcdir("."),
|
||||
m_add_tcs(add_tcs)
|
||||
{
|
||||
}
|
||||
|
||||
tp::~tp(void)
|
||||
{
|
||||
for (tc_vector::iterator iter = m_tcs.begin();
|
||||
iter != m_tcs.end(); iter++) {
|
||||
impl::tc* tc = *iter;
|
||||
|
||||
delete tc;
|
||||
}
|
||||
}
|
||||
|
||||
std::string
|
||||
tp::specific_args(void)
|
||||
const
|
||||
{
|
||||
return "test_case";
|
||||
}
|
||||
|
||||
tp::options_set
|
||||
tp::specific_options(void)
|
||||
const
|
||||
{
|
||||
using atf::application::option;
|
||||
options_set opts;
|
||||
opts.insert(option('l', "", "List test cases and their purpose"));
|
||||
opts.insert(option('r', "resfile", "The file to which the test program "
|
||||
"will write the results of the "
|
||||
"executed test case"));
|
||||
opts.insert(option('s', "srcdir", "Directory where the test's data "
|
||||
"files are located"));
|
||||
opts.insert(option('v', "var=value", "Sets the configuration variable "
|
||||
"`var' to `value'"));
|
||||
return opts;
|
||||
}
|
||||
|
||||
void
|
||||
tp::process_option(int ch, const char* arg)
|
||||
{
|
||||
switch (ch) {
|
||||
case 'l':
|
||||
m_lflag = true;
|
||||
break;
|
||||
|
||||
case 'r':
|
||||
m_resfile = atf::fs::path(arg);
|
||||
break;
|
||||
|
||||
case 's':
|
||||
m_srcdir_arg = arg;
|
||||
break;
|
||||
|
||||
case 'v':
|
||||
parse_vflag(arg);
|
||||
break;
|
||||
|
||||
default:
|
||||
UNREACHABLE;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
tp::parse_vflag(const std::string& str)
|
||||
static void
|
||||
parse_vflag(const std::string& str, atf::tests::vars_map& vars)
|
||||
{
|
||||
if (str.empty())
|
||||
throw std::runtime_error("-v requires a non-empty argument");
|
||||
|
||||
std::vector< std::string > ws = atf::text::split(str, "=");
|
||||
if (ws.size() == 1 && str[str.length() - 1] == '=') {
|
||||
m_vars[ws[0]] = "";
|
||||
vars[ws[0]] = "";
|
||||
} else {
|
||||
if (ws.size() != 2)
|
||||
throw std::runtime_error("-v requires an argument of the form "
|
||||
"var=value");
|
||||
|
||||
m_vars[ws[0]] = ws[1];
|
||||
vars[ws[0]] = ws[1];
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
tp::handle_srcdir(void)
|
||||
static atf::fs::path
|
||||
handle_srcdir(const char* argv0, const std::string& srcdir_arg)
|
||||
{
|
||||
if (m_srcdir_arg.empty()) {
|
||||
m_srcdir = atf::fs::path(m_argv0).branch_path();
|
||||
if (m_srcdir.leaf_name() == ".libs")
|
||||
m_srcdir = m_srcdir.branch_path();
|
||||
atf::fs::path srcdir(".");
|
||||
|
||||
if (srcdir_arg.empty()) {
|
||||
srcdir = atf::fs::path(argv0).branch_path();
|
||||
if (srcdir.leaf_name() == ".libs")
|
||||
srcdir = srcdir.branch_path();
|
||||
} else
|
||||
m_srcdir = atf::fs::path(m_srcdir_arg);
|
||||
srcdir = atf::fs::path(srcdir_arg);
|
||||
|
||||
if (!atf::fs::exists(m_srcdir / m_prog_name))
|
||||
throw std::runtime_error("Cannot find the test program in the "
|
||||
"source directory `" + m_srcdir.str() + "'");
|
||||
if (!atf::fs::exists(srcdir / Program_Name))
|
||||
throw usage_error("Cannot find the test program in the source "
|
||||
"directory `%s'", srcdir.c_str());
|
||||
|
||||
if (!m_srcdir.is_absolute())
|
||||
m_srcdir = m_srcdir.to_absolute();
|
||||
if (!srcdir.is_absolute())
|
||||
srcdir = srcdir.to_absolute();
|
||||
|
||||
m_vars["srcdir"] = m_srcdir.str();
|
||||
return srcdir;
|
||||
}
|
||||
|
||||
tp::tc_vector
|
||||
tp::init_tcs(void)
|
||||
static void
|
||||
init_tcs(void (*add_tcs)(tc_vector&), tc_vector& tcs,
|
||||
const atf::tests::vars_map& vars)
|
||||
{
|
||||
m_add_tcs(m_tcs);
|
||||
for (tc_vector::iterator iter = m_tcs.begin();
|
||||
iter != m_tcs.end(); iter++) {
|
||||
add_tcs(tcs);
|
||||
for (tc_vector::iterator iter = tcs.begin(); iter != tcs.end(); iter++) {
|
||||
impl::tc* tc = *iter;
|
||||
|
||||
tc->init(m_vars);
|
||||
tc->init(vars);
|
||||
}
|
||||
return m_tcs;
|
||||
}
|
||||
|
||||
//
|
||||
// An auxiliary unary predicate that compares the given test case's
|
||||
// identifier to the identifier stored in it.
|
||||
//
|
||||
class tc_equal_to_ident {
|
||||
const std::string& m_ident;
|
||||
|
||||
public:
|
||||
tc_equal_to_ident(const std::string& i) :
|
||||
m_ident(i)
|
||||
{
|
||||
}
|
||||
|
||||
bool operator()(const impl::tc* tc)
|
||||
{
|
||||
return tc->get_md_var("ident") == m_ident;
|
||||
}
|
||||
};
|
||||
|
||||
void
|
||||
tp::list_tcs(void)
|
||||
static int
|
||||
list_tcs(const tc_vector& tcs)
|
||||
{
|
||||
tc_vector tcs = init_tcs();
|
||||
detail::atf_tp_writer writer(std::cout);
|
||||
|
||||
for (tc_vector::const_iterator iter = tcs.begin();
|
||||
@ -596,10 +485,12 @@ tp::list_tcs(void)
|
||||
|
||||
writer.end_tc();
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
impl::tc*
|
||||
tp::find_tc(tc_vector tcs, const std::string& name)
|
||||
static impl::tc*
|
||||
find_tc(tc_vector tcs, const std::string& name)
|
||||
{
|
||||
std::vector< std::string > ids;
|
||||
for (tc_vector::iterator iter = tcs.begin();
|
||||
@ -609,12 +500,11 @@ tp::find_tc(tc_vector tcs, const std::string& name)
|
||||
if (tc->get_md_var("ident") == name)
|
||||
return tc;
|
||||
}
|
||||
throw atf::application::usage_error("Unknown test case `%s'",
|
||||
name.c_str());
|
||||
throw usage_error("Unknown test case `%s'", name.c_str());
|
||||
}
|
||||
|
||||
std::pair< std::string, tp::tc_part >
|
||||
tp::process_tcarg(const std::string& tcarg)
|
||||
static std::pair< std::string, tc_part >
|
||||
process_tcarg(const std::string& tcarg)
|
||||
{
|
||||
const std::string::size_type pos = tcarg.find(':');
|
||||
if (pos == std::string::npos) {
|
||||
@ -628,83 +518,141 @@ tp::process_tcarg(const std::string& tcarg)
|
||||
else if (partname == "cleanup")
|
||||
return std::make_pair(tcname, CLEANUP);
|
||||
else {
|
||||
using atf::application::usage_error;
|
||||
throw usage_error("Invalid test case part `%s'", partname.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
tp::run_tc(const std::string& tcarg)
|
||||
static int
|
||||
run_tc(tc_vector& tcs, const std::string& tcarg, const atf::fs::path& resfile)
|
||||
{
|
||||
const std::pair< std::string, tc_part > fields = process_tcarg(tcarg);
|
||||
|
||||
impl::tc* tc = find_tc(init_tcs(), fields.first);
|
||||
impl::tc* tc = find_tc(tcs, fields.first);
|
||||
|
||||
if (!atf::env::has("__RUNNING_INSIDE_ATF_RUN") || atf::env::get(
|
||||
"__RUNNING_INSIDE_ATF_RUN") != "internal-yes-value")
|
||||
{
|
||||
std::cerr << m_prog_name << ": WARNING: Running test cases without "
|
||||
"atf-run(1) is unsupported\n";
|
||||
std::cerr << m_prog_name << ": WARNING: No isolation nor timeout "
|
||||
std::cerr << Program_Name << ": WARNING: Running test cases outside "
|
||||
"of kyua(1) is unsupported\n";
|
||||
std::cerr << Program_Name << ": WARNING: No isolation nor timeout "
|
||||
"control is being applied; you may get unexpected failures; see "
|
||||
"atf-test-case(4)\n";
|
||||
}
|
||||
|
||||
try {
|
||||
switch (fields.second) {
|
||||
case BODY:
|
||||
tc->run(m_resfile.str());
|
||||
break;
|
||||
case CLEANUP:
|
||||
tc->run_cleanup();
|
||||
break;
|
||||
default:
|
||||
UNREACHABLE;
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
} catch (const std::runtime_error& e) {
|
||||
std::cerr << "ERROR: " << e.what() << "\n";
|
||||
return EXIT_FAILURE;
|
||||
switch (fields.second) {
|
||||
case BODY:
|
||||
tc->run(resfile.str());
|
||||
break;
|
||||
case CLEANUP:
|
||||
tc->run_cleanup();
|
||||
break;
|
||||
default:
|
||||
UNREACHABLE;
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
int
|
||||
tp::main(void)
|
||||
static int
|
||||
safe_main(int argc, char** argv, void (*add_tcs)(tc_vector&))
|
||||
{
|
||||
using atf::application::usage_error;
|
||||
const char* argv0 = argv[0];
|
||||
|
||||
bool lflag = false;
|
||||
atf::fs::path resfile("/dev/stdout");
|
||||
std::string srcdir_arg;
|
||||
atf::tests::vars_map vars;
|
||||
|
||||
int ch;
|
||||
int old_opterr;
|
||||
|
||||
old_opterr = opterr;
|
||||
::opterr = 0;
|
||||
while ((ch = ::getopt(argc, argv, GETOPT_POSIX ":lr:s:v:")) != -1) {
|
||||
switch (ch) {
|
||||
case 'l':
|
||||
lflag = true;
|
||||
break;
|
||||
|
||||
case 'r':
|
||||
resfile = atf::fs::path(::optarg);
|
||||
break;
|
||||
|
||||
case 's':
|
||||
srcdir_arg = ::optarg;
|
||||
break;
|
||||
|
||||
case 'v':
|
||||
parse_vflag(::optarg, vars);
|
||||
break;
|
||||
|
||||
case ':':
|
||||
throw usage_error("Option -%c requires an argument.", ::optopt);
|
||||
break;
|
||||
|
||||
case '?':
|
||||
default:
|
||||
throw usage_error("Unknown option -%c.", ::optopt);
|
||||
}
|
||||
}
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
// Clear getopt state just in case the test wants to use it.
|
||||
::opterr = old_opterr;
|
||||
::optind = 1;
|
||||
#if defined(HAVE_OPTRESET)
|
||||
::optreset = 1;
|
||||
#endif
|
||||
|
||||
vars["srcdir"] = handle_srcdir(argv0, srcdir_arg).str();
|
||||
|
||||
int errcode;
|
||||
|
||||
handle_srcdir();
|
||||
|
||||
if (m_lflag) {
|
||||
if (m_argc > 0)
|
||||
tc_vector tcs;
|
||||
if (lflag) {
|
||||
if (argc > 0)
|
||||
throw usage_error("Cannot provide test case names with -l");
|
||||
|
||||
list_tcs();
|
||||
errcode = EXIT_SUCCESS;
|
||||
init_tcs(add_tcs, tcs, vars);
|
||||
errcode = list_tcs(tcs);
|
||||
} else {
|
||||
if (m_argc == 0)
|
||||
if (argc == 0)
|
||||
throw usage_error("Must provide a test case name");
|
||||
else if (m_argc > 1)
|
||||
else if (argc > 1)
|
||||
throw usage_error("Cannot provide more than one test case name");
|
||||
INV(m_argc == 1);
|
||||
INV(argc == 1);
|
||||
|
||||
errcode = run_tc(m_argv[0]);
|
||||
init_tcs(add_tcs, tcs, vars);
|
||||
errcode = run_tc(tcs, argv[0], resfile);
|
||||
}
|
||||
for (tc_vector::iterator iter = tcs.begin(); iter != tcs.end(); iter++) {
|
||||
impl::tc* tc = *iter;
|
||||
|
||||
delete tc;
|
||||
}
|
||||
|
||||
return errcode;
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
namespace atf {
|
||||
namespace tests {
|
||||
int run_tp(int, char* const*, void (*)(tp::tc_vector&));
|
||||
int run_tp(int, char**, void (*)(tc_vector&));
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
impl::run_tp(int argc, char* const* argv, void (*add_tcs)(tp::tc_vector&))
|
||||
impl::run_tp(int argc, char** argv, void (*add_tcs)(tc_vector&))
|
||||
{
|
||||
return tp(add_tcs).run(argc, argv);
|
||||
try {
|
||||
set_program_name(argv[0]);
|
||||
return ::safe_main(argc, argv, add_tcs);
|
||||
} catch (const usage_error& e) {
|
||||
std::cerr
|
||||
<< Program_Name << ": ERROR: " << e.what() << '\n'
|
||||
<< Program_Name << ": See atf-test-program(1) for usage details.\n";
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,10 +22,9 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#if !defined(_ATF_CXX_TESTS_HPP_)
|
||||
#define _ATF_CXX_TESTS_HPP_
|
||||
#if !defined(ATF_CXX_TESTS_HPP)
|
||||
#define ATF_CXX_TESTS_HPP
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
@ -126,4 +122,4 @@ class tc {
|
||||
} // namespace tests
|
||||
} // namespace atf
|
||||
|
||||
#endif // !defined(_ATF_CXX_TESTS_HPP_)
|
||||
#endif // !defined(ATF_CXX_TESTS_HPP)
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,7 +22,8 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#include "atf-c++/tests.hpp"
|
||||
|
||||
extern "C" {
|
||||
#include <sys/types.h>
|
||||
@ -36,12 +34,12 @@ extern "C" {
|
||||
}
|
||||
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
#include "macros.hpp"
|
||||
#include <atf-c++.hpp>
|
||||
|
||||
#include "detail/test_helpers.hpp"
|
||||
#include "detail/text.hpp"
|
||||
#include "atf-c++/detail/text.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Tests for the "atf_tp_writer" class.
|
||||
@ -181,12 +179,6 @@ ATF_TEST_CASE_BODY(atf_tp_writer)
|
||||
#undef RESET
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Tests cases for the header file.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
HEADER_TC(include, "atf-c++/tests.hpp");
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Main.
|
||||
// ------------------------------------------------------------------------
|
||||
@ -195,7 +187,4 @@ ATF_INIT_TEST_CASES(tcs)
|
||||
{
|
||||
// Add tests for the "atf_tp_writer" class.
|
||||
ATF_ADD_TEST_CASE(tcs, atf_tp_writer);
|
||||
|
||||
// Add the test cases for the header file.
|
||||
ATF_ADD_TEST_CASE(tcs, include);
|
||||
}
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2012 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,9 +22,8 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#include <atf-c++/macros.hpp>
|
||||
#include <atf-c++.hpp>
|
||||
|
||||
ATF_TEST_CASE(this_is_used);
|
||||
ATF_TEST_CASE_HEAD(this_is_used)
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,7 +22,8 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#include "atf-c++/utils.hpp"
|
||||
|
||||
extern "C" {
|
||||
#include "atf-c/utils.h"
|
||||
@ -34,8 +32,6 @@ extern "C" {
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
|
||||
#include "utils.hpp"
|
||||
|
||||
void
|
||||
atf::utils::cat_file(const std::string& path, const std::string& prefix)
|
||||
{
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,10 +22,9 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#if !defined(_ATF_CXX_UTILS_HPP_)
|
||||
#define _ATF_CXX_UTILS_HPP_
|
||||
#if !defined(ATF_CXX_UTILS_HPP)
|
||||
#define ATF_CXX_UTILS_HPP
|
||||
|
||||
extern "C" {
|
||||
#include <unistd.h>
|
||||
@ -65,4 +61,4 @@ grep_collection(const std::string& regexp, const Collection& collection)
|
||||
} // namespace utils
|
||||
} // namespace atf
|
||||
|
||||
#endif // !defined(_ATF_CXX_UTILS_HPP_)
|
||||
#endif // !defined(ATF_CXX_UTILS_HPP)
|
||||
|
@ -1,6 +1,3 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -25,7 +22,8 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
#include "atf-c++/utils.hpp"
|
||||
|
||||
extern "C" {
|
||||
#include <sys/stat.h>
|
||||
@ -38,22 +36,20 @@ extern "C" {
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <set>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "macros.hpp"
|
||||
#include "utils.hpp"
|
||||
|
||||
#include "detail/test_helpers.hpp"
|
||||
#include <atf-c++.hpp>
|
||||
|
||||
static std::string
|
||||
read_file(const char *path)
|
||||
read_file(const std::string& path)
|
||||
{
|
||||
char buffer[1024];
|
||||
|
||||
const int fd = open(path, O_RDONLY);
|
||||
const int fd = open(path.c_str(), O_RDONLY);
|
||||
if (fd == -1)
|
||||
ATF_FAIL("Cannot open " + std::string(path));
|
||||
ATF_FAIL("Cannot open " + path);
|
||||
const ssize_t length = read(fd, buffer, sizeof(buffer) - 1);
|
||||
close(fd);
|
||||
ATF_REQUIRE(length != -1);
|
||||
@ -238,8 +234,13 @@ ATF_TEST_CASE_BODY(fork)
|
||||
ATF_REQUIRE(WIFEXITED(status));
|
||||
ATF_REQUIRE_EQ(EXIT_SUCCESS, WEXITSTATUS(status));
|
||||
|
||||
ATF_REQUIRE_EQ("Child stdout\n", read_file("atf_utils_fork_out.txt"));
|
||||
ATF_REQUIRE_EQ("Child stderr\n", read_file("atf_utils_fork_err.txt"));
|
||||
std::ostringstream out_name;
|
||||
out_name << "atf_utils_fork_" << pid << "_out.txt";
|
||||
std::ostringstream err_name;
|
||||
err_name << "atf_utils_fork_" << pid << "_err.txt";
|
||||
|
||||
ATF_REQUIRE_EQ("Child stdout\n", read_file(out_name.str()));
|
||||
ATF_REQUIRE_EQ("Child stderr\n", read_file(err_name.str()));
|
||||
}
|
||||
|
||||
ATF_TEST_CASE_WITHOUT_HEAD(grep_collection__set);
|
||||
@ -353,6 +354,35 @@ ATF_TEST_CASE_BODY(wait__ok)
|
||||
}
|
||||
}
|
||||
|
||||
ATF_TEST_CASE_WITHOUT_HEAD(wait__ok_nested);
|
||||
ATF_TEST_CASE_BODY(wait__ok_nested)
|
||||
{
|
||||
const pid_t parent = atf::utils::fork();
|
||||
ATF_REQUIRE(parent != -1);
|
||||
if (parent == 0) {
|
||||
const pid_t child = atf::utils::fork();
|
||||
ATF_REQUIRE(child != -1);
|
||||
if (child == 0) {
|
||||
std::cerr.flush();
|
||||
std::cout << "Child output\n";
|
||||
std::cout.flush();
|
||||
std::cerr << "Child error\n";
|
||||
std::exit(50);
|
||||
} else {
|
||||
std::cout << "Parent output\n";
|
||||
std::cerr << "Parent error\n";
|
||||
atf::utils::wait(child, 50, "Child output\n", "Child error\n");
|
||||
std::exit(40);
|
||||
}
|
||||
} else {
|
||||
atf::utils::wait(parent, 40,
|
||||
"Parent output\n"
|
||||
"subprocess stdout: Child output\n"
|
||||
"subprocess stderr: Child error\n",
|
||||
"Parent error\n");
|
||||
}
|
||||
}
|
||||
|
||||
ATF_TEST_CASE_WITHOUT_HEAD(wait__invalid_exitstatus);
|
||||
ATF_TEST_CASE_BODY(wait__invalid_exitstatus)
|
||||
{
|
||||
@ -432,12 +462,6 @@ ATF_TEST_CASE_BODY(wait__save_stderr)
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Tests cases for the header file.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
HEADER_TC(include, "atf-c++/utils.hpp");
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Main.
|
||||
// ------------------------------------------------------------------------
|
||||
@ -476,12 +500,10 @@ ATF_INIT_TEST_CASES(tcs)
|
||||
ATF_ADD_TEST_CASE(tcs, redirect__other);
|
||||
|
||||
ATF_ADD_TEST_CASE(tcs, wait__ok);
|
||||
ATF_ADD_TEST_CASE(tcs, wait__ok_nested);
|
||||
ATF_ADD_TEST_CASE(tcs, wait__invalid_exitstatus);
|
||||
ATF_ADD_TEST_CASE(tcs, wait__invalid_stdout);
|
||||
ATF_ADD_TEST_CASE(tcs, wait__invalid_stderr);
|
||||
ATF_ADD_TEST_CASE(tcs, wait__save_stdout);
|
||||
ATF_ADD_TEST_CASE(tcs, wait__save_stderr);
|
||||
|
||||
// Add the test cases for the header file.
|
||||
ATF_ADD_TEST_CASE(tcs, include);
|
||||
}
|
||||
|
8
atf-c.h
8
atf-c.h
@ -1,7 +1,4 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
/* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -24,8 +21,7 @@
|
||||
* 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.
|
||||
*/
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
|
||||
|
||||
#if !defined(ATF_C_H)
|
||||
#define ATF_C_H
|
||||
|
@ -5,7 +5,6 @@ test_suite("atf")
|
||||
atf_test_program{name="atf_c_test"}
|
||||
atf_test_program{name="build_test"}
|
||||
atf_test_program{name="check_test"}
|
||||
atf_test_program{name="config_test"}
|
||||
atf_test_program{name="error_test"}
|
||||
atf_test_program{name="macros_test"}
|
||||
atf_test_program{name="pkg_config_test"}
|
||||
|
@ -1,6 +1,3 @@
|
||||
#
|
||||
# Automated Testing Framework (atf)
|
||||
#
|
||||
# Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
@ -25,15 +22,12 @@
|
||||
# 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.
|
||||
#
|
||||
|
||||
lib_LTLIBRARIES += libatf-c.la
|
||||
libatf_c_la_SOURCES = atf-c/build.c \
|
||||
atf-c/build.h \
|
||||
atf-c/check.c \
|
||||
atf-c/check.h \
|
||||
atf-c/config.c \
|
||||
atf-c/config.h \
|
||||
atf-c/error.c \
|
||||
atf-c/error.h \
|
||||
atf-c/error_fwd.h \
|
||||
@ -50,34 +44,22 @@ libatf_c_la_CPPFLAGS = "-DATF_BUILD_CC=\"$(ATF_BUILD_CC)\"" \
|
||||
"-DATF_BUILD_CPP=\"$(ATF_BUILD_CPP)\"" \
|
||||
"-DATF_BUILD_CPPFLAGS=\"$(ATF_BUILD_CPPFLAGS)\"" \
|
||||
"-DATF_BUILD_CXX=\"$(ATF_BUILD_CXX)\"" \
|
||||
"-DATF_BUILD_CXXFLAGS=\"$(ATF_BUILD_CXXFLAGS)\"" \
|
||||
"-DATF_INCLUDEDIR=\"$(includedir)\"" \
|
||||
"-DATF_LIBEXECDIR=\"$(libexecdir)\"" \
|
||||
"-DATF_PKGDATADIR=\"$(pkgdatadir)\"" \
|
||||
"-DATF_SHELL=\"$(ATF_SHELL)\"" \
|
||||
"-DATF_WORKDIR=\"$(ATF_WORKDIR)\""
|
||||
libatf_c_la_LDFLAGS = -version-info 0:0:0
|
||||
|
||||
# XXX For some reason, the nodist line above does not work as expected.
|
||||
# Work this problem around.
|
||||
dist-hook: kill-defs-h
|
||||
kill-defs-h:
|
||||
rm -f $(distdir)/atf-c/defs.h
|
||||
"-DATF_BUILD_CXXFLAGS=\"$(ATF_BUILD_CXXFLAGS)\""
|
||||
libatf_c_la_LDFLAGS = -version-info 1:0:0
|
||||
|
||||
include_HEADERS += atf-c.h
|
||||
atf_c_HEADERS = atf-c/build.h \
|
||||
atf-c/check.h \
|
||||
atf-c/config.h \
|
||||
atf-c/defs.h \
|
||||
atf-c/error.h \
|
||||
atf-c/error_fwd.h \
|
||||
atf-c/macros.h \
|
||||
atf-c/tc.h \
|
||||
atf-c/tp.h \
|
||||
atf-c/utils.h
|
||||
nodist_atf_c_HEADERS = atf-c/defs.h
|
||||
atf_cdir = $(includedir)/atf-c
|
||||
|
||||
dist_man_MANS += atf-c/atf-c-api.3
|
||||
dist_man_MANS += atf-c/atf-c.3
|
||||
|
||||
atf_aclocal_DATA += atf-c/atf-common.m4 atf-c/atf-c.m4
|
||||
EXTRA_DIST += atf-c/atf-common.m4 atf-c/atf-c.m4
|
||||
@ -87,12 +69,12 @@ atf_cpkgconfig_DATA = atf-c/atf-c.pc
|
||||
CLEANFILES += atf-c/atf-c.pc
|
||||
EXTRA_DIST += atf-c/atf-c.pc.in
|
||||
atf-c/atf-c.pc: $(srcdir)/atf-c/atf-c.pc.in Makefile
|
||||
test -d atf-c || mkdir -p atf-c
|
||||
$(AM_V_GEN)test -d atf-c || mkdir -p atf-c; \
|
||||
sed -e 's#__ATF_VERSION__#$(PACKAGE_VERSION)#g' \
|
||||
-e 's#__CC__#$(CC)#g' \
|
||||
-e 's#__INCLUDEDIR__#$(includedir)#g' \
|
||||
-e 's#__LIBDIR__#$(libdir)#g' \
|
||||
<$(srcdir)/atf-c/atf-c.pc.in >atf-c/atf-c.pc.tmp
|
||||
<$(srcdir)/atf-c/atf-c.pc.in >atf-c/atf-c.pc.tmp; \
|
||||
mv atf-c/atf-c.pc.tmp atf-c/atf-c.pc
|
||||
|
||||
tests_atf_c_DATA = atf-c/Kyuafile \
|
||||
@ -113,10 +95,6 @@ tests_atf_c_PROGRAMS += atf-c/check_test
|
||||
atf_c_check_test_SOURCES = atf-c/check_test.c
|
||||
atf_c_check_test_LDADD = atf-c/detail/libtest_helpers.la libatf-c.la
|
||||
|
||||
tests_atf_c_PROGRAMS += atf-c/config_test
|
||||
atf_c_config_test_SOURCES = atf-c/config_test.c
|
||||
atf_c_config_test_LDADD = atf-c/detail/libtest_helpers.la libatf-c.la
|
||||
|
||||
tests_atf_c_PROGRAMS += atf-c/error_test
|
||||
atf_c_error_test_SOURCES = atf-c/error_test.c
|
||||
atf_c_error_test_LDADD = atf-c/detail/libtest_helpers.la libatf-c.la
|
||||
@ -129,8 +107,7 @@ tests_atf_c_SCRIPTS = atf-c/pkg_config_test
|
||||
CLEANFILES += atf-c/pkg_config_test
|
||||
EXTRA_DIST += atf-c/pkg_config_test.sh
|
||||
atf-c/pkg_config_test: $(srcdir)/atf-c/pkg_config_test.sh
|
||||
test -d atf-c || mkdir -p atf-c
|
||||
@src="$(srcdir)/atf-c/pkg_config_test.sh"; \
|
||||
$(AM_V_GEN)src="$(srcdir)/atf-c/pkg_config_test.sh"; \
|
||||
dst="atf-c/pkg_config_test"; $(BUILD_SH_TP)
|
||||
|
||||
tests_atf_c_PROGRAMS += atf-c/tc_test
|
||||
|
@ -1,6 +1,3 @@
|
||||
.\"
|
||||
.\" Automated Testing Framework (atf)
|
||||
.\"
|
||||
.\" Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
@ -25,12 +22,11 @@
|
||||
.\" 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.
|
||||
.\"
|
||||
.Dd November 15, 2013
|
||||
.Dt ATF-C-API 3
|
||||
.Dd October 13, 2014
|
||||
.Dt ATF-C 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm atf-c-api ,
|
||||
.Nm atf-c ,
|
||||
.Nm ATF_CHECK ,
|
||||
.Nm ATF_CHECK_MSG ,
|
||||
.Nm ATF_CHECK_EQ ,
|
||||
@ -93,24 +89,26 @@
|
||||
.Nd C API to write ATF-based test programs
|
||||
.Sh SYNOPSIS
|
||||
.In atf-c.h
|
||||
.\" NO_CHECK_STYLE_BEGIN
|
||||
.Fn ATF_CHECK "expression"
|
||||
.Fn ATF_CHECK_MSG "expression" "fail_msg_fmt" ...
|
||||
.Fn ATF_CHECK_EQ "expression_1" "expression_2"
|
||||
.Fn ATF_CHECK_EQ_MSG "expression_1" "expression_2" "fail_msg_fmt" ...
|
||||
.Fn ATF_CHECK_EQ "expected_expression" "actual_expression"
|
||||
.Fn ATF_CHECK_EQ_MSG "expected_expression" "actual_expression" "fail_msg_fmt" ...
|
||||
.Fn ATF_CHECK_MATCH "regexp" "string"
|
||||
.Fn ATF_CHECK_MATCH_MSG "regexp" "string" "fail_msg_fmt" ...
|
||||
.Fn ATF_CHECK_STREQ "string_1" "string_2"
|
||||
.Fn ATF_CHECK_STREQ_MSG "string_1" "string_2" "fail_msg_fmt" ...
|
||||
.Fn ATF_CHECK_ERRNO "exp_errno" "bool_expression"
|
||||
.Fn ATF_CHECK_ERRNO "expected_errno" "bool_expression"
|
||||
.Fn ATF_REQUIRE "expression"
|
||||
.Fn ATF_REQUIRE_MSG "expression" "fail_msg_fmt" ...
|
||||
.Fn ATF_REQUIRE_EQ "expression_1" "expression_2"
|
||||
.Fn ATF_REQUIRE_EQ_MSG "expression_1" "expression_2" "fail_msg_fmt" ...
|
||||
.Fn ATF_REQUIRE_EQ "expected_expression" "actual_expression"
|
||||
.Fn ATF_REQUIRE_EQ_MSG "expected_expression" "actual_expression" "fail_msg_fmt" ...
|
||||
.Fn ATF_REQUIRE_MATCH "regexp" "string"
|
||||
.Fn ATF_REQUIRE_MATCH_MSG "regexp" "string" "fail_msg_fmt" ...
|
||||
.Fn ATF_REQUIRE_STREQ "string_1" "string_2"
|
||||
.Fn ATF_REQUIRE_STREQ_MSG "string_1" "string_2" "fail_msg_fmt" ...
|
||||
.Fn ATF_REQUIRE_ERRNO "exp_errno" "bool_expression"
|
||||
.Fn ATF_REQUIRE_STREQ "expected_string" "actual_string"
|
||||
.Fn ATF_REQUIRE_STREQ_MSG "expected_string" "actual_string" "fail_msg_fmt" ...
|
||||
.Fn ATF_REQUIRE_ERRNO "expected_errno" "bool_expression"
|
||||
.\" NO_CHECK_STYLE_END
|
||||
.Fn ATF_TC "name"
|
||||
.Fn ATF_TC_BODY "name" "tc"
|
||||
.Fn ATF_TC_BODY_NAME "name"
|
||||
@ -409,9 +407,8 @@ If
|
||||
.Va exitcode
|
||||
is not
|
||||
.Sq -1 ,
|
||||
.Xr atf-run 1
|
||||
will validate that the exit code of the test case matches the one provided
|
||||
in this call.
|
||||
the runtime engine will validate that the exit code of the test case
|
||||
matches the one provided in this call.
|
||||
Otherwise, the exact value will be ignored.
|
||||
.It Fn atf_tc_expect_fail "reason" "..."
|
||||
Any failure (be it fatal or non-fatal) raised in this mode is recorded.
|
||||
@ -443,9 +440,8 @@ If
|
||||
.Va signo
|
||||
is not
|
||||
.Sq -1 ,
|
||||
.Xr atf-run 1
|
||||
will validate that the signal that terminated the test case matches the one
|
||||
provided in this call.
|
||||
the runtime engine will validate that the signal that terminated the test
|
||||
case matches the one provided in this call.
|
||||
Otherwise, the exact value will be ignored.
|
||||
.It Fn atf_tc_expect_timeout "reason" "..."
|
||||
Expects the test case to execute for longer than its timeout.
|
||||
@ -497,6 +493,8 @@ take an expression and fail if the expression evaluates to false.
|
||||
and
|
||||
.Fn ATF_REQUIRE_EQ_MSG
|
||||
take two expressions and fail if the two evaluated values are not equal.
|
||||
The common style is to put the expected value in the first parameter and the
|
||||
actual value in the second parameter.
|
||||
.Pp
|
||||
.Fn ATF_CHECK_MATCH ,
|
||||
.Fn ATF_CHECK_MATCH_MSG ,
|
||||
@ -514,6 +512,8 @@ the string.
|
||||
and
|
||||
.Fn ATF_REQUIRE_STREQ_MSG
|
||||
take two strings and fail if the two are not equal character by character.
|
||||
The common style is to put the expected string in the first parameter and the
|
||||
actual string in the second parameter.
|
||||
.Pp
|
||||
.Fn ATF_CHECK_ERRNO
|
||||
and
|
||||
@ -698,6 +698,25 @@ strings are prefixed with
|
||||
then they specify the name of the file into which to store the stdout or stderr
|
||||
of the subprocess, and no comparison is performed.
|
||||
.Ed
|
||||
.Sh ENVIRONMENT
|
||||
The following variables are recognized by
|
||||
.Nm
|
||||
but should not be overridden other than for testing purposes:
|
||||
.Pp
|
||||
.Bl -tag -width ATFXBUILDXCXXFLAGSXX -compact
|
||||
.It Va ATF_BUILD_CC
|
||||
Path to the C compiler.
|
||||
.It Va ATF_BUILD_CFLAGS
|
||||
C compiler flags.
|
||||
.It Va ATF_BUILD_CPP
|
||||
Path to the C/C++ preprocessor.
|
||||
.It Va ATF_BUILD_CPPFLAGS
|
||||
C/C++ preprocessor flags.
|
||||
.It Va ATF_BUILD_CXX
|
||||
Path to the C++ compiler.
|
||||
.It Va ATF_BUILD_CXXFLAGS
|
||||
C++ compiler flags.
|
||||
.El
|
||||
.Sh EXAMPLES
|
||||
The following shows a complete test program with a single test case that
|
||||
validates the addition operator:
|
||||
@ -712,13 +731,13 @@ ATF_TC_HEAD(addition, tc)
|
||||
}
|
||||
ATF_TC_BODY(addition, tc)
|
||||
{
|
||||
ATF_CHECK_EQ(0 + 0, 0);
|
||||
ATF_CHECK_EQ(0 + 1, 1);
|
||||
ATF_CHECK_EQ(1 + 0, 1);
|
||||
ATF_CHECK_EQ(0, 0 + 0);
|
||||
ATF_CHECK_EQ(1, 0 + 1);
|
||||
ATF_CHECK_EQ(1, 1 + 0);
|
||||
|
||||
ATF_CHECK_EQ(1 + 1, 2);
|
||||
ATF_CHECK_EQ(2, 1 + 1);
|
||||
|
||||
ATF_CHECK_EQ(100 + 200, 300);
|
||||
ATF_CHECK_EQ(300, 100 + 200);
|
||||
}
|
||||
|
||||
ATF_TC(string_formatting);
|
||||
@ -771,5 +790,4 @@ ATF_TP_ADD_TCS(tp)
|
||||
.Ed
|
||||
.Sh SEE ALSO
|
||||
.Xr atf-test-program 1 ,
|
||||
.Xr atf-test-case 4 ,
|
||||
.Xr atf 7
|
||||
.Xr atf-test-case 4
|
@ -1,6 +1,3 @@
|
||||
dnl
|
||||
dnl Automated Testing Framework (atf)
|
||||
dnl
|
||||
dnl Copyright 2011 Google Inc.
|
||||
dnl All rights reserved.
|
||||
dnl
|
||||
@ -28,7 +25,6 @@ dnl DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
dnl THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
dnl (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
dnl OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
dnl
|
||||
|
||||
dnl ATF_CHECK_C([version-spec])
|
||||
dnl
|
||||
|
@ -1,6 +1,3 @@
|
||||
dnl
|
||||
dnl Automated Testing Framework (atf)
|
||||
dnl
|
||||
dnl Copyright 2011 Google Inc.
|
||||
dnl All rights reserved.
|
||||
dnl
|
||||
@ -28,7 +25,6 @@ dnl DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
dnl THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
dnl (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
dnl OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
dnl
|
||||
|
||||
dnl ATF_ARG_WITH
|
||||
dnl
|
||||
|
@ -1,7 +1,4 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
/* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -24,12 +21,11 @@
|
||||
* 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.
|
||||
*/
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
|
||||
|
||||
#include <atf-c.h>
|
||||
|
||||
#include "detail/test_helpers.h"
|
||||
#include "atf-c/detail/test_helpers.h"
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
* Tests cases for the header file.
|
||||
|
@ -1,7 +1,4 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2009 The NetBSD Foundation, Inc.
|
||||
/* Copyright (c) 2009 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -24,31 +21,31 @@
|
||||
* 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.
|
||||
*/
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
|
||||
|
||||
#include "atf-c/build.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "atf-c/build.h"
|
||||
#include "atf-c/config.h"
|
||||
#include "atf-c/detail/env.h"
|
||||
#include "atf-c/detail/sanity.h"
|
||||
#include "atf-c/detail/text.h"
|
||||
#include "atf-c/error.h"
|
||||
|
||||
#include "detail/sanity.h"
|
||||
#include "detail/text.h"
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
* Auxiliary functions.
|
||||
* --------------------------------------------------------------------- */
|
||||
|
||||
static
|
||||
atf_error_t
|
||||
append_config_var(const char *var, atf_list_t *argv)
|
||||
append_config_var(const char *var, const char *default_value, atf_list_t *argv)
|
||||
{
|
||||
atf_error_t err;
|
||||
atf_list_t words;
|
||||
|
||||
err = atf_text_split(atf_config_get(var), " ", &words);
|
||||
err = atf_text_split(atf_env_get_with_default(var, default_value),
|
||||
" ", &words);
|
||||
if (atf_is_error(err))
|
||||
goto out;
|
||||
|
||||
@ -158,15 +155,16 @@ atf_build_c_o(const char *sfile,
|
||||
if (atf_is_error(err))
|
||||
goto out;
|
||||
|
||||
err = append_config_var("atf_build_cc", &argv_list);
|
||||
err = append_config_var("ATF_BUILD_CC", ATF_BUILD_CC, &argv_list);
|
||||
if (atf_is_error(err))
|
||||
goto out_list;
|
||||
|
||||
err = append_config_var("atf_build_cppflags", &argv_list);
|
||||
err = append_config_var("ATF_BUILD_CPPFLAGS", ATF_BUILD_CPPFLAGS,
|
||||
&argv_list);
|
||||
if (atf_is_error(err))
|
||||
goto out_list;
|
||||
|
||||
err = append_config_var("atf_build_cflags", &argv_list);
|
||||
err = append_config_var("ATF_BUILD_CFLAGS", ATF_BUILD_CFLAGS, &argv_list);
|
||||
if (atf_is_error(err))
|
||||
goto out_list;
|
||||
|
||||
@ -203,11 +201,12 @@ atf_build_cpp(const char *sfile,
|
||||
if (atf_is_error(err))
|
||||
goto out;
|
||||
|
||||
err = append_config_var("atf_build_cpp", &argv_list);
|
||||
err = append_config_var("ATF_BUILD_CPP", ATF_BUILD_CPP, &argv_list);
|
||||
if (atf_is_error(err))
|
||||
goto out_list;
|
||||
|
||||
err = append_config_var("atf_build_cppflags", &argv_list);
|
||||
err = append_config_var("ATF_BUILD_CPPFLAGS", ATF_BUILD_CPPFLAGS,
|
||||
&argv_list);
|
||||
if (atf_is_error(err))
|
||||
goto out_list;
|
||||
|
||||
@ -248,15 +247,17 @@ atf_build_cxx_o(const char *sfile,
|
||||
if (atf_is_error(err))
|
||||
goto out;
|
||||
|
||||
err = append_config_var("atf_build_cxx", &argv_list);
|
||||
err = append_config_var("ATF_BUILD_CXX", ATF_BUILD_CXX, &argv_list);
|
||||
if (atf_is_error(err))
|
||||
goto out_list;
|
||||
|
||||
err = append_config_var("atf_build_cppflags", &argv_list);
|
||||
err = append_config_var("ATF_BUILD_CPPFLAGS", ATF_BUILD_CPPFLAGS,
|
||||
&argv_list);
|
||||
if (atf_is_error(err))
|
||||
goto out_list;
|
||||
|
||||
err = append_config_var("atf_build_cxxflags", &argv_list);
|
||||
err = append_config_var("ATF_BUILD_CXXFLAGS", ATF_BUILD_CXXFLAGS,
|
||||
&argv_list);
|
||||
if (atf_is_error(err))
|
||||
goto out_list;
|
||||
|
||||
|
@ -1,7 +1,4 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2009 The NetBSD Foundation, Inc.
|
||||
/* Copyright (c) 2009 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -24,8 +21,7 @@
|
||||
* 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.
|
||||
*/
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
|
||||
|
||||
#if !defined(ATF_C_BUILD_H)
|
||||
#define ATF_C_BUILD_H
|
||||
@ -39,4 +35,4 @@ atf_error_t atf_build_cpp(const char *, const char *, const char *const [],
|
||||
atf_error_t atf_build_cxx_o(const char *, const char *, const char *const [],
|
||||
char ***);
|
||||
|
||||
#endif /* ATF_C_BUILD_H */
|
||||
#endif /* !defined(ATF_C_BUILD_H) */
|
||||
|
@ -1,7 +1,4 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2009 The NetBSD Foundation, Inc.
|
||||
/* Copyright (c) 2009 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -24,8 +21,9 @@
|
||||
* 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.
|
||||
*/
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
|
||||
|
||||
#include "atf-c/build.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@ -33,20 +31,15 @@
|
||||
|
||||
#include <atf-c.h>
|
||||
|
||||
#include "atf-c/build.h"
|
||||
#include "atf-c/config.h"
|
||||
#include "atf-c/detail/env.h"
|
||||
#include "atf-c/detail/test_helpers.h"
|
||||
#include "atf-c/h_build.h"
|
||||
#include "atf-c/utils.h"
|
||||
|
||||
#include "detail/env.h"
|
||||
#include "detail/test_helpers.h"
|
||||
#include "h_build.h"
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
* Auxiliary functions.
|
||||
* --------------------------------------------------------------------- */
|
||||
|
||||
void __atf_config_reinit(void);
|
||||
|
||||
static
|
||||
bool
|
||||
equal_arrays(const char *const *exp_array, char **actual_array)
|
||||
@ -167,7 +160,6 @@ ATF_TC_BODY(c_o, tc)
|
||||
verbose_set_env("ATF_BUILD_CC", test->cc);
|
||||
verbose_set_env("ATF_BUILD_CFLAGS", test->cflags);
|
||||
verbose_set_env("ATF_BUILD_CPPFLAGS", test->cppflags);
|
||||
__atf_config_reinit();
|
||||
|
||||
{
|
||||
char **argv;
|
||||
@ -196,7 +188,6 @@ ATF_TC_BODY(cpp, tc)
|
||||
|
||||
verbose_set_env("ATF_BUILD_CPP", test->cpp);
|
||||
verbose_set_env("ATF_BUILD_CPPFLAGS", test->cppflags);
|
||||
__atf_config_reinit();
|
||||
|
||||
{
|
||||
char **argv;
|
||||
@ -226,7 +217,6 @@ ATF_TC_BODY(cxx_o, tc)
|
||||
verbose_set_env("ATF_BUILD_CXX", test->cxx);
|
||||
verbose_set_env("ATF_BUILD_CXXFLAGS", test->cxxflags);
|
||||
verbose_set_env("ATF_BUILD_CPPFLAGS", test->cppflags);
|
||||
__atf_config_reinit();
|
||||
|
||||
{
|
||||
char **argv;
|
||||
@ -241,12 +231,6 @@ ATF_TC_BODY(cxx_o, tc)
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
* Tests cases for the header file.
|
||||
* --------------------------------------------------------------------- */
|
||||
|
||||
HEADER_TC(include, "atf-c/build.h");
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
* Main.
|
||||
* --------------------------------------------------------------------- */
|
||||
@ -261,8 +245,5 @@ ATF_TP_ADD_TCS(tp)
|
||||
ATF_TP_ADD_TC(tp, cpp);
|
||||
ATF_TP_ADD_TC(tp, cxx_o);
|
||||
|
||||
/* Add the test cases for the header file. */
|
||||
ATF_TP_ADD_TC(tp, include);
|
||||
|
||||
return atf_no_error();
|
||||
}
|
||||
|
@ -1,7 +1,4 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
/* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -24,8 +21,9 @@
|
||||
* 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.
|
||||
*/
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
|
||||
|
||||
#include "atf-c/check.h"
|
||||
|
||||
#include <sys/wait.h>
|
||||
|
||||
@ -37,18 +35,16 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include "atf-c/build.h"
|
||||
#include "atf-c/check.h"
|
||||
#include "atf-c/config.h"
|
||||
#include "atf-c/defs.h"
|
||||
#include "atf-c/detail/dynstr.h"
|
||||
#include "atf-c/detail/env.h"
|
||||
#include "atf-c/detail/fs.h"
|
||||
#include "atf-c/detail/list.h"
|
||||
#include "atf-c/detail/process.h"
|
||||
#include "atf-c/detail/sanity.h"
|
||||
#include "atf-c/error.h"
|
||||
#include "atf-c/utils.h"
|
||||
|
||||
#include "detail/dynstr.h"
|
||||
#include "detail/fs.h"
|
||||
#include "detail/list.h"
|
||||
#include "detail/process.h"
|
||||
#include "detail/sanity.h"
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
* Auxiliary functions.
|
||||
* --------------------------------------------------------------------- */
|
||||
@ -60,7 +56,7 @@ create_tmpdir(atf_fs_path_t *dir)
|
||||
atf_error_t err;
|
||||
|
||||
err = atf_fs_path_init_fmt(dir, "%s/check.XXXXXX",
|
||||
atf_config_get("atf_workdir"));
|
||||
atf_env_get_with_default("TMPDIR", "/tmp"));
|
||||
if (atf_is_error(err))
|
||||
goto out;
|
||||
|
||||
|
@ -1,7 +1,4 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
/* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -24,8 +21,7 @@
|
||||
* 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.
|
||||
*/
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
|
||||
|
||||
#if !defined(ATF_C_CHECK_H)
|
||||
#define ATF_C_CHECK_H
|
||||
@ -70,4 +66,4 @@ atf_error_t atf_check_build_cxx_o(const char *, const char *,
|
||||
bool *);
|
||||
atf_error_t atf_check_exec_array(const char *const *, atf_check_result_t *);
|
||||
|
||||
#endif /* ATF_C_CHECK_H */
|
||||
#endif /* !defined(ATF_C_CHECK_H) */
|
||||
|
@ -1,7 +1,4 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
/* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -24,8 +21,9 @@
|
||||
* 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.
|
||||
*/
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
|
||||
|
||||
#include "atf-c/check.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <signal.h>
|
||||
@ -36,13 +34,10 @@
|
||||
|
||||
#include <atf-c.h>
|
||||
|
||||
#include "atf-c/check.h"
|
||||
#include "atf-c/config.h"
|
||||
|
||||
#include "detail/fs.h"
|
||||
#include "detail/map.h"
|
||||
#include "detail/process.h"
|
||||
#include "detail/test_helpers.h"
|
||||
#include "atf-c/detail/fs.h"
|
||||
#include "atf-c/detail/map.h"
|
||||
#include "atf-c/detail/process.h"
|
||||
#include "atf-c/detail/test_helpers.h"
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
* Auxiliary functions.
|
||||
@ -494,12 +489,8 @@ ATF_TC_HEAD(exec_unknown, tc)
|
||||
}
|
||||
ATF_TC_BODY(exec_unknown, tc)
|
||||
{
|
||||
char buf[1024];
|
||||
snprintf(buf, sizeof(buf), "%s/non-existent",
|
||||
atf_config_get("atf_workdir"));
|
||||
|
||||
const char *argv[2];
|
||||
argv[0] = buf;
|
||||
argv[0] = "/foo/bar/non-existent";
|
||||
argv[1] = NULL;
|
||||
|
||||
atf_check_result_t result;
|
||||
@ -509,12 +500,6 @@ ATF_TC_BODY(exec_unknown, tc)
|
||||
atf_check_result_fini(&result);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
* Tests cases for the header file.
|
||||
* --------------------------------------------------------------------- */
|
||||
|
||||
HEADER_TC(include, "atf-c/check.h");
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
* Main.
|
||||
* --------------------------------------------------------------------- */
|
||||
@ -532,8 +517,5 @@ ATF_TP_ADD_TCS(tp)
|
||||
ATF_TP_ADD_TC(tp, exec_umask);
|
||||
ATF_TP_ADD_TC(tp, exec_unknown);
|
||||
|
||||
/* Add the test cases for the header file. */
|
||||
ATF_TP_ADD_TC(tp, include);
|
||||
|
||||
return atf_no_error();
|
||||
}
|
||||
|
160
atf-c/config.c
160
atf-c/config.c
@ -1,160 +0,0 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* 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
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "atf-c/config.h"
|
||||
|
||||
#include "detail/env.h"
|
||||
#include "detail/sanity.h"
|
||||
|
||||
static bool initialized = false;
|
||||
|
||||
static struct var {
|
||||
const char *name;
|
||||
const char *default_value;
|
||||
const char *value;
|
||||
bool can_be_empty;
|
||||
} vars[] = {
|
||||
{ "atf_build_cc", ATF_BUILD_CC, NULL, false, },
|
||||
{ "atf_build_cflags", ATF_BUILD_CFLAGS, NULL, true, },
|
||||
{ "atf_build_cpp", ATF_BUILD_CPP, NULL, false, },
|
||||
{ "atf_build_cppflags", ATF_BUILD_CPPFLAGS, NULL, true, },
|
||||
{ "atf_build_cxx", ATF_BUILD_CXX, NULL, false, },
|
||||
{ "atf_build_cxxflags", ATF_BUILD_CXXFLAGS, NULL, true, },
|
||||
{ "atf_includedir", ATF_INCLUDEDIR, NULL, false, },
|
||||
{ "atf_libexecdir", ATF_LIBEXECDIR, NULL, false, },
|
||||
{ "atf_pkgdatadir", ATF_PKGDATADIR, NULL, false, },
|
||||
{ "atf_shell", ATF_SHELL, NULL, false, },
|
||||
{ "atf_workdir", ATF_WORKDIR, NULL, false, },
|
||||
{ NULL, NULL, NULL, false, },
|
||||
};
|
||||
|
||||
/* Only used for unit testing, so this prototype is private. */
|
||||
void __atf_config_reinit(void);
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
* Auxiliary functions.
|
||||
* --------------------------------------------------------------------- */
|
||||
|
||||
static
|
||||
char *
|
||||
string_to_upper(const char *str)
|
||||
{
|
||||
char *uc;
|
||||
|
||||
uc = (char *)malloc(strlen(str) + 1);
|
||||
if (uc != NULL) {
|
||||
char *ucptr = uc;
|
||||
while (*str != '\0') {
|
||||
*ucptr = toupper((int)*str);
|
||||
|
||||
str++;
|
||||
ucptr++;
|
||||
}
|
||||
*ucptr = '\0';
|
||||
}
|
||||
|
||||
return uc;
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
initialize_var(struct var *var, const char *envname)
|
||||
{
|
||||
PRE(var->value == NULL);
|
||||
|
||||
if (atf_env_has(envname)) {
|
||||
const char *val = atf_env_get(envname);
|
||||
if (strlen(val) > 0 || var->can_be_empty)
|
||||
var->value = val;
|
||||
else
|
||||
var->value = var->default_value;
|
||||
} else
|
||||
var->value = var->default_value;
|
||||
|
||||
POST(var->value != NULL);
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
initialize(void)
|
||||
{
|
||||
struct var *var;
|
||||
|
||||
PRE(!initialized);
|
||||
|
||||
for (var = vars; var->name != NULL; var++) {
|
||||
char *envname;
|
||||
|
||||
envname = string_to_upper(var->name);
|
||||
initialize_var(var, envname);
|
||||
free(envname);
|
||||
}
|
||||
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
* Free functions.
|
||||
* --------------------------------------------------------------------- */
|
||||
|
||||
const char *
|
||||
atf_config_get(const char *name)
|
||||
{
|
||||
const struct var *var;
|
||||
const char *value;
|
||||
|
||||
if (!initialized) {
|
||||
initialize();
|
||||
INV(initialized);
|
||||
}
|
||||
|
||||
value = NULL;
|
||||
for (var = vars; value == NULL && var->name != NULL; var++)
|
||||
if (strcmp(var->name, name) == 0)
|
||||
value = var->value;
|
||||
INV(value != NULL);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
void
|
||||
__atf_config_reinit(void)
|
||||
{
|
||||
struct var *var;
|
||||
|
||||
initialized = false;
|
||||
|
||||
for (var = vars; var->name != NULL; var++)
|
||||
var->value = NULL;
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* 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
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#if !defined(ATF_C_CONFIG_H)
|
||||
#define ATF_C_CONFIG_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
const char *atf_config_get(const char *);
|
||||
|
||||
#endif /* !defined(ATF_C_CONFIG_H) */
|
@ -1,152 +0,0 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <atf-c.h>
|
||||
|
||||
#include "atf-c/config.h"
|
||||
|
||||
#include "detail/env.h"
|
||||
#include "detail/test_helpers.h"
|
||||
|
||||
static const char *test_value = "env-value";
|
||||
|
||||
static struct varnames {
|
||||
const char *lc;
|
||||
const char *uc;
|
||||
bool can_be_empty;
|
||||
} all_vars[] = {
|
||||
{ "atf_build_cc", "ATF_BUILD_CC", false },
|
||||
{ "atf_build_cflags", "ATF_BUILD_CFLAGS", true },
|
||||
{ "atf_build_cpp", "ATF_BUILD_CPP", false },
|
||||
{ "atf_build_cppflags", "ATF_BUILD_CPPFLAGS", true },
|
||||
{ "atf_build_cxx", "ATF_BUILD_CXX", false },
|
||||
{ "atf_build_cxxflags", "ATF_BUILD_CXXFLAGS", true },
|
||||
{ "atf_includedir", "ATF_INCLUDEDIR", false },
|
||||
{ "atf_libexecdir", "ATF_LIBEXECDIR", false },
|
||||
{ "atf_pkgdatadir", "ATF_PKGDATADIR", false },
|
||||
{ "atf_shell", "ATF_SHELL", false },
|
||||
{ "atf_workdir", "ATF_WORKDIR", false },
|
||||
{ NULL, NULL, false }
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
* Auxiliary functions.
|
||||
* --------------------------------------------------------------------- */
|
||||
|
||||
void __atf_config_reinit(void);
|
||||
|
||||
static
|
||||
void
|
||||
unset_all(void)
|
||||
{
|
||||
const struct varnames *v;
|
||||
for (v = all_vars; v->lc != NULL; v++)
|
||||
RE(atf_env_unset(v->uc));
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
compare_one(const char *var, const char *expvalue)
|
||||
{
|
||||
const struct varnames *v;
|
||||
|
||||
printf("Checking that %s is set to %s\n", var, expvalue);
|
||||
|
||||
for (v = all_vars; v->lc != NULL; v++) {
|
||||
if (strcmp(v->lc, var) == 0)
|
||||
ATF_CHECK_STREQ(atf_config_get(v->lc), test_value);
|
||||
else
|
||||
ATF_CHECK(strcmp(atf_config_get(v->lc), test_value) != 0);
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
* Test cases for the free functions.
|
||||
* --------------------------------------------------------------------- */
|
||||
|
||||
ATF_TC(get);
|
||||
ATF_TC_HEAD(get, tc)
|
||||
{
|
||||
atf_tc_set_md_var(tc, "descr", "Tests the atf_config_get function");
|
||||
}
|
||||
ATF_TC_BODY(get, tc)
|
||||
{
|
||||
const struct varnames *v;
|
||||
|
||||
/* Unset all known environment variables and make sure the built-in
|
||||
* values do not match the bogus value we will use for testing. */
|
||||
unset_all();
|
||||
__atf_config_reinit();
|
||||
for (v = all_vars; v->lc != NULL; v++)
|
||||
ATF_CHECK(strcmp(atf_config_get(v->lc), test_value) != 0);
|
||||
|
||||
/* Test the behavior of empty values. */
|
||||
for (v = all_vars; v->lc != NULL; v++) {
|
||||
unset_all();
|
||||
if (strcmp(atf_config_get(v->lc), "") != 0) {
|
||||
RE(atf_env_set(v->uc, ""));
|
||||
__atf_config_reinit();
|
||||
if (v->can_be_empty)
|
||||
ATF_CHECK(strlen(atf_config_get(v->lc)) == 0);
|
||||
else
|
||||
ATF_CHECK(strlen(atf_config_get(v->lc)) > 0);
|
||||
}
|
||||
}
|
||||
|
||||
/* Check if every variable is recognized individually. */
|
||||
for (v = all_vars; v->lc != NULL; v++) {
|
||||
unset_all();
|
||||
RE(atf_env_set(v->uc, test_value));
|
||||
__atf_config_reinit();
|
||||
compare_one(v->lc, test_value);
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
* Tests cases for the header file.
|
||||
* --------------------------------------------------------------------- */
|
||||
|
||||
HEADER_TC(include, "atf-c/config.h");
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
* Main.
|
||||
* --------------------------------------------------------------------- */
|
||||
|
||||
ATF_TP_ADD_TCS(tp)
|
||||
{
|
||||
ATF_TP_ADD_TC(tp, get);
|
||||
|
||||
/* Add the test cases for the header file. */
|
||||
ATF_TP_ADD_TC(tp, include);
|
||||
|
||||
return atf_no_error();
|
||||
}
|
@ -1,7 +1,4 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
/* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -24,8 +21,7 @@
|
||||
* 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.
|
||||
*/
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
|
||||
|
||||
#if !defined(ATF_C_DEFS_H)
|
||||
#define ATF_C_DEFS_H
|
||||
|
@ -1,6 +1,3 @@
|
||||
#
|
||||
# Automated Testing Framework (atf)
|
||||
#
|
||||
# Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
@ -25,7 +22,6 @@
|
||||
# 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.
|
||||
#
|
||||
|
||||
libatf_c_la_SOURCES += atf-c/detail/dynstr.c \
|
||||
atf-c/detail/dynstr.h \
|
||||
@ -54,7 +50,8 @@ EXTRA_DIST += $(tests_atf_c_detail_DATA)
|
||||
noinst_LTLIBRARIES += atf-c/detail/libtest_helpers.la
|
||||
atf_c_detail_libtest_helpers_la_SOURCES = atf-c/detail/test_helpers.c \
|
||||
atf-c/detail/test_helpers.h
|
||||
atf_c_detail_libtest_helpers_la_CPPFLAGS = -I$(srcdir)/atf-c
|
||||
atf_c_detail_libtest_helpers_la_CPPFLAGS = -I$(srcdir)/atf-c \
|
||||
-DATF_INCLUDEDIR=\"$(includedir)\"
|
||||
|
||||
tests_atf_c_detail_PROGRAMS = atf-c/detail/dynstr_test
|
||||
atf_c_detail_dynstr_test_SOURCES = atf-c/detail/dynstr_test.c
|
||||
|
@ -1,7 +1,4 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
/* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -24,8 +21,9 @@
|
||||
* 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.
|
||||
*/
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
|
||||
|
||||
#include "atf-c/detail/dynstr.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdarg.h>
|
||||
@ -34,12 +32,10 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "atf-c/detail/sanity.h"
|
||||
#include "atf-c/detail/text.h"
|
||||
#include "atf-c/error.h"
|
||||
|
||||
#include "dynstr.h"
|
||||
#include "sanity.h"
|
||||
#include "text.h"
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
* Auxiliary functions.
|
||||
* --------------------------------------------------------------------- */
|
||||
|
@ -1,7 +1,4 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
/* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -24,11 +21,10 @@
|
||||
* 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.
|
||||
*/
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
|
||||
|
||||
#if !defined(ATF_C_DYNSTR_H)
|
||||
#define ATF_C_DYNSTR_H
|
||||
#if !defined(ATF_C_DETAIL_DYNSTR_H)
|
||||
#define ATF_C_DETAIL_DYNSTR_H
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
@ -78,4 +74,4 @@ atf_error_t atf_dynstr_prepend_fmt(atf_dynstr_t *, const char *, ...);
|
||||
bool atf_equal_dynstr_cstring(const atf_dynstr_t *, const char *);
|
||||
bool atf_equal_dynstr_dynstr(const atf_dynstr_t *, const atf_dynstr_t *);
|
||||
|
||||
#endif /* ATF_C_DYNSTR_H */
|
||||
#endif /* !defined(ATF_C_DETAIL_DYNSTR_H) */
|
||||
|
@ -1,7 +1,4 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
/* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -24,8 +21,9 @@
|
||||
* 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.
|
||||
*/
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
|
||||
|
||||
#include "atf-c/detail/dynstr.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
@ -35,8 +33,7 @@
|
||||
|
||||
#include <atf-c.h>
|
||||
|
||||
#include "dynstr.h"
|
||||
#include "test_helpers.h"
|
||||
#include "atf-c/detail/test_helpers.h"
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
* Tests for the "atf_dynstr" type.
|
||||
|
@ -1,7 +1,4 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
/* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -24,22 +21,21 @@
|
||||
* 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.
|
||||
*/
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
|
||||
|
||||
#include "atf-c/detail/env.h"
|
||||
|
||||
#if defined(HAVE_CONFIG_H)
|
||||
#include "bconfig.h"
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "atf-c/detail/sanity.h"
|
||||
#include "atf-c/detail/text.h"
|
||||
#include "atf-c/error.h"
|
||||
|
||||
#include "env.h"
|
||||
#include "sanity.h"
|
||||
#include "text.h"
|
||||
|
||||
const char *
|
||||
atf_env_get(const char *name)
|
||||
{
|
||||
@ -48,6 +44,16 @@ atf_env_get(const char *name)
|
||||
return val;
|
||||
}
|
||||
|
||||
const char *
|
||||
atf_env_get_with_default(const char *name, const char *default_value)
|
||||
{
|
||||
const char* val = getenv(name);
|
||||
if (val == NULL)
|
||||
return default_value;
|
||||
else
|
||||
return val;
|
||||
}
|
||||
|
||||
bool
|
||||
atf_env_has(const char *name)
|
||||
{
|
||||
|
@ -1,7 +1,4 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
/* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -24,19 +21,19 @@
|
||||
* 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.
|
||||
*/
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
|
||||
|
||||
#if !defined(ATF_C_ENV_H)
|
||||
#define ATF_C_ENV_H
|
||||
#if !defined(ATF_C_DETAIL_ENV_H)
|
||||
#define ATF_C_DETAIL_ENV_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <atf-c/error_fwd.h>
|
||||
|
||||
const char *atf_env_get(const char *);
|
||||
const char *atf_env_get_with_default(const char *, const char *);
|
||||
bool atf_env_has(const char *);
|
||||
atf_error_t atf_env_set(const char *, const char *);
|
||||
atf_error_t atf_env_unset(const char *);
|
||||
|
||||
#endif /* !defined(ATF_C_ENV_H) */
|
||||
#endif /* !defined(ATF_C_DETAIL_ENV_H) */
|
||||
|
@ -1,7 +1,4 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
/* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -24,17 +21,17 @@
|
||||
* 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.
|
||||
*/
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
|
||||
|
||||
#include "atf-c/detail/env.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <atf-c.h>
|
||||
|
||||
#include "env.h"
|
||||
#include "test_helpers.h"
|
||||
#include "text.h"
|
||||
#include "atf-c/detail/test_helpers.h"
|
||||
#include "atf-c/detail/text.h"
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
* Test cases for the free functions.
|
||||
@ -67,6 +64,25 @@ ATF_TC_BODY(get, tc)
|
||||
ATF_REQUIRE(strchr(val, ':') != NULL);
|
||||
}
|
||||
|
||||
ATF_TC(get_with_default);
|
||||
ATF_TC_HEAD(get_with_default, tc)
|
||||
{
|
||||
atf_tc_set_md_var(tc, "descr", "Tests the atf_env_get_with_default "
|
||||
"function");
|
||||
}
|
||||
ATF_TC_BODY(get_with_default, tc)
|
||||
{
|
||||
const char *val;
|
||||
|
||||
ATF_REQUIRE(atf_env_has("PATH"));
|
||||
|
||||
val = atf_env_get_with_default("PATH", "unknown");
|
||||
ATF_REQUIRE(strcmp(val, "unknown") != 0);
|
||||
|
||||
val = atf_env_get_with_default("_UNKNOWN_VARIABLE_", "foo bar");
|
||||
ATF_REQUIRE(strcmp(val, "foo bar") == 0);
|
||||
}
|
||||
|
||||
ATF_TC(set);
|
||||
ATF_TC_HEAD(set, tc)
|
||||
{
|
||||
@ -109,6 +125,7 @@ ATF_TP_ADD_TCS(tp)
|
||||
{
|
||||
ATF_TP_ADD_TC(tp, has);
|
||||
ATF_TP_ADD_TC(tp, get);
|
||||
ATF_TP_ADD_TC(tp, get_with_default);
|
||||
ATF_TP_ADD_TC(tp, set);
|
||||
ATF_TP_ADD_TC(tp, unset);
|
||||
|
||||
|
@ -1,7 +1,4 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
/* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -24,11 +21,12 @@
|
||||
* 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.
|
||||
*/
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
|
||||
|
||||
#include "atf-c/detail/fs.h"
|
||||
|
||||
#if defined(HAVE_CONFIG_H)
|
||||
#include "bconfig.h"
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -47,13 +45,11 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include "atf-c/defs.h"
|
||||
#include "atf-c/detail/sanity.h"
|
||||
#include "atf-c/detail/text.h"
|
||||
#include "atf-c/detail/user.h"
|
||||
#include "atf-c/error.h"
|
||||
|
||||
#include "fs.h"
|
||||
#include "sanity.h"
|
||||
#include "text.h"
|
||||
#include "user.h"
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
* Prototypes for auxiliary functions.
|
||||
* --------------------------------------------------------------------- */
|
||||
|
@ -1,7 +1,4 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
/* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -24,11 +21,10 @@
|
||||
* 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.
|
||||
*/
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
|
||||
|
||||
#if !defined(ATF_C_FS_H)
|
||||
#define ATF_C_FS_H
|
||||
#if !defined(ATF_C_DETAIL_FS_H)
|
||||
#define ATF_C_DETAIL_FS_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
@ -36,10 +32,9 @@
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <atf-c/detail/dynstr.h>
|
||||
#include <atf-c/error_fwd.h>
|
||||
|
||||
#include "dynstr.h"
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
* The "atf_fs_path" type.
|
||||
* --------------------------------------------------------------------- */
|
||||
@ -130,4 +125,4 @@ atf_error_t atf_fs_mkstemp(atf_fs_path_t *, int *);
|
||||
atf_error_t atf_fs_rmdir(const atf_fs_path_t *);
|
||||
atf_error_t atf_fs_unlink(const atf_fs_path_t *);
|
||||
|
||||
#endif /* !defined(ATF_C_FS_H) */
|
||||
#endif /* !defined(ATF_C_DETAIL_FS_H) */
|
||||
|
@ -1,7 +1,4 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
/* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -24,8 +21,9 @@
|
||||
* 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.
|
||||
*/
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
|
||||
|
||||
#include "atf-c/detail/fs.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
@ -39,9 +37,8 @@
|
||||
|
||||
#include <atf-c.h>
|
||||
|
||||
#include "fs.h"
|
||||
#include "test_helpers.h"
|
||||
#include "user.h"
|
||||
#include "atf-c/detail/test_helpers.h"
|
||||
#include "atf-c/detail/user.h"
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
* Auxiliary functions.
|
||||
|
@ -1,7 +1,4 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
/* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -24,18 +21,17 @@
|
||||
* 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.
|
||||
*/
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
|
||||
|
||||
#include "atf-c/detail/list.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "atf-c/detail/sanity.h"
|
||||
#include "atf-c/error.h"
|
||||
#include "atf-c/utils.h"
|
||||
|
||||
#include "list.h"
|
||||
#include "sanity.h"
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
* Auxiliary functions.
|
||||
* --------------------------------------------------------------------- */
|
||||
|
@ -1,7 +1,4 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
/* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -24,11 +21,10 @@
|
||||
* 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.
|
||||
*/
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
|
||||
|
||||
#if !defined(ATF_C_LIST_H)
|
||||
#define ATF_C_LIST_H
|
||||
#if !defined(ATF_C_DETAIL_LIST_H)
|
||||
#define ATF_C_DETAIL_LIST_H
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
@ -112,4 +108,4 @@ void atf_list_append_list(atf_list_t *, atf_list_t *);
|
||||
!atf_equal_list_citer_list_citer((iter), atf_list_end_c(list)); \
|
||||
iter = atf_list_citer_next(iter))
|
||||
|
||||
#endif /* ATF_C_LIST_H */
|
||||
#endif /* !defined(ATF_C_DETAIL_LIST_H) */
|
||||
|
@ -1,7 +1,4 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
/* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -24,19 +21,18 @@
|
||||
* 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.
|
||||
*/
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
|
||||
|
||||
#include "atf-c/detail/list.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <atf-c.h>
|
||||
|
||||
#include "atf-c/detail/test_helpers.h"
|
||||
#include "atf-c/utils.h"
|
||||
|
||||
#include "list.h"
|
||||
#include "test_helpers.h"
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
* Tests for the "atf_list" type.
|
||||
* --------------------------------------------------------------------- */
|
||||
|
@ -1,7 +1,4 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
/* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -24,19 +21,18 @@
|
||||
* 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.
|
||||
*/
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
|
||||
|
||||
#include "atf-c/detail/map.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "atf-c/detail/sanity.h"
|
||||
#include "atf-c/error.h"
|
||||
#include "atf-c/utils.h"
|
||||
|
||||
#include "map.h"
|
||||
#include "sanity.h"
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
* Auxiliary functions.
|
||||
* --------------------------------------------------------------------- */
|
||||
|
@ -1,7 +1,4 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
/* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -24,19 +21,17 @@
|
||||
* 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.
|
||||
*/
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
|
||||
|
||||
#if !defined(ATF_C_MAP_H)
|
||||
#define ATF_C_MAP_H
|
||||
#if !defined(ATF_C_DETAIL_MAP_H)
|
||||
#define ATF_C_DETAIL_MAP_H
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <atf-c/detail/list.h>
|
||||
#include <atf-c/error_fwd.h>
|
||||
|
||||
#include "list.h"
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
* The "atf_map_citer" type.
|
||||
* --------------------------------------------------------------------- */
|
||||
@ -116,4 +111,4 @@ atf_error_t atf_map_insert(atf_map_t *, const char *, void *, bool);
|
||||
!atf_equal_map_citer_map_citer((iter), atf_map_end_c(map)); \
|
||||
iter = atf_map_citer_next(iter))
|
||||
|
||||
#endif /* ATF_C_MAP_H */
|
||||
#endif /* !defined(ATF_C_DETAIL_MAP_H) */
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user