From fbcc100f5bc4e5d57370544093fc9edfbde411d3 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 14 Nov 2010 12:07:57 +0100 Subject: [PATCH] tests: convert remaining uses of test-lib.sh to init.sh RHS='. "\${srcdir=.}/init.sh"; path_prepend_ ../src' git grep -l test-lib.sh \ | xargs perl -pi -e 's,^\. \$srcdir/test-lib\.sh$,'"$RHS", --- tests/chmod/silent | 2 +- tests/cp/acl | 2 +- tests/cp/cp-mv-backup | 2 +- tests/cp/cp-mv-enotsup-xattr | 2 +- tests/cp/perm | 2 +- tests/cp/preserve-gid | 2 +- tests/ln/sf-1 | 2 +- tests/ls/nameless-uid | 2 +- tests/ls/rt-1 | 2 +- tests/misc/arch | 2 +- tests/misc/env-null | 2 +- tests/misc/md5sum-parallel | 2 +- tests/misc/printenv | 2 +- tests/misc/printf | 2 +- tests/misc/printf-hex | 2 +- tests/misc/printf-surprise | 2 +- tests/misc/pwd-long | 2 +- tests/misc/pwd-option | 2 +- tests/misc/pwd-unreadable-parent | 2 +- tests/misc/selinux | 2 +- tests/misc/stdbuf | 2 +- tests/misc/stty | 2 +- tests/misc/stty-row-col | 2 +- tests/misc/su-fail | 2 +- tests/misc/sum-sysv | 2 +- tests/misc/truncate-owned-by-other | 2 +- tests/misc/wc-parallel | 2 +- tests/misc/xattr | 2 +- tests/mkdir/selinux | 2 +- tests/mv/acl | 2 +- tests/mv/childproof | 2 +- tests/mv/diag | 2 +- tests/mv/dup-source | 2 +- tests/mv/hard-2 | 2 +- tests/mv/i-2 | 2 +- tests/mv/part-symlink | 2 +- tests/mv/update | 2 +- 37 files changed, 37 insertions(+), 37 deletions(-) diff --git a/tests/chmod/silent b/tests/chmod/silent index 2cfbcbbd75..20c232b94a 100755 --- a/tests/chmod/silent +++ b/tests/chmod/silent @@ -16,7 +16,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && { chgrp --version; chmod --version; chown --version; } chmod -f 0 no-such 2> out && fail=1 diff --git a/tests/cp/acl b/tests/cp/acl index 3e93645abd..a3b909ae44 100755 --- a/tests/cp/acl +++ b/tests/cp/acl @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && { mv --version; getfacl --version; setfacl --version; } require_acl_ diff --git a/tests/cp/cp-mv-backup b/tests/cp/cp-mv-backup index c978ba253b..ad7bfa5114 100755 --- a/tests/cp/cp-mv-backup +++ b/tests/cp/cp-mv-backup @@ -16,7 +16,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && cp --version umask 022 diff --git a/tests/cp/cp-mv-enotsup-xattr b/tests/cp/cp-mv-enotsup-xattr index bd0ef0ed89..bcee4214f9 100755 --- a/tests/cp/cp-mv-enotsup-xattr +++ b/tests/cp/cp-mv-enotsup-xattr @@ -18,7 +18,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && { cp --version; mv --version; } require_root_ diff --git a/tests/cp/perm b/tests/cp/perm index 346b24536d..cb4709f505 100755 --- a/tests/cp/perm +++ b/tests/cp/perm @@ -16,7 +16,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && { cp --version; mv --version; } very_expensive_ diff --git a/tests/cp/preserve-gid b/tests/cp/preserve-gid index a5190e4e70..6fa5293c7c 100755 --- a/tests/cp/preserve-gid +++ b/tests/cp/preserve-gid @@ -16,7 +16,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && cp --version require_root_ diff --git a/tests/ln/sf-1 b/tests/ln/sf-1 index fdfc3f7111..189abe5b82 100755 --- a/tests/ln/sf-1 +++ b/tests/ln/sf-1 @@ -16,7 +16,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && ln --version echo foo > a || framework_failure diff --git a/tests/ls/nameless-uid b/tests/ls/nameless-uid index bf2dfcd529..6b4f368d23 100755 --- a/tests/ls/nameless-uid +++ b/tests/ls/nameless-uid @@ -19,7 +19,7 @@ : ${srcdir=.} . $srcdir/require-perl -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && ls --version require_root_ diff --git a/tests/ls/rt-1 b/tests/ls/rt-1 index 51d023642b..909deb161a 100755 --- a/tests/ls/rt-1 +++ b/tests/ls/rt-1 @@ -16,7 +16,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && { ls --version; touch --version; } date=1998-01-15 diff --git a/tests/misc/arch b/tests/misc/arch index a4475e6d05..462919f57e 100755 --- a/tests/misc/arch +++ b/tests/misc/arch @@ -16,7 +16,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && arch --version require_built_ arch diff --git a/tests/misc/env-null b/tests/misc/env-null index ed2e21d582..c08856c01e 100755 --- a/tests/misc/env-null +++ b/tests/misc/env-null @@ -16,7 +16,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && { env --version; env -- printenv --version; } # POSIX is clear that environ may, but need not be, sorted. diff --git a/tests/misc/md5sum-parallel b/tests/misc/md5sum-parallel index 6f38b8b1bf..fdbc4c2025 100755 --- a/tests/misc/md5sum-parallel +++ b/tests/misc/md5sum-parallel @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && md5sum --version (mkdir tmp && cd tmp && seq 500 | xargs touch) diff --git a/tests/misc/printenv b/tests/misc/printenv index dd82c05096..67173ed58e 100755 --- a/tests/misc/printenv +++ b/tests/misc/printenv @@ -16,7 +16,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && env -- printenv --version # Without arguments, printenv behaves like env. Some shells provide diff --git a/tests/misc/printf b/tests/misc/printf index cf376f3bac..b0fe19cdb3 100755 --- a/tests/misc/printf +++ b/tests/misc/printf @@ -18,7 +18,7 @@ prog="$abs_top_builddir/src/printf" -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && env -- printf --version getlimits_ diff --git a/tests/misc/printf-hex b/tests/misc/printf-hex index 39b70d6efc..864dc0bb2d 100755 --- a/tests/misc/printf-hex +++ b/tests/misc/printf-hex @@ -16,7 +16,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && env -- printf --version env printf '\x7e3\n' > out || fail=1 diff --git a/tests/misc/printf-surprise b/tests/misc/printf-surprise index 702ab67a38..53f46b58fb 100755 --- a/tests/misc/printf-surprise +++ b/tests/misc/printf-surprise @@ -18,7 +18,7 @@ prog=printf -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && env -- printf --version require_ulimit_ diff --git a/tests/misc/pwd-long b/tests/misc/pwd-long index c58207abe5..b3d14c6ca7 100755 --- a/tests/misc/pwd-long +++ b/tests/misc/pwd-long @@ -20,7 +20,7 @@ : ${srcdir=.} . $srcdir/require-perl -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && env -- pwd --version require_readable_root_ diff --git a/tests/misc/pwd-option b/tests/misc/pwd-option index e4ecf11f96..e01026674c 100755 --- a/tests/misc/pwd-option +++ b/tests/misc/pwd-option @@ -16,7 +16,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && env -- pwd --version mkdir -p a/b || framework_failure diff --git a/tests/misc/pwd-unreadable-parent b/tests/misc/pwd-unreadable-parent index 1f3d914eb0..b24a97c89c 100755 --- a/tests/misc/pwd-unreadable-parent +++ b/tests/misc/pwd-unreadable-parent @@ -18,7 +18,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && { env -- pwd --version; readlink --version; } test $host_os != linux-gnu && diff --git a/tests/misc/selinux b/tests/misc/selinux index 0a8259fef3..0d798c1d23 100755 --- a/tests/misc/selinux +++ b/tests/misc/selinux @@ -16,7 +16,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && for i in chcon cp ls mv stat; do $i --version; done require_root_ diff --git a/tests/misc/stdbuf b/tests/misc/stdbuf index 8302c4896f..4a694c7cde 100755 --- a/tests/misc/stdbuf +++ b/tests/misc/stdbuf @@ -16,7 +16,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && { stdbuf --version; mv --version; } getlimits_ diff --git a/tests/misc/stty b/tests/misc/stty index 0659d51a5e..cc1d933a30 100755 --- a/tests/misc/stty +++ b/tests/misc/stty @@ -17,7 +17,7 @@ # along with this program. If not, see . # Make sure there's a tty on stdin. -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && stty --version require_controlling_input_terminal_ diff --git a/tests/misc/stty-row-col b/tests/misc/stty-row-col index 5acb3d0bbc..ed7fede977 100755 --- a/tests/misc/stty-row-col +++ b/tests/misc/stty-row-col @@ -28,7 +28,7 @@ export COLUMNS LC_ALL=C export LC_ALL -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && stty --version require_controlling_input_terminal_ diff --git a/tests/misc/su-fail b/tests/misc/su-fail index 4c57c945b5..e8a0c5ff53 100755 --- a/tests/misc/su-fail +++ b/tests/misc/su-fail @@ -16,7 +16,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && su --version require_built_ su diff --git a/tests/misc/sum-sysv b/tests/misc/sum-sysv index 705de2766e..5465f213a2 100755 --- a/tests/misc/sum-sysv +++ b/tests/misc/sum-sysv @@ -25,7 +25,7 @@ LC_ALL=C export LC_ALL -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && sum --version # FYI, 16843009 is floor (2^32 / 255). diff --git a/tests/misc/truncate-owned-by-other b/tests/misc/truncate-owned-by-other index 86fd5288e2..88aa63cbef 100755 --- a/tests/misc/truncate-owned-by-other +++ b/tests/misc/truncate-owned-by-other @@ -16,7 +16,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && truncate --version require_root_ diff --git a/tests/misc/wc-parallel b/tests/misc/wc-parallel index 47f10441c9..fd809f5f2f 100755 --- a/tests/misc/wc-parallel +++ b/tests/misc/wc-parallel @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && md5sum --version (mkdir tmp && cd tmp && seq 2000 | xargs touch) diff --git a/tests/misc/xattr b/tests/misc/xattr index 3a27f15e0a..13e0857a59 100755 --- a/tests/misc/xattr +++ b/tests/misc/xattr @@ -18,7 +18,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && { cp --version; mv --version; ginstall --version; } # Skip this test if cp was built without xattr support: diff --git a/tests/mkdir/selinux b/tests/mkdir/selinux index b0240eb0a0..f055cb8ac4 100755 --- a/tests/mkdir/selinux +++ b/tests/mkdir/selinux @@ -16,7 +16,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && { mkdir --version; mkfifo --version; mknod --version; } # Note: on an SELinux/enforcing system running mcstransd older than diff --git a/tests/mv/acl b/tests/mv/acl index c67630ed0a..75f5007866 100755 --- a/tests/mv/acl +++ b/tests/mv/acl @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && { mv --version; getfacl --version; setfacl --version; } require_acl_ diff --git a/tests/mv/childproof b/tests/mv/childproof index 2e5e4611c8..ed6c1802e2 100755 --- a/tests/mv/childproof +++ b/tests/mv/childproof @@ -18,7 +18,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && { cp --version; mv --version; ln --version; } skip_if_root_ diff --git a/tests/mv/diag b/tests/mv/diag index f40fc7c42b..d32513d9b5 100755 --- a/tests/mv/diag +++ b/tests/mv/diag @@ -16,7 +16,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && mv --version touch f1 || framework_failure diff --git a/tests/mv/dup-source b/tests/mv/dup-source index 9ede87ef62..34ef63332b 100755 --- a/tests/mv/dup-source +++ b/tests/mv/dup-source @@ -19,7 +19,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && { cp --version; mv --version; } skip_if_root_ diff --git a/tests/mv/hard-2 b/tests/mv/hard-2 index 704e2679d4..eb83b117f2 100755 --- a/tests/mv/hard-2 +++ b/tests/mv/hard-2 @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && { cp --version; mv --version; } skip_if_root_ diff --git a/tests/mv/i-2 b/tests/mv/i-2 index 83596426e2..7e49bcadd5 100755 --- a/tests/mv/i-2 +++ b/tests/mv/i-2 @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && { cp --version; mv --version; } skip_if_root_ diff --git a/tests/mv/part-symlink b/tests/mv/part-symlink index bf2fd451ac..3f67d6cdd9 100755 --- a/tests/mv/part-symlink +++ b/tests/mv/part-symlink @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && { cp --version; mv --version; } cleanup_() { rm -rf "$other_partition_tmpdir"; } diff --git a/tests/mv/update b/tests/mv/update index b0a532c635..5bee53cb2e 100755 --- a/tests/mv/update +++ b/tests/mv/update @@ -16,7 +16,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src test "$VERBOSE" = yes && { cp --version; mv --version; } echo old > old || framework_failure -- 2.47.2