1. Add README.txt with upgrade instructions as well as license info

and governance.
2.  Add FREEBSD-Xlist to prune the distribution.
3.  Remove files & directories not used by FreeBSD.
This commit is contained in:
Marcel Moolenaar 2012-09-05 15:58:39 +00:00
parent 679bf1899d
commit f1e38e2131
46 changed files with 0 additions and 18887 deletions

232
INSTALL
View File

@ -1,232 +0,0 @@
Installation instructions Automated Testing Framework
===========================================================================
Introduction
************
ATF uses the GNU Automake, GNU Autoconf and GNU Libtool utilities as its
build system. These are used only when compiling the application from the
source code package. If you want to install ATF from a binary package, you
do not need to read this document.
For the impatient:
$ ./configure
$ make
Gain root privileges
# make install
Drop root privileges
$ make installcheck
Or alternatively, install as a regular user into your home directory:
$ ./configure --prefix ~/local
$ make
$ make install
$ make installcheck
Dependencies
************
To build and use ATF successfully you need:
* A standards-compliant C/C++ complier. For example, GNU GCC 2.95 will not
work.
* A POSIX shell interpreter.
* A make(1) utility.
If you are building ATF from the code on the repository, you will also need
the following tools. The versions listed here are the ones used to build
the files bundled in the last formal release, but these are not strictly
required. Newer ones will most likely work and, maybe, some slightly older
ones:
* GNU autoconf 2.68
* GNU automake 1.11.3
* GNU libtool 2.4.2
Regenerating the build system
*****************************
If you are building ATF from code extracted from the repository, you must
first regenerate the files used by the build system. You will also need to
do this if you modify configure.ac, Makefile.am or any of the other build
system files. To do this, simply run:
$ autoreconf -i -s
For formal releases, no extra steps are needed.
General build procedure
***********************
To build and install the source package, you must follow these steps:
1. Configure the sources to adapt to your operating system. This is done
using the 'configure' script located on the sources' top directory,
and it is usually invoked without arguments unless you want to change
the installation prefix. More details on this procedure are given on a
later section.
2. Build the sources to generate the binaries and scripts. Simply run
'make' on the sources' top directory after configuring them. No
problems should arise.
3. Install the program by running 'make install'. You may need to become
root to issue this step.
4. Issue any manual installation steps that may be required. These are
described later in their own section.
5. Check that the installed programs work by running 'make installcheck'.
You do not need to be root to do this, even though some checks will not
be run otherwise.
Configuration flags
*******************
The most common, standard flags given to 'configure' are:
* --prefix=directory
Possible values: Any path
Default: /usr/local
Specifies where the program (binaries and all associated files) will
be installed.
* --sysconfdir=directory
Possible values: Any path
Default: /usr/local/etc
Specifies where the installed programs will look for configuration files.
'/atf' will be appended to the given path unless ATF_CONFSUBDIR is
redefined as explained later on.
* --help
Shows information about all available flags and exits immediately,
without running any configuration tasks.
The following environment variables are specific to ATF's 'configure'
script:
* ATF_BUILD_CC
Possible values: empty, a absolute or relative path to a C compiler.
Default: the value of CC as detected by the configure script.
Specifies the C compiler that ATF will use at run time whenever the
build-time-specific checks are used.
* ATF_BUILD_CFLAGS
Possible values: empty, a list of valid C compiler flags.
Default: the value of CFLAGS as detected by the configure script.
Specifies the C compiler flags that ATF will use at run time whenever the
build-time-specific checks are used.
* ATF_BUILD_CPP
Possible values: empty, a absolute or relative path to a C/C++
preprocessor.
Default: the value of CPP as detected by the configure script.
Specifies the C/C++ preprocessor that ATF will use at run time whenever
the build-time-specific checks are used.
* ATF_BUILD_CPPFLAGS
Possible values: empty, a list of valid C/C++ preprocessor flags.
Default: the value of CPPFLAGS as detected by the configure script.
Specifies the C/C++ preprocessor flags that ATF will use at run time
whenever the build-time-specific checks are used.
* ATF_BUILD_CXX
Possible values: empty, a absolute or relative path to a C++ compiler.
Default: the value of CXX as detected by the configure script.
Specifies the C++ compiler that ATF will use at run time whenever the
build-time-specific checks are used.
* ATF_BUILD_CXXFLAGS
Possible values: empty, a list of valid C++ compiler flags.
Default: the value of CXXFLAGS as detected by the configure script.
Specifies the C++ compiler flags that ATF will use at run time whenever
the build-time-specific checks are used.
* ATF_CONFSUBDIR
Possible values: empty, a relative path.
Default: atf.
Specifies the subdirectory of the configuration directory (given by the
--sysconfdir argument) under which ATF will search for its configuration
files.
* ATF_SHELL
Possible values: empty, absolute path to a POSIX shell interpreter.
Default: empty.
Specifies the POSIX shell interpreter that ATF will use at run time to
execute its scripts and the test programs written using the atf-sh
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.
* GDB
Possible values: empty, absolute path to GNU GDB.
Default: empty.
Specifies the path to the GNU GDB binary that atf-run will use to gather
a stack trace of a crashing test program. If empty, the configure script
will try to find a suitable binary for you.
The following flags are specific to ATF's 'configure' script:
* --enable-developer
Possible values: yes, no
Default: 'yes' in Git HEAD builds; 'no' in formal releases.
Enables several features useful for development, such as the inclusion
of debugging symbols in all objects or the enforcement of compilation
warnings.
The compiler will be executed with an exhaustive collection of warning
detection features regardless of the value of this flag. However, such
warnings are only fatal when --enable-developer is 'yes'.
* --enable-tools
Possible values: yes, no
Default: no.
Enables the build of the deprecated atf-config, atf-report, atf-run
and atf-version tools. atf-report and atf-run have been superseded by
Kyua, and atf-config and atf-version are unnecessary.
Post-installation steps
***********************
After installing ATF, you have to register the DTDs it provides into the
system-wide XML catalog. See the comments at the top of the files in
${datadir}/share/xml/atf to see the correct public identifiers. This
directory will typically be /usr/local/share/xml/atf or /usr/share/xml/atf.
Failure to do so will lead to further errors when processing the XML files
generated by atf-report.
===========================================================================
vim: filetype=text:textwidth=75:expandtab:shiftwidth=2:softtabstop=2

184
TODO
View File

@ -1,184 +0,0 @@
Things to do Automated Testing Framework
===========================================================================
Last revised: November 30th, 2010
This document includes the list of things that need to be done in ATF that
are most requested by the users. This information used to be available in
an ad-hoc bug tracker but that proved to be a bad idea. I have collected
all worthy comments in here.
Please note that most work these days is going into Kyua (see
http://code.google.com/p/kyua/). The ideas listed here apply to the
components of ATF that have *not* been migrated to the new codebase yet.
For bug reports or ideas that apply to the components that already have
been migrated, please use the bug tracker in the URL above. Similarly,
whenever a component is migrated, the ideas in this file should be revised
and migrated to the new bug tracker where appropriate.
---------------------------------------------------------------------------
Add build-time checks to atf-sh
The 0.7 release introduced build-time tests to atf-c and atf-c++, but not
to atf-sh. Expose the functionality to the shell interface.
This will probably require writing an atf-build utility that exposes the C
code and can be called from the shell.
---------------------------------------------------------------------------
Revisit what to do when an Atffile lists a non-existent file
---------------------------------------------------------------------------
Add ATF_CHECK* versions to atf-c++ to support non-fatal tests
---------------------------------------------------------------------------
Implement race-condition tests
gcooper:
I would think that stress/negative tests would be of more value than race
condition tests (they're similar, but not exactly the same in my mind).
In particular,
1. Feed through as much data as possible to determine where reporting
breaks down.
2. Feed through data quickly and terminate ASAP. The data should be
captured. Terminate child applications with unexpected exit codes and
signals (in particular, SIGCHLD, SIGPIPE, exit codes that terminate,
etc).
3. Open up a file descriptor in the test application, don't close the file
descriptor.
4. fork(2) a process; don't wait(2) for the application to complete.
There are other scenarios that could be exercised, but these are the ones
I could think of off the topic of my head.
--
jmmv:
1. The thing is: how do you express any of this in a portable/abstract
interface? How do you express that a test case "receives data"? What
does that exactly mean? I don't think the framework should care about
this: each test should be free to decide where its data is and how to
deal with it.
2. Ditto.
3. Not sure I understand your request, but testing for "unexpected exit
codes" is already supported. See wiki:DesignXFail for the feature
design details.
4. What's the problem with this case? The test case exits right away after
terminating the execution of its body; any open file descriptors,
leaked memory, etc. die with it.
5. forking and not waiting for a subprocess was a problem already
addressed.
I kinda have an idea of what Antti means with "race condition tests", but
every time I have tried to describe my understanding of matters I seem to
be wrong. Would be nice to have a clear description of what this involves;
in particular, what are the expectations from the framework and how should
the feature be exposed.
As of now, what I understand by "race condition test" is: a test case that
exercises a race condition. The test case may finish without triggering
the race, in which case it just exists with a successful status.
Otherwise, if the race triggers, the test case gets stuck and times out.
The result should be reported as an "expected failure" different from
timeout.
--
pooka:
Yup. Plus some atf-wide mechanism for the operator to supply some kind of
guideline if the test should try to trigger the race for a second or for
an hour.
--
jmmv:
Alright. While mocking up some code for this, I think that your two
requests are complementary.
On the one hand, when you are talking about a "race condition" test you
really mean an "expected race condition" test. Correct? If so, we need to
extend the xfail mechanism to add one more case, which is to report any
failures as a race condition error and, if there is no failure, report the
test as successful.
On the other hand, the atf-wide mechanism to support how long the test
should run for can be thought as a "stress test" mechanism. I.e. run this
test for X time / iterations and report its results regularly without
involving xfail at all.
So, with this in mind:
* For a test that triggers an unfixed race condition, you set xfail to
race mode and define the test as a stress test. Any failures are
reported as expected failures.
* For a test that verifies a supposedly-fixed race condition, you do *not*
set xfail to race mode, and only set the test to stress test. Any
failures are reported as real failures.
These stress test cases implement a single iteration of the test and
atf-run is in charge of running the test several times, stopping on the
first failure.
Does that make sense?
---------------------------------------------------------------------------
Implement ATF_REQUIRE_ERRNO
pooka:
Most of the lines in tests against system functionality are:
if (syscall(args) == -1)
atf_tc_fail_errno("flop")
Some shorthand would be helpful, like ATF_REQUIRE_ERRNO(syscall(args))
Also, a variant which allows arbitrary return value checks (e.g. "!= 0" or
"< 124" or "!= size") would be nice.
--
gcooper:
There's a problem with this request; not all functions fail in the same
way ... in particular compare the pthread family of functions (which
return errno) vs many native syscalls. Furthermore, compare some
fcntl-like syscalls vs other syscalls. One size fits all solutions may not
be a wise idea in this case, so I think that the problem statement needs
to be better defined, because the above request is too loose.
FWIW, there's also a TEST macro in LTP, which tests for non-zero status,
and sets an appropriate set of global variables for errnos and return
codes, respectively. It was a good idea, but has been mostly abandoned
because it's too difficult to define a success and failure in a universal
manner, so I think that we need to be careful with what's implemented in
ATF to not repeat the mistakes that others have made.
--
jmmv:
I think you've got a good point.
This was mostly intended to simplify the handling of the stupid errno
global variable. I think this is valuable to have, but maybe the
macro/function name should be different because _ERRNO can be confusing.
Probably something like an ATF_CHECK_LIBC / ATF_CHECK_PTHREAD approach
would be more flexible and simple.
===========================================================================
vim: filetype=text:textwidth=75:expandtab:shiftwidth=2:softtabstop=2

1021
aclocal.m4 vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,48 +0,0 @@
dnl
dnl Automated Testing Framework (atf)
dnl
dnl Copyright 2011 Google Inc.
dnl All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions are
dnl met:
dnl
dnl * Redistributions of source code must retain the above copyright
dnl notice, this list of conditions and the following disclaimer.
dnl * Redistributions in binary form must reproduce the above copyright
dnl notice, this list of conditions and the following disclaimer in the
dnl documentation and/or other materials provided with the distribution.
dnl * Neither the name of Google Inc. nor the names of its contributors
dnl may be used to endorse or promote products derived from this software
dnl without specific prior written permission.
dnl
dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
dnl "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
dnl LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
dnl A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
dnl OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
dnl SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
dnl LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
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
dnl Checks if atf-c++ is present. If version-spec is provided, ensures that
dnl the installed version of atf-sh matches the required version. This
dnl argument must be something like '>= 0.14' and accepts any version
dnl specification supported by pkg-config.
dnl
dnl Defines and substitutes ATF_CXX_CFLAGS and ATF_CXX_LIBS with the compiler
dnl and linker flags need to build against atf-c++.
AC_DEFUN([ATF_CHECK_CXX], [
spec="atf-c++[]m4_default_nblank([ $1], [])"
_ATF_CHECK_ARG_WITH(
[PKG_CHECK_MODULES([ATF_CXX], [${spec}],
[found=yes found_atf_cxx=yes], [found=no])],
[required ${spec} not found])
])

View File

@ -1,11 +0,0 @@
# ATF pkg-config file
cxx=__CXX__
includedir=__INCLUDEDIR__
libdir=__LIBDIR__
Name: atf-c++
Description: Automated Testing Framework (C++ binding)
Version: __ATF_VERSION__
Cflags: -I${includedir}
Libs: -L${libdir} -latf-c++ -latf-c

View File

@ -1,48 +0,0 @@
dnl
dnl Automated Testing Framework (atf)
dnl
dnl Copyright 2011 Google Inc.
dnl All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions are
dnl met:
dnl
dnl * Redistributions of source code must retain the above copyright
dnl notice, this list of conditions and the following disclaimer.
dnl * Redistributions in binary form must reproduce the above copyright
dnl notice, this list of conditions and the following disclaimer in the
dnl documentation and/or other materials provided with the distribution.
dnl * Neither the name of Google Inc. nor the names of its contributors
dnl may be used to endorse or promote products derived from this software
dnl without specific prior written permission.
dnl
dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
dnl "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
dnl LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
dnl A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
dnl OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
dnl SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
dnl LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
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
dnl Checks if atf-c is present. If version-spec is provided, ensures that
dnl the installed version of atf-sh matches the required version. This
dnl argument must be something like '>= 0.14' and accepts any version
dnl specification supported by pkg-config.
dnl
dnl Defines and substitutes ATF_C_CFLAGS and ATF_C_LIBS with the compiler
dnl and linker flags need to build against atf-c.
AC_DEFUN([ATF_CHECK_C], [
spec="atf-c[]m4_default_nblank([ $1], [])"
_ATF_CHECK_ARG_WITH(
[PKG_CHECK_MODULES([ATF_CXX], [${spec}],
[found=yes found_atf_c=yes], [found=no])],
[required ${spec} not found])
])

View File

@ -1,11 +0,0 @@
# ATF pkg-config file
cc=__CC__
includedir=__INCLUDEDIR__
libdir=__LIBDIR__
Name: atf-c
Description: Automated Testing Framework (C binding)
Version: __ATF_VERSION__
Cflags: -I${includedir}
Libs: -L${libdir} -latf-c

View File

@ -1,92 +0,0 @@
dnl
dnl Automated Testing Framework (atf)
dnl
dnl Copyright 2011 Google Inc.
dnl All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions are
dnl met:
dnl
dnl * Redistributions of source code must retain the above copyright
dnl notice, this list of conditions and the following disclaimer.
dnl * Redistributions in binary form must reproduce the above copyright
dnl notice, this list of conditions and the following disclaimer in the
dnl documentation and/or other materials provided with the distribution.
dnl * Neither the name of Google Inc. nor the names of its contributors
dnl may be used to endorse or promote products derived from this software
dnl without specific prior written permission.
dnl
dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
dnl "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
dnl LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
dnl A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
dnl OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
dnl SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
dnl LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
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
dnl Adds a --with-atf flag to the configure script that allows the user to
dnl enable or disable atf support.
dnl
dnl The ATF_CHECK_{C,CXX,SH} macros honor the flag defined herein if
dnl instantiated. If not instantiated, they will request the presence of
dnl the libraries unconditionally.
dnl
dnl Defines the WITH_ATF Automake conditional if ATF has been found by any
dnl of the ATF_CHECK_{C,CXX,SH} macros.
AC_DEFUN([ATF_ARG_WITH], [
m4_define([atf_arg_with_called], [yes])
m4_divert_text([DEFAULTS], [with_atf=auto])
AC_ARG_WITH([atf],
[AS_HELP_STRING([--with-atf=<yes|no|auto>],
[build atf-based test programs])],
[with_atf=${withval}], [with_atf=auto])
m4_divert_text([DEFAULTS], [
found_atf_c=no
found_atf_cxx=no
found_atf_sh=no
])
AM_CONDITIONAL([WITH_ATF], [test x"${found_atf_c}" = x"yes" -o \
x"${found_atf_cxx}" = x"yes" -o \
x"${found_atf_sh}" = x"yes"])
])
dnl _ATF_CHECK_ARG_WITH(check, error_message)
dnl
dnl Internal macro to execute a check conditional on the --with-atf flag
dnl and handle the result accordingly.
dnl
dnl 'check' specifies the piece of code to be run to detect the feature.
dnl This code must set the 'found' shell variable to yes or no depending
dnl on the raw result of the check.
AC_DEFUN([_ATF_CHECK_ARG_WITH], [
m4_ifdef([atf_arg_with_called], [
m4_fatal([ATF_ARG_WITH must be called after the ATF_CHECK_* checks])
])
m4_divert_text([DEFAULTS], [with_atf=yes])
if test x"${with_atf}" = x"no"; then
_found=no
else
$1
if test x"${with_atf}" = x"auto"; then
_found="${found}"
else
if test x"${found}" = x"yes"; then
_found=yes
else
AC_MSG_ERROR([$2])
fi
fi
fi
])

View File

@ -1,53 +0,0 @@
dnl
dnl Automated Testing Framework (atf)
dnl
dnl Copyright 2011 Google Inc.
dnl All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions are
dnl met:
dnl
dnl * Redistributions of source code must retain the above copyright
dnl notice, this list of conditions and the following disclaimer.
dnl * Redistributions in binary form must reproduce the above copyright
dnl notice, this list of conditions and the following disclaimer in the
dnl documentation and/or other materials provided with the distribution.
dnl * Neither the name of Google Inc. nor the names of its contributors
dnl may be used to endorse or promote products derived from this software
dnl without specific prior written permission.
dnl
dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
dnl "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
dnl LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
dnl A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
dnl OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
dnl SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
dnl LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
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_SH([version-spec])
dnl
dnl Checks if atf-sh is present. If version-spec is provided, ensures that
dnl the installed version of atf-sh matches the required version. This
dnl argument must be something like '>= 0.14' and accepts any version
dnl specification supported by pkg-config.
dnl
dnl Defines and substitutes ATF_SH with the full path to the atf-sh interpreter.
AC_DEFUN([ATF_CHECK_SH], [
spec="atf-sh[]m4_default_nblank([ $1], [])"
_ATF_CHECK_ARG_WITH(
[AC_MSG_CHECKING([for ${spec}])
PKG_CHECK_EXISTS([${spec}], [found=yes], [found=no])
if test "${found}" = yes; then
ATF_SH="$(${PKG_CONFIG} --variable=interpreter atf-sh)"
AC_SUBST([ATF_SH], [${ATF_SH}])
found_atf_sh=yes
fi
AC_MSG_RESULT([${ATF_SH}])],
[required ${spec} not found])
])

View File

@ -1,8 +0,0 @@
# ATF pkg-config file
exec_prefix=__EXEC_PREFIX__
interpreter=${exec_prefix}/bin/atf-sh
Name: atf-sh
Description: Automated Testing Framework (POSIX shell binding)
Version: __ATF_VERSION__

View File

@ -1,122 +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.
#
check_PROGRAMS = bootstrap/h_app_empty
bootstrap_h_app_empty_SOURCES = bootstrap/h_app_empty.cpp
bootstrap_h_app_empty_LDADD = $(ATF_CXX_LIBS)
check_PROGRAMS += bootstrap/h_app_opts_args
bootstrap_h_app_opts_args_SOURCES = bootstrap/h_app_opts_args.cpp
bootstrap_h_app_opts_args_LDADD = $(ATF_CXX_LIBS)
check_PROGRAMS += bootstrap/h_tp_basic_c
bootstrap_h_tp_basic_c_SOURCES = bootstrap/h_tp_basic_c.c
bootstrap_h_tp_basic_c_LDADD = libatf-c.la
check_PROGRAMS += bootstrap/h_tp_basic_cpp
bootstrap_h_tp_basic_cpp_SOURCES = bootstrap/h_tp_basic_cpp.cpp
bootstrap_h_tp_basic_cpp_LDADD = $(ATF_CXX_LIBS)
check_SCRIPTS = bootstrap/h_tp_basic_sh
CLEANFILES += bootstrap/h_tp_basic_sh
EXTRA_DIST += bootstrap/h_tp_basic_sh.sh
bootstrap/h_tp_basic_sh: $(srcdir)/bootstrap/h_tp_basic_sh.sh
test -d bootstrap || mkdir -p bootstrap
@src=$(srcdir)/bootstrap/h_tp_basic_sh.sh; dst=$@; $(BUILD_SH_TP)
check_SCRIPTS += bootstrap/h_tp_atf_check_sh
CLEANFILES += bootstrap/h_tp_atf_check_sh
EXTRA_DIST += bootstrap/h_tp_atf_check_sh.sh
bootstrap/h_tp_atf_check_sh: \
$(srcdir)/bootstrap/h_tp_atf_check_sh.sh
test -d bootstrap || mkdir -p bootstrap
@src=$(srcdir)/bootstrap/h_tp_atf_check_sh.sh; dst=$@; $(BUILD_SH_TP)
check_SCRIPTS += bootstrap/h_tp_fail
CLEANFILES += bootstrap/h_tp_fail
EXTRA_DIST += bootstrap/h_tp_fail.sh
bootstrap/h_tp_fail: $(srcdir)/bootstrap/h_tp_fail.sh
test -d bootstrap || mkdir -p bootstrap
@src=$(srcdir)/bootstrap/h_tp_fail.sh; dst=$@; $(BUILD_SH_TP)
check_SCRIPTS += bootstrap/h_tp_pass
CLEANFILES += bootstrap/h_tp_pass
EXTRA_DIST += bootstrap/h_tp_pass.sh
bootstrap/h_tp_pass: $(srcdir)/bootstrap/h_tp_pass.sh
test -d bootstrap || mkdir -p bootstrap
@src=$(srcdir)/bootstrap/h_tp_pass.sh; dst=$@; $(BUILD_SH_TP)
DISTCLEANFILES = \
bootstrap/atconfig \
testsuite.lineno \
testsuite.log
distclean-local:
-rm -rf testsuite.dir
EXTRA_DIST += bootstrap/testsuite \
bootstrap/package.m4 \
bootstrap/testsuite.at \
$(testsuite_incs)
testsuite_incs= $(srcdir)/bootstrap/t_application_help.at \
$(srcdir)/bootstrap/t_application_opts_args.at \
$(srcdir)/bootstrap/t_atf_config.at \
$(srcdir)/bootstrap/t_atf_run.at \
$(srcdir)/bootstrap/t_subr_atf_check.at \
$(srcdir)/bootstrap/t_test_program_compare.at \
$(srcdir)/bootstrap/t_test_program_filter.at \
$(srcdir)/bootstrap/t_test_program_list.at \
$(srcdir)/bootstrap/t_test_program_run.at
@target_srcdir@bootstrap/package.m4: $(top_srcdir)/configure.ac
{ \
echo '# Signature of the current package.'; \
echo 'm4_define(AT_PACKAGE_NAME, @PACKAGE_NAME@)'; \
echo 'm4_define(AT_PACKAGE_TARNAME, @PACKAGE_TARNAME@)'; \
echo 'm4_define(AT_PACKAGE_VERSION, @PACKAGE_VERSION@)'; \
echo 'm4_define(AT_PACKAGE_STRING, @PACKAGE_STRING@)'; \
echo 'm4_define(AT_PACKAGE_BUGREPORT, @PACKAGE_BUGREPORT@)'; \
echo 'm4_define(ENABLE_TOOLS, @ENABLE_TOOLS@)'; \
} >$(srcdir)/bootstrap/package.m4
@target_srcdir@bootstrap/testsuite: $(srcdir)/bootstrap/testsuite.at \
$(testsuite_incs) \
@target_srcdir@bootstrap/package.m4
autom4te --language=Autotest -I $(srcdir) \
-I $(srcdir)/bootstrap \
$(srcdir)/bootstrap/testsuite.at -o $@.tmp
mv $@.tmp $@
INSTALLCHECK_TARGETS += installcheck-bootstrap
PHONY_TARGETS += installcheck-bootstrap
installcheck-bootstrap: @target_srcdir@bootstrap/testsuite check
$(TESTS_ENVIRONMENT) $(srcdir)/bootstrap/testsuite
# vim: syntax=make:noexpandtab:shiftwidth=8:softtabstop=8

View File

@ -1,62 +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 <cstdlib>
#include "atf-c++/detail/application.hpp"
class h_app_empty : public atf::application::app {
static const char* m_description;
public:
h_app_empty(void);
int main(void);
};
const char* h_app_empty::m_description =
"A helper application for the bootstrap test suite that does nothing "
"on its own and redefines no methods.";
h_app_empty::h_app_empty(void) :
app(m_description, "h_app_empty(1)", "atf(7)")
{
}
int
h_app_empty::main(void)
{
return EXIT_SUCCESS;
}
int
main(int argc, char* const* argv)
{
return h_app_empty().run(argc, argv);
}

View File

@ -1,103 +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 <cstdlib>
#include <iostream>
#include "atf-c++/detail/application.hpp"
#include "atf-c++/detail/sanity.hpp"
class h_app_opts_args : public atf::application::app {
static const char* m_description;
std::string specific_args(void) const;
options_set specific_options(void) const;
void process_option(int, const char*);
public:
h_app_opts_args(void);
int main(void);
};
const char* h_app_opts_args::m_description =
"A helper application for the bootstrap test suite that redefines the "
"methods to specify custom options and arguments.";
h_app_opts_args::h_app_opts_args(void) :
app(m_description, "h_app_opts_args(1)", "atf(7)")
{
}
std::string
h_app_opts_args::specific_args(void)
const
{
return "<arg1> <arg2>";
}
h_app_opts_args::options_set
h_app_opts_args::specific_options(void)
const
{
using atf::application::option;
options_set opts;
opts.insert(option('d', "", "Debug mode"));
opts.insert(option('v', "level", "Verbosity level"));
return opts;
}
void
h_app_opts_args::process_option(int ch, const char* arg)
{
switch (ch) {
case 'd':
std::cout << "-d given\n";
break;
case 'v':
std::cout << "-v given with argument " << arg << "\n";
break;
default:
UNREACHABLE;
}
}
int
h_app_opts_args::main(void)
{
return EXIT_SUCCESS;
}
int
main(int argc, char* const* argv)
{
return h_app_opts_args().run(argc, argv);
}

View File

@ -1,304 +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.
#
atf_test_case exitcode_0_0
exitcode_0_0_head()
{
atf_set "descr" "Runs a program that returns true and expects true"
}
exitcode_0_0_body()
{
atf_check -s eq:0 -o empty -e empty true
}
atf_test_case exitcode_0_1
exitcode_0_1_head()
{
atf_set "descr" "Runs a program that returns true and expects false"
}
exitcode_0_1_body()
{
atf_check -s eq:1 -o empty -e empty true
}
atf_test_case exitcode_1_0
exitcode_1_0_head()
{
atf_set "descr" "Runs a program that returns false and expects true"
}
exitcode_1_0_body()
{
atf_check -s eq:0 -o empty -e empty false
}
atf_test_case exitcode_1_1
exitcode_1_1_head()
{
atf_set "descr" "Runs a program that returns false and expects false"
}
exitcode_1_1_body()
{
# In Solaris, /usr/bin/false returns 255 rather than 1. Use the
# built-in version for the check.
atf_check -s eq:1 -o empty -e empty sh -c "false"
}
atf_test_case stdout_expout_pass
stdout_expout_pass_head()
{
atf_set "descr" "Runs a program with stdout set to expout and passes"
}
stdout_expout_pass_body()
{
echo foo >expout
atf_check -s eq:0 -o file:expout -e empty echo foo
}
atf_test_case stdout_expout_fail
stdout_expout_fail_head()
{
atf_set "descr" "Runs a program with stdout set to expout and fails"
}
stdout_expout_fail_body()
{
echo foo >expout
atf_check -s eq:0 -o file:expout -e empty echo bar
}
atf_test_case stdout_ignore_empty
stdout_ignore_empty_head()
{
atf_set "descr" "Runs a program with stdout set to ignore and" \
"writes nothing"
}
stdout_ignore_empty_body()
{
atf_check -s eq:0 -o ignore -e empty true
}
atf_test_case stdout_ignore_sth
stdout_ignore_sth_head()
{
atf_set "descr" "Runs a program with stdout set to ignore and" \
"writes something"
}
stdout_ignore_sth_body()
{
atf_check -s eq:0 -o ignore -e empty echo foo
}
atf_test_case stdout_null_empty
stdout_null_empty_head()
{
atf_set "descr" "Runs a program with stdout set to null and" \
"writes nothing"
}
stdout_null_empty_body()
{
atf_check -s eq:0 -o empty -e empty true
}
atf_test_case stdout_null_sth
stdout_null_sth_head()
{
atf_set "descr" "Runs a program with stdout set to null and" \
"writes something"
}
stdout_null_sth_body()
{
atf_check -s eq:0 -o empty -e empty echo foo
}
atf_test_case stdout_stdout_written
stdout_stdout_written_head()
{
atf_set "descr" "Runs a program with stdout set to stdout and" \
"writes something"
}
stdout_stdout_written_body()
{
atf_check -s eq:0 -o save:stdout -e empty echo foo
echo foo >aux
cmp -s stdout aux || atf_fail "Test failed"
}
atf_test_case stdout_match_ok
stdout_match_ok_head()
{
atf_set "descr" "Runs a program with stdout set to match and" \
"matches the regular expression"
}
stdout_match_ok_body()
{
atf_check -s eq:0 -o 'match:bar$' -e empty -x "echo line; echo foo bar"
}
atf_test_case stdout_match_fail
stdout_match_fail_head()
{
atf_set "descr" "Runs a program with stdout set to match and" \
"does not match the regular expression"
}
stdout_match_fail_body()
{
atf_check -s eq:0 -o 'match:bar$' -e empty -x "echo line; echo foo bar baz"
}
atf_test_case stderr_experr_pass
stderr_experr_pass_head()
{
atf_set "descr" "Runs a program with stderr set to experr and passes"
}
stderr_experr_pass_body()
{
echo foo >experr
atf_check -s eq:0 -o empty -e file:experr -x 'echo foo 1>&2'
}
atf_test_case stderr_experr_fail
stderr_experr_fail_head()
{
atf_set "descr" "Runs a program with stderr set to experr and fails"
}
stderr_experr_fail_body()
{
echo foo >experr
atf_check -s eq:0 -o empty -e file:stderr -x 'echo bar 1>&2'
}
atf_test_case stderr_ignore_empty
stderr_ignore_empty_head()
{
atf_set "descr" "Runs a program with stderr set to ignore and" \
"writes nothing"
}
stderr_ignore_empty_body()
{
atf_check -s eq:0 -o empty -e ignore -x 'true 1>&2'
}
atf_test_case stderr_ignore_sth
stderr_ignore_sth_head()
{
atf_set "descr" "Runs a program with stderr set to ignore and" \
"writes something"
}
stderr_ignore_sth_body()
{
atf_check -s eq:0 -o empty -e ignore -x 'echo foo 1>&2'
}
atf_test_case stderr_null_empty
stderr_null_empty_head()
{
atf_set "descr" "Runs a program with stderr set to null and" \
"writes nothing"
}
stderr_null_empty_body()
{
atf_check -s eq:0 -o empty -e empty -x 'true 1>&2'
}
atf_test_case stderr_null_sth
stderr_null_sth_head()
{
atf_set "descr" "Runs a program with stderr set to null and" \
"writes something"
}
stderr_null_sth_body()
{
atf_check -s eq:0 -o empty -e empty -x 'echo foo 1>&2'
}
atf_test_case stderr_stderr_written
stderr_stderr_written_head()
{
atf_set "descr" "Runs a program with stderr set to stderr and" \
"writes something"
}
stderr_stderr_written_body()
{
atf_check -s eq:0 -o empty -e save:stderr -x 'echo foo 1>&2'
echo foo >aux
cmp -s stderr aux || atf_fail "Test failed"
}
atf_test_case stderr_match_ok
stderr_match_ok_head()
{
atf_set "descr" "Runs a program with stderr set to match and" \
"matches the regular expression"
}
stderr_match_ok_body()
{
atf_check -s eq:0 -o empty -e 'match:bar$' -x \
"echo line 1>&2; echo foo bar 1>&2"
}
atf_test_case stderr_match_fail
stderr_match_fail_head()
{
atf_set "descr" "Runs a program with stderr set to match and" \
"does not match the regular expression"
}
stderr_match_fail_body()
{
atf_check -s eq:0 -o empty -e 'match:bar$' -x \
"echo line 1>&2; echo foo bar baz 1>&2"
}
atf_init_test_cases()
{
atf_add_test_case exitcode_0_0
atf_add_test_case exitcode_0_1
atf_add_test_case exitcode_1_0
atf_add_test_case exitcode_1_1
atf_add_test_case stdout_expout_pass
atf_add_test_case stdout_expout_fail
atf_add_test_case stdout_ignore_empty
atf_add_test_case stdout_ignore_sth
atf_add_test_case stdout_null_empty
atf_add_test_case stdout_null_sth
atf_add_test_case stdout_stdout_written
atf_add_test_case stdout_match_ok
atf_add_test_case stdout_match_fail
atf_add_test_case stderr_experr_pass
atf_add_test_case stderr_experr_fail
atf_add_test_case stderr_ignore_empty
atf_add_test_case stderr_ignore_sth
atf_add_test_case stderr_null_empty
atf_add_test_case stderr_null_sth
atf_add_test_case stderr_stderr_written
atf_add_test_case stderr_match_ok
atf_add_test_case stderr_match_fail
}
# vim: syntax=sh:expandtab:shiftwidth=4:softtabstop=4

View File

@ -1,83 +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 <atf-c.h>
#include "atf-c/error.h"
ATF_TC(pass);
ATF_TC_HEAD(pass, tc)
{
atf_tc_set_md_var(tc, "descr", "An empty test case that always passes");
}
ATF_TC_BODY(pass, tc)
{
atf_tc_pass();
}
ATF_TC(fail);
ATF_TC_HEAD(fail, tc)
{
atf_tc_set_md_var(tc, "descr", "An empty test case that always fails");
}
ATF_TC_BODY(fail, tc)
{
atf_tc_fail("On purpose");
}
ATF_TC(skip);
ATF_TC_HEAD(skip, tc)
{
atf_tc_set_md_var(tc, "descr", "An empty test case that is always "
"skipped");
}
ATF_TC_BODY(skip, tc)
{
atf_tc_skip("By design");
}
ATF_TC(default);
ATF_TC_HEAD(default, tc)
{
atf_tc_set_md_var(tc, "descr", "A test case that passes without "
"explicitly stating it");
}
ATF_TC_BODY(default, tc)
{
}
ATF_TP_ADD_TCS(tp)
{
ATF_TP_ADD_TC(tp, pass);
ATF_TP_ADD_TC(tp, fail);
ATF_TP_ADD_TC(tp, skip);
ATF_TP_ADD_TC(tp, default);
return atf_no_error();
}

View File

@ -1,86 +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 <atf-c++.hpp>
ATF_TEST_CASE(pass);
ATF_TEST_CASE_HEAD(pass)
{
set_md_var("descr", "An empty test case that always passes");
}
ATF_TEST_CASE_BODY(pass)
{
ATF_PASS();
}
ATF_TEST_CASE(fail);
ATF_TEST_CASE_HEAD(fail)
{
set_md_var("descr", "An empty test case that always fails");
}
ATF_TEST_CASE_BODY(fail)
{
ATF_FAIL("On purpose");
}
ATF_TEST_CASE(skip);
ATF_TEST_CASE_HEAD(skip)
{
set_md_var("descr", "An empty test case that is always skipped");
}
ATF_TEST_CASE_BODY(skip)
{
ATF_SKIP("By design");
}
ATF_TEST_CASE(default);
ATF_TEST_CASE_HEAD(default)
{
set_md_var("descr", "A test case that passes without explicitly "
"stating it");
}
ATF_TEST_CASE_BODY(default)
{
}
ATF_INIT_TEST_CASES(tcs)
{
ATF_ADD_TEST_CASE(tcs, pass);
ATF_ADD_TEST_CASE(tcs, fail);
ATF_ADD_TEST_CASE(tcs, skip);
ATF_ADD_TEST_CASE(tcs, default);
}

View File

@ -1,79 +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.
#
atf_test_case pass
pass_head()
{
atf_set "descr" "An empty test case that always passes"
}
pass_body()
{
atf_pass
}
atf_test_case fail
fail_head()
{
atf_set "descr" "An empty test case that always fails"
}
fail_body()
{
atf_fail "On purpose"
}
atf_test_case skip
skip_head()
{
atf_set "descr" "An empty test case that is always skipped"
}
skip_body()
{
atf_skip "By design"
}
atf_test_case default
default_head()
{
atf_set "descr" "A test case that passes without explicitly" \
"stating it"
}
default_body()
{
:
}
atf_init_test_cases()
{
atf_add_test_case pass
atf_add_test_case fail
atf_add_test_case skip
atf_add_test_case default
}
# vim: syntax=sh:expandtab:shiftwidth=4:softtabstop=4

View File

@ -1,47 +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.
#
atf_test_case @TC_NAME@
@TC_NAME@_head()
{
atf_set "descr" "An empty test case that always fails"
}
@TC_NAME@_body()
{
echo "ignore-me"
echo "ignore-me" 1>&2
atf_fail "No reason"
}
atf_init_test_cases()
{
atf_add_test_case @TC_NAME@
}
# vim: syntax=sh:expandtab:shiftwidth=4:softtabstop=4

View File

@ -1,47 +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.
#
atf_test_case @TC_NAME@
@TC_NAME@_head()
{
atf_set "descr" "An empty test case that always passes"
}
@TC_NAME@_body()
{
echo "ignore-me"
echo "ignore-me" 1>&2
atf_pass
}
atf_init_test_cases()
{
atf_add_test_case @TC_NAME@
}
# vim: syntax=sh:expandtab:shiftwidth=4:softtabstop=4

View File

@ -1,7 +0,0 @@
# Signature of the current package.
m4_define(AT_PACKAGE_NAME, Automated Testing Framework)
m4_define(AT_PACKAGE_TARNAME, atf)
m4_define(AT_PACKAGE_VERSION, 0.16)
m4_define(AT_PACKAGE_STRING, Automated Testing Framework 0.16)
m4_define(AT_PACKAGE_BUGREPORT, atf-devel@NetBSD.org)
m4_define(ENABLE_TOOLS, no)

View File

@ -1,40 +0,0 @@
dnl
dnl Automated Testing Framework (atf)
dnl
dnl Copyright (c) 2007 The NetBSD Foundation, Inc.
dnl All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions
dnl are met:
dnl 1. Redistributions of source code must retain the above copyright
dnl notice, this list of conditions and the following disclaimer.
dnl 2. Redistributions in binary form must reproduce the above copyright
dnl notice, this list of conditions and the following disclaimer in the
dnl documentation and/or other materials provided with the distribution.
dnl
dnl THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
dnl CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
dnl INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
dnl MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
dnl IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
dnl DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
dnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
dnl GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
dnl IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
dnl OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
dnl IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dnl
AT_SETUP([application: online help option])
AT_CHECK([APP_HELPER(app_empty)], 0, [stdout], [])
AT_CHECK([grep 'Available options' stdout], 1, [ignore], [])
AT_CHECK([APP_HELPER(app_empty) -h], 0, [stdout], [])
AT_CHECK([grep 'Available options' stdout], 0, [ignore], [])
AT_CLEANUP()
dnl vim: syntax=m4:expandtab:shiftwidth=4:softtabstop=4

View File

@ -1,86 +0,0 @@
dnl
dnl Automated Testing Framework (atf)
dnl
dnl Copyright (c) 2007 The NetBSD Foundation, Inc.
dnl All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions
dnl are met:
dnl 1. Redistributions of source code must retain the above copyright
dnl notice, this list of conditions and the following disclaimer.
dnl 2. Redistributions in binary form must reproduce the above copyright
dnl notice, this list of conditions and the following disclaimer in the
dnl documentation and/or other materials provided with the distribution.
dnl
dnl THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
dnl CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
dnl INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
dnl MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
dnl IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
dnl DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
dnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
dnl GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
dnl IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
dnl OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
dnl IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dnl
AT_SETUP([application: arguments and options handling])
dnl Check that an application that does not redefine any method does
dnl not show strange flags in the usage message.
AT_CHECK([APP_HELPER(app_empty) -h], 0, [stdout], [])
AT_CHECK([grep ' -d ' stdout], 1, [ignore], [])
AT_CHECK([grep ' -h ' stdout], 0, [ignore], [])
AT_CHECK([grep ' -v ' stdout], 1, [ignore], [])
AT_CHECK([grep ' -z ' stdout], 1, [ignore], [])
dnl Check that an application that adds its own options shows them in
dnl the usage message.
AT_CHECK([APP_HELPER(app_opts_args) -h], 0, [stdout], [])
AT_CHECK([grep ' -d ' stdout], 0, [ignore], [])
AT_CHECK([grep ' -h ' stdout], 0, [ignore], [])
AT_CHECK([grep ' -v ' stdout], 0, [ignore], [])
AT_CHECK([grep ' -z ' stdout], 1, [ignore], [])
dnl Check that an application that does not redefine any method does
dnl not recognize strange flags.
AT_CHECK([APP_HELPER(app_empty) -d], 1, [], [stderr])
AT_CHECK([grep 'Unknown option.*-d' stderr], 0, [ignore], [])
AT_CHECK([APP_HELPER(app_empty) -v], 1, [], [stderr])
AT_CHECK([grep 'Unknown option.*-v' stderr], 0, [ignore], [])
AT_CHECK([APP_HELPER(app_empty) -z], 1, [], [stderr])
AT_CHECK([grep 'Unknown option.*-z' stderr], 0, [ignore], [])
dnl Check that an application that adds its own options is able to
dnl properly handle them.
AT_CHECK([APP_HELPER(app_opts_args) -d], 0, [stdout], [])
AT_CHECK([grep -- '-d given' stdout], 0, [ignore], [])
AT_CHECK([APP_HELPER(app_opts_args) -v], 1, [], [stderr])
AT_CHECK([grep 'Option.*-v.*requires an argument' stderr], 0, [ignore], [])
AT_CHECK([APP_HELPER(app_opts_args) -v foo], 0, [stdout], [])
AT_CHECK([grep -- '-v given with argument foo' stdout], 0, [ignore], [])
AT_CHECK([APP_HELPER(app_opts_args) -z], 1, [], [stderr])
AT_CHECK([grep 'Unknown option.*-z' stderr], 0, [ignore], [])
dnl Check that option processing stops after an argument.
AT_CHECK([APP_HELPER(app_opts_args) -- -d], 0, [stdout], [])
AT_CHECK([grep -- '-d given' stdout], 1, [], [])
AT_CHECK([APP_HELPER(app_opts_args) arg -d], 0, [stdout], [])
AT_CHECK([grep -- '-d given' stdout], 1, [], [])
dnl Check that an application that does not redefine any method does
dnl not show unexpected arguments in the usage message.
AT_CHECK([APP_HELPER(app_empty) -h], 0, [stdout], [])
AT_CHECK([grep '\@<:@options\@:>@$' stdout], 0, [ignore], [])
dnl Check that an application that defines the arguments it takes
dnl shows them in the usage message.
AT_CHECK([APP_HELPER(app_opts_args) -h], 0, [stdout], [])
AT_CHECK([grep '\@<:@options\@:>@ <arg1> <arg2>' stdout], 0, [ignore], [])
AT_CLEANUP()
dnl vim: syntax=m4:expandtab:shiftwidth=4:softtabstop=4

View File

@ -1,108 +0,0 @@
dnl
dnl Automated Testing Framework (atf)
dnl
dnl Copyright (c) 2007 The NetBSD Foundation, Inc.
dnl All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions
dnl are met:
dnl 1. Redistributions of source code must retain the above copyright
dnl notice, this list of conditions and the following disclaimer.
dnl 2. Redistributions in binary form must reproduce the above copyright
dnl notice, this list of conditions and the following disclaimer in the
dnl documentation and/or other materials provided with the distribution.
dnl
dnl THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
dnl CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
dnl INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
dnl MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
dnl IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
dnl DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
dnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
dnl GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
dnl IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
dnl OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
dnl IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dnl
AT_SETUP([atf-config: querying of build-time variables])
AT_TESTED(atf-config)
all_vars="atf_arch \
atf_build_cc \
atf_build_cflags \
atf_build_cpp \
atf_build_cppflags \
atf_build_cxx \
atf_build_cxxflags \
atf_confdir \
atf_includedir \
atf_libdir \
atf_libexecdir \
atf_machine \
atf_pkgdatadir \
atf_shell \
atf_workdir"
all_vars_no=15
dnl List all variables.
AT_CHECK([atf-config], [0], [stdout], [])
AT_CHECK([COUNT_LINES(stdout, ${all_vars_no})], [0], [], [])
for v in ${all_vars}; do
AT_CHECK([grep "${v}" stdout], [0], [ignore], [])
done
dnl Query a single variable and test terse mode.
for v in ${all_vars}; do
AT_CHECK([atf-config ${v}], [0], [stdout], [])
AT_CHECK([COUNT_LINES(stdout, 1)], [0], [], [])
AT_CHECK([grep "${v}" stdout], [0], [ignore], [])
AT_CHECK([cut -d ' ' -f 3- stdout], [0], [stdout], [])
AT_CHECK([mv stdout expout], [0], [], [])
AT_CHECK([atf-config -t ${v}], [0], [expout], [])
done
dnl Query several variables.
AT_CHECK([atf-config atf_libexecdir atf_pkgdatadir], [0], [stdout], [])
AT_CHECK([grep 'atf_libexecdir' stdout], [0], [ignore], [])
AT_CHECK([grep 'atf_pkgdatadir' stdout], [0], [ignore], [])
AT_CHECK([COUNT_LINES(stdout, 2)], [0], [ignore], [])
dnl Query a non-existent variable.
AT_CHECK([atf-config non_existent], [1], [], [stderr])
AT_CHECK([grep 'Unknown variable.*non_existent' stderr], [0], [ignore], [])
dnl Query an existent and non-existent variable.
for v in ${all_vars}; do
AT_CHECK([atf-config ${v} non_existent], [1], [], [stderr])
AT_CHECK([grep 'Unknown variable.*non_existent' stderr],
[0], [ignore], [])
AT_CHECK([atf-config non_existent ${v}], [1], [], [stderr])
AT_CHECK([grep 'Unknown variable.*non_existent' stderr],
[0], [ignore], [])
done
dnl Override every variable through the environment.
for v in ${all_vars}; do
V=$(echo ${v} | tr '@<:@a-z@:>@' '@<:@A-Z@:>@')
AT_CHECK([env ${V}=testval atf-config], [0], [stdout], [])
AT_CHECK([mv stdout all], [0], [], [])
AT_CHECK([grep "^${v} : " all], [0], [stdout], [])
AT_CHECK([mv stdout affected], [0], [], [])
AT_CHECK([grep -v "^${v} : " all], [0], [stdout], [])
AT_CHECK([mv stdout unaffected], [0], [], [])
AT_CHECK([COUNT_LINES(affected, 1)], [0], [ignore], [])
AT_CHECK([COUNT_LINES(unaffected, $((${all_vars_no} - 1)))],
[0], [ignore], [])
AT_CHECK([grep "^${v} : testval$" affected], [0], [ignore], [])
AT_CHECK([grep ' : testval$' unaffected], [1], [], [])
done
AT_CLEANUP()
dnl vim: syntax=m4:expandtab:shiftwidth=4:softtabstop=4

View File

@ -1,178 +0,0 @@
dnl
dnl Automated Testing Framework (atf)
dnl
dnl Copyright (c) 2007 The NetBSD Foundation, Inc.
dnl All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions
dnl are met:
dnl 1. Redistributions of source code must retain the above copyright
dnl notice, this list of conditions and the following disclaimer.
dnl 2. Redistributions in binary form must reproduce the above copyright
dnl notice, this list of conditions and the following disclaimer in the
dnl documentation and/or other materials provided with the distribution.
dnl
dnl THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
dnl CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
dnl INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
dnl MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
dnl IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
dnl DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
dnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
dnl GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
dnl IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
dnl OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
dnl IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dnl
AT_SETUP([atf-run: execution of tests])
AT_TESTED(atf-run)
m4_define([CREATE_PASS_TEST],
[AT_CHECK([sed -e 's,@TC_NAME@,$2,g' <TEST_HELPER_NO_S(tp_pass)],
[0], [stdout], [])
AT_CHECK([mv stdout $1], [0], [], [])
AT_CHECK([chmod +x $1], [0], [], [])
])
m4_define([CREATE_FAIL_TEST],
[AT_CHECK([sed -e 's,@TC_NAME@,$2,g' <TEST_HELPER_NO_S(tp_fail)],
[0], [stdout], [])
AT_CHECK([mv stdout $1], [0], [], [])
AT_CHECK([chmod +x $1], [0], [], [])
])
AT_CHECK([mkdir top], [0], [], [])
AT_CHECK([mkdir top/dir1], [0], [], [])
AT_CHECK([mkdir top/dir2], [0], [], [])
AT_DATA([top/Atffile],
[Content-Type: application/X-atf-atffile; version="1"
prop: test-suite = atf
tp: dir1
tp: dir2
tp: test1
tp: test2
])
AT_DATA([top/dir1/Atffile],
[Content-Type: application/X-atf-atffile; version="1"
prop: test-suite = atf
tp: test3
])
AT_DATA([top/dir2/Atffile],
[Content-Type: application/X-atf-atffile; version="1"
prop: test-suite = atf
tp: test4
tp: test5
])
CREATE_PASS_TEST([top/test1], [tc_1])
CREATE_FAIL_TEST([top/test2], [tc_2])
CREATE_PASS_TEST([top/dir1/test3], [tc_3])
CREATE_FAIL_TEST([top/dir2/test4], [tc_4])
CREATE_PASS_TEST([top/dir2/test5], [tc_5])
AT_CHECK([cd top/dir1 && atf-run], [0], [stdout], [])
CHECK_TPS_TCR(tc_3, passed, stdout)
AT_CHECK([grep -i 'tc_@<:@1245@:>@' stdout], [1], [], [])
AT_CHECK([grep 'tc-so:ignore-me' stdout], [0], [ignore], [])
AT_CHECK([grep 'tc-se:ignore-me' stdout], [0], [ignore], [])
AT_CHECK([cd top/dir2 && atf-run], [1], [stdout], [stderr])
CHECK_TPS_TCR(tc_4, failed, stdout)
CHECK_TPS_TCR(tc_5, passed, stdout)
AT_CHECK([grep -i 'tc_@<:@123@:>@' stdout], [1], [], [])
AT_CHECK([grep 'tc-so:ignore-me' stdout], [0], [ignore], [])
AT_CHECK([grep 'tc-se:ignore-me' stdout], [0], [ignore], [])
AT_CHECK([cd top && atf-run], [1], [stdout], [stderr])
CHECK_TPS_TCR(tc_1, passed, stdout)
CHECK_TPS_TCR(tc_2, failed, stdout)
CHECK_TPS_TCR(tc_3, passed, stdout)
CHECK_TPS_TCR(tc_4, failed, stdout)
CHECK_TPS_TCR(tc_5, passed, stdout)
AT_CHECK([grep 'tc-so:ignore-me' stdout], [0], [ignore], [])
AT_CHECK([grep 'tc-se:ignore-me' stdout], [0], [ignore], [])
dnl Repeat previous but using a glob that matches everything.
AT_DATA([top/Atffile],
[Content-Type: application/X-atf-atffile; version="1"
prop: test-suite = atf
tp-glob: *
])
AT_CHECK([cd top && atf-run], [1], [stdout], [stderr])
CHECK_TPS_TCR(tc_1, passed, stdout)
CHECK_TPS_TCR(tc_2, failed, stdout)
CHECK_TPS_TCR(tc_3, passed, stdout)
CHECK_TPS_TCR(tc_4, failed, stdout)
CHECK_TPS_TCR(tc_5, passed, stdout)
AT_CHECK([grep 'tc-so:ignore-me' stdout], [0], [ignore], [])
AT_CHECK([grep 'tc-se:ignore-me' stdout], [0], [ignore], [])
dnl Repeat previous but using a glob that matches directories only.
AT_DATA([top/Atffile],
[Content-Type: application/X-atf-atffile; version="1"
prop: test-suite = atf
tp-glob: d*
])
AT_CHECK([cd top && atf-run], [1], [stdout], [stderr])
CHECK_TPS_TCR(tc_3, passed, stdout)
CHECK_TPS_TCR(tc_4, failed, stdout)
CHECK_TPS_TCR(tc_5, passed, stdout)
AT_CHECK([grep 'tc-so:ignore-me' stdout], [0], [ignore], [])
AT_CHECK([grep 'tc-se:ignore-me' stdout], [0], [ignore], [])
dnl Make sure globs do not match non-executable nor hidden files.
dnl XXX This is not really part of the bootstrap test suite. Move to
dnl tests/atf/tools/t_atf_run.sh when it exists.
AT_CHECK([rm -rf top], [0], [], [])
AT_CHECK([mkdir top], [0], [], [])
CREATE_PASS_TEST([top/test1], [tc_1])
CREATE_PASS_TEST([top/test2], [tc_2])
CREATE_PASS_TEST([top/test3], [tc_3])
AT_CHECK([chmod -x top/test3], [0], [], [])
CREATE_PASS_TEST([top/.test4], [tc_4])
AT_CHECK([chmod -x top/.test4], [0], [], [])
AT_DATA([top/Atffile],
[Content-Type: application/X-atf-atffile; version="1"
prop: test-suite = atf
tp-glob: *
])
AT_CHECK([cd top && atf-run], [0], [stdout], [stderr])
CHECK_TPS_TCR(tc_1, passed, stdout)
CHECK_TPS_TCR(tc_2, passed, stdout)
AT_CHECK([grep -i 'tc_3' stdout], [1], [ignore], [])
AT_CHECK([grep -i 'tc_4' stdout], [1], [ignore], [])
dnl Run all test cases from a test program.
AT_CHECK([rm -rf top], [0], [], [])
AT_CHECK([mkdir top], [0], [], [])
AT_CHECK([cp TEST_HELPER_NO_S(tp_basic_sh) top])
AT_DATA([top/Atffile],
[Content-Type: application/X-atf-atffile; version="1"
prop: test-suite = atf
tp: h_tp_basic_sh
])
AT_CHECK([cd top && atf-run], [1], [stdout], [stderr])
CHECK_TPS_TCR(pass, passed, stdout)
CHECK_TPS_TCR(fail, failed, stdout)
CHECK_TPS_TCR(skip, skipped, stdout)
CHECK_TPS_TCR(default, passed, stdout)
AT_CLEANUP()
dnl vim: syntax=m4:expandtab:shiftwidth=4:softtabstop=4

View File

@ -1,81 +0,0 @@
dnl
dnl Automated Testing Framework (atf)
dnl
dnl Copyright (c) 2007 The NetBSD Foundation, Inc.
dnl All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions
dnl are met:
dnl 1. Redistributions of source code must retain the above copyright
dnl notice, this list of conditions and the following disclaimer.
dnl 2. Redistributions in binary form must reproduce the above copyright
dnl notice, this list of conditions and the following disclaimer in the
dnl documentation and/or other materials provided with the distribution.
dnl
dnl THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
dnl CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
dnl INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
dnl MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
dnl IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
dnl DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
dnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
dnl GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
dnl IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
dnl OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
dnl IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dnl
AT_SETUP([subr: atf_check function])
AT_CHECK([TEST_HELPER(tp_atf_check_sh) exitcode_0_0],
[0], [ignore], [ignore])
AT_CHECK([TEST_HELPER(tp_atf_check_sh) exitcode_0_1],
[1], [ignore], [ignore])
AT_CHECK([TEST_HELPER(tp_atf_check_sh) exitcode_1_0],
[1], [ignore], [ignore])
AT_CHECK([TEST_HELPER(tp_atf_check_sh) exitcode_1_1],
[0], [ignore], [ignore])
AT_CHECK([TEST_HELPER(tp_atf_check_sh) stdout_expout_pass],
[0], [ignore], [ignore])
AT_CHECK([TEST_HELPER(tp_atf_check_sh) stdout_expout_fail],
[1], [ignore], [ignore])
AT_CHECK([TEST_HELPER(tp_atf_check_sh) stdout_ignore_empty],
[0], [ignore], [ignore])
AT_CHECK([TEST_HELPER(tp_atf_check_sh) stdout_ignore_sth],
[0], [ignore], [ignore])
AT_CHECK([TEST_HELPER(tp_atf_check_sh) stdout_null_empty],
[0], [ignore], [ignore])
AT_CHECK([TEST_HELPER(tp_atf_check_sh) stdout_null_sth],
[1], [ignore], [ignore])
AT_CHECK([TEST_HELPER(tp_atf_check_sh) stdout_stdout_written],
[0], [ignore], [ignore])
AT_CHECK([TEST_HELPER(tp_atf_check_sh) stdout_match_ok],
[0], [ignore], [ignore])
AT_CHECK([TEST_HELPER(tp_atf_check_sh) stdout_match_fail],
[1], [ignore], [ignore])
AT_CHECK([TEST_HELPER(tp_atf_check_sh) stderr_experr_pass],
[0], [ignore], [ignore])
AT_CHECK([TEST_HELPER(tp_atf_check_sh) stderr_experr_fail],
[1], [ignore], [ignore])
AT_CHECK([TEST_HELPER(tp_atf_check_sh) stderr_ignore_empty],
[0], [ignore], [ignore])
AT_CHECK([TEST_HELPER(tp_atf_check_sh) stderr_ignore_sth],
[0], [ignore], [ignore])
AT_CHECK([TEST_HELPER(tp_atf_check_sh) stderr_null_empty],
[0], [ignore], [ignore])
AT_CHECK([TEST_HELPER(tp_atf_check_sh) stderr_null_sth],
[1], [ignore], [ignore])
AT_CHECK([TEST_HELPER(tp_atf_check_sh) stderr_stderr_written],
[0], [ignore], [ignore])
AT_CHECK([TEST_HELPER(tp_atf_check_sh) stderr_match_ok],
[0], [ignore], [ignore])
AT_CHECK([TEST_HELPER(tp_atf_check_sh) stderr_match_fail],
[1], [ignore], [ignore])
AT_CLEANUP()
dnl vim: syntax=m4:expandtab:shiftwidth=4:softtabstop=4

View File

@ -1,186 +0,0 @@
dnl
dnl Automated Testing Framework (atf)
dnl
dnl Copyright (c) 2007 The NetBSD Foundation, Inc.
dnl All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions
dnl are met:
dnl 1. Redistributions of source code must retain the above copyright
dnl notice, this list of conditions and the following disclaimer.
dnl 2. Redistributions in binary form must reproduce the above copyright
dnl notice, this list of conditions and the following disclaimer in the
dnl documentation and/or other materials provided with the distribution.
dnl
dnl THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
dnl CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
dnl INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
dnl MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
dnl IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
dnl DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
dnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
dnl GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
dnl IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
dnl OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
dnl IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dnl
AT_SETUP([test_program: compare the user-visible interfaces])
dnl No arguments.
AT_CHECK([TEST_HELPER(tp_basic_c)], [1], [], [stderr])
sed 's,tp_basic_c,tp_basic_cpp,g' <stderr >experr
AT_CHECK([TEST_HELPER(tp_basic_cpp)], [1], [], [experr])
sed 's,tp_basic_c,tp_basic_sh,g' <stderr >experr
AT_CHECK([TEST_HELPER(tp_basic_sh)], [1], [], [experr])
dnl Try to ask for help, which is not bundled in.
AT_CHECK([TEST_HELPER(tp_basic_c) -h], [1], [], [stderr])
sed 's,tp_basic_c,tp_basic_cpp,g' <stderr >experr
AT_CHECK([TEST_HELPER(tp_basic_cpp) -h], [1], [], [experr])
sed 's,tp_basic_c,tp_basic_sh,g' <stderr >experr
AT_CHECK([TEST_HELPER(tp_basic_sh) -h], [1], [], [experr])
dnl Give an invalid option.
AT_CHECK([TEST_HELPER(tp_basic_c) -Z], [1], [], [stderr])
sed 's,tp_basic_c,tp_basic_cpp,g' <stderr >experr
AT_CHECK([TEST_HELPER(tp_basic_cpp) -Z], [1], [], [experr])
sed 's,tp_basic_c,tp_basic_sh,g' <stderr >experr
AT_CHECK([TEST_HELPER(tp_basic_sh) -Z], [1], [], [experr])
dnl List all tests.
AT_CHECK([TEST_HELPER(tp_basic_c) -l], [0], [stdout], [])
sed 's,tp_basic_c,tp_basic_cpp,g' <stdout >expout
AT_CHECK([TEST_HELPER(tp_basic_cpp) -l], [0], [expout], [])
sed 's,tp_basic_c,tp_basic_sh,g' <stdout >expout
AT_CHECK([TEST_HELPER(tp_basic_sh) -l], [0], [expout], [])
dnl Run no tests.
AT_CHECK([TEST_HELPER(tp_basic_c)],
[1], [stdout], [stderr])
sed 's,tp_basic_c,tp_basic_cpp,g' <stdout >expout
sed 's,tp_basic_c,tp_basic_cpp,g' <stderr >experr
AT_CHECK([TEST_HELPER(tp_basic_cpp)],
[1], [expout], [experr])
sed 's,tp_basic_c,tp_basic_sh,g' <stdout >expout
sed 's,tp_basic_c,tp_basic_sh,g' <stderr >experr
AT_CHECK([TEST_HELPER(tp_basic_sh)],
[1], [expout], [experr])
dnl Run the pass test case.
AT_CHECK([TEST_HELPER(tp_basic_c) -r resout pass],
[0], [stdout], [stderr])
sed 's,tp_basic_c,tp_basic_cpp,g' <stdout >expout
sed 's,tp_basic_c,tp_basic_cpp,g' <stderr >experr
sed 's,tp_basic_c,tp_basic_cpp,g' <resout >resexp
AT_CHECK([TEST_HELPER(tp_basic_cpp) -r resout pass],
[0], [expout], [experr])
AT_CHECK([cmp -s resout resexp], [0], [], [])
sed 's,tp_basic_c,tp_basic_sh,g' <stdout >expout
sed 's,tp_basic_c,tp_basic_sh,g' <stderr >experr
sed 's,tp_basic_c,tp_basic_sh,g' <resout >resexp
AT_CHECK([TEST_HELPER(tp_basic_sh) -r resout pass],
[0], [expout], [experr])
AT_CHECK([cmp -s resout resexp], [0], [], [])
dnl Run the fail test case.
AT_CHECK([TEST_HELPER(tp_basic_c) -r resout fail],
[1], [stdout], [stderr])
sed 's,tp_basic_c,tp_basic_cpp,g' <stdout >expout
sed 's,tp_basic_c,tp_basic_cpp,g' <stderr >experr
sed 's,tp_basic_c,tp_basic_cpp,g' <resout >resexp
AT_CHECK([TEST_HELPER(tp_basic_cpp) -r resout fail],
[1], [expout], [experr])
AT_CHECK([cmp -s resout resexp], [0], [], [])
sed 's,tp_basic_c,tp_basic_sh,g' <stdout >expout
sed 's,tp_basic_c,tp_basic_sh,g' <stderr >experr
sed 's,tp_basic_c,tp_basic_sh,g' <resout >resexp
AT_CHECK([TEST_HELPER(tp_basic_sh) -r resout fail],
[1], [expout], [experr])
AT_CHECK([cmp -s resout resexp], [0], [], [])
dnl Run the skip test case.
AT_CHECK([TEST_HELPER(tp_basic_c) -r resout skip],
[0], [stdout], [stderr])
sed 's,tp_basic_c,tp_basic_cpp,g' <stdout >expout
sed 's,tp_basic_c,tp_basic_cpp,g' <stderr >experr
sed 's,tp_basic_c,tp_basic_cpp,g' <resout >resexp
AT_CHECK([TEST_HELPER(tp_basic_cpp) -r resout skip],
[0], [expout], [experr])
AT_CHECK([cmp -s resout resexp], [0], [], [])
sed 's,tp_basic_c,tp_basic_sh,g' <stdout >expout
sed 's,tp_basic_c,tp_basic_sh,g' <stderr >experr
sed 's,tp_basic_c,tp_basic_sh,g' <resout >resexp
AT_CHECK([TEST_HELPER(tp_basic_sh) -r resout skip],
[0], [expout], [experr])
AT_CHECK([cmp -s resout resexp], [0], [], [])
dnl Run the default test case.
AT_CHECK([TEST_HELPER(tp_basic_c) -r resout default],
[0], [stdout], [stderr])
sed 's,tp_basic_c,tp_basic_cpp,g' <stdout >expout
sed 's,tp_basic_c,tp_basic_cpp,g' <stderr >experr
sed 's,tp_basic_c,tp_basic_cpp,g' <resout >resexp
AT_CHECK([TEST_HELPER(tp_basic_cpp) -r resout default],
[0], [expout], [experr])
AT_CHECK([cmp -s resout resexp], [0], [], [])
sed 's,tp_basic_c,tp_basic_sh,g' <stdout >expout
sed 's,tp_basic_c,tp_basic_sh,g' <stderr >experr
sed 's,tp_basic_c,tp_basic_sh,g' <resout >resexp
AT_CHECK([TEST_HELPER(tp_basic_sh) -r resout default],
[0], [expout], [experr])
AT_CHECK([cmp -s resout resexp], [0], [], [])
dnl Try running multiple tests.
AT_CHECK([TEST_HELPER(tp_basic_c) pass fail],
[1], [stdout], [stderr])
sed 's,tp_basic_c,tp_basic_cpp,g' <stdout >expout
sed 's,tp_basic_c,tp_basic_cpp,g' <stderr >experr
AT_CHECK([TEST_HELPER(tp_basic_cpp) pass fail],
[1], [expout], [experr])
sed 's,tp_basic_c,tp_basic_sh,g' <stdout >expout
sed 's,tp_basic_c,tp_basic_sh,g' <stderr >experr
AT_CHECK([TEST_HELPER(tp_basic_sh) pass fail],
[1], [expout], [experr])
dnl Run an unknown test case.
AT_CHECK([TEST_HELPER(tp_basic_c) unknown],
[1], [stdout], [stderr])
sed 's,tp_basic_c,tp_basic_cpp,g' <stdout >expout
sed 's,tp_basic_c,tp_basic_cpp,g' <stderr >experr
AT_CHECK([TEST_HELPER(tp_basic_cpp) unknown],
[1], [expout], [experr])
sed 's,tp_basic_c,tp_basic_sh,g' <stdout >expout
sed 's,tp_basic_c,tp_basic_sh,g' <stderr >experr
AT_CHECK([TEST_HELPER(tp_basic_sh) unknown],
[1], [expout], [experr])
dnl Try running a non-existent cleanup routine.
AT_CHECK([TEST_HELPER(tp_basic_c) pass:cleanup],
[0], [stdout], [stderr])
sed 's,tp_basic_c,tp_basic_cpp,g' <stdout >expout
sed 's,tp_basic_c,tp_basic_cpp,g' <stderr >experr
AT_CHECK([TEST_HELPER(tp_basic_cpp) pass:cleanup],
[0], [expout], [experr])
sed 's,tp_basic_c,tp_basic_sh,g' <stdout >expout
sed 's,tp_basic_c,tp_basic_sh,g' <stderr >experr
AT_CHECK([TEST_HELPER(tp_basic_sh) pass:cleanup],
[0], [expout], [experr])
dnl Run a test and dump the results on stdout.
AT_CHECK([TEST_HELPER(tp_basic_c) skip],
[0], [stdout], [stderr])
sed 's,tp_basic_c,tp_basic_cpp,g' <stdout >expout
sed 's,tp_basic_c,tp_basic_cpp,g' <stderr >experr
AT_CHECK([TEST_HELPER(tp_basic_cpp) skip],
[0], [expout], [experr])
sed 's,tp_basic_c,tp_basic_sh,g' <stdout >expout
sed 's,tp_basic_c,tp_basic_sh,g' <stderr >experr
AT_CHECK([TEST_HELPER(tp_basic_sh) skip],
[0], [expout], [experr])
AT_CLEANUP()
dnl vim: syntax=m4:expandtab:shiftwidth=4:softtabstop=4

View File

@ -1,63 +0,0 @@
dnl
dnl Automated Testing Framework (atf)
dnl
dnl Copyright (c) 2007 The NetBSD Foundation, Inc.
dnl All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions
dnl are met:
dnl 1. Redistributions of source code must retain the above copyright
dnl notice, this list of conditions and the following disclaimer.
dnl 2. Redistributions in binary form must reproduce the above copyright
dnl notice, this list of conditions and the following disclaimer in the
dnl documentation and/or other materials provided with the distribution.
dnl
dnl THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
dnl CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
dnl INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
dnl MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
dnl IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
dnl DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
dnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
dnl GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
dnl IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
dnl OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
dnl IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dnl
AT_SETUP([test_program: filter test cases by name])
for h in tp_basic_c tp_basic_cpp tp_basic_sh; do
dnl Try an invalid test case name.
AT_CHECK([TEST_HELPER(${h}) invalid], 1, [], [stderr])
AT_CHECK([grep "Unknown test case .invalid'" stderr],
[0], [ignore], [])
dnl Try a glob as a test case name.
AT_CHECK([TEST_HELPER(${h}) "*p*"], 1, [], [stderr])
AT_CHECK([grep "Unknown test case .\\*p\\*'" stderr],
[0], [ignore], [])
AT_DATA([expres], [passed
])
AT_CHECK([TEST_HELPER(${h}) -r resout pass], 0, [ignore], [ignore])
AT_CHECK([cmp -s resout expres], [0], [], [])
AT_DATA([expres], [skipped: By design
])
AT_CHECK([TEST_HELPER(${h}) -r resout skip], 0, [ignore], [ignore])
AT_CHECK([cmp -s resout expres], [0], [], [])
AT_DATA([expres], [failed: On purpose
])
AT_CHECK([TEST_HELPER(${h}) -r resout fail], 1, [ignore], [ignore])
AT_CHECK([cmp -s resout expres], [0], [], [])
done
AT_CLEANUP()
dnl vim: syntax=m4:expandtab:shiftwidth=4:softtabstop=4

View File

@ -1,63 +0,0 @@
dnl
dnl Automated Testing Framework (atf)
dnl
dnl Copyright (c) 2007 The NetBSD Foundation, Inc.
dnl All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions
dnl are met:
dnl 1. Redistributions of source code must retain the above copyright
dnl notice, this list of conditions and the following disclaimer.
dnl 2. Redistributions in binary form must reproduce the above copyright
dnl notice, this list of conditions and the following disclaimer in the
dnl documentation and/or other materials provided with the distribution.
dnl
dnl THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
dnl CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
dnl INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
dnl MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
dnl IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
dnl DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
dnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
dnl GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
dnl IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
dnl OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
dnl IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dnl
AT_SETUP([test_program: list test cases])
for h in tp_basic_c tp_basic_cpp tp_basic_sh; do
AT_DATA([expout], [Content-Type: application/X-atf-tp; version="1"
ident: pass
descr: An empty test case that always passes
ident: fail
descr: An empty test case that always fails
ident: skip
descr: An empty test case that is always skipped
ident: default
descr: A test case that passes without explicitly stating it
])
AT_CHECK([TEST_HELPER(${h}) -l], [0], [expout], [])
AT_CHECK([TEST_HELPER(${h}) -l pass], [1], [], [stderr])
AT_CHECK([grep 'Cannot provide test case names with -l' stderr],
[0], [ignore], [])
AT_CHECK([TEST_HELPER(${h}) -l pass fail], [1], [], [stderr])
AT_CHECK([grep 'Cannot provide test case names with -l' stderr],
[0], [ignore], [])
done
AT_CLEANUP()
dnl vim: syntax=m4:expandtab:shiftwidth=4:softtabstop=4

View File

@ -1,51 +0,0 @@
dnl
dnl Automated Testing Framework (atf)
dnl
dnl Copyright (c) 2007 The NetBSD Foundation, Inc.
dnl All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions
dnl are met:
dnl 1. Redistributions of source code must retain the above copyright
dnl notice, this list of conditions and the following disclaimer.
dnl 2. Redistributions in binary form must reproduce the above copyright
dnl notice, this list of conditions and the following disclaimer in the
dnl documentation and/or other materials provided with the distribution.
dnl
dnl THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
dnl CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
dnl INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
dnl MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
dnl IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
dnl DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
dnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
dnl GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
dnl IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
dnl OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
dnl IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dnl
AT_SETUP([test_program: output format and exit codes])
for h in tp_basic_c tp_basic_cpp tp_basic_sh; do
dnl Check the -r flag to redirect the results output.
AT_CHECK([TEST_HELPER(${h}) -r resout pass], 0, [stdout], [stderr])
CHECK_TCR([resout], [passed])
AT_CHECK([TEST_HELPER(${h}) -r resout fail], 1, [stdout], [stderr])
CHECK_TCR([resout], [failed], [On purpose])
AT_CHECK([TEST_HELPER(${h}) -r resout skip], 0, [stdout], [stderr])
CHECK_TCR([resout], [skipped], [By design])
AT_CHECK([TEST_HELPER(${h}) -r resout default], 0, [stdout], [stderr])
CHECK_TCR([resout], [passed])
done
AT_CLEANUP()
dnl vim: syntax=m4:expandtab:shiftwidth=4:softtabstop=4

File diff suppressed because it is too large Load Diff

View File

@ -1,84 +0,0 @@
dnl
dnl Automated Testing Framework (atf)
dnl
dnl Copyright (c) 2007 The NetBSD Foundation, Inc.
dnl All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions
dnl are met:
dnl 1. Redistributions of source code must retain the above copyright
dnl notice, this list of conditions and the following disclaimer.
dnl 2. Redistributions in binary form must reproduce the above copyright
dnl notice, this list of conditions and the following disclaimer in the
dnl documentation and/or other materials provided with the distribution.
dnl
dnl THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
dnl CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
dnl INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
dnl MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
dnl IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
dnl DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
dnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
dnl GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
dnl IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
dnl OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
dnl IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dnl
AT_INIT([bootstrap tests])
m4_define([GUESS_TOPDIR], {
old=$(pwd)
while test $(pwd) != '/' -a ! -e ./Makefile; do
cd ..
done
topdir=$(pwd)
cd ${old}
echo ${topdir}
})
m4_define([APP_HELPER], [$(GUESS_TOPDIR)/bootstrap/h_$1])
m4_define([TEST_HELPER_NO_S], [$(GUESS_TOPDIR)/bootstrap/h_$1])
m4_define([TEST_HELPER], [$(GUESS_TOPDIR)/bootstrap/h_$1 \
-s $(GUESS_TOPDIR)/bootstrap])
m4_define(COUNT_IN_LINES,
[test @S|@[($1 | wc -l | awk '{ print @S|@1 }')] = $2])
m4_define(COUNT_LINES, [test @S|@[(wc -l $1 | awk '{ print @S|@1 }')] = $2])
m4_define(TCR_DATA, [echo '$2' >$1 <<EOF
$2
EOF
m4_ifnblank([$3], [echo "$2: $3" >$1])])
m4_define(CHECK_TCR, [TCR_DATA([expres], $2, $3)
AT_CHECK([diff -u expres $1], [0], [], [])])
m4_define(CHECK_TCS_TCR,
[AT_CHECK([grep '^tc-end: @<:@0-9. @:>@*, $1, $2' $3], [0],
[ignore], [])])
m4_define(CHECK_TPS_TCR,
[AT_CHECK([grep '^tc-end: @<:@0-9. @:>@*, $1, $2' $3], [0],
[ignore], [])])
dnl The tests below are sorted depending on how important they are.
m4_include(bootstrap/t_test_program_filter.at)
m4_include(bootstrap/t_test_program_run.at)
m4_include(bootstrap/t_test_program_list.at)
m4_include(bootstrap/t_test_program_compare.at)
m4_include(bootstrap/t_subr_atf_check.at)
m4_if([ENABLE_TOOLS], yes, [
m4_include(bootstrap/t_application_opts_args.at)
m4_include(bootstrap/t_application_help.at)
m4_include(bootstrap/t_atf_config.at)
m4_include(bootstrap/t_atf_run.at)
])
dnl vim: syntax=m4:expandtab:shiftwidth=4:softtabstop=4

View File

@ -1,159 +0,0 @@
dnl Copyright 2010 Google Inc.
dnl All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions are
dnl met:
dnl
dnl * Redistributions of source code must retain the above copyright
dnl notice, this list of conditions and the following disclaimer.
dnl * Redistributions in binary form must reproduce the above copyright
dnl notice, this list of conditions and the following disclaimer in the
dnl documentation and/or other materials provided with the distribution.
dnl * Neither the name of Google Inc. nor the names of its contributors
dnl may be used to endorse or promote products derived from this software
dnl without specific prior written permission.
dnl
dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
dnl "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
dnl LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
dnl A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
dnl OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
dnl SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
dnl LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
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 \file compiler-flags.m4
dnl
dnl Macros to check for the existence of compiler flags. The macros in this
dnl file support both C and C++.
dnl
dnl Be aware that, in order to detect a flag accurately, we may need to enable
dnl strict warning checking in the compiler (i.e. enable -Werror). Some
dnl compilers, e.g. Clang, report unknown -W flags as warnings unless -Werror is
dnl selected. This fact would confuse the flag checks below because we would
dnl conclude that a flag is valid while in reality it is not. To resolve this,
dnl the macros below will pass -Werror to the compiler along with any other flag
dnl being checked.
dnl Checks for a compiler flag and sets a result variable.
dnl
dnl This is an auxiliary macro for the implementation of _KYUA_FLAG.
dnl
dnl \param 1 The shell variable containing the compiler name. Used for
dnl reporting purposes only. C or CXX.
dnl \param 2 The shell variable containing the flags for the compiler.
dnl CFLAGS or CXXFLAGS.
dnl \param 3 The name of the compiler flag to check for.
dnl \param 4 The shell variable to set with the result of the test. Will
dnl be set to 'yes' if the flag is valid, 'no' otherwise.
dnl \param 5 Additional, optional flags to pass to the C compiler while
dnl looking for the flag in $3. We use this here to pass -Werror to the
dnl flag checks (unless we are checking for -Werror already).
AC_DEFUN([_KYUA_FLAG_AUX], [
if test x"${$4-unset}" = xunset; then
AC_MSG_CHECKING(whether ${$1} supports $3)
saved_flags="${$2}"
$4=no
$2="${$2} $5 $3"
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 0;])],
AC_MSG_RESULT(yes)
$4=yes,
AC_MSG_RESULT(no))
$2="${saved_flags}"
fi
])
dnl Checks for a compiler flag and appends it to a result variable.
dnl
dnl \param 1 The shell variable containing the compiler name. Used for
dnl reporting purposes only. CC or CXX.
dnl \param 2 The shell variable containing the flags for the compiler.
dnl CFLAGS or CXXFLAGS.
dnl \param 3 The name of the compiler flag to check for.
dnl \param 4 The shell variable to which to append $3 if the flag is valid.
AC_DEFUN([_KYUA_FLAG], [
_KYUA_FLAG_AUX([$1], [$2], [-Werror], [kyua_$1_has_werror])
if test "$3" = "-Werror"; then
found=${kyua_$1_has_werror}
else
found=unset
if test ${kyua_$1_has_werror} = yes; then
_KYUA_FLAG_AUX([$1], [$2], [$3], [found], [-Werror])
else
_KYUA_FLAG_AUX([$1], [$2], [$3], [found], [])
fi
fi
if test ${found} = yes; then
$4="${$4} $3"
fi
])
dnl Checks for a C compiler flag and appends it to a variable.
dnl
dnl \pre The current language is C.
dnl
dnl \param 1 The name of the compiler flag to check for.
dnl \param 2 The shell variable to which to append $1 if the flag is valid.
AC_DEFUN([KYUA_CC_FLAG], [
AC_LANG_ASSERT([C])
_KYUA_FLAG([CC], [CFLAGS], [$1], [$2])
])
dnl Checks for a C++ compiler flag and appends it to a variable.
dnl
dnl \pre The current language is C++.
dnl
dnl \param 1 The name of the compiler flag to check for.
dnl \param 2 The shell variable to which to append $1 if the flag is valid.
AC_DEFUN([KYUA_CXX_FLAG], [
AC_LANG_ASSERT([C++])
_KYUA_FLAG([CXX], [CXXFLAGS], [$1], [$2])
])
dnl Checks for a set of C compiler flags and appends them to CFLAGS.
dnl
dnl The checks are performed independently and only when all the checks are
dnl done, the output variable is modified.
dnl
dnl \param 1 Whitespace-separated list of C flags to check.
AC_DEFUN([KYUA_CC_FLAGS], [
AC_LANG_PUSH([C])
valid_cflags=
for f in $1; do
KYUA_CC_FLAG(${f}, valid_cflags)
done
if test -n "${valid_cflags}"; then
CFLAGS="${CFLAGS} ${valid_cflags}"
fi
AC_LANG_POP([C])
])
dnl Checks for a set of C++ compiler flags and appends them to CXXFLAGS.
dnl
dnl The checks are performed independently and only when all the checks are
dnl done, the output variable is modified.
dnl
dnl \pre The current language is C++.
dnl
dnl \param 1 Whitespace-separated list of C flags to check.
AC_DEFUN([KYUA_CXX_FLAGS], [
AC_LANG_PUSH([C++])
valid_cxxflags=
for f in $1; do
KYUA_CXX_FLAG(${f}, valid_cxxflags)
done
if test -n "${valid_cxxflags}"; then
CXXFLAGS="${CXXFLAGS} ${valid_cxxflags}"
fi
AC_LANG_POP([C++])
])

View File

@ -1,79 +0,0 @@
dnl
dnl Automated Testing Framework (atf)
dnl
dnl Copyright (c) 2007 The NetBSD Foundation, Inc.
dnl All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions
dnl are met:
dnl 1. Redistributions of source code must retain the above copyright
dnl notice, this list of conditions and the following disclaimer.
dnl 2. Redistributions in binary form must reproduce the above copyright
dnl notice, this list of conditions and the following disclaimer in the
dnl documentation and/or other materials provided with the distribution.
dnl
dnl THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
dnl CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
dnl INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
dnl MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
dnl IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
dnl DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
dnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
dnl GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
dnl IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
dnl OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
dnl IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dnl
AC_DEFUN([ATF_CHECK_IN_STD], [
AC_MSG_CHECKING(whether $1 is in std)
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([$2], [$3 return 0;])],
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z])[_IN_STD], [1],
[Define to 1 if $1 is in std]),
AC_MSG_RESULT(no)
)
])
AC_DEFUN([ATF_CHECK_STD_PUTENV], [
ATF_CHECK_IN_STD([putenv],
[#include <cstdio>],
[std::putenv("a=b");]
)
])
AC_DEFUN([ATF_CHECK_STD_SETENV], [
ATF_CHECK_IN_STD([setenv],
[#include <cstdio>],
[std::setenv("a", "b");]
)
])
AC_DEFUN([ATF_CHECK_STD_SNPRINTF], [
ATF_CHECK_IN_STD([snprintf],
[#include <cstdio>],
[char buf;
std::snprintf(&buf, 1, "");]
)
])
AC_DEFUN([ATF_CHECK_STD_UNSETENV], [
ATF_CHECK_IN_STD([unsetenv],
[#include <cstdio>],
[std::unsetenv("a");]
)
])
AC_DEFUN([ATF_CHECK_STD_VSNPRINTF], [
ATF_CHECK_IN_STD([vsnprintf],
[#include <cstdarg>
#include <cstdio>],
[va_list ap;
char* buf = NULL;
const char* fmt = NULL;
std::vsnprintf(buf, 0, fmt, ap);]
)
])

View File

@ -1,112 +0,0 @@
dnl Copyright 2010 Google Inc.
dnl All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions are
dnl met:
dnl
dnl * Redistributions of source code must retain the above copyright
dnl notice, this list of conditions and the following disclaimer.
dnl * Redistributions in binary form must reproduce the above copyright
dnl notice, this list of conditions and the following disclaimer in the
dnl documentation and/or other materials provided with the distribution.
dnl * Neither the name of Google Inc. nor the names of its contributors
dnl may be used to endorse or promote products derived from this software
dnl without specific prior written permission.
dnl
dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
dnl "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
dnl LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
dnl A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
dnl OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
dnl SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
dnl LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
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 \file developer-mode.m4
dnl
dnl "Developer mode" is a mode in which the build system reports any
dnl build-time warnings as fatal errors. This helps in minimizing the
dnl amount of trivial coding problems introduced in the code.
dnl Unfortunately, this is not bullet-proof due to the wide variety of
dnl compilers available and their different warning diagnostics.
dnl
dnl When developer mode support is added to a package, the compilation will
dnl gain a bunch of extra warning diagnostics. These will NOT be enforced
dnl unless developer mode is enabled.
dnl
dnl Developer mode is enabled when the user requests it through the
dnl configure command line, or when building from the repository. The
dnl latter is to minimize the risk of committing new code with warnings
dnl into the tree.
dnl Adds "developer mode" support to the package.
dnl
dnl This macro performs the actual definition of the --enable-developer
dnl flag and implements all of its logic. See the file-level comment for
dnl details as to what this implies.
AC_DEFUN([KYUA_DEVELOPER_MODE], [
m4_foreach([language], [$1], [m4_set_add([languages], language)])
AC_ARG_ENABLE(
[developer],
AS_HELP_STRING([--enable-developer], [enable developer features]),,
[if test -d ${srcdir}/.git; then
AC_MSG_NOTICE([building from HEAD; developer mode autoenabled])
enable_developer=yes
else
enable_developer=no
fi])
#
# The following warning flags should also be enabled but cannot be.
# Reasons given below.
#
# -Wold-style-cast: Raises errors when using TIOCGWINSZ, at least under
# Mac OS X. This is due to the way _IOR is defined.
#
try_c_cxx_flags="-D_FORTIFY_SOURCE=2 \
-Wall \
-Wcast-qual \
-Wextra \
-Wpointer-arith \
-Wredundant-decls \
-Wreturn-type \
-Wshadow \
-Wsign-compare \
-Wswitch \
-Wwrite-strings"
try_c_flags="-Wmissing-prototypes \
-Wno-traditional \
-Wstrict-prototypes"
try_cxx_flags="-Wabi \
-Wctor-dtor-privacy \
-Wno-deprecated \
-Wno-non-template-friend \
-Wno-pmf-conversions \
-Wnon-virtual-dtor \
-Woverloaded-virtual \
-Wreorder \
-Wsign-promo \
-Wsynth"
if test ${enable_developer} = yes; then
try_werror=yes
try_c_cxx_flags="${try_c_cxx_flags} -g -Werror"
else
try_werror=no
try_c_cxx_flags="${try_c_cxx_flags} -DNDEBUG"
fi
m4_set_contains([languages], [C],
[KYUA_CC_FLAGS(${try_c_cxx_flags} ${try_c_flags})])
m4_set_contains([languages], [C++],
[KYUA_CXX_FLAGS(${try_c_cxx_flags} ${try_cxx_flags})])
])

7986
m4/libtool.m4 vendored

File diff suppressed because it is too large Load Diff

384
m4/ltoptions.m4 vendored
View File

@ -1,384 +0,0 @@
# Helper functions for option handling. -*- Autoconf -*-
#
# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 7 ltoptions.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
# ------------------------------------------
m4_define([_LT_MANGLE_OPTION],
[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
# ---------------------------------------
# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
# matching handler defined, dispatch to it. Other OPTION-NAMEs are
# saved as a flag.
m4_define([_LT_SET_OPTION],
[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
_LT_MANGLE_DEFUN([$1], [$2]),
[m4_warning([Unknown $1 option `$2'])])[]dnl
])
# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
# ------------------------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
m4_define([_LT_IF_OPTION],
[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
# -------------------------------------------------------
# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
# are set.
m4_define([_LT_UNLESS_OPTIONS],
[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
[m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
[m4_define([$0_found])])])[]dnl
m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
])[]dnl
])
# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
# ----------------------------------------
# OPTION-LIST is a space-separated list of Libtool options associated
# with MACRO-NAME. If any OPTION has a matching handler declared with
# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
# the unknown option and exit.
m4_defun([_LT_SET_OPTIONS],
[# Set options
m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
[_LT_SET_OPTION([$1], _LT_Option)])
m4_if([$1],[LT_INIT],[
dnl
dnl Simply set some default values (i.e off) if boolean options were not
dnl specified:
_LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
])
_LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
])
dnl
dnl If no reference was made to various pairs of opposing options, then
dnl we run the default mode handler for the pair. For example, if neither
dnl `shared' nor `disable-shared' was passed, we enable building of shared
dnl archives by default:
_LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
_LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
_LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
_LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
[_LT_ENABLE_FAST_INSTALL])
])
])# _LT_SET_OPTIONS
## --------------------------------- ##
## Macros to handle LT_INIT options. ##
## --------------------------------- ##
# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
# -----------------------------------------
m4_define([_LT_MANGLE_DEFUN],
[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
# -----------------------------------------------
m4_define([LT_OPTION_DEFINE],
[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
])# LT_OPTION_DEFINE
# dlopen
# ------
LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
])
AU_DEFUN([AC_LIBTOOL_DLOPEN],
[_LT_SET_OPTION([LT_INIT], [dlopen])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `dlopen' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
# win32-dll
# ---------
# Declare package support for building win32 dll's.
LT_OPTION_DEFINE([LT_INIT], [win32-dll],
[enable_win32_dll=yes
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
;;
esac
test -z "$AS" && AS=as
_LT_DECL([], [AS], [1], [Assembler program])dnl
test -z "$DLLTOOL" && DLLTOOL=dlltool
_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
test -z "$OBJDUMP" && OBJDUMP=objdump
_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
])# win32-dll
AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
_LT_SET_OPTION([LT_INIT], [win32-dll])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `win32-dll' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
# _LT_ENABLE_SHARED([DEFAULT])
# ----------------------------
# implement the --enable-shared flag, and supports the `shared' and
# `disable-shared' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_SHARED],
[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([shared],
[AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*)
enable_shared=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_shared=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
_LT_DECL([build_libtool_libs], [enable_shared], [0],
[Whether or not to build shared libraries])
])# _LT_ENABLE_SHARED
LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
# Old names:
AC_DEFUN([AC_ENABLE_SHARED],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
])
AC_DEFUN([AC_DISABLE_SHARED],
[_LT_SET_OPTION([LT_INIT], [disable-shared])
])
AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_ENABLE_SHARED], [])
dnl AC_DEFUN([AM_DISABLE_SHARED], [])
# _LT_ENABLE_STATIC([DEFAULT])
# ----------------------------
# implement the --enable-static flag, and support the `static' and
# `disable-static' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_STATIC],
[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([static],
[AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_static=yes ;;
no) enable_static=no ;;
*)
enable_static=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_static=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_static=]_LT_ENABLE_STATIC_DEFAULT)
_LT_DECL([build_old_libs], [enable_static], [0],
[Whether or not to build static libraries])
])# _LT_ENABLE_STATIC
LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
# Old names:
AC_DEFUN([AC_ENABLE_STATIC],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
])
AC_DEFUN([AC_DISABLE_STATIC],
[_LT_SET_OPTION([LT_INIT], [disable-static])
])
AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_ENABLE_STATIC], [])
dnl AC_DEFUN([AM_DISABLE_STATIC], [])
# _LT_ENABLE_FAST_INSTALL([DEFAULT])
# ----------------------------------
# implement the --enable-fast-install flag, and support the `fast-install'
# and `disable-fast-install' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_FAST_INSTALL],
[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([fast-install],
[AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
[optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
enable_fast_install=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_fast_install=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
_LT_DECL([fast_install], [enable_fast_install], [0],
[Whether or not to optimize for fast installation])dnl
])# _LT_ENABLE_FAST_INSTALL
LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
# Old names:
AU_DEFUN([AC_ENABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
the `fast-install' option into LT_INIT's first parameter.])
])
AU_DEFUN([AC_DISABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
the `disable-fast-install' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
# _LT_WITH_PIC([MODE])
# --------------------
# implement the --with-pic flag, and support the `pic-only' and `no-pic'
# LT_INIT options.
# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
m4_define([_LT_WITH_PIC],
[AC_ARG_WITH([pic],
[AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
[lt_p=${PACKAGE-default}
case $withval in
yes|no) pic_mode=$withval ;;
*)
pic_mode=default
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for lt_pkg in $withval; do
IFS="$lt_save_ifs"
if test "X$lt_pkg" = "X$lt_p"; then
pic_mode=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[pic_mode=default])
test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
])# _LT_WITH_PIC
LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
# Old name:
AU_DEFUN([AC_LIBTOOL_PICMODE],
[_LT_SET_OPTION([LT_INIT], [pic-only])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `pic-only' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
## ----------------- ##
## LTDL_INIT Options ##
## ----------------- ##
m4_define([_LTDL_MODE], [])
LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
[m4_define([_LTDL_MODE], [nonrecursive])])
LT_OPTION_DEFINE([LTDL_INIT], [recursive],
[m4_define([_LTDL_MODE], [recursive])])
LT_OPTION_DEFINE([LTDL_INIT], [subproject],
[m4_define([_LTDL_MODE], [subproject])])
m4_define([_LTDL_TYPE], [])
LT_OPTION_DEFINE([LTDL_INIT], [installable],
[m4_define([_LTDL_TYPE], [installable])])
LT_OPTION_DEFINE([LTDL_INIT], [convenience],
[m4_define([_LTDL_TYPE], [convenience])])

123
m4/ltsugar.m4 vendored
View File

@ -1,123 +0,0 @@
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
#
# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 6 ltsugar.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
# lt_join(SEP, ARG1, [ARG2...])
# -----------------------------
# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
# associated separator.
# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
# versions in m4sugar had bugs.
m4_define([lt_join],
[m4_if([$#], [1], [],
[$#], [2], [[$2]],
[m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
m4_define([_lt_join],
[m4_if([$#$2], [2], [],
[m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
# lt_car(LIST)
# lt_cdr(LIST)
# ------------
# Manipulate m4 lists.
# These macros are necessary as long as will still need to support
# Autoconf-2.59 which quotes differently.
m4_define([lt_car], [[$1]])
m4_define([lt_cdr],
[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
[$#], 1, [],
[m4_dquote(m4_shift($@))])])
m4_define([lt_unquote], $1)
# lt_append(MACRO-NAME, STRING, [SEPARATOR])
# ------------------------------------------
# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
# Note that neither SEPARATOR nor STRING are expanded; they are appended
# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
# No SEPARATOR is output if MACRO-NAME was previously undefined (different
# than defined and empty).
#
# This macro is needed until we can rely on Autoconf 2.62, since earlier
# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
m4_define([lt_append],
[m4_define([$1],
m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
# ----------------------------------------------------------
# Produce a SEP delimited list of all paired combinations of elements of
# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
# has the form PREFIXmINFIXSUFFIXn.
# Needed until we can rely on m4_combine added in Autoconf 2.62.
m4_define([lt_combine],
[m4_if(m4_eval([$# > 3]), [1],
[m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
[[m4_foreach([_Lt_prefix], [$2],
[m4_foreach([_Lt_suffix],
]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
# -----------------------------------------------------------------------
# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
m4_define([lt_if_append_uniq],
[m4_ifdef([$1],
[m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
[lt_append([$1], [$2], [$3])$4],
[$5])],
[lt_append([$1], [$2], [$3])$4])])
# lt_dict_add(DICT, KEY, VALUE)
# -----------------------------
m4_define([lt_dict_add],
[m4_define([$1($2)], [$3])])
# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
# --------------------------------------------
m4_define([lt_dict_add_subkey],
[m4_define([$1($2:$3)], [$4])])
# lt_dict_fetch(DICT, KEY, [SUBKEY])
# ----------------------------------
m4_define([lt_dict_fetch],
[m4_ifval([$3],
m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
# -----------------------------------------------------------------
m4_define([lt_if_dict_fetch],
[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
[$5],
[$6])])
# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
# --------------------------------------------------------------
m4_define([lt_dict_filter],
[m4_if([$5], [], [],
[lt_join(m4_quote(m4_default([$4], [[, ]])),
lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
[lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
])

23
m4/ltversion.m4 vendored
View File

@ -1,23 +0,0 @@
# ltversion.m4 -- version numbers -*- Autoconf -*-
#
# Copyright (C) 2004 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# @configure_input@
# serial 3337 ltversion.m4
# This file is part of GNU Libtool
m4_define([LT_PACKAGE_VERSION], [2.4.2])
m4_define([LT_PACKAGE_REVISION], [1.3337])
AC_DEFUN([LTVERSION_VERSION],
[macro_version='2.4.2'
macro_revision='1.3337'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])

98
m4/lt~obsolete.m4 vendored
View File

@ -1,98 +0,0 @@
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
#
# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004.
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 5 lt~obsolete.m4
# These exist entirely to fool aclocal when bootstrapping libtool.
#
# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
# which have later been changed to m4_define as they aren't part of the
# exported API, or moved to Autoconf or Automake where they belong.
#
# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
# using a macro with the same name in our local m4/libtool.m4 it'll
# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
# and doesn't know about Autoconf macros at all.)
#
# So we provide this file, which has a silly filename so it's always
# included after everything else. This provides aclocal with the
# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
# because those macros already exist, or will be overwritten later.
# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
#
# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
# Yes, that means every name once taken will need to remain here until
# we give up compatibility with versions before 1.7, at which point
# we need to keep only those names which we still refer to.
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])

View File

@ -1,88 +0,0 @@
dnl
dnl Automated Testing Framework (atf)
dnl
dnl Copyright (c) 2007 The NetBSD Foundation, Inc.
dnl All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions
dnl are met:
dnl 1. Redistributions of source code must retain the above copyright
dnl notice, this list of conditions and the following disclaimer.
dnl 2. Redistributions in binary form must reproduce the above copyright
dnl notice, this list of conditions and the following disclaimer in the
dnl documentation and/or other materials provided with the distribution.
dnl
dnl THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
dnl CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
dnl INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
dnl MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
dnl IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
dnl DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
dnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
dnl GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
dnl IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
dnl OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
dnl IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dnl
AC_DEFUN([ATF_MODULE_APPLICATION], [
ATF_CHECK_STD_VSNPRINTF
AC_LANG_PUSH([C])
AC_MSG_CHECKING(whether getopt allows a + sign for POSIX behavior)
AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <stdlib.h>
#include <string.h>
#include <unistd.h>], [
int argc = 4;
char* argv@<:@5@:>@ = {
strdup("conftest"),
strdup("-+"),
strdup("-a"),
strdup("bar"),
NULL
};
int ch;
int seen_a = 0, seen_plus = 0;
while ((ch = getopt(argc, argv, "+a:")) != -1) {
switch (ch) {
case 'a':
seen_a = 1;
break;
case '+':
seen_plus = 1;
break;
case '?':
default:
;
}
}
return (seen_a && !seen_plus) ? EXIT_SUCCESS : EXIT_FAILURE;
])],
[getopt_allows_plus=yes
AC_DEFINE([HAVE_GNU_GETOPT], [1],
[Define to 1 if getopt allows a + sign for POSIX behavior])],
[getopt_allows_plus=no])
AC_MSG_RESULT(${getopt_allows_plus})
AC_LANG_POP([C])
AC_LANG_PUSH([C])
AC_MSG_CHECKING(whether getopt has optreset)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <stdlib.h>
#include <unistd.h>], [
optreset = 1;
return EXIT_SUCCESS;
])],
[getopt_has_optreset=yes],
[getopt_has_optreset=no])
if test x"${getopt_has_optreset}" = yes; then
AC_DEFINE([HAVE_OPTRESET], [1], [Define to 1 if getopt has optreset])
fi
AC_MSG_RESULT(${getopt_has_optreset})
AC_LANG_POP([C])
])

View File

@ -1,107 +0,0 @@
dnl
dnl Automated Testing Framework (atf)
dnl
dnl Copyright (c) 2008 The NetBSD Foundation, Inc.
dnl All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions
dnl are met:
dnl 1. Redistributions of source code must retain the above copyright
dnl notice, this list of conditions and the following disclaimer.
dnl 2. Redistributions in binary form must reproduce the above copyright
dnl notice, this list of conditions and the following disclaimer in the
dnl documentation and/or other materials provided with the distribution.
dnl
dnl THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
dnl CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
dnl INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
dnl MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
dnl IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
dnl DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
dnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
dnl GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
dnl IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
dnl OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
dnl IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dnl
AC_DEFUN([ATF_ATTRIBUTE_FORMAT_PRINTF], [
AC_MSG_CHECKING(
[whether __attribute__((__format__(__printf__, a, b))) is supported])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([
#include <stdarg.h>
#include <stdio.h>
static void test_printf(const char *, ...)
__attribute__((__format__(__printf__, 1, 2)));
static void
test_printf(const char *format, ...)
{
va_list ap;
va_start(ap, format);
vprintf(format, ap);
va_end(ap);
}], [
test_printf("foo %s", "bar");
return 0;
])],
[AC_MSG_RESULT(yes)
value="__attribute__((__format__(__printf__, a, b)))"],
[AC_MSG_RESULT(no)
value=""]
)
AC_SUBST([ATTRIBUTE_FORMAT_PRINTF], [${value}])
])
AC_DEFUN([ATF_ATTRIBUTE_NORETURN], [
dnl XXX This check is overly simple and should be fixed. For example,
dnl Sun's cc does support the noreturn attribute but CC (the C++
dnl compiler) does not. And in that case, CC just raises a warning
dnl during compilation, not an error, which later breaks the
dnl atf-c++/t_pkg_config:cxx_build check.
AC_MSG_CHECKING(whether __attribute__((__noreturn__)) is supported)
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([], [
#if ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
return 0;
#else
return 1;
#endif
])],
[AC_MSG_RESULT(yes)
value="__attribute__((__noreturn__))"],
[AC_MSG_RESULT(no)
value=""]
)
AC_SUBST([ATTRIBUTE_NORETURN], [${value}])
])
AC_DEFUN([ATF_ATTRIBUTE_UNUSED], [
AC_MSG_CHECKING(whether __attribute__((__unused__)) is supported)
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([
static void
function(int a __attribute__((__unused__)))
{
}], [
function(3);
return 0;
])],
[AC_MSG_RESULT(yes)
value="__attribute__((__unused__))"],
[AC_MSG_RESULT(no)
value=""]
)
AC_SUBST([ATTRIBUTE_UNUSED], [${value}])
])
AC_DEFUN([ATF_MODULE_DEFS], [
ATF_ATTRIBUTE_FORMAT_PRINTF
ATF_ATTRIBUTE_NORETURN
ATF_ATTRIBUTE_UNUSED
])

View File

@ -1,36 +0,0 @@
dnl
dnl Automated Testing Framework (atf)
dnl
dnl Copyright (c) 2007 The NetBSD Foundation, Inc.
dnl All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions
dnl are met:
dnl 1. Redistributions of source code must retain the above copyright
dnl notice, this list of conditions and the following disclaimer.
dnl 2. Redistributions in binary form must reproduce the above copyright
dnl notice, this list of conditions and the following disclaimer in the
dnl documentation and/or other materials provided with the distribution.
dnl
dnl THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
dnl CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
dnl INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
dnl MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
dnl IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
dnl DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
dnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
dnl GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
dnl IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
dnl OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
dnl IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dnl
AC_DEFUN([ATF_MODULE_ENV], [
AC_CHECK_FUNCS([putenv setenv unsetenv])
ATF_CHECK_STD_PUTENV
ATF_CHECK_STD_SETENV
ATF_CHECK_STD_UNSETENV
])

View File

@ -1,66 +0,0 @@
dnl
dnl Automated Testing Framework (atf)
dnl
dnl Copyright (c) 2007 The NetBSD Foundation, Inc.
dnl All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions
dnl are met:
dnl 1. Redistributions of source code must retain the above copyright
dnl notice, this list of conditions and the following disclaimer.
dnl 2. Redistributions in binary form must reproduce the above copyright
dnl notice, this list of conditions and the following disclaimer in the
dnl documentation and/or other materials provided with the distribution.
dnl
dnl THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
dnl CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
dnl INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
dnl MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
dnl IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
dnl DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
dnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
dnl GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
dnl IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
dnl OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
dnl IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dnl
AC_DEFUN([ATF_MODULE_FS], [
AC_MSG_CHECKING(whether basename takes a constant pointer)
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([#include <libgen.h>], [
const char* s = "/foo/bar/";
(void)::basename(s);
])],
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_CONST_BASENAME], [1],
[Define to 1 if basename takes a constant pointer]),
AC_MSG_RESULT(no))
AC_MSG_CHECKING(whether dirname takes a constant pointer)
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([#include <libgen.h>], [
const char* s = "/foo/bar/";
(void)::dirname(s);
])],
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_CONST_DIRNAME], [1],
[Define to 1 if dirname takes a constant pointer]),
AC_MSG_RESULT(no))
AC_MSG_CHECKING(whether getcwd(NULL, 0) works)
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([#include <stdlib.h>
#include <unistd.h>], [
char *cwd = getcwd(NULL, 0);
return (cwd != NULL) ? EXIT_SUCCESS : EXIT_FAILURE;
])],
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_GETCWD_DYN], [1],
[Define to 1 if getcwd(NULL, 0) works]),
AC_MSG_RESULT(no))
AC_CHECK_FUNCS([unmount])
])

View File

@ -1,32 +0,0 @@
dnl
dnl Automated Testing Framework (atf)
dnl
dnl Copyright (c) 2007 The NetBSD Foundation, Inc.
dnl All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions
dnl are met:
dnl 1. Redistributions of source code must retain the above copyright
dnl notice, this list of conditions and the following disclaimer.
dnl 2. Redistributions in binary form must reproduce the above copyright
dnl notice, this list of conditions and the following disclaimer in the
dnl documentation and/or other materials provided with the distribution.
dnl
dnl THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
dnl CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
dnl INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
dnl MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
dnl IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
dnl DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
dnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
dnl GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
dnl IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
dnl OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
dnl IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dnl
AC_DEFUN([ATF_MODULE_SANITY], [
ATF_CHECK_STD_SNPRINTF
])

View File

@ -1,86 +0,0 @@
dnl
dnl Automated Testing Framework (atf)
dnl
dnl Copyright (c) 2008 The NetBSD Foundation, Inc.
dnl All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions
dnl are met:
dnl 1. Redistributions of source code must retain the above copyright
dnl notice, this list of conditions and the following disclaimer.
dnl 2. Redistributions in binary form must reproduce the above copyright
dnl notice, this list of conditions and the following disclaimer in the
dnl documentation and/or other materials provided with the distribution.
dnl
dnl THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
dnl CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
dnl INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
dnl MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
dnl IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
dnl DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
dnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
dnl GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
dnl IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
dnl OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
dnl IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dnl
AC_DEFUN([ATF_MODULE_SIGNALS], [
AC_MSG_CHECKING(for the last valid signal)
AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <err.h>
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>], [
int i;
FILE *f;
i = 0;
while (i < 1024) {
i++;
if (i != SIGKILL && i != SIGSTOP) {
struct sigaction sa;
int ret;
sa.sa_handler = SIG_IGN;
sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
ret = sigaction(i, &sa, NULL);
if (ret == -1) {
if (errno == EINVAL) {
i--;
break;
} else
err(EXIT_FAILURE, "sigaction failed");
}
}
}
if (i == 100)
errx(EXIT_FAILURE, "too much signals");
f = fopen("conftest.cnt", "w");
if (f == NULL)
err(EXIT_FAILURE, "failed to open file");
fprintf(f, "%d\n", i);
fclose(f);
return EXIT_SUCCESS;
])],
[if test ! -f conftest.cnt; then
last_signo=15
AC_MSG_RESULT(failed; assuming ${last_signo})
else
last_signo=$(cat conftest.cnt)
rm -f conftest.cnt
AC_MSG_RESULT(${last_signo})
fi],
[last_signo=15
AC_MSG_RESULT(failed; assuming ${last_signo})])
AC_DEFINE_UNQUOTED([LAST_SIGNO], [${last_signo}],
[Define to the last valid signal number])
])

View File

@ -1,44 +0,0 @@
dnl
dnl Automated Testing Framework (atf)
dnl
dnl Copyright (c) 2009 The NetBSD Foundation, Inc.
dnl All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions
dnl are met:
dnl 1. Redistributions of source code must retain the above copyright
dnl notice, this list of conditions and the following disclaimer.
dnl 2. Redistributions in binary form must reproduce the above copyright
dnl notice, this list of conditions and the following disclaimer in the
dnl documentation and/or other materials provided with the distribution.
dnl
dnl THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
dnl CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
dnl INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
dnl MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
dnl IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
dnl DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
dnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
dnl GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
dnl IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
dnl OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
dnl IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dnl
dnl -----------------------------------------------------------------------
dnl User-customizable tools used at run-time.
dnl -----------------------------------------------------------------------
dnl
dnl ATF_RUNTIME_TOOL(varname, description, default)
dnl
dnl Provides a configuration-time environment variable to select a tool
dnl that will be later available through atf-config(1).
dnl
AC_DEFUN([ATF_RUNTIME_TOOL],[
AC_ARG_VAR([$1], [$2])
test x"${$1-unset}" = x"unset" && $1="$3"
AC_SUBST($1)
])