summaryrefslogtreecommitdiff
path: root/tests/rm
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2010-11-14 11:05:05 +0100
committerJim Meyering <meyering@redhat.com>2010-11-17 20:48:57 +0100
commitf38becab02472e6872048a1951b249b2a3c054df (patch)
treee5b531384b55abae8b1829ada892891bfee58fe3 /tests/rm
parent30b74dfff16240ea0e4a4c5b705f1e9631e5d0a7 (diff)
downloadcoreutils-f38becab02472e6872048a1951b249b2a3c054df.tar.xz
tests: convert first batch of tests from test-lib.sh to init.sh
Initially, I did this, git grep -l srcdir/test-lib.sh|xargs perl -p0i -e '~180-byte script' but that line would have been much longer than the maximum permitted by coreutils' commit hook, and wasn't readable besides, so here's a more readable version: lhs=$(printf '%s\\n' \ 'if test "$VERBOSE" = yes; then' \ ' set -x' \ ' touch --version' \ 'fi' \ '' \ '. $srcdir/test-lib.sh' \ | sed 's/\$/\\\$/g;s/touch/(\\w+)/') rhs=$(printf '%s\\n' \ '. "${srcdir=.}/init.sh"; path_prepend_ ../src' \ 'test "$VERBOSE" = yes && FIXME --version' \ | sed 's/\$/\\\$/g;s/FIXME/\$1/') git grep -l srcdir/test-lib.sh|xargs perl -p0i -e "s,$lhs,$rhs,"
Diffstat (limited to 'tests/rm')
-rwxr-xr-xtests/rm/cycle8
-rwxr-xr-xtests/rm/dangling-symlink8
-rwxr-xr-xtests/rm/deep-18
-rwxr-xr-xtests/rm/deep-28
-rwxr-xr-xtests/rm/dir-no-w8
-rwxr-xr-xtests/rm/dir-nonrecur8
-rwxr-xr-xtests/rm/dot-rel8
-rwxr-xr-xtests/rm/empty-inacc8
-rwxr-xr-xtests/rm/ext3-perf8
-rwxr-xr-xtests/rm/f-18
-rwxr-xr-xtests/rm/fail-2eperm8
-rwxr-xr-xtests/rm/fail-eacces8
-rwxr-xr-xtests/rm/hash8
-rwxr-xr-xtests/rm/i-18
-rwxr-xr-xtests/rm/i-never8
-rwxr-xr-xtests/rm/i-no-r8
-rwxr-xr-xtests/rm/ignorable8
-rwxr-xr-xtests/rm/inaccessible8
-rwxr-xr-xtests/rm/interactive-always8
-rwxr-xr-xtests/rm/interactive-once8
-rwxr-xr-xtests/rm/ir-18
-rwxr-xr-xtests/rm/isatty8
-rwxr-xr-xtests/rm/no-give-up8
-rwxr-xr-xtests/rm/one-file-system8
-rwxr-xr-xtests/rm/one-file-system28
-rwxr-xr-xtests/rm/r-18
-rwxr-xr-xtests/rm/r-28
-rwxr-xr-xtests/rm/r-38
-rwxr-xr-xtests/rm/r-48
-rwxr-xr-xtests/rm/read-only8
-rwxr-xr-xtests/rm/readdir-bug8
-rwxr-xr-xtests/rm/rm18
-rwxr-xr-xtests/rm/rm28
-rwxr-xr-xtests/rm/rm38
-rwxr-xr-xtests/rm/rm48
-rwxr-xr-xtests/rm/rm58
-rwxr-xr-xtests/rm/sunos-18
-rwxr-xr-xtests/rm/unread28
-rwxr-xr-xtests/rm/unread38
-rwxr-xr-xtests/rm/v-slash8
40 files changed, 80 insertions, 240 deletions
diff --git a/tests/rm/cycle b/tests/rm/cycle
index e700dbf38..4af7afee3 100755
--- a/tests/rm/cycle
+++ b/tests/rm/cycle
@@ -16,12 +16,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
skip_if_root_
mkdir -p a/b
diff --git a/tests/rm/dangling-symlink b/tests/rm/dangling-symlink
index 270459c5b..b082901a6 100755
--- a/tests/rm/dangling-symlink
+++ b/tests/rm/dangling-symlink
@@ -19,12 +19,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
ln -s no-file dangle
ln -s / symlink
diff --git a/tests/rm/deep-1 b/tests/rm/deep-1
index 861667916..b21e1e603 100755
--- a/tests/rm/deep-1
+++ b/tests/rm/deep-1
@@ -23,12 +23,8 @@
# If this test takes too long on your system, blame the OS.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
umask 022
diff --git a/tests/rm/deep-2 b/tests/rm/deep-2
index cb52b7fed..c90f60730 100755
--- a/tests/rm/deep-2
+++ b/tests/rm/deep-2
@@ -16,12 +16,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
# Root can run this test, but it always succeeds, since for root, all
# files are writable, and write_protected_non_symlink never reaches
diff --git a/tests/rm/dir-no-w b/tests/rm/dir-no-w
index c1b6fc4cb..8dc19d4fa 100755
--- a/tests/rm/dir-no-w
+++ b/tests/rm/dir-no-w
@@ -17,12 +17,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
mkdir --mode=0500 unwritable-dir || framework_failure
diff --git a/tests/rm/dir-nonrecur b/tests/rm/dir-nonrecur
index 7f62bd59c..816b72d18 100755
--- a/tests/rm/dir-nonrecur
+++ b/tests/rm/dir-nonrecur
@@ -17,12 +17,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
mkdir d || framework_failure
diff --git a/tests/rm/dot-rel b/tests/rm/dot-rel
index e88e9238f..81d405a72 100755
--- a/tests/rm/dot-rel
+++ b/tests/rm/dot-rel
@@ -17,12 +17,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
mkdir a b || framework_failure
touch a/f b/f || framework_failure
diff --git a/tests/rm/empty-inacc b/tests/rm/empty-inacc
index 70c974c6b..3aef6abaa 100755
--- a/tests/rm/empty-inacc
+++ b/tests/rm/empty-inacc
@@ -16,12 +16,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
skip_if_root_
mkdir -m0 inacc || framework_failure
diff --git a/tests/rm/ext3-perf b/tests/rm/ext3-perf
index 227d4b997..155de1828 100755
--- a/tests/rm/ext3-perf
+++ b/tests/rm/ext3-perf
@@ -16,12 +16,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
very_expensive_
diff --git a/tests/rm/f-1 b/tests/rm/f-1
index 819dc2f19..6400d5b84 100755
--- a/tests/rm/f-1
+++ b/tests/rm/f-1
@@ -18,12 +18,8 @@
test=f-1
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
mkdir -p d || framework_failure
diff --git a/tests/rm/fail-2eperm b/tests/rm/fail-2eperm
index 04b2ad1e3..0085d1f48 100755
--- a/tests/rm/fail-2eperm
+++ b/tests/rm/fail-2eperm
@@ -17,12 +17,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
require_root_
# The containing directory must be owned by the user who eventually runs rm.
diff --git a/tests/rm/fail-eacces b/tests/rm/fail-eacces
index 5d87211f9..fc20bd69e 100755
--- a/tests/rm/fail-eacces
+++ b/tests/rm/fail-eacces
@@ -19,12 +19,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
skip_if_root_
ok=0
diff --git a/tests/rm/hash b/tests/rm/hash
index 9573f7a3d..8a4d66154 100755
--- a/tests/rm/hash
+++ b/tests/rm/hash
@@ -18,12 +18,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
expensive_
# Create a hierarchy with 3*26 leaf directories, each at depth 153.
diff --git a/tests/rm/i-1 b/tests/rm/i-1
index b73b61725..20e88e875 100755
--- a/tests/rm/i-1
+++ b/tests/rm/i-1
@@ -18,12 +18,8 @@
test=i-1
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
t=t
mkdir -p $t || framework_failure
diff --git a/tests/rm/i-never b/tests/rm/i-never
index fa6d911a3..b00d3ef1b 100755
--- a/tests/rm/i-never
+++ b/tests/rm/i-never
@@ -17,12 +17,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
skip_if_root_
touch f || framework_failure
diff --git a/tests/rm/i-no-r b/tests/rm/i-no-r
index c0548b087..3178a9843 100755
--- a/tests/rm/i-no-r
+++ b/tests/rm/i-no-r
@@ -18,12 +18,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
mkdir dir || framework_failure
echo y > y || framework_failure
diff --git a/tests/rm/ignorable b/tests/rm/ignorable
index f7f66b3ee..9028de8dc 100755
--- a/tests/rm/ignorable
+++ b/tests/rm/ignorable
@@ -16,12 +16,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
skip_if_root_
touch existing-non-dir || framework_failure
diff --git a/tests/rm/inaccessible b/tests/rm/inaccessible
index 722e49cb9..6e09de67a 100755
--- a/tests/rm/inaccessible
+++ b/tests/rm/inaccessible
@@ -17,12 +17,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
# Skip this test if your system has neither the openat-style functions
# nor /proc/self/fd support with which to emulate them.
diff --git a/tests/rm/interactive-always b/tests/rm/interactive-always
index 8444f7d36..9e15e2258 100755
--- a/tests/rm/interactive-always
+++ b/tests/rm/interactive-always
@@ -18,12 +18,8 @@
test=interactive-always
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
touch file1-1 file1-2 file2-1 file2-2 file3-1 file3-2 file4-1 file4-2 \
|| framework_failure
diff --git a/tests/rm/interactive-once b/tests/rm/interactive-once
index bc612b0e7..48086d704 100755
--- a/tests/rm/interactive-once
+++ b/tests/rm/interactive-once
@@ -18,12 +18,8 @@
test=interactive-once
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
mkdir -p dir1-1 dir2-1 dir2-2 || framework_failure
touch file1-1 file2-1 file2-2 file2-3 file3-1 file3-2 file3-3 file3-4 \
diff --git a/tests/rm/ir-1 b/tests/rm/ir-1
index e453def75..b48fa948b 100755
--- a/tests/rm/ir-1
+++ b/tests/rm/ir-1
@@ -18,12 +18,8 @@
test=ir-1
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
t=t
mkdir -p $t $t/a $t/b $t/c || framework_failure
diff --git a/tests/rm/isatty b/tests/rm/isatty
index ac3e1420b..1b18654cb 100755
--- a/tests/rm/isatty
+++ b/tests/rm/isatty
@@ -16,12 +16,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
skip_if_root_
diff --git a/tests/rm/no-give-up b/tests/rm/no-give-up
index 9ee0357fe..e85196ce7 100755
--- a/tests/rm/no-give-up
+++ b/tests/rm/no-give-up
@@ -17,12 +17,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
require_root_
mkdir d || framework_failure
diff --git a/tests/rm/one-file-system b/tests/rm/one-file-system
index cb0b713b4..8abf7dc71 100755
--- a/tests/rm/one-file-system
+++ b/tests/rm/one-file-system
@@ -16,12 +16,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
require_root_
# If used, these must *follow* test-lib.sh.
diff --git a/tests/rm/one-file-system2 b/tests/rm/one-file-system2
index 64725c7be..83a9cecee 100755
--- a/tests/rm/one-file-system2
+++ b/tests/rm/one-file-system2
@@ -16,12 +16,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
mkdir -p a/b
diff --git a/tests/rm/r-1 b/tests/rm/r-1
index c1d2d815e..e07881b0e 100755
--- a/tests/rm/r-1
+++ b/tests/rm/r-1
@@ -19,12 +19,8 @@
test=r-1
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
mkdir a a/a || framework_failure
> b || framework_failure
diff --git a/tests/rm/r-2 b/tests/rm/r-2
index 445c634c7..485620fe4 100755
--- a/tests/rm/r-2
+++ b/tests/rm/r-2
@@ -17,12 +17,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
mkdir t t/a t/a/b || framework_failure
> t/a/f || framework_failure
diff --git a/tests/rm/r-3 b/tests/rm/r-3
index 3d944f6a9..829685055 100755
--- a/tests/rm/r-3
+++ b/tests/rm/r-3
@@ -23,12 +23,8 @@
# And the rm from coreutils-5.0 exposes the same problem when there
# are 338 or more files in a directory on a Darwin-6.5 system
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
mkdir t || framework_failure
cd t || framework_failure
diff --git a/tests/rm/r-4 b/tests/rm/r-4
index 0b6658a4e..c8d3f9bc7 100755
--- a/tests/rm/r-4
+++ b/tests/rm/r-4
@@ -16,12 +16,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
mkdir d || framework_failure
touch d/a || framework_failure
diff --git a/tests/rm/read-only b/tests/rm/read-only
index eb9a0cbd5..c54259469 100755
--- a/tests/rm/read-only
+++ b/tests/rm/read-only
@@ -16,12 +16,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
require_root_
cwd=`pwd`
diff --git a/tests/rm/readdir-bug b/tests/rm/readdir-bug
index c446d752b..be3e546c0 100755
--- a/tests/rm/readdir-bug
+++ b/tests/rm/readdir-bug
@@ -17,12 +17,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
# Create a directory containing many files.
# What counts is a combination of the number of files and
diff --git a/tests/rm/rm1 b/tests/rm/rm1
index 5e54adf34..46ae76971 100755
--- a/tests/rm/rm1
+++ b/tests/rm/rm1
@@ -16,12 +16,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
skip_if_root_
mkdir -p b/a/p b/c b/d || framework_failure
diff --git a/tests/rm/rm2 b/tests/rm/rm2
index 35fd2f9fd..11b153fee 100755
--- a/tests/rm/rm2
+++ b/tests/rm/rm2
@@ -16,12 +16,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
skip_if_root_
mkdir -p a/0 || framework_failure
diff --git a/tests/rm/rm3 b/tests/rm/rm3
index 5b90025b8..b62dec603 100755
--- a/tests/rm/rm3
+++ b/tests/rm/rm3
@@ -16,12 +16,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
skip_if_root_
mkdir -p z || framework_failure
diff --git a/tests/rm/rm4 b/tests/rm/rm4
index 0f73b276d..571fdb019 100755
--- a/tests/rm/rm4
+++ b/tests/rm/rm4
@@ -16,12 +16,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
skip_if_root_
mkdir dir || framework_failure
diff --git a/tests/rm/rm5 b/tests/rm/rm5
index 311b3ee99..1d27f7cda 100755
--- a/tests/rm/rm5
+++ b/tests/rm/rm5
@@ -16,12 +16,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
skip_if_root_
mkdir -p d/e || framework_failure
diff --git a/tests/rm/sunos-1 b/tests/rm/sunos-1
index be988e11f..3057ecbbd 100755
--- a/tests/rm/sunos-1
+++ b/tests/rm/sunos-1
@@ -22,12 +22,8 @@
# actually remove files with names of entries in the current directory
# but relative to `/' rather than relative to the current directory.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
rm -r '' > /dev/null 2>&1 && fail=1
diff --git a/tests/rm/unread2 b/tests/rm/unread2
index 5da31756a..69c27474e 100755
--- a/tests/rm/unread2
+++ b/tests/rm/unread2
@@ -16,12 +16,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
skip_if_root_
mkdir -p a/b || framework_failure
diff --git a/tests/rm/unread3 b/tests/rm/unread3
index 4627c125f..a2782bbba 100755
--- a/tests/rm/unread3
+++ b/tests/rm/unread3
@@ -16,12 +16,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
skip_if_root_
mkdir -p a/1 b c d/2 e/3 || framework_failure
diff --git a/tests/rm/v-slash b/tests/rm/v-slash
index e53d9d934..a9ab828bc 100755
--- a/tests/rm/v-slash
+++ b/tests/rm/v-slash
@@ -16,12 +16,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- rm --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && rm --version
mkdir a || framework_failure
touch a/x || framework_failure