summaryrefslogtreecommitdiff
path: root/tests/chmod/usage
diff options
context:
space:
mode:
Diffstat (limited to 'tests/chmod/usage')
-rwxr-xr-xtests/chmod/usage28
1 files changed, 5 insertions, 23 deletions
diff --git a/tests/chmod/usage b/tests/chmod/usage
index 98944f54d..8e45edc69 100755
--- a/tests/chmod/usage
+++ b/tests/chmod/usage
@@ -1,7 +1,7 @@
#!/bin/sh
# Verify that chmod works correctly with odd option combinations.
-# Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2004-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
@@ -22,20 +22,7 @@ if test "$VERBOSE" = yes; then
fi
. $srcdir/../lang-default
-
-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 '(exit $?); exit $?' 1 2 13 15
-
-framework_failure=0
-mkdir -p $tmp || framework_failure=1
-cd $tmp || framework_failure=1
-
-if test $framework_failure = 1; then
- echo "$0: failure in testing framework" 1>&2
- (exit 1); exit 1
-fi
+. $srcdir/../test-lib.sh
fail=0
@@ -85,26 +72,21 @@ for case in $cases; do
case $files in
'')
- touch -- $all_files || framework_failure=1
+ touch -- $all_files || framework_failure
chmod $args 2>/dev/null && fail=1
;;
?*)
- touch -- $files || framework_failure=1
+ touch -- $files || framework_failure
chmod $args || fail=1
for file in $files; do
# Test for misparsing args by creating all $files but $file.
# chmod has a bug if it succeeds even though $file is absent.
rm -f -- $all_files && touch -- $files && rm -- $file \
- || framework_failure=1
+ || framework_failure
chmod $args 2>/dev/null && fail=1
done
;;
esac
done
-if test $framework_failure = 1; then
- echo "$0: failure in testing framework" 1>&2
- fail=1
-fi
-
(exit $fail); exit $fail