tests: convert remaining uses of test-lib.sh to init.sh
authorJim Meyering <meyering@redhat.com>
Sun, 14 Nov 2010 11:07:57 +0000 (12:07 +0100)
committerJim Meyering <meyering@redhat.com>
Wed, 17 Nov 2010 19:48:57 +0000 (20:48 +0100)
RHS='. "\${srcdir=.}/init.sh"; path_prepend_ ../src'
git grep -l test-lib.sh \
  | xargs perl -pi -e 's,^\. \$srcdir/test-lib\.sh$,'"$RHS",

37 files changed:
tests/chmod/silent
tests/cp/acl
tests/cp/cp-mv-backup
tests/cp/cp-mv-enotsup-xattr
tests/cp/perm
tests/cp/preserve-gid
tests/ln/sf-1
tests/ls/nameless-uid
tests/ls/rt-1
tests/misc/arch
tests/misc/env-null
tests/misc/md5sum-parallel
tests/misc/printenv
tests/misc/printf
tests/misc/printf-hex
tests/misc/printf-surprise
tests/misc/pwd-long
tests/misc/pwd-option
tests/misc/pwd-unreadable-parent
tests/misc/selinux
tests/misc/stdbuf
tests/misc/stty
tests/misc/stty-row-col
tests/misc/su-fail
tests/misc/sum-sysv
tests/misc/truncate-owned-by-other
tests/misc/wc-parallel
tests/misc/xattr
tests/mkdir/selinux
tests/mv/acl
tests/mv/childproof
tests/mv/diag
tests/mv/dup-source
tests/mv/hard-2
tests/mv/i-2
tests/mv/part-symlink
tests/mv/update

index 2cfbcbb..20c232b 100755 (executable)
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $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
index 3e93645..a3b909a 100755 (executable)
@@ -17,7 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
 test "$VERBOSE" = yes && { mv --version; getfacl --version; setfacl --version; }
 
 require_acl_
index c978ba2..ad7bfa5 100755 (executable)
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
 test "$VERBOSE" = yes && cp --version
 
 umask 022
index bd0ef0e..bcee421 100755 (executable)
@@ -18,7 +18,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
 test "$VERBOSE" = yes && { cp --version; mv --version; }
 
 require_root_
index 346b245..cb4709f 100755 (executable)
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
 test "$VERBOSE" = yes && { cp --version; mv --version; }
 
 very_expensive_
index a5190e4..6fa5293 100755 (executable)
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
 test "$VERBOSE" = yes && cp --version
 
 require_root_
index fdfc3f7..189abe5 100755 (executable)
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
 test "$VERBOSE" = yes && ln --version
 
 echo foo > a || framework_failure
index bf2dfcd..6b4f368 100755 (executable)
@@ -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_
index 51d0236..909deb1 100755 (executable)
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
 test "$VERBOSE" = yes && { ls --version; touch --version; }
 
 date=1998-01-15
index a4475e6..462919f 100755 (executable)
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
 test "$VERBOSE" = yes && arch --version
 
 require_built_ arch
index ed2e21d..c08856c 100755 (executable)
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $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.
index 6f38b8b..fdbc4c2 100755 (executable)
@@ -17,7 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
 test "$VERBOSE" = yes && md5sum --version
 
 (mkdir tmp && cd tmp && seq 500 | xargs touch)
index dd82c05..67173ed 100755 (executable)
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $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
index cf376f3..b0fe19c 100755 (executable)
@@ -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_
index 39b70d6..864dc0b 100755 (executable)
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
 test "$VERBOSE" = yes && env -- printf --version
 
 env printf '\x7e3\n' > out || fail=1
index 702ab67..53f46b5 100755 (executable)
@@ -18,7 +18,7 @@
 
 prog=printf
 
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
 test "$VERBOSE" = yes && env -- printf --version
 
 require_ulimit_
index c58207a..b3d14c6 100755 (executable)
@@ -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_
index e4ecf11..e010266 100755 (executable)
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
 test "$VERBOSE" = yes && env -- pwd --version
 
 mkdir -p a/b || framework_failure
index 1f3d914..b24a97c 100755 (executable)
@@ -18,7 +18,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
 test "$VERBOSE" = yes && { env -- pwd --version; readlink --version; }
 
 test $host_os != linux-gnu &&
index 0a8259f..0d798c1 100755 (executable)
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $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_
index 8302c48..4a694c7 100755 (executable)
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
 test "$VERBOSE" = yes && { stdbuf --version; mv --version; }
 
 getlimits_
index 0659d51..cc1d933 100755 (executable)
@@ -17,7 +17,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # 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_
index 5acb3d0..ed7fede 100755 (executable)
@@ -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_
index 4c57c94..e8a0c5f 100755 (executable)
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
 test "$VERBOSE" = yes && su --version
 
 require_built_ su
index 705de27..5465f21 100755 (executable)
@@ -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).
index 86fd528..88aa63c 100755 (executable)
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
 test "$VERBOSE" = yes && truncate --version
 
 require_root_
index 47f1044..fd809f5 100755 (executable)
@@ -17,7 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
 test "$VERBOSE" = yes && md5sum --version
 
 (mkdir tmp && cd tmp && seq 2000 | xargs touch)
index 3a27f15..13e0857 100755 (executable)
@@ -18,7 +18,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $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:
index b0240eb..f055cb8 100755 (executable)
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $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
index c67630e..75f5007 100755 (executable)
@@ -17,7 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
 test "$VERBOSE" = yes && { mv --version; getfacl --version; setfacl --version; }
 
 require_acl_
index 2e5e461..ed6c180 100755 (executable)
@@ -18,7 +18,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
 test "$VERBOSE" = yes && { cp --version; mv --version; ln --version; }
 
 skip_if_root_
index f40fc7c..d32513d 100755 (executable)
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
 test "$VERBOSE" = yes && mv --version
 
 touch f1 || framework_failure
index 9ede87e..34ef633 100755 (executable)
@@ -19,7 +19,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
 test "$VERBOSE" = yes && { cp --version; mv --version; }
 
 skip_if_root_
index 704e267..eb83b11 100755 (executable)
@@ -17,7 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
 test "$VERBOSE" = yes && { cp --version; mv --version; }
 
 skip_if_root_
index 8359642..7e49bca 100755 (executable)
@@ -17,7 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
 test "$VERBOSE" = yes && { cp --version; mv --version; }
 
 skip_if_root_
index bf2fd45..3f67d6c 100755 (executable)
@@ -17,7 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
 test "$VERBOSE" = yes && { cp --version; mv --version; }
 
 cleanup_() { rm -rf "$other_partition_tmpdir"; }
index b0a532c..5bee53c 100755 (executable)
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
 test "$VERBOSE" = yes && { cp --version; mv --version; }
 
 echo old > old || framework_failure