From a669dfdabb3fa1be2e1367d53a797d495e7bd5c9 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 12 Sep 2007 14:52:26 +0200 Subject: More misc, test-related changes. (some to allow running tests as root) --- tests/rmdir/ignore | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'tests/rmdir/ignore') 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 -- cgit v1.2.3-54-g00ecf