# TESTS_ENVIRONMENT definition.
stderr_fileno_=9
-# FIXME: eventually s/error_/fail_/ and remove the definition of error_ below.
-# FIXME: s/(framework_failure)\>/${1}_/ and remove def. of framework_failure
+# FIXME: eventually, FIXME: s/(framework_failure)\>/${1}_/ and remove the
+# FIXME: definition of framework_failure below
# Having an unsearchable directory in PATH causes execve to fail with EACCES
# when applied to an unresolvable program name, contrary to the desired ENOENT.
getlimits_()
{
eval $(getlimits)
- test "$INT_MAX" ||
- error_ "Error running getlimits"
+ test "$INT_MAX" || fatal_ "running getlimits"
}
require_acl_()
}
skip_if_root_() { uid_is_privileged_ && skip_ "must be run as non-root"; }
-error_() { echo "$0: $@" 1>&2; Exit 1; }
-framework_failure() { error_ 'failure in testing framework'; }
+framework_failure() { fatal_ 'failure in testing framework'; }
# Set `groups' to a space-separated list of at least two groups
# of which the user is a member.
me=shell-or-perl
-error_ ()
+fatal_ ()
{
echo "$me: $*" >&2
+ # Exit with status `99' to inform the testsuite harness that an
+ # hard error occurred.
exit 99
}
# ---------------- #
assign_optarg_to_var='
- test $# -gt 1 || error_ "option '\''$1'\'' requires an argument"
+ test $# -gt 1 || fatal_ "option '\''$1'\'' requires an argument"
eval "$var=\$2"
shift'
--srcdir) var=srcdir;;
--test-name) var=test_name;;
--) shift; break;;
- -*) error_ "unknown option '$1'";;
+ -*) fatal_ "unknown option '$1'";;
*) break;;
esac
test -z "$var" || eval "$assign_optarg_to_var"
unset assign_optarg_to_var var
case $# in
- 0) error_ "missing argument";;
+ 0) fatal_ "missing argument";;
*) test_script=$1; shift;;
esac
# --------------------- #
test -f "$test_script" && test -r "$test_script" \
- || error_ "test script '$test_script' does not exist, or isn't readable"
+ || fatal_ "test script '$test_script' does not exist, or isn't readable"
read shebang_line < "$test_script" \
- || error_ "cannot read from the test script '$test_script'"
+ || fatal_ "cannot read from the test script '$test_script'"
case $shebang_line in
'#!/usr/bin/perl'*)
# Not reached #
# ------------- #
-error_ "dead code reached"
+fatal_ "dead code reached"