3 # Copyright (C) 2011 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 # stderr_fileno_=9; export stderr_fileno_; exec 9>&2;
24 # in the definition of AM_TESTS_ENVIRONMENT.
25 # This is useful when using automake's parallel tests mode, to print the
26 # reason for skip/failure to console, rather than to the *.log files.
29 # Copied from Gnulib's `tests/init.sh'.
30 warn_ () { echo "$@" 1>&$stderr_fileno_; }
31 fail_ () { warn_ "$me: failed test: $@"; Exit 1; }
32 skip_ () { warn_ "$me: skipped test: $@"; Exit 77; }
33 fatal_ () { warn_ "$me: hard error: $@"; Exit 99; }
34 framework_failure_ () { warn_ "$me: set-up failure: $@"; Exit 99; }
36 # For compatibility with TAP functions.
37 skip_all_ () { skip "$@"; }