summaryrefslogtreecommitdiff
path: root/tests/rm/r-3
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2007-09-12 14:52:26 +0200
committerJim Meyering <jim@meyering.net>2007-09-15 08:40:39 +0200
commita669dfdabb3fa1be2e1367d53a797d495e7bd5c9 (patch)
treec88d6414649f7f4f5571138e193c72da44a03876 /tests/rm/r-3
parent0539705768992ebcc290bc859f64e27898c7f958 (diff)
downloadcoreutils-a669dfdabb3fa1be2e1367d53a797d495e7bd5c9.tar.xz
More misc, test-related changes. (some to allow running tests as root)
Diffstat (limited to 'tests/rm/r-3')
-rwxr-xr-xtests/rm/r-332
1 files changed, 11 insertions, 21 deletions
diff --git a/tests/rm/r-3 b/tests/rm/r-3
index feca33a5c..485832d0b 100755
--- a/tests/rm/r-3
+++ b/tests/rm/r-3
@@ -1,8 +1,7 @@
#!/bin/sh
# Create and remove a directory with more than 254 files.
-# Copyright (C) 1997, 2001, 2002, 2003, 2004, 2006 Free Software Foundation,
-# Inc.
+# Copyright (C) 1997, 2001-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
@@ -25,18 +24,14 @@
# are 338 or more files in a directory on a Darwin-6.5 system
if test "$VERBOSE" = yes; then
- rm --version
set -x
+ rm --version
fi
-pwd=`pwd`
-t0=`echo "$0"|sed 's,.*/,,'`.tmp;tmp=$t0/$$
-trap 'status=$?; cd "$pwd" && rm -rf $t0 && exit $status' 0
-trap '(exit $?); exit' 1 2 13 15
+. $srcdir/../test-lib.sh
-framework_fail=0
-mkdir -p $tmp || framework_fail=1
-cd $tmp || framework_fail=1
+mkdir t || framework_failure
+cd t || framework_failure
# Create 500 files (20 * 25).
for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j; do
@@ -44,20 +39,15 @@ for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j; do
for j in a b c d e f g h i j k l m n o p q r s t u v w x y; do
files="$files $i$j"
done
- touch $files || framework_fail=1
+ touch $files || framework_failure
done
-test -f 0a || framework_fail=1
-test -f by || framework_fail=1
-cd "$pwd" || framework_fail=1
-
-if test $framework_fail = 1; then
- echo 'failure in testing framework'
- (exit 1); exit 1
-fi
+test -f 0a || framework_failure
+test -f by || framework_failure
+cd .. || framework_failure
fail=0
-rm -rf $tmp || fail=1
-test -d $tmp && fail=1
+rm -rf t || fail=1
+test -d t && fail=1
(exit $fail); exit $fail