tests: "am_using_tap=yes" -> "am_test_protocol=tap"
[platform/upstream/automake.git] / t / ax / test-defs.in
1 # -*- shell-script -*-
2 # @configure_input@
3 #
4 # Copyright (C) 1996-2012 Free Software Foundation, Inc.
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
9 # any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
19 # Defines and minimal setup for Automake testing environment.
20
21 # IMPORTANT NOTES AND REQUIREMENTS
22 #   - Multiple inclusions of this file should be idempotent.
23 #   - This code has to be 'set -e' clean.
24
25 # Check that the environment is properly sanitized.
26 # Having variables exported to the empty string is OK, since our code
27 # treats such variables as if they were unset.
28 for var in \
29   required \
30   am_test_protocol \
31   am_serial_tests \
32   am_create_testdir \
33   am_tap_implementation \
34   am_test_prefer_config_shell \
35   am_original_AUTOMAKE \
36   am_original_ACLOCAL \
37 ; do
38   if eval "test x\"\$$var\" != x" && env | grep "^$var=" >/dev/null; then
39     echo "$me: variable '$var' is set in the environment:" \
40          "this is unsafe" >&2
41     exit 99
42   fi
43 done
44 unset var
45
46 # See whether the current test script is expected to use TAP or not.
47 # Use a sensible default, while allowing the scripts to override this
48 # check.
49 if test -z "$am_test_protocol"; then
50   case $argv0 in
51     *.tap) am_test_protocol=tap;;
52         *) am_test_protocol=none;;
53   esac
54 fi
55
56 am_rel_srcdir='@srcdir@'
57 am_top_srcdir='@abs_srcdir@'
58 am_top_builddir='@abs_builddir@'
59
60 # Where testsuite-related helper scripts, data files and shell libraries
61 # are placed.
62 am_testauxdir=$am_top_srcdir/t/ax
63
64 # Support for the "installcheck" target.
65 case ${am_running_installcheck:=no} in
66   yes)
67     am_amdir='@amdir@'
68     am_automake_acdir='@automake_acdir@'
69     am_bindir='@bindir@'
70     am_datadir='@datadir@'
71     am_docdir='@docdir@'
72     am_pkgvdatadir='@pkgvdatadir@'
73     am_scriptdir='@scriptdir@'
74     am_system_acdir='@system_acdir@'
75     ;;
76   no)
77     am_amdir=$am_top_srcdir/lib/am
78     am_automake_acdir=$am_top_srcdir/m4
79     am_bindir=$am_top_builddir/t/wrap
80     am_datadir=$am_top_srcdir
81     am_docdir=$am_top_srcdir/doc
82     am_pkgvdatadir=$am_top_srcdir/lib
83     am_scriptdir=$am_top_srcdir/lib
84     am_system_acdir=$am_top_srcdir/m4/acdir
85     ;;
86   *)
87     echo "$me: variable 'am_running_installcheck' has invalid"
88          "value '$am_running_installcheck'" >&2
89     exit 99
90     ;;
91 esac
92
93 APIVERSION='@APIVERSION@'
94 PATH_SEPARATOR='@PATH_SEPARATOR@'
95
96 host_alias=${host_alias-'@host_alias@'}; export host_alias
97 build_alias=${build_alias-'@build_alias@'}; export build_alias
98
99 # A concurrency-safe "mkdir -p" implementation.
100 MKDIR_P=${AM_TESTSUITE_MKDIR_P-'@MKDIR_P@'}
101
102 # The shell we use to run our own test scripts, determined at configure
103 # time.  It is required in the self tests, and most importantly for the
104 # automatic re-execution of test scripts.
105 AM_TEST_RUNNER_SHELL=${AM_TEST_RUNNER_SHELL-'@AM_TEST_RUNNER_SHELL@'}
106
107 # Make sure we override the user shell.  And do not read the value of
108 # $SHELL from the environment (think to the non-uncommon situation where
109 # e.g., $SHELL=/bin/tcsh).
110 SHELL=${AM_TESTSUITE_SHELL-'@SHELL@'}; export SHELL
111
112 # User can override various tools used.  Prefer overriding specific for
113 # that automake testsuite, if they are available.
114 AWK=${AM_TESTSUITE_AWK-${AWK-'@AWK@'}}
115 PERL=${AM_TESTSUITE_PERL-${PERL-'@PERL@'}}
116 MAKE=${AM_TESTSUITE_MAKE-${MAKE-'make'}}
117 YACC=${AM_TESTSUITE_YACC-${YACC-'@YACC@'}}
118 LEX=${AM_TESTSUITE_LEX-${LEX-'@LEX@'}}
119 AUTOCONF=${AM_TESTSUITE_AUTOCONF-${AUTOCONF-'@am_AUTOCONF@'}}
120 AUTOM4TE=${AM_TESTSUITE_AUTOM4TE-${AUTOM4TE-'@am_AUTOM4TE@'}}
121 AUTORECONF=${AM_TESTSUITE_AUTORECONF-${AUTORECONF-'@am_AUTORECONF@'}}
122 AUTOHEADER=${AM_TESTSUITE_AUTOHEADER-${AUTOHEADER-'@am_AUTOHEADER@'}}
123 AUTOUPDATE=${AM_TESTSUITE_AUTOUPDATE-${AUTOUPDATE-'@am_AUTOUPDATE@'}}
124
125 # Tests who want complete control over aclocal or automake command-line
126 # options should use $am_original_ACLOCAL or $am_original_AUTOMAKE.  The
127 # "test -z" tests take care not to re-initialize them if 'test-defs.sh'
128 # is re-sourced, as we want that file to remain really idempotent.
129 if test -z "$am_original_AUTOMAKE"; then
130   am_original_AUTOMAKE=${AM_TESTSUITE_AUTOMAKE-${AUTOMAKE-"automake-$APIVERSION"}}
131 fi
132 if test -z "$am_original_ACLOCAL"; then
133   am_original_ACLOCAL=${AM_TESTSUITE_ACLOCAL-${ACLOCAL-"aclocal-$APIVERSION"}}
134 fi
135
136 # Use -Werror because this also turns some Perl warnings into error.
137 # Tests for which this is inappropriate should use -Wno-error.
138 # Tests who want complete control over aclocal command-line options
139 # should use $am_original_ACLOCAL instead.
140 ACLOCAL="$am_original_ACLOCAL -Werror"
141
142 # See how Automake should be run.  We put --foreign as the default
143 # strictness to avoid having to create lots and lots of files.  A test
144 # can override this by specifying a different strictness.  Use -Wall
145 # -Werror by default.  Tests for which this is inappropriate (e.g. when
146 # testing that a warning is enabled by a specific switch) should use
147 # -Wnone or/and -Wno-error.
148 # Tests who want complete control over automake command-line options
149 # should use $am_original_AUTOMAKE instead.
150 AUTOMAKE="$am_original_AUTOMAKE --foreign -Werror -Wall"
151
152 # POSIX no longer requires 'egrep' and 'fgrep',
153 # but some hosts lack 'grep -E' and 'grep -F'.
154 EGREP=${AM_TESTSUITE_EGREP-'@EGREP@'}
155 FGREP=${AM_TESTSUITE_FGREP-'@FGREP@'}
156
157 # Compilers and their flags.  These can point to non-GNU compilers (and
158 # on non-Linux and non-BSD systems, they probably will).
159 CC=${AM_TESTSUITE_CC-${CC-'@CC@'}}
160 CXX=${AM_TESTSUITE_CXX-${CXX-'@CXX@'}}
161 F77=${AM_TESTSUITE_F77-${F77-'@F77@'}}
162 FC=${AM_TESTSUITE_FC-${FC-'@FC@'}}
163 CFLAGS=${AM_TESTSUITE_CFLAGS-${CFLAGS-'@CFLAGS@'}}
164 CXXFLAGS=${AM_TESTSUITE_CXXFLAGS-${CXXFLAGS-'@CXXFLAGS@'}}
165 FCFLAGS=${AM_TESTSUITE_FCFLAGS-${FCFLAGS-'@FCFLAGS@'}}
166 FFLAGS=${AM_TESTSUITE_FFLAGS-${FFLAGS-'@FFLAGS@'}}
167 CPPFLAGS=${AM_TESTSUITE_CPPFLAGS-${CPPFLAGS-'@CPPFLAGS@'}}
168
169 # GNU compilers and their flags.
170 GNU_CC=${AM_TESTSUITE_GNU_CC-${GNU_CC-'@GNU_CC@'}}
171 GNU_CXX=${AM_TESTSUITE_GNU_CXX-${GNU_CXX-'@GNU_CXX@'}}
172 GNU_F77=${AM_TESTSUITE_GNU_F77-${GNU_F77-'@GNU_F77@'}}
173 GNU_FC=${AM_TESTSUITE_GNU_FC-${GNU_FC-'@GNU_FC@'}}
174 GNU_FFLAGS=${AM_TESTSUITE_GNU_FFLAGS-${GNU_FFLAGS-'@GNU_FFLAGS@'}}
175 GNU_FCFLAGS=${AM_TESTSUITE_GNU_FCFLAGS-${GNU_FCFLAGS-'@GNU_FCFLAGS@'}}
176 GNU_CXXFLAGS=${AM_TESTSUITE_GNU_CXXFLAGS-${GNU_CXXFLAGS-'@GNU_CXXFLAGS@'}}
177 GNU_CFLAGS=${AM_TESTSUITE_GNU_CFLAGS-${GNU_CFLAGS-'@GNU_CFLAGS@'}}
178 GNU_GCJ=${AM_TESTSUITE_GNU_GCJ-${GNU_GCJ-'@GNU_GCJ@'}}
179 GNU_GCJFLAGS=${AM_TESTSUITE_GNU_GCJFLAGS-${GNU_GCJFLAGS-'@GNU_GCJFLAGS@'}}
180
181 # No all versions of Tex support '--version', so we use a configure
182 # check to decide if tex is available.  This decision is embodied in
183 # this variable.
184 TEX=${AM_TESTSUITE_TEX-'@TEX@'}
185
186 # The amount we should wait after modifying files depends on the platform.
187 # For instance, Windows '95, '98 and ME have 2-second granularity
188 # and can be up to 3 seconds in the future w.r.t. the system clock.
189 sleep='sleep @MODIFICATION_DELAY@'
190
191 # An old timestamp that can be given to a file, in "touch -t" format.
192 # The time stamp should be portable to all file systems of interest.
193 # Just for fun, choose the exact time of the announcement of the GNU project
194 # in UTC; see <http://www.gnu.org/gnu/initial-announcement.html>.
195 old_timestamp=198309271735.59
196
197 # Make our wrapper script (or installed scripts, if running under
198 # "installcheck") accessible by default.  And avoid to uselessly
199 # extend $PATH multiple times if this file is sourced multiple times.
200 case $PATH in
201   $am_bindir$PATH_SEPARATOR*) ;;
202   *) PATH=$am_bindir$PATH_SEPARATOR$PATH;;
203 esac
204
205 export PATH