summaryrefslogtreecommitdiff
path: root/tests/rmdir/ignore
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/rmdir/ignore
parent0539705768992ebcc290bc859f64e27898c7f958 (diff)
downloadcoreutils-a669dfdabb3fa1be2e1367d53a797d495e7bd5c9.tar.xz
More misc, test-related changes. (some to allow running tests as root)
Diffstat (limited to 'tests/rmdir/ignore')
-rwxr-xr-xtests/rmdir/ignore26
1 files changed, 10 insertions, 16 deletions
diff --git a/tests/rmdir/ignore b/tests/rmdir/ignore
index 5b6a6bc3e..5acc786cb 100755
--- a/tests/rmdir/ignore
+++ b/tests/rmdir/ignore
@@ -1,7 +1,7 @@
#!/bin/sh
# make sure rmdir's --ignore-fail-on-non-empty option works
-# Copyright (C) 1999 Free Software Foundation, Inc.
+# Copyright (C) 1999, 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,23 +21,17 @@ if test "$VERBOSE" = yes; then
rmdir --version
fi
-tmp=rmdir.$$
-trap "rm -rf $tmp" 0 1 2 3 15
+. $srcdir/../test-lib.sh
-test_failure=0
-mkdir -p $tmp/a/b $tmp/x || test_failure=1
-
-if test $test_failure = 1; then
- echo "$0: failure in testing framework" 1>&2
- exit 1
-fi
+cwd=`pwd`
+mkdir -p $cwd/a/b $cwd/x || framework_failure
fail=0
-rmdir -p --ignore-fail-on-non-empty $tmp/a/b || fail=1
-# $tmp/x should remain
-test -d $tmp/x || fail=1
-# $tmp/{a,b} should be gone
-test -d $tmp/a && fail=1
-test -d $tmp/a/b && fail=1
+rmdir -p --ignore-fail-on-non-empty $cwd/a/b || fail=1
+# $cwd/x should remain
+test -d $cwd/x || fail=1
+# $cwd/{a,b} should be gone
+test -d $cwd/a && fail=1
+test -d $cwd/a/b && fail=1
exit $fail