Merge branch 'micro' into maint
[platform/upstream/automake.git] / t / ax / test-defs.in
1 # -*- shell-script -*-
2 # @configure_input@
3 #
4 # Copyright (C) 1996-2013 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 # See whether the current test script is expected to use TAP or not.
26 # Use a sensible default, while allowing the scripts to override this
27 # check.
28 if test -z "$am_test_protocol"; then
29   case $argv0 in
30     *.tap) am_test_protocol=tap;;
31         *) am_test_protocol=none;;
32   esac
33 fi
34
35 am_rel_srcdir='@srcdir@'
36 am_top_srcdir='@abs_srcdir@'
37 am_top_builddir='@abs_builddir@'
38
39 # Where testsuite-related helper scripts, data files and shell libraries
40 # are placed.
41 am_testaux_srcdir=$am_top_srcdir/t/ax
42 am_testaux_builddir=$am_top_builddir/t/ax
43
44 # Support for the "installcheck" target.
45 case ${am_running_installcheck:=no} in
46   yes)
47     am_amdir='@amdir@'
48     am_automake_acdir='@automake_acdir@'
49     am_bindir='@bindir@'
50     am_datadir='@datadir@'
51     am_docdir='@docdir@'
52     am_pkgvdatadir='@pkgvdatadir@'
53     am_scriptdir='@scriptdir@'
54     am_system_acdir='@system_acdir@'
55     ;;
56   no)
57     am_amdir=$am_top_srcdir/lib/am
58     am_automake_acdir=$am_top_srcdir/m4
59     am_bindir=$am_top_builddir/t/wrap
60     am_datadir=$am_top_srcdir
61     am_docdir=$am_top_srcdir/doc
62     am_pkgvdatadir=$am_top_srcdir/lib
63     am_scriptdir=$am_top_srcdir/lib
64     am_system_acdir=$am_top_srcdir/m4/acdir
65     ;;
66   *)
67     echo "$me: variable 'am_running_installcheck' has invalid"
68          "value '$am_running_installcheck'" >&2
69     exit 99
70     ;;
71 esac
72
73 APIVERSION='@APIVERSION@'
74 PATH_SEPARATOR='@PATH_SEPARATOR@'
75
76 host_alias=${host_alias-'@host_alias@'}; export host_alias
77 build_alias=${build_alias-'@build_alias@'}; export build_alias
78
79 # Whether the testsuite is being run by faking the presence of a C
80 # compiler that doesn't grasp the '-c' and '-o' flags together.  By
81 # default, of course, it isn't.
82 : "${AM_TESTSUITE_SIMULATING_NO_CC_C_O:=no}"
83
84 # A concurrency-safe "mkdir -p" implementation.
85 MKDIR_P=${AM_TESTSUITE_MKDIR_P-'@MKDIR_P@'}
86
87 # The shell we use to run our own test scripts, determined at configure
88 # time.  It is required in the self tests, and most importantly for the
89 # automatic re-execution of test scripts.
90 AM_TEST_RUNNER_SHELL=${AM_TEST_RUNNER_SHELL-'@AM_TEST_RUNNER_SHELL@'}
91
92 # Make sure we override the user shell.  And do not read the value of
93 # $SHELL from the environment (think to the non-uncommon situation where
94 # e.g., $SHELL=/bin/tcsh).
95 SHELL=${AM_TESTSUITE_SHELL-'@SHELL@'}; export SHELL
96
97 # User can override various tools used.  Prefer overriding specific for
98 # that automake testsuite, if they are available.
99 AWK=${AM_TESTSUITE_AWK-${AWK-'@AWK@'}}
100 PERL=${AM_TESTSUITE_PERL-${PERL-'@PERL@'}}
101 MAKE=${AM_TESTSUITE_MAKE-${MAKE-'make'}}
102 YACC=${AM_TESTSUITE_YACC-${YACC-'@YACC@'}}
103 LEX=${AM_TESTSUITE_LEX-${LEX-'@LEX@'}}
104 AUTOCONF=${AM_TESTSUITE_AUTOCONF-${AUTOCONF-'@am_AUTOCONF@'}}
105 AUTOM4TE=${AM_TESTSUITE_AUTOM4TE-${AUTOM4TE-'@am_AUTOM4TE@'}}
106 AUTORECONF=${AM_TESTSUITE_AUTORECONF-${AUTORECONF-'@am_AUTORECONF@'}}
107 AUTOHEADER=${AM_TESTSUITE_AUTOHEADER-${AUTOHEADER-'@am_AUTOHEADER@'}}
108 AUTOUPDATE=${AM_TESTSUITE_AUTOUPDATE-${AUTOUPDATE-'@am_AUTOUPDATE@'}}
109
110 # Tests which want complete control over aclocal or automake command-line
111 # options should use $am_original_ACLOCAL or $am_original_AUTOMAKE.  The
112 # "test -z" tests take care not to re-initialize them if 'test-defs.sh'
113 # is re-sourced, as we want that file to remain really idempotent.
114 if test -z "$am_original_AUTOMAKE"; then
115   am_original_AUTOMAKE=${AM_TESTSUITE_AUTOMAKE-${AUTOMAKE-"automake-$APIVERSION"}}
116 fi
117 if test -z "$am_original_ACLOCAL"; then
118   am_original_ACLOCAL=${AM_TESTSUITE_ACLOCAL-${ACLOCAL-"aclocal-$APIVERSION"}}
119 fi
120
121 # Use -Werror by default.  Tests for which this is inappropriate should
122 # use -Wno-error.
123 # Tests which want complete control over aclocal command-line options
124 # should use $am_original_ACLOCAL instead.
125 ACLOCAL="$am_original_ACLOCAL -Werror"
126
127 # See how Automake should be run.  We put --foreign as the default
128 # strictness to avoid having to create lots and lots of files.  A test
129 # can override this by specifying a different strictness.  Use -Wall
130 # -Werror by default.  Tests for which this is inappropriate (e.g. when
131 # testing that a warning is enabled by a specific switch) should use
132 # -Wnone or/and -Wno-error.
133 # Tests who want complete control over automake command-line options
134 # should use $am_original_AUTOMAKE instead.
135 AUTOMAKE="$am_original_AUTOMAKE --foreign -Werror -Wall"
136
137 # POSIX no longer requires 'egrep' and 'fgrep',
138 # but some hosts lack 'grep -E' and 'grep -F'.
139 EGREP=${AM_TESTSUITE_EGREP-'@EGREP@'}
140 FGREP=${AM_TESTSUITE_FGREP-'@FGREP@'}
141
142 # Compilers and their flags.  These can point to non-GNU compilers (and
143 # on non-Linux and non-BSD systems, they probably will).
144 if test $AM_TESTSUITE_SIMULATING_NO_CC_C_O = no; then
145   CC=${AM_TESTSUITE_CC-${CC-'@CC@'}}
146 else
147   CC=$am_testaux_builddir/cc-no-c-o
148 fi
149 CXX=${AM_TESTSUITE_CXX-${CXX-'@CXX@'}}
150 F77=${AM_TESTSUITE_F77-${F77-'@F77@'}}
151 FC=${AM_TESTSUITE_FC-${FC-'@FC@'}}
152 CFLAGS=${AM_TESTSUITE_CFLAGS-${CFLAGS-'@CFLAGS@'}}
153 CXXFLAGS=${AM_TESTSUITE_CXXFLAGS-${CXXFLAGS-'@CXXFLAGS@'}}
154 FCFLAGS=${AM_TESTSUITE_FCFLAGS-${FCFLAGS-'@FCFLAGS@'}}
155 FFLAGS=${AM_TESTSUITE_FFLAGS-${FFLAGS-'@FFLAGS@'}}
156 CPPFLAGS=${AM_TESTSUITE_CPPFLAGS-${CPPFLAGS-'@CPPFLAGS@'}}
157
158 # GNU compilers and their flags.
159 if test $AM_TESTSUITE_SIMULATING_NO_CC_C_O = no; then
160   GNU_CC=${AM_TESTSUITE_GNU_CC-${GNU_CC-'@GNU_CC@'}}
161 else
162   GNU_CC=$am_testaux_builddir/cc-no-c-o
163 fi
164 GNU_CC=${AM_TESTSUITE_GNU_CC-${GNU_CC-'@GNU_CC@'}}
165 GNU_CXX=${AM_TESTSUITE_GNU_CXX-${GNU_CXX-'@GNU_CXX@'}}
166 GNU_F77=${AM_TESTSUITE_GNU_F77-${GNU_F77-'@GNU_F77@'}}
167 GNU_FC=${AM_TESTSUITE_GNU_FC-${GNU_FC-'@GNU_FC@'}}
168 GNU_FFLAGS=${AM_TESTSUITE_GNU_FFLAGS-${GNU_FFLAGS-'@GNU_FFLAGS@'}}
169 GNU_FCFLAGS=${AM_TESTSUITE_GNU_FCFLAGS-${GNU_FCFLAGS-'@GNU_FCFLAGS@'}}
170 GNU_CXXFLAGS=${AM_TESTSUITE_GNU_CXXFLAGS-${GNU_CXXFLAGS-'@GNU_CXXFLAGS@'}}
171 GNU_CFLAGS=${AM_TESTSUITE_GNU_CFLAGS-${GNU_CFLAGS-'@GNU_CFLAGS@'}}
172 GNU_GCJ=${AM_TESTSUITE_GNU_GCJ-${GNU_GCJ-'@GNU_GCJ@'}}
173 GNU_GCJFLAGS=${AM_TESTSUITE_GNU_GCJFLAGS-${GNU_GCJFLAGS-'@GNU_GCJFLAGS@'}}
174
175 # No all versions of Tex support '--version', so we use a configure
176 # check to decide if tex is available.  This decision is embodied in
177 # this variable.
178 TEX=${AM_TESTSUITE_TEX-'@TEX@'}
179
180 # The amount we should wait after modifying files depends on the platform.
181 # For instance, Windows '95, '98 and ME have 2-second granularity
182 # and can be up to 3 seconds in the future w.r.t. the system clock.
183 # The creative quoting is to avoid spuriously triggering a failure in
184 # the maintainer checks,
185 sleep='sleep ''@MODIFICATION_DELAY@'
186
187 # An old timestamp that can be given to a file, in "touch -t" format.
188 # The time stamp should be portable to all file systems of interest.
189 # Just for fun, choose the exact time of the announcement of the GNU project
190 # in UTC; see <http://www.gnu.org/gnu/initial-announcement.html>.
191 old_timestamp=198309271735.59
192
193 # Make our wrapper script (or installed scripts, if running under
194 # "installcheck") accessible by default.  And avoid to uselessly
195 # extend $PATH multiple times if this file is sourced multiple times.
196 case $PATH in
197   $am_bindir$PATH_SEPARATOR*) ;;
198   *) PATH=$am_bindir$PATH_SEPARATOR$PATH;;
199 esac
200
201 export PATH