diff options
Diffstat (limited to 'tests/readlink/rl-1')
-rwxr-xr-x | tests/readlink/rl-1 | 55 |
1 files changed, 17 insertions, 38 deletions
diff --git a/tests/readlink/rl-1 b/tests/readlink/rl-1 index 056b8aed3..0b1b21819 100755 --- a/tests/readlink/rl-1 +++ b/tests/readlink/rl-1 @@ -1,7 +1,7 @@ #!/bin/sh # test for readlink mode. -# Copyright (C) 2004, 2006 Free Software Foundation, Inc. +# Copyright (C) 2004, 2006, 2007 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,49 +21,28 @@ if test "$VERBOSE" = yes; then readlink --version fi -pwd=`pwd` -t0=`echo "$0" |sed 's,.*/,,'`.tmp; tmp=$t0/$$ -trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0 -trap 'status=$?; (exit $status); exit $status' 1 2 13 15 +. $srcdir/../test-lib.sh -fail=1 -while :; do - mkdir -p $tmp || break - cd $tmp || break +mkdir subdir || framework_failure +touch regfile || framework_failure +ln -s regfile link1 || framework_failure +ln -s missing link2 || framework_failure - mkdir subdir || break - touch regfile || break - ln -s regfile link1 || break - ln -s missing link2 || break +fail=0 - fail=0 - break -done +v=`readlink link1` || fail=1 +test "$v" = regfile || fail=1 -if test $fail = 1; then - echo "$0: failure in testing framework" 1>&2 - (exit 1); exit 1 -fi - -fail=1 -while :; do - v=`readlink link1` || break - test "$v" = regfile || break - - v=`readlink link2` || break - test "$v" = missing || break - - v=`readlink subdir` && break - test -z "$v" || break +v=`readlink link2` || fail=1 +test "$v" = missing || fail=1 - v=`readlink regfile` && break - test -z "$v" || break +v=`readlink subdir` && fail=1 +test -z "$v" || fail=1 - v=`readlink missing` && break - test -z "$v" || break +v=`readlink regfile` && fail=1 +test -z "$v" || fail=1 - fail=0 - break -done +v=`readlink missing` && fail=1 +test -z "$v" || fail=1 (exit $fail); exit $fail |