3 # Copyright (C) 2011-2012 Free Software Foundation, Inc.
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)
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.
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/>.
18 # Helper functions used by "plain" tests of the Automake testsuite
19 # (i.e., tests that don't use any test protocol).
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.
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; }
37 # For compatibility with TAP functions.
38 skip_all_ () { skip_ "$@"; }