e6483dc0f4fb5e38c7e8ebb37ee5d3016f071ea5
[platform/upstream/automake.git] / t / ax / plain-functions.sh
1 # -*- shell-script -*-
2 #
3 # Copyright (C) 2011-2012 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
8 # any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
18 # Helper functions used by "plain" tests of the Automake testsuite
19 # (i.e., tests that don't use any test protocol).
20
21 # Print warnings (e.g., about skipped and failed tests) to this file
22 # number.  Override by putting, say:
23 #   AM_TESTS_ENVIRONMENT = stderr_fileno_=9; export stderr_fileno_;
24 #   AM_TESTS_FD_REDIRECT = 9>&2
25 # in your Makefile.am.
26 # This is useful when using automake's parallel tests mode, to print the
27 # reason for skip/failure to console, rather than to the *.log files.
28 : ${stderr_fileno_=2}
29
30 # Copied from Gnulib's 'tests/init.sh'.
31 warn_ () { echo "$@" 1>&$stderr_fileno_; }
32 fail_ () { warn_ "$me: failed test: $@"; Exit 1; }
33 skip_ () { warn_ "$me: skipped test: $@"; Exit 77; }
34 fatal_ () { warn_ "$me: hard error: $@"; Exit 99; }
35 framework_failure_ () { warn_ "$me: set-up failure: $@"; Exit 99; }
36
37 # For compatibility with TAP functions.
38 skip_all_ () { skip_ "$@"; }
39
40 :