diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2011-08-04 10:48:38 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2011-08-04 18:07:52 +0200 |
commit | bbcf3abc2c76456dac47743f8a228d403f4dc9ea (patch) | |
tree | 8f224e9560cf13dac7ab16228096f8699b34dbec /tests/shell-or-perl | |
parent | 7eaff0fea3583d0ae7f8a6f6ccaf1c44f3ed4d3e (diff) | |
download | coreutils-bbcf3abc2c76456dac47743f8a228d403f4dc9ea.tar.xz |
tests: remove obsolete 'error_' shell function
* tests/init.cfg (framework_failure, getlimits_): Use 'fatal_'
instead of 'error_'.
(error_): Delete, it's not used anymore (and one is anyway
advised to use 'fatal_' instead).
Update heading comments.
* tests/shell-or-perl (error_): Renamed ...
(fatal_): ... to this, for consistency. Also, add a useful
comment.
Diffstat (limited to 'tests/shell-or-perl')
-rw-r--r-- | tests/shell-or-perl | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/tests/shell-or-perl b/tests/shell-or-perl index accb37a85..489c11219 100644 --- a/tests/shell-or-perl +++ b/tests/shell-or-perl @@ -28,9 +28,11 @@ set -u 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 } @@ -47,7 +49,7 @@ EOH # ---------------- # 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' @@ -64,7 +66,7 @@ while test $# -gt 0; do --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" @@ -74,7 +76,7 @@ done unset assign_optarg_to_var var case $# in - 0) error_ "missing argument";; + 0) fatal_ "missing argument";; *) test_script=$1; shift;; esac @@ -85,10 +87,10 @@ test -z "$test_name" && test_name=$test_script # --------------------- # 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'*) @@ -116,4 +118,4 @@ esac # Not reached # # ------------- # -error_ "dead code reached" +fatal_ "dead code reached" |