From: Jim Meyering Date: Sun, 14 Nov 2010 10:05:05 +0000 (+0100) Subject: tests: convert first batch of tests from test-lib.sh to init.sh X-Git-Tag: v8.8~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f38becab02472e6872048a1951b249b2a3c054df;p=thirdparty%2Fcoreutils.git 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," --- diff --git a/tests/chgrp/basic b/tests/chgrp/basic index 19e9602cab..7d6716624a 100755 --- a/tests/chgrp/basic +++ b/tests/chgrp/basic @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - chgrp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && chgrp --version require_membership_in_two_groups_ diff --git a/tests/chgrp/default-no-deref b/tests/chgrp/default-no-deref index b4ea299f8f..77d3bcbcbe 100755 --- a/tests/chgrp/default-no-deref +++ b/tests/chgrp/default-no-deref @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - chgrp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && chgrp --version require_membership_in_two_groups_ set _ $groups; shift diff --git a/tests/chgrp/deref b/tests/chgrp/deref index 36a320be0d..e3cfed2294 100755 --- a/tests/chgrp/deref +++ b/tests/chgrp/deref @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - chgrp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && chgrp --version require_membership_in_two_groups_ set _ $groups; shift diff --git a/tests/chgrp/no-x b/tests/chgrp/no-x index a8e49cddb5..e3a4aefd0c 100755 --- a/tests/chgrp/no-x +++ b/tests/chgrp/no-x @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - chgrp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && chgrp --version require_membership_in_two_groups_ skip_if_root_ diff --git a/tests/chgrp/posix-H b/tests/chgrp/posix-H index db0b077967..6cf101c8f6 100755 --- a/tests/chgrp/posix-H +++ b/tests/chgrp/posix-H @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - chgrp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && chgrp --version require_membership_in_two_groups_ set _ $groups; shift diff --git a/tests/chgrp/recurse b/tests/chgrp/recurse index 8fd53da4d3..0f7f00f223 100755 --- a/tests/chgrp/recurse +++ b/tests/chgrp/recurse @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - chgrp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && chgrp --version require_membership_in_two_groups_ set _ $groups; shift diff --git a/tests/chmod/c-option b/tests/chmod/c-option index c8b8ac8d12..4db905fc63 100755 --- a/tests/chmod/c-option +++ b/tests/chmod/c-option @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - chmod --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && chmod --version umask 0 file=f diff --git a/tests/chmod/equal-x b/tests/chmod/equal-x index cd1358a002..32226f1ff0 100755 --- a/tests/chmod/equal-x +++ b/tests/chmod/equal-x @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - chmod --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && chmod --version file=f touch $file || framework_failure diff --git a/tests/chmod/equals b/tests/chmod/equals index 79f39f46be..79e01fb04f 100755 --- a/tests/chmod/equals +++ b/tests/chmod/equals @@ -18,12 +18,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - chmod --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && chmod --version touch f || framework_failure diff --git a/tests/chmod/inaccessible b/tests/chmod/inaccessible index 6127ad5374..37dc8ffac5 100755 --- a/tests/chmod/inaccessible +++ b/tests/chmod/inaccessible @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - chmod --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && chmod --version mkdir -p d/e || framework_failure chmod 0 d/e d || framework_failure diff --git a/tests/chmod/no-x b/tests/chmod/no-x index f4e10826d3..464a2544ae 100755 --- a/tests/chmod/no-x +++ b/tests/chmod/no-x @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - chmod --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && chmod --version skip_if_root_ mkdir -p d/no-x/y a/b || framework_failure diff --git a/tests/chmod/octal b/tests/chmod/octal index 695dbbd380..add57775bd 100755 --- a/tests/chmod/octal +++ b/tests/chmod/octal @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - chmod --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && chmod --version # Before coreutils-5.92, this would mistakenly succeed, diff --git a/tests/chmod/setgid b/tests/chmod/setgid index 01a320db9b..89e971c5fe 100755 --- a/tests/chmod/setgid +++ b/tests/chmod/setgid @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - chmod --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && chmod --version umask 0 mkdir d || framework_failure diff --git a/tests/chmod/thru-dangling b/tests/chmod/thru-dangling index 478db701ad..8421a989c6 100755 --- a/tests/chmod/thru-dangling +++ b/tests/chmod/thru-dangling @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - chmod --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && chmod --version ln -s non-existent dangle || framework_failure diff --git a/tests/chmod/umask-x b/tests/chmod/umask-x index da1cf1525f..e0c5e36a96 100755 --- a/tests/chmod/umask-x +++ b/tests/chmod/umask-x @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - chmod --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && chmod --version touch file chmod 755 file diff --git a/tests/chmod/usage b/tests/chmod/usage index 0aa1e18fcd..e2d33fc323 100755 --- a/tests/chmod/usage +++ b/tests/chmod/usage @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - chmod --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && chmod --version # Each line in this list is a set of arguments, followed by :, diff --git a/tests/chown/basic b/tests/chown/basic index f161b536bc..3ad43b403f 100755 --- a/tests/chown/basic +++ b/tests/chown/basic @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - chgrp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && chgrp --version require_root_ touch f || framework_failure diff --git a/tests/chown/deref b/tests/chown/deref index 7a269e7567..85603b4299 100755 --- a/tests/chown/deref +++ b/tests/chown/deref @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - chown --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && chown --version ln -s no-such dangle || framework_failure diff --git a/tests/chown/preserve-root b/tests/chown/preserve-root index 81483db5b4..c01149629f 100755 --- a/tests/chown/preserve-root +++ b/tests/chown/preserve-root @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - chown --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && chown --version skip_if_root_ mkdir d && ln -s / d/slink-to-root diff --git a/tests/chown/separator b/tests/chown/separator index 4c204f126b..914d9cca4b 100755 --- a/tests/chown/separator +++ b/tests/chown/separator @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - chown --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && chown --version id_u=`id -u` || framework_failure test -n "$id_u" || framework_failure diff --git a/tests/cp/abuse b/tests/cp/abuse index 2979f0d99a..fb5e4358c5 100755 --- a/tests/cp/abuse +++ b/tests/cp/abuse @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version mkdir a b c || framework_failure ln -s ../t a/1 || framework_failure diff --git a/tests/cp/backup-1 b/tests/cp/backup-1 index fc72028574..6908462141 100755 --- a/tests/cp/backup-1 +++ b/tests/cp/backup-1 @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version suffix=.b file=b1.$$ diff --git a/tests/cp/backup-dir b/tests/cp/backup-dir index 4368123196..c1718dedc1 100755 --- a/tests/cp/backup-dir +++ b/tests/cp/backup-dir @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version mkdir x y || framework_failure diff --git a/tests/cp/backup-is-src b/tests/cp/backup-is-src index 5944eb9b7c..8a8b480694 100755 --- a/tests/cp/backup-is-src +++ b/tests/cp/backup-is-src @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version echo a > a || framework_failure echo a-tilde > a~ || framework_failure diff --git a/tests/cp/capability b/tests/cp/capability index f4ee227f5f..3a241d0587 100755 --- a/tests/cp/capability +++ b/tests/cp/capability @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ls --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ls --version require_root_ working_umask_or_skip_ diff --git a/tests/cp/cp-HL b/tests/cp/cp-HL index 6407fb7dca..f2a2dc4389 100755 --- a/tests/cp/cp-HL +++ b/tests/cp/cp-HL @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version mkdir src-dir dest-dir || framework_failure echo f > f || framework_failure diff --git a/tests/cp/cp-a-selinux b/tests/cp/cp-a-selinux index cff87311ff..bfc79562d2 100755 --- a/tests/cp/cp-a-selinux +++ b/tests/cp/cp-a-selinux @@ -19,12 +19,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version require_root_ require_selinux_ diff --git a/tests/cp/cp-deref b/tests/cp/cp-deref index 50efdd3b51..8315a62545 100755 --- a/tests/cp/cp-deref +++ b/tests/cp/cp-deref @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version mkdir a b c d || framework_failure ln -s ../c a || framework_failure diff --git a/tests/cp/cp-i b/tests/cp/cp-i index f5cba16e1e..8e86267fa1 100755 --- a/tests/cp/cp-i +++ b/tests/cp/cp-i @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version mkdir -p a b/a/c || framework_failure touch a/c || framework_failure diff --git a/tests/cp/cp-parents b/tests/cp/cp-parents index c77a32857d..22100b5026 100755 --- a/tests/cp/cp-parents +++ b/tests/cp/cp-parents @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mv --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mv --version working_umask_or_skip_ diff --git a/tests/cp/deref-slink b/tests/cp/deref-slink index de2e5e6319..a11bd0dc91 100755 --- a/tests/cp/deref-slink +++ b/tests/cp/deref-slink @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version touch f slink-target || framework_failure ln -s slink-target slink || framework_failure diff --git a/tests/cp/dir-rm-dest b/tests/cp/dir-rm-dest index 523edbdc1c..2923a474ea 100755 --- a/tests/cp/dir-rm-dest +++ b/tests/cp/dir-rm-dest @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version mkdir d e || framework_failure diff --git a/tests/cp/dir-slash b/tests/cp/dir-slash index 76b14b6e79..18050a3afc 100755 --- a/tests/cp/dir-slash +++ b/tests/cp/dir-slash @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version mkdir dir1 dir2 || framework_failure touch dir1/file || framework_failure diff --git a/tests/cp/dir-vs-file b/tests/cp/dir-vs-file index 32530a613f..499014184d 100755 --- a/tests/cp/dir-vs-file +++ b/tests/cp/dir-vs-file @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version mkdir dir || framework_failure touch file || framework_failure diff --git a/tests/cp/existing-perm-race b/tests/cp/existing-perm-race index ffd29f0f4a..f1c7bc1adf 100755 --- a/tests/cp/existing-perm-race +++ b/tests/cp/existing-perm-race @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version require_membership_in_two_groups_ diff --git a/tests/cp/fail-perm b/tests/cp/fail-perm index 656b16e23e..cd763f7dab 100755 --- a/tests/cp/fail-perm +++ b/tests/cp/fail-perm @@ -15,12 +15,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version skip_if_root_ chmod g-s . || framework_failure diff --git a/tests/cp/file-perm-race b/tests/cp/file-perm-race index d807612595..6b3b60450d 100755 --- a/tests/cp/file-perm-race +++ b/tests/cp/file-perm-race @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version # cp -p gives ENOTSUP on NFS on Linux 2.6.9 at least require_local_dir_ diff --git a/tests/cp/into-self b/tests/cp/into-self index 21aae8076b..3341d1a8be 100755 --- a/tests/cp/into-self +++ b/tests/cp/into-self @@ -21,12 +21,8 @@ # Now it gives this: # cp: can't copy a directory `dir' into itself `dir/dir' -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version mkdir a dir || framework_failure diff --git a/tests/cp/link b/tests/cp/link index 9935465d40..f0bd241f93 100755 --- a/tests/cp/link +++ b/tests/cp/link @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version touch src || framework_failure touch dest || framework_failure diff --git a/tests/cp/link-heap b/tests/cp/link-heap index fe2f6b1aaf..f5ed6e60e2 100755 --- a/tests/cp/link-heap +++ b/tests/cp/link-heap @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version expensive_ require_ulimit_ diff --git a/tests/cp/link-no-deref b/tests/cp/link-no-deref index 86f05fd5d1..d575ec8515 100755 --- a/tests/cp/link-no-deref +++ b/tests/cp/link-no-deref @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version ln -s no-such-file dangling-slink || framework_failure diff --git a/tests/cp/link-preserve b/tests/cp/link-preserve index 9eb95ad5e5..fe5ad42c92 100755 --- a/tests/cp/link-preserve +++ b/tests/cp/link-preserve @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version touch a || framework_failure ln a b || framework_failure diff --git a/tests/cp/no-deref-link1 b/tests/cp/no-deref-link1 index 411692842c..f0d1a9e9b1 100755 --- a/tests/cp/no-deref-link1 +++ b/tests/cp/no-deref-link1 @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version mkdir a b msg=bar diff --git a/tests/cp/no-deref-link2 b/tests/cp/no-deref-link2 index aa0d8ab3bc..2351589a79 100755 --- a/tests/cp/no-deref-link2 +++ b/tests/cp/no-deref-link2 @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version mkdir b msg=bar diff --git a/tests/cp/no-deref-link3 b/tests/cp/no-deref-link3 index c3c7d89ac2..1053b3ef76 100755 --- a/tests/cp/no-deref-link3 +++ b/tests/cp/no-deref-link3 @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version msg=bar echo $msg > a diff --git a/tests/cp/parent-perm b/tests/cp/parent-perm index 4a7d98947a..82dd913ac5 100755 --- a/tests/cp/parent-perm +++ b/tests/cp/parent-perm @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version working_umask_or_skip_ # cp -p gives ENOTSUP on NFS on Linux 2.6.9 at least diff --git a/tests/cp/parent-perm-race b/tests/cp/parent-perm-race index e595d9ea8e..b6374aecd9 100755 --- a/tests/cp/parent-perm-race +++ b/tests/cp/parent-perm-race @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version # cp -p gives ENOTSUP on NFS on Linux 2.6.9 at least require_local_dir_ diff --git a/tests/cp/preserve-2 b/tests/cp/preserve-2 index 9863952c27..d7565df3b5 100755 --- a/tests/cp/preserve-2 +++ b/tests/cp/preserve-2 @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version # cp -p gives ENOTSUP on NFS on Linux 2.6.9 at least require_local_dir_ diff --git a/tests/cp/preserve-slink-time b/tests/cp/preserve-slink-time index 88c1016f81..5a61b7e8cf 100755 --- a/tests/cp/preserve-slink-time +++ b/tests/cp/preserve-slink-time @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version grep '^#define HAVE_UTIMENSAT 1' "$CONFIG_HEADER" > /dev/null || grep '^#define HAVE_LUTIMES 1' "$CONFIG_HEADER" > /dev/null || diff --git a/tests/cp/proc-short-read b/tests/cp/proc-short-read index afe08491b3..2bc2a61953 100755 --- a/tests/cp/proc-short-read +++ b/tests/cp/proc-short-read @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version kall=/proc/kallsyms diff --git a/tests/cp/proc-zero-len b/tests/cp/proc-zero-len index 9cc81bc142..ca28fa4285 100755 --- a/tests/cp/proc-zero-len +++ b/tests/cp/proc-zero-len @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version touch empty || framework_failure diff --git a/tests/cp/r-vs-symlink b/tests/cp/r-vs-symlink index e537767b9b..7d9dfd8e42 100755 --- a/tests/cp/r-vs-symlink +++ b/tests/cp/r-vs-symlink @@ -20,12 +20,8 @@ # though now such usage evokes a warning: # cp: `slink': WARNING: using -r to copy symbolic links is not portable -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version echo abc > foo || framework_failure ln -s foo slink || framework_failure diff --git a/tests/cp/reflink-auto b/tests/cp/reflink-auto index 9d60940bb3..7d61ed25bc 100755 --- a/tests/cp/reflink-auto +++ b/tests/cp/reflink-auto @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version cleanup_() { rm -rf "$other_partition_tmpdir"; } . "$abs_srcdir/other-fs-tmpdir" diff --git a/tests/cp/reflink-perm b/tests/cp/reflink-perm index e1c12aa5ad..a330584c10 100755 --- a/tests/cp/reflink-perm +++ b/tests/cp/reflink-perm @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version : > time_check diff --git a/tests/cp/same-file b/tests/cp/same-file index bcb2a9d0d1..97b5b29096 100755 --- a/tests/cp/same-file +++ b/tests/cp/same-file @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version # Unset CDPATH. Otherwise, output from the `cd dir' command # can make this test fail. diff --git a/tests/cp/slink-2-slink b/tests/cp/slink-2-slink index bdfb9a90b3..69e0c95113 100755 --- a/tests/cp/slink-2-slink +++ b/tests/cp/slink-2-slink @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version touch file || framework_failure ln -s file a || framework_failure diff --git a/tests/cp/sparse b/tests/cp/sparse index 73c2924765..60e226b273 100755 --- a/tests/cp/sparse +++ b/tests/cp/sparse @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version require_sparse_support_ # Create a sparse file. diff --git a/tests/cp/special-bits b/tests/cp/special-bits index 6f32847bc0..f09e499fc2 100755 --- a/tests/cp/special-bits +++ b/tests/cp/special-bits @@ -20,12 +20,8 @@ # This test would fail due to a bug introduced in 4.0y. # The bug was fixed in 4.0z. -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version require_root_ touch a b c || framework_failure diff --git a/tests/cp/special-f b/tests/cp/special-f index 22872e7338..6c0b13734c 100755 --- a/tests/cp/special-f +++ b/tests/cp/special-f @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version mkfifo fifo || skip_test_ "fifos not supported" diff --git a/tests/cp/src-base-dot b/tests/cp/src-base-dot index 8e38ae68a2..73e4f6ff79 100755 --- a/tests/cp/src-base-dot +++ b/tests/cp/src-base-dot @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version mkdir x y || framework_failure diff --git a/tests/cp/symlink-slash b/tests/cp/symlink-slash index ac63ba2b18..dfc9b2bf00 100755 --- a/tests/cp/symlink-slash +++ b/tests/cp/symlink-slash @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version mkdir dir || framework_failure ln -s dir symlink || framework_failure diff --git a/tests/cp/thru-dangling b/tests/cp/thru-dangling index 729eb5e6fd..592dda2a59 100755 --- a/tests/cp/thru-dangling +++ b/tests/cp/thru-dangling @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version ln -s no-such dangle || framework_failure echo hi > f || framework_failure diff --git a/tests/dd/direct b/tests/dd/direct index 46bf35f320..1381ce68c9 100755 --- a/tests/dd/direct +++ b/tests/dd/direct @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - dd --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && dd --version truncate -s 8192 in || framework_failure dd if=in oflag=direct of=out 2> /dev/null \ diff --git a/tests/dd/misc b/tests/dd/misc index ddd7bbd9ec..92be450460 100755 --- a/tests/dd/misc +++ b/tests/dd/misc @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - dd --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && dd --version tmp_in=dd-in.$$ tmp_in2=dd-in2.$$ diff --git a/tests/dd/not-rewound b/tests/dd/not-rewound index 67c2971f43..75c08c952f 100755 --- a/tests/dd/not-rewound +++ b/tests/dd/not-rewound @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - dd --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && dd --version echo abcde > in diff --git a/tests/dd/reblock b/tests/dd/reblock index 9c9b0f85f2..c5d667c8c7 100755 --- a/tests/dd/reblock +++ b/tests/dd/reblock @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - dd --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && dd --version # 2 short reads -> 1 full write + 1 partial write cat <<\EOF > exp-reblock || framework_failure diff --git a/tests/dd/skip-seek-past-dev b/tests/dd/skip-seek-past-dev index 9e910e8ee9..762671c274 100755 --- a/tests/dd/skip-seek-past-dev +++ b/tests/dd/skip-seek-past-dev @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - dd --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && dd --version # need write access to local device # (even though we don't actually write anything) diff --git a/tests/dd/skip-seek-past-file b/tests/dd/skip-seek-past-file index 9327f1ea54..605e964f71 100755 --- a/tests/dd/skip-seek-past-file +++ b/tests/dd/skip-seek-past-file @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - dd --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && dd --version require_sparse_support_ # for `truncate --size=$OFF_T_MAX` eval $(getlimits) # for OFF_T limits diff --git a/tests/dd/skip-seek2 b/tests/dd/skip-seek2 index 7b60af62e6..4897e10e1c 100755 --- a/tests/dd/skip-seek2 +++ b/tests/dd/skip-seek2 @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - dd --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && dd --version echo LA:3456789abcdef > in || fail=1 diff --git a/tests/dd/stderr b/tests/dd/stderr index 5ef91e45e6..fd7b7470d7 100755 --- a/tests/dd/stderr +++ b/tests/dd/stderr @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - dd --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && dd --version p=$abs_top_builddir diff --git a/tests/dd/unblock-sync b/tests/dd/unblock-sync index 7e45b7ee87..2d8dc328e9 100755 --- a/tests/dd/unblock-sync +++ b/tests/dd/unblock-sync @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - dd --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && dd --version printf 000100020003xx > in || framework_failure diff --git a/tests/df/total-verify b/tests/df/total-verify index 8bfa2053bf..abe85bcbf5 100755 --- a/tests/df/total-verify +++ b/tests/df/total-verify @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - df --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && df --version df || skip_test_ "df fails" diff --git a/tests/df/unreadable b/tests/df/unreadable index e58692d206..5c98760029 100755 --- a/tests/df/unreadable +++ b/tests/df/unreadable @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - df --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && df --version skip_if_root_ touch unreadable || fail=1 diff --git a/tests/du/2g b/tests/du/2g index 61bbebce8f..0021fdadce 100755 --- a/tests/du/2g +++ b/tests/du/2g @@ -18,12 +18,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - du --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && du --version # Creating a 2GB file counts as `very expensive'. very_expensive_ diff --git a/tests/du/8gb b/tests/du/8gb index 8043b8ae8f..f416111ed8 100755 --- a/tests/du/8gb +++ b/tests/du/8gb @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - du --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && du --version require_sparse_support_ dd bs=1 seek=8G of=big < /dev/null 2> /dev/null diff --git a/tests/du/basic b/tests/du/basic index 6d3eeb1e72..b96d861c84 100755 --- a/tests/du/basic +++ b/tests/du/basic @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - du --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && du --version mkdir -p a/b d d/sub || framework_failure diff --git a/tests/du/deref b/tests/du/deref index 8e4feac3bf..0dbf4854e1 100755 --- a/tests/du/deref +++ b/tests/du/deref @@ -19,12 +19,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - du --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && du --version mkdir -p a/sub || framework_failure ln -s a/sub slink || framework_failure diff --git a/tests/du/deref-args b/tests/du/deref-args index 57118f7415..1743b04480 100755 --- a/tests/du/deref-args +++ b/tests/du/deref-args @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - du --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && du --version mkdir -p dir/a || framework_failure ln -s dir slink || framework_failure diff --git a/tests/du/exclude b/tests/du/exclude index 9649623b0d..d3295cf683 100755 --- a/tests/du/exclude +++ b/tests/du/exclude @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - du --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && du --version mkdir -p a/b/c a/x/y a/u/v || framework_failure diff --git a/tests/du/fd-leak b/tests/du/fd-leak index ac9274e36f..728ce05335 100755 --- a/tests/du/fd-leak +++ b/tests/du/fd-leak @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - du --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && du --version # Call this an expensive test. It's not that expensive, but command line # limitations might induce failure on some losing systems. diff --git a/tests/du/hard-link b/tests/du/hard-link index e22320b56f..68a7e2245a 100755 --- a/tests/du/hard-link +++ b/tests/du/hard-link @@ -18,12 +18,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - du --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && du --version mkdir -p dir/sub ( cd dir && diff --git a/tests/du/inacc-dest b/tests/du/inacc-dest index 4c7b9b8756..24242815d3 100755 --- a/tests/du/inacc-dest +++ b/tests/du/inacc-dest @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - du --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && du --version skip_if_root_ mkdir f && cd f && mkdir a b c d e && touch c/j && chmod a-x c \ diff --git a/tests/du/inacc-dir b/tests/du/inacc-dir index 8504d64380..0be254c784 100755 --- a/tests/du/inacc-dir +++ b/tests/du/inacc-dir @@ -15,12 +15,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - du --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && du --version skip_if_root_ mkdir -p a/sub || framework_failure diff --git a/tests/du/inaccessible-cwd b/tests/du/inaccessible-cwd index 1a4bf9fe69..a1656b2174 100755 --- a/tests/du/inaccessible-cwd +++ b/tests/du/inaccessible-cwd @@ -20,12 +20,8 @@ # Before the switch to an fts-based implementation in coreutils 5.0.92, # this test would fail. -if test "$VERBOSE" = yes; then - set -x - du --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && du --version skip_if_root_ cwd=`pwd` diff --git a/tests/du/long-from-unreadable b/tests/du/long-from-unreadable index 73d32a6761..2b38e69e7b 100755 --- a/tests/du/long-from-unreadable +++ b/tests/du/long-from-unreadable @@ -28,12 +28,8 @@ # on Linux+PROC_FS systems because its fts implementation would revert # unnecessarily to using FTS_NOCHDIR mode in this corner case. -if test "$VERBOSE" = yes; then - set -x - du --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && du --version proc_file=/proc/self/fd if test ! -d $proc_file; then diff --git a/tests/du/long-sloop b/tests/du/long-sloop index 06843dcc38..391174a3d6 100755 --- a/tests/du/long-sloop +++ b/tests/du/long-sloop @@ -18,12 +18,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - du --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && du --version # Create lots of directories, each containing a single symlink # pointing at the next directory in the list. diff --git a/tests/du/no-deref b/tests/du/no-deref index 4aa3a5672e..d56bc753e8 100755 --- a/tests/du/no-deref +++ b/tests/du/no-deref @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - du --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && du --version mkdir -p dir/a/b || framework_failure ln -s dir slink || framework_failure diff --git a/tests/du/no-x b/tests/du/no-x index bf00ec647a..580b527a44 100755 --- a/tests/du/no-x +++ b/tests/du/no-x @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - du --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && du --version skip_if_root_ mkdir -p d/no-x/y || framework_failure diff --git a/tests/du/one-file-system b/tests/du/one-file-system index 53ca9ebfc1..bb4d7cba1c 100755 --- a/tests/du/one-file-system +++ b/tests/du/one-file-system @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - du --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && du --version mkdir -p b/c y/z || framework_failure diff --git a/tests/du/restore-wd b/tests/du/restore-wd index 8bddf014ea..bb2b165c50 100755 --- a/tests/du/restore-wd +++ b/tests/du/restore-wd @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - du --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && du --version mkdir a b || framework_failure diff --git a/tests/du/slash b/tests/du/slash index 1a849bb104..3434e3ef3e 100755 --- a/tests/du/slash +++ b/tests/du/slash @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - du --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && du --version require_readable_root_ diff --git a/tests/du/slink b/tests/du/slink index 5c2b125c78..092ea12922 100755 --- a/tests/du/slink +++ b/tests/du/slink @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - du --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && du --version # Determine if `.' is on a local (would non-NFS be sufficient?) file system. # At least on OSF/1 4.0d, when using an nfsv3 file system, diff --git a/tests/du/trailing-slash b/tests/du/trailing-slash index 87fe62a69c..70549a80da 100755 --- a/tests/du/trailing-slash +++ b/tests/du/trailing-slash @@ -19,12 +19,8 @@ # Before coreutils-4.5.3, it would remove a single trailing slash. -if test "$VERBOSE" = yes; then - set -x - du --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && du --version mkdir -p dir/1/2 || framework_failure ln -s dir slink || framework_failure diff --git a/tests/du/two-args b/tests/du/two-args index e679921fec..ed544b0915 100755 --- a/tests/du/two-args +++ b/tests/du/two-args @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - du --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && du --version # Run this test from a sub-directory one level deeper than normal, # so that the "du .." below doesn't traverse sibling directories diff --git a/tests/id/no-context b/tests/id/no-context index fa9ffb3508..90ff71ee0e 100755 --- a/tests/id/no-context +++ b/tests/id/no-context @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - id --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && id --version # We don't need selinux *FS* support to test id, # but this is as good a witness as any, in general. diff --git a/tests/install/basic-1 b/tests/install/basic-1 index 7ea103b28d..6470f5dd38 100755 --- a/tests/install/basic-1 +++ b/tests/install/basic-1 @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ginstall --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ginstall --version skip_if_root_ dir=dir diff --git a/tests/install/create-leading b/tests/install/create-leading index e342e23df0..acb92a9a60 100755 --- a/tests/install/create-leading +++ b/tests/install/create-leading @@ -19,12 +19,8 @@ # Note that the tests below use `ginstall', not install, because # that's the name of the binary in ../../src. -if test "$VERBOSE" = yes; then - set -x - ginstall --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ginstall --version file=file diff --git a/tests/install/d-slashdot b/tests/install/d-slashdot index 960898c52e..b7cd17a228 100755 --- a/tests/install/d-slashdot +++ b/tests/install/d-slashdot @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - install --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && install --version ginstall -d d1/. || fail=1 diff --git a/tests/install/install-C b/tests/install/install-C index 681a60e9a7..ea6292c792 100755 --- a/tests/install/install-C +++ b/tests/install/install-C @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ginstall --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ginstall --version skip_if_setgid_ mode1=0644 diff --git a/tests/install/install-C-root b/tests/install/install-C-root index 29ff2503ca..a36aa1efe6 100755 --- a/tests/install/install-C-root +++ b/tests/install/install-C-root @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ginstall --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ginstall --version require_root_ skip_if_setgid_ diff --git a/tests/install/install-C-selinux b/tests/install/install-C-selinux index fe8e5a61b3..8818c7359f 100755 --- a/tests/install/install-C-selinux +++ b/tests/install/install-C-selinux @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ginstall --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ginstall --version require_selinux_ diff --git a/tests/install/strip-program b/tests/install/strip-program index abe4b5fb09..71001d9d97 100755 --- a/tests/install/strip-program +++ b/tests/install/strip-program @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ginstall --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ginstall --version working_umask_or_skip_ diff --git a/tests/install/trap b/tests/install/trap index d71bd4a010..3092e9249d 100755 --- a/tests/install/trap +++ b/tests/install/trap @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ginstall --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ginstall --version # Use a subshell and an exec to work around a bug in FreeBSD 5.0 /bin/sh. diff --git a/tests/ln/backup-1 b/tests/ln/backup-1 index 83d7e629b2..f07ba94931 100755 --- a/tests/ln/backup-1 +++ b/tests/ln/backup-1 @@ -19,12 +19,8 @@ # Based on a problem report from Jamie Lokier. -if test "$VERBOSE" = yes; then - set -x - ln --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ln --version touch a b || framework_failure diff --git a/tests/ln/hard-backup b/tests/ln/hard-backup index 6dfce51639..3b3f6ec715 100755 --- a/tests/ln/hard-backup +++ b/tests/ln/hard-backup @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ln --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ln --version touch f || framework_failure diff --git a/tests/ln/hard-to-sym b/tests/ln/hard-to-sym index ac74bb97dd..a78b738ad2 100755 --- a/tests/ln/hard-to-sym +++ b/tests/ln/hard-to-sym @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ln --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ln --version # =================================================== diff --git a/tests/ln/misc b/tests/ln/misc index 362bf354ca..de03890f4b 100755 --- a/tests/ln/misc +++ b/tests/ln/misc @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ln --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ln --version t=tln-symlink d=tln-subdir diff --git a/tests/ln/slash-decorated-nonexistent-dest b/tests/ln/slash-decorated-nonexistent-dest index f7d51e8bb1..1020da270b 100755 --- a/tests/ln/slash-decorated-nonexistent-dest +++ b/tests/ln/slash-decorated-nonexistent-dest @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ln --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ln --version touch f || framework_failure diff --git a/tests/ln/target-1 b/tests/ln/target-1 index 3865e2cdec..1f1ebc2d51 100755 --- a/tests/ln/target-1 +++ b/tests/ln/target-1 @@ -21,12 +21,8 @@ # ln: `d/.': cannot overwrite directory # Based on a test case from Dmitry V. Levin. -if test "$VERBOSE" = yes; then - set -x - ln --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ln --version mkdir d || framework_failure ln -s --target-dir=d ../f || fail=1 diff --git a/tests/ls/abmon-align b/tests/ls/abmon-align index 9b50d5e4d1..21c22f480b 100755 --- a/tests/ls/abmon-align +++ b/tests/ls/abmon-align @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ls --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ls --version for mon in $(seq -w 12); do touch -d"+$mon month" $mon.ts || framework_failure diff --git a/tests/ls/capability b/tests/ls/capability index 3997c731ef..200060ae86 100755 --- a/tests/ls/capability +++ b/tests/ls/capability @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ls --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ls --version require_root_ grep '^#define HAVE_CAP 1' $CONFIG_HEADER > /dev/null \ diff --git a/tests/ls/color-clear-to-eol b/tests/ls/color-clear-to-eol index 1be68cab60..683ee4e9f8 100755 --- a/tests/ls/color-clear-to-eol +++ b/tests/ls/color-clear-to-eol @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ls --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ls --version long_name=zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz.foo touch $long_name || framework_failure diff --git a/tests/ls/color-dtype-dir b/tests/ls/color-dtype-dir index 29b872c216..b691ae75c0 100755 --- a/tests/ls/color-dtype-dir +++ b/tests/ls/color-dtype-dir @@ -19,12 +19,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ls --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ls --version # Don't let a different umask perturb the results. umask 22 diff --git a/tests/ls/color-norm b/tests/ls/color-norm index e7a68299e4..9d946a09b5 100755 --- a/tests/ls/color-norm +++ b/tests/ls/color-norm @@ -18,12 +18,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ls --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ls --version # Don't let a different umask perturb the results. umask 22 diff --git a/tests/ls/dangle b/tests/ls/dangle index f7d97833a3..f544df266a 100755 --- a/tests/ls/dangle +++ b/tests/ls/dangle @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ls --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ls --version ln -s no-such-file dangle || framework_failure mkdir -p dir/sub || framework_failure diff --git a/tests/ls/dired b/tests/ls/dired index 1d9c0ee1b6..b59426d835 100755 --- a/tests/ls/dired +++ b/tests/ls/dired @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ls --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ls --version mkdir dir || framework_failure diff --git a/tests/ls/file-type b/tests/ls/file-type index 7557166ba4..07a8cd4330 100755 --- a/tests/ls/file-type +++ b/tests/ls/file-type @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ls --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ls --version mkdir sub cd sub diff --git a/tests/ls/follow-slink b/tests/ls/follow-slink index afa9947d8e..00e49bac92 100755 --- a/tests/ls/follow-slink +++ b/tests/ls/follow-slink @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ls --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ls --version # Isolate output files from directory being listed mkdir dir dir/sub dir1 || framework_failure diff --git a/tests/ls/infloop b/tests/ls/infloop index b237adc394..be89efcab9 100755 --- a/tests/ls/infloop +++ b/tests/ls/infloop @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ls --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ls --version mkdir loop || framework_failure ln -s ../loop loop/sub || framework_failure diff --git a/tests/ls/inode b/tests/ls/inode index 16a80f25b0..08ae0f8b97 100755 --- a/tests/ls/inode +++ b/tests/ls/inode @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ls --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ls --version touch f || framework_failure ln -s f slink || framework_failure diff --git a/tests/ls/m-option b/tests/ls/m-option index de73b8d804..b35e527d41 100755 --- a/tests/ls/m-option +++ b/tests/ls/m-option @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ls --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ls --version seq 2000 > b || framework_failure touch a || framework_failure diff --git a/tests/ls/multihardlink b/tests/ls/multihardlink index 20a94c8071..46850e8839 100755 --- a/tests/ls/multihardlink +++ b/tests/ls/multihardlink @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ls --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ls --version working_umask_or_skip_ touch file file1 || framework_failure diff --git a/tests/ls/no-arg b/tests/ls/no-arg index 9eb32dce3d..288688b357 100755 --- a/tests/ls/no-arg +++ b/tests/ls/no-arg @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ls --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ls --version mkdir -p dir/subdir || framework_failure touch dir/subdir/file2 || framework_failure diff --git a/tests/ls/no-cap b/tests/ls/no-cap index 04b99edbc9..c826202699 100755 --- a/tests/ls/no-cap +++ b/tests/ls/no-cap @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ls --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ls --version require_strace_ capget strace -e capget ls --color=always > /dev/null 2> out || fail=1 diff --git a/tests/ls/proc-selinux-segfault b/tests/ls/proc-selinux-segfault index 4173ee84f8..f0dbb96ad2 100755 --- a/tests/ls/proc-selinux-segfault +++ b/tests/ls/proc-selinux-segfault @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ls --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ls --version f=/proc/sys test -r $f || f=. diff --git a/tests/ls/readdir-mountpoint-inode b/tests/ls/readdir-mountpoint-inode index d03ba06f95..9a38627c92 100755 --- a/tests/ls/readdir-mountpoint-inode +++ b/tests/ls/readdir-mountpoint-inode @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ls --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ls --version # We use --local here so as to not activate # potentially very many remote mounts. diff --git a/tests/ls/recursive b/tests/ls/recursive index fe82241ca8..a216249d10 100755 --- a/tests/ls/recursive +++ b/tests/ls/recursive @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ls --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ls --version mkdir x y a b c a/1 a/2 a/3 || framework_failure touch f a/1/I a/1/II || framework_failure diff --git a/tests/ls/stat-dtype b/tests/ls/stat-dtype index 6aaab53384..bfc51aad35 100755 --- a/tests/ls/stat-dtype +++ b/tests/ls/stat-dtype @@ -21,12 +21,8 @@ # The trick is to create an un-stat'able symlink and to see if ls # can report its type nonetheless, using dirent.d_type. -if test "$VERBOSE" = yes; then - set -x - ls --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ls --version # Skip this test unless "." is on a file system with useful d_type info. # FIXME: This uses "ls -p" to decide whether to test "ls" with other options, diff --git a/tests/ls/stat-failed b/tests/ls/stat-failed index 4a2b6c4a16..e7feba5526 100755 --- a/tests/ls/stat-failed +++ b/tests/ls/stat-failed @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ls --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ls --version skip_if_root_ mkdir d || framework_failure diff --git a/tests/ls/stat-free-symlinks b/tests/ls/stat-free-symlinks index 7af9e344d5..f9b6bb59f2 100755 --- a/tests/ls/stat-free-symlinks +++ b/tests/ls/stat-free-symlinks @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ls --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ls --version require_strace_ stat touch x || framework_failure diff --git a/tests/ls/stat-vs-dirent b/tests/ls/stat-vs-dirent index 25b2021e13..00a08140dd 100755 --- a/tests/ls/stat-vs-dirent +++ b/tests/ls/stat-vs-dirent @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ls --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ls --version root_dev_ino=`stat --format=%d-%i /` diff --git a/tests/ls/symlink-slash b/tests/ls/symlink-slash index bacbc73d70..9db9ba61d2 100755 --- a/tests/ls/symlink-slash +++ b/tests/ls/symlink-slash @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ls --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ls --version mkdir dir || framework_failure ln -s dir symlink || framework_failure diff --git a/tests/ls/x-option b/tests/ls/x-option index 8d96581244..ed6ef625f7 100755 --- a/tests/ls/x-option +++ b/tests/ls/x-option @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ls --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ls --version mkdir subdir || framework_failure touch subdir/b || framework_failure diff --git a/tests/misc/cat-buf b/tests/misc/cat-buf index cd6f9df8a8..303c4e268b 100755 --- a/tests/misc/cat-buf +++ b/tests/misc/cat-buf @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cat --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cat --version # Use a fifo rather than a pipe in the tests below # so that the producer (cat) will wait until the diff --git a/tests/misc/cat-proc b/tests/misc/cat-proc index 9219d86aa7..7214c25c8c 100755 --- a/tests/misc/cat-proc +++ b/tests/misc/cat-proc @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - cat --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cat --version f=/proc/cpuinfo diff --git a/tests/misc/chcon b/tests/misc/chcon index 72961b0776..3aefab51b8 100755 --- a/tests/misc/chcon +++ b/tests/misc/chcon @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - chcon --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && chcon --version require_root_ require_selinux_ skip_if_mcstransd_is_running_ diff --git a/tests/misc/chcon-fail b/tests/misc/chcon-fail index e099256d04..4daa848cfc 100755 --- a/tests/misc/chcon-fail +++ b/tests/misc/chcon-fail @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - chcon --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && chcon --version # neither context nor file diff --git a/tests/misc/chroot-credentials b/tests/misc/chroot-credentials index bf79c05ce2..e671f7fc8c 100755 --- a/tests/misc/chroot-credentials +++ b/tests/misc/chroot-credentials @@ -17,12 +17,8 @@ # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - chroot --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && chroot --version require_root_ diff --git a/tests/misc/chroot-fail b/tests/misc/chroot-fail index 6b4e2d8e14..a3044f70b5 100755 --- a/tests/misc/chroot-fail +++ b/tests/misc/chroot-fail @@ -17,12 +17,8 @@ # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - chroot --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && chroot --version # These tests verify exact status of internal failure; since none of diff --git a/tests/misc/close-stdout b/tests/misc/close-stdout index c7b0b65a96..e236558dbe 100755 --- a/tests/misc/close-stdout +++ b/tests/misc/close-stdout @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -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 p=$abs_top_builddir diff --git a/tests/misc/csplit b/tests/misc/csplit index f365da3355..98c704c143 100755 --- a/tests/misc/csplit +++ b/tests/misc/csplit @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - csplit --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && csplit --version # csplit could get a failed assertion to 2.0.17 diff --git a/tests/misc/date-sec b/tests/misc/date-sec index 0d184131c0..a9f19a55b4 100755 --- a/tests/misc/date-sec +++ b/tests/misc/date-sec @@ -18,12 +18,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - date --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && date --version diff --git a/tests/misc/df b/tests/misc/df index 730f841a3d..22451c53af 100755 --- a/tests/misc/df +++ b/tests/misc/df @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - df --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && df --version case `df .` in *' diff --git a/tests/misc/df-P b/tests/misc/df-P index c7cada4993..bd4e0bc7ca 100755 --- a/tests/misc/df-P +++ b/tests/misc/df-P @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - df --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && df --version df -P . > t1 || fail=1 diff --git a/tests/misc/env b/tests/misc/env index 96a4eaba63..11343a1ffb 100755 --- a/tests/misc/env +++ b/tests/misc/env @@ -17,12 +17,8 @@ # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - env --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && env --version # Verify clearing the environment diff --git a/tests/misc/false-status b/tests/misc/false-status index 28f4ce4f2d..a8e1fa624c 100755 --- a/tests/misc/false-status +++ b/tests/misc/false-status @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - false --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && false --version false --version > /dev/null && fail=1 false --help > /dev/null && fail=1 diff --git a/tests/misc/fmt-long-line b/tests/misc/fmt-long-line index a8be381f14..3fb98e5727 100755 --- a/tests/misc/fmt-long-line +++ b/tests/misc/fmt-long-line @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - fmt --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && fmt --version printf '%2030s\n' ' '|sed 's/../ y/g' > in || framework_failure diff --git a/tests/misc/groups-dash b/tests/misc/groups-dash index 5c7989e1d3..ea4b94ac7e 100755 --- a/tests/misc/groups-dash +++ b/tests/misc/groups-dash @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - groups --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && groups --version require_built_ groups # Coreutils 6.9 and earlier failed to display information on first argument diff --git a/tests/misc/groups-version b/tests/misc/groups-version index b3a87873b6..ec157a26cf 100755 --- a/tests/misc/groups-version +++ b/tests/misc/groups-version @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - groups --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && groups --version require_built_ groups groups --version | sed 's/^groups/id/; /^$/q' > out || fail=1 diff --git a/tests/misc/head-c b/tests/misc/head-c index ab933ec7bb..70a0b45e83 100755 --- a/tests/misc/head-c +++ b/tests/misc/head-c @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - head --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && head --version echo abc > in || framework_failure diff --git a/tests/misc/head-pos b/tests/misc/head-pos index abbf22c0ab..8d5d00a276 100755 --- a/tests/misc/head-pos +++ b/tests/misc/head-pos @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - head --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && head --version (echo a; echo b) > in || framework_failure diff --git a/tests/misc/id-context b/tests/misc/id-context index b49fbc6929..8e380944ce 100755 --- a/tests/misc/id-context +++ b/tests/misc/id-context @@ -15,12 +15,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - id --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && id --version # Require selinux - when selinux is disabled, id never prints scontext. require_selinux_ diff --git a/tests/misc/id-groups b/tests/misc/id-groups index 0b50930c8a..8a6eea34d1 100755 --- a/tests/misc/id-groups +++ b/tests/misc/id-groups @@ -15,12 +15,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - id --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && id --version id -G $(id -nu) || fail=1 diff --git a/tests/misc/ls-time b/tests/misc/ls-time index eda0f0105a..721fb8128b 100755 --- a/tests/misc/ls-time +++ b/tests/misc/ls-time @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ls --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ls --version # Avoid any possible glitches due to daylight-saving changes near the # time stamps used during the test. diff --git a/tests/misc/mknod b/tests/misc/mknod index 872249262d..049ed0f72d 100755 --- a/tests/misc/mknod +++ b/tests/misc/mknod @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mknod --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mknod --version umask 777 diff --git a/tests/misc/nice b/tests/misc/nice index 3a724ad834..939a9aa620 100755 --- a/tests/misc/nice +++ b/tests/misc/nice @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - nice --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && nice --version tests=' 0 empty 10 diff --git a/tests/misc/nice-fail b/tests/misc/nice-fail index 9440233870..6c8314c6be 100755 --- a/tests/misc/nice-fail +++ b/tests/misc/nice-fail @@ -17,12 +17,8 @@ # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - nice --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && nice --version # These tests verify exact status of internal failure. diff --git a/tests/misc/nl b/tests/misc/nl index 506501d91a..81d0a40deb 100755 --- a/tests/misc/nl +++ b/tests/misc/nl @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - nl --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && nl --version echo a | nl > out || fail=1 diff --git a/tests/misc/nohup b/tests/misc/nohup index a7246df16e..9d3d76aa61 100755 --- a/tests/misc/nohup +++ b/tests/misc/nohup @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - nohup --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && nohup --version nohup sh -c 'echo stdout; echo stderr 1>&2' 2>err || fail=1 diff --git a/tests/misc/nproc-avail b/tests/misc/nproc-avail index ea4ba976c6..424bbe043b 100755 --- a/tests/misc/nproc-avail +++ b/tests/misc/nproc-avail @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - nproc --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && nproc --version all=$(nproc --all) available=$(OMP_NUM_THREADS= nproc) diff --git a/tests/misc/nproc-positive b/tests/misc/nproc-positive index 03157c51bb..1f12c9b96a 100755 --- a/tests/misc/nproc-positive +++ b/tests/misc/nproc-positive @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - nproc --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && nproc --version for mode in --all ''; do procs=$(nproc $mode) diff --git a/tests/misc/od-N b/tests/misc/od-N index 037ea371c2..6d09f8e983 100755 --- a/tests/misc/od-N +++ b/tests/misc/od-N @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - od --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && od --version echo abcdefg > in || framework_failure diff --git a/tests/misc/od-multiple-t b/tests/misc/od-multiple-t index bc482d9f53..0aecaf05b6 100755 --- a/tests/misc/od-multiple-t +++ b/tests/misc/od-multiple-t @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - od --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && od --version # Choose 48 bytes for the input, as that is lcm for 1, 2, 4, 8, 12, 16; # we don't anticipate any other native object size on modern hardware. diff --git a/tests/misc/od-x8 b/tests/misc/od-x8 index f25669efef..d9c9338002 100755 --- a/tests/misc/od-x8 +++ b/tests/misc/od-x8 @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - od --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && od --version od -t x8 /dev/null >/dev/null || skip_test_ "od lacks support for 8-byte quantities" diff --git a/tests/misc/pathchk1 b/tests/misc/pathchk1 index cc0def8665..ae32c9c295 100755 --- a/tests/misc/pathchk1 +++ b/tests/misc/pathchk1 @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - pathchk --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && pathchk --version skip_if_root_ touch file || framework_failure diff --git a/tests/misc/ptx-overrun b/tests/misc/ptx-overrun index 7cd5f84773..637c61d137 100755 --- a/tests/misc/ptx-overrun +++ b/tests/misc/ptx-overrun @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ptx --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ptx --version # Using a long file name makes an abort more likely. # Even with no file name, valgrind detects the buffer overrun. diff --git a/tests/misc/readlink-fp-loop b/tests/misc/readlink-fp-loop index dfb2ba19a2..ab66fa12a9 100755 --- a/tests/misc/readlink-fp-loop +++ b/tests/misc/readlink-fp-loop @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - readlink --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && readlink --version cwd=$("$abs_top_builddir/src/pwd") # To trigger this bug, we have to construct a name/situation during diff --git a/tests/misc/runcon-no-reorder b/tests/misc/runcon-no-reorder index c38c91d3c3..ee20df0412 100755 --- a/tests/misc/runcon-no-reorder +++ b/tests/misc/runcon-no-reorder @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - runcon --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && runcon --version diag='runcon: runcon may be used only on a SELinux kernel' echo "$diag" > exp || framework_failure diff --git a/tests/misc/seq-long-double b/tests/misc/seq-long-double index f9450a2eae..e07ea82db1 100755 --- a/tests/misc/seq-long-double +++ b/tests/misc/seq-long-double @@ -18,12 +18,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - seq --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && seq --version getlimits_ # Run this test only with glibc and sizeof (long double) > sizeof (double). diff --git a/tests/misc/shred-exact b/tests/misc/shred-exact index 289b4544c0..2aeef77ac8 100755 --- a/tests/misc/shred-exact +++ b/tests/misc/shred-exact @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - shred --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && shred --version for opt in --exact --zero; do diff --git a/tests/misc/shred-passes b/tests/misc/shred-passes index 8d92c053af..2298553eb8 100755 --- a/tests/misc/shred-passes +++ b/tests/misc/shred-passes @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - shred --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && shred --version # shred a single letter, zero length file which should result in diff --git a/tests/misc/shred-remove b/tests/misc/shred-remove index fbd30aaeaa..0e2423cff2 100755 --- a/tests/misc/shred-remove +++ b/tests/misc/shred-remove @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - shred --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && shred --version skip_if_root_ # The length of the basename is what matters. diff --git a/tests/misc/shuf b/tests/misc/shuf index 6adaae37f5..e612ee0bc8 100755 --- a/tests/misc/shuf +++ b/tests/misc/shuf @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - shuf --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && shuf --version seq 100 > in || framework_failure diff --git a/tests/misc/sort-compress b/tests/misc/sort-compress index 5ad28d69d5..bba07604da 100755 --- a/tests/misc/sort-compress +++ b/tests/misc/sort-compress @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - sort --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && sort --version seq -w 2000 > exp || framework_failure tac exp > in || framework_failure diff --git a/tests/misc/sort-continue b/tests/misc/sort-continue index c68ceece1d..e4b8adfb31 100755 --- a/tests/misc/sort-continue +++ b/tests/misc/sort-continue @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - sort --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && sort --version # Skip the test when running under valgrind. ( ulimit -n 6; sort < /dev/null ) \ diff --git a/tests/misc/sort-debug-keys b/tests/misc/sort-debug-keys index 1dd3895c9e..ee65a7284b 100755 --- a/tests/misc/sort-debug-keys +++ b/tests/misc/sort-debug-keys @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - sort --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && sort --version number() { cat -n | sed 's/^ *//'; } diff --git a/tests/misc/sort-debug-warn b/tests/misc/sort-debug-warn index 1ba6c0479c..67668a135a 100755 --- a/tests/misc/sort-debug-warn +++ b/tests/misc/sort-debug-warn @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - sort --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && sort --version cat <<\EOF > exp sort: using simple byte comparison diff --git a/tests/misc/sort-float b/tests/misc/sort-float index 04071598ff..bd6a9b88b5 100755 --- a/tests/misc/sort-float +++ b/tests/misc/sort-float @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - sort --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && sort --version # Return 0 if LDBL_MIN is smaller than DBL_MIN, else 1. # Dissect numbers like these, comparing first exponent, then diff --git a/tests/misc/sort-merge-fdlimit b/tests/misc/sort-merge-fdlimit index 56b8518114..89a4084905 100755 --- a/tests/misc/sort-merge-fdlimit +++ b/tests/misc/sort-merge-fdlimit @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - sort --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && sort --version require_ulimit_ mkdir in err || framework_failure diff --git a/tests/misc/sort-month b/tests/misc/sort-month index 5ac6afde57..c0fb2eb916 100755 --- a/tests/misc/sort-month +++ b/tests/misc/sort-month @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - sort --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && sort --version locale --version >/dev/null 2>&1 || skip_test_ 'The locale utility is not present' diff --git a/tests/misc/sort-rand b/tests/misc/sort-rand index cead49ef52..07169e3c6f 100755 --- a/tests/misc/sort-rand +++ b/tests/misc/sort-rand @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - sort --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && sort --version seq 100 > in || framework_failure diff --git a/tests/misc/sort-version b/tests/misc/sort-version index 741ee8b27e..e6a07c27b7 100755 --- a/tests/misc/sort-version +++ b/tests/misc/sort-version @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - sort --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && sort --version cat > in << _EOF_ gcc-c++-10.fc9.tar.gz diff --git a/tests/misc/split-a b/tests/misc/split-a index 2fefff59d8..27269e2dbf 100755 --- a/tests/misc/split-a +++ b/tests/misc/split-a @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - split --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && split --version a_z='a b c d e f g h i j k l m n o p q r s t u v w x y z' diff --git a/tests/misc/split-fail b/tests/misc/split-fail index 0ce6f57340..ec1941691a 100755 --- a/tests/misc/split-fail +++ b/tests/misc/split-fail @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - split --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && split --version getlimits_ touch in || framework_failure diff --git a/tests/misc/split-l b/tests/misc/split-l index fb07a27a06..2e64a2c933 100755 --- a/tests/misc/split-l +++ b/tests/misc/split-l @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - ln --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && ln --version printf '1\n2\n3\n4\n5\n' > in || framework_failure diff --git a/tests/misc/stat-fmt b/tests/misc/stat-fmt index 3133c51030..5e58ea46ac 100755 --- a/tests/misc/stat-fmt +++ b/tests/misc/stat-fmt @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - stat --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && stat --version diff --git a/tests/misc/stat-hyphen b/tests/misc/stat-hyphen index ea68b08fa5..2e0fdd29aa 100755 --- a/tests/misc/stat-hyphen +++ b/tests/misc/stat-hyphen @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - stat --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && stat --version printf -- '-\n' > exp || framework_failure touch f || framework_failure diff --git a/tests/misc/stat-slash b/tests/misc/stat-slash index 7210f92fd0..4f0660f220 100755 --- a/tests/misc/stat-slash +++ b/tests/misc/stat-slash @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - stat --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && stat --version touch file || framework_failure mkdir dir || framework_failure diff --git a/tests/misc/stty-invalid b/tests/misc/stty-invalid index 0537568bf7..d80e3d4139 100755 --- a/tests/misc/stty-invalid +++ b/tests/misc/stty-invalid @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - stty --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && stty --version require_controlling_input_terminal_ trap '' TTOU # Ignore SIGTTOU diff --git a/tests/misc/tac-continue b/tests/misc/tac-continue index 5bf709f78a..59dddc83e9 100755 --- a/tests/misc/tac-continue +++ b/tests/misc/tac-continue @@ -18,12 +18,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - tac --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && tac --version # See if the envvar is defined. if test x = "x$FULL_PARTITION_TMPDIR"; then diff --git a/tests/misc/tee b/tests/misc/tee index 6c4c859043..9562966ae9 100755 --- a/tests/misc/tee +++ b/tests/misc/tee @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - tee --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && tee --version echo line >sample || framework_failure nums=`seq 9` || framework_failure diff --git a/tests/misc/tee-dash b/tests/misc/tee-dash index ba688c00da..e72eadeef5 100755 --- a/tests/misc/tee-dash +++ b/tests/misc/tee-dash @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - tee --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && tee --version tee - . -if test "$VERBOSE" = yes; then - set -x - timeout --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && timeout --version # no timeout timeout 10 true || fail=1 diff --git a/tests/misc/timeout-parameters b/tests/misc/timeout-parameters index 42d7b13b26..c5949e62b8 100755 --- a/tests/misc/timeout-parameters +++ b/tests/misc/timeout-parameters @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - timeout --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && timeout --version getlimits_ diff --git a/tests/misc/truncate-dangling-symlink b/tests/misc/truncate-dangling-symlink index 3499da755f..801b55d17b 100755 --- a/tests/misc/truncate-dangling-symlink +++ b/tests/misc/truncate-dangling-symlink @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - truncate --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && truncate --version ln -s truncate-target t-symlink diff --git a/tests/misc/truncate-dir-fail b/tests/misc/truncate-dir-fail index fe33857a2a..cc94dc4bcc 100755 --- a/tests/misc/truncate-dir-fail +++ b/tests/misc/truncate-dir-fail @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - truncate --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && truncate --version # truncate on dir not allowed truncate -s+0 . && fail=1 diff --git a/tests/misc/truncate-fail-diag b/tests/misc/truncate-fail-diag index 5ce248113e..68a3842365 100755 --- a/tests/misc/truncate-fail-diag +++ b/tests/misc/truncate-fail-diag @@ -20,12 +20,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - truncate --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && truncate --version skip_if_root_ diff --git a/tests/misc/truncate-fifo b/tests/misc/truncate-fifo index a4c36cb90b..469ba5e970 100755 --- a/tests/misc/truncate-fifo +++ b/tests/misc/truncate-fifo @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - truncate --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && truncate --version mkfifo_or_skip_ fifo diff --git a/tests/misc/truncate-no-create-missing b/tests/misc/truncate-no-create-missing index aa43d80268..c5a87c2d07 100755 --- a/tests/misc/truncate-no-create-missing +++ b/tests/misc/truncate-no-create-missing @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - truncate --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && truncate --version # truncate -c no-such-file should not fail. diff --git a/tests/misc/truncate-overflow b/tests/misc/truncate-overflow index 0e9519f640..991c1c83fb 100755 --- a/tests/misc/truncate-overflow +++ b/tests/misc/truncate-overflow @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - truncate --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && truncate --version getlimits_ diff --git a/tests/misc/truncate-parameters b/tests/misc/truncate-parameters index c2f7019708..980ebffaba 100755 --- a/tests/misc/truncate-parameters +++ b/tests/misc/truncate-parameters @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - truncate --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && truncate --version # must specify at least 1 file diff --git a/tests/misc/truncate-relative b/tests/misc/truncate-relative index 9d589564f2..a82fd9c321 100755 --- a/tests/misc/truncate-relative +++ b/tests/misc/truncate-relative @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - truncate --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && truncate --version # mixture of relative modifiers not allowed diff --git a/tests/misc/wc-files0 b/tests/misc/wc-files0 index eb2aaa6491..7d3634e957 100755 --- a/tests/misc/wc-files0 +++ b/tests/misc/wc-files0 @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - wc --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && wc --version echo 2 > 2b || framework_failure echo 2 words > 2w || framework_failure diff --git a/tests/mkdir/p-1 b/tests/mkdir/p-1 index cd60d9f369..9c8e8a5d8d 100755 --- a/tests/mkdir/p-1 +++ b/tests/mkdir/p-1 @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mkdir --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mkdir --version mkdir --parents "`pwd`/t" || fail=1 test -d t || fail=1 diff --git a/tests/mkdir/p-2 b/tests/mkdir/p-2 index 863f188dc1..735d7ad080 100755 --- a/tests/mkdir/p-2 +++ b/tests/mkdir/p-2 @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mkdir --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mkdir --version mkdir --parents "`pwd`/t/u" || fail=1 test -d t/u || fail=1 diff --git a/tests/mkdir/p-3 b/tests/mkdir/p-3 index 116c794be9..ddc812e0ec 100755 --- a/tests/mkdir/p-3 +++ b/tests/mkdir/p-3 @@ -18,12 +18,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mkdir --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mkdir --version skip_if_root_ mkdir no-access || framework_failure diff --git a/tests/mkdir/p-slashdot b/tests/mkdir/p-slashdot index 49843f1c0d..fba112df28 100755 --- a/tests/mkdir/p-slashdot +++ b/tests/mkdir/p-slashdot @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mkdir --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mkdir --version mkdir -p d1/. || fail=1 diff --git a/tests/mkdir/p-thru-slink b/tests/mkdir/p-thru-slink index 687c0ffed6..e2cc9c93f9 100755 --- a/tests/mkdir/p-thru-slink +++ b/tests/mkdir/p-thru-slink @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mkdir --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mkdir --version ln -s . slink || framework_failure diff --git a/tests/mkdir/p-v b/tests/mkdir/p-v index 6118b492a5..aeae33da9b 100755 --- a/tests/mkdir/p-v +++ b/tests/mkdir/p-v @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mkdir --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mkdir --version mkdir -pv foo/a/b/c/d >out || fail=1 diff --git a/tests/mkdir/parents b/tests/mkdir/parents index 405cc19426..951b6f9e01 100755 --- a/tests/mkdir/parents +++ b/tests/mkdir/parents @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mkdir --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mkdir --version skip_if_setgid_ mkdir -m 700 e-dir || framework_failure diff --git a/tests/mkdir/perm b/tests/mkdir/perm index 7707e4f8d1..0cd0a55811 100755 --- a/tests/mkdir/perm +++ b/tests/mkdir/perm @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mkdir --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mkdir --version skip_if_setgid_ working_umask_or_skip_ diff --git a/tests/mkdir/special-1 b/tests/mkdir/special-1 index 93d203e779..7ed437021d 100755 --- a/tests/mkdir/special-1 +++ b/tests/mkdir/special-1 @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mkdir --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mkdir --version set_mode_string=u=rwx,g=rx,o=w,-s,+t output_mode_string=drwxr-x-wT diff --git a/tests/mkdir/t-slash b/tests/mkdir/t-slash index 053f98df3d..ed72880c74 100755 --- a/tests/mkdir/t-slash +++ b/tests/mkdir/t-slash @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mkdir --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mkdir --version mkdir -p dir/ || fail=1 diff --git a/tests/mkdir/writable-under-readonly b/tests/mkdir/writable-under-readonly index 18a44ae9a5..2c8ac52f4e 100755 --- a/tests/mkdir/writable-under-readonly +++ b/tests/mkdir/writable-under-readonly @@ -24,12 +24,8 @@ # # Demonstrate the problem, as root: -if test "$VERBOSE" = yes; then - set -x - mkdir --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mkdir --version require_root_ # FIXME: for now, skip it unconditionally diff --git a/tests/mv/atomic b/tests/mv/atomic index 1d313c59e1..5df2d60fd0 100755 --- a/tests/mv/atomic +++ b/tests/mv/atomic @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mv --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mv --version require_strace_ unlink # Before the fix, mv would unnecessarily unlink the destination symlink: diff --git a/tests/mv/atomic2 b/tests/mv/atomic2 index 49949bd7ce..4bc0e73fe1 100755 --- a/tests/mv/atomic2 +++ b/tests/mv/atomic2 @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mv --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mv --version require_strace_ unlink # Before the fix, mv would unnecessarily unlink the destination symlink: diff --git a/tests/mv/backup-dir b/tests/mv/backup-dir index 3c2bb52620..a96edc680a 100755 --- a/tests/mv/backup-dir +++ b/tests/mv/backup-dir @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mv --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mv --version mkdir A B || framework_failure touch X Y || framework_failure diff --git a/tests/mv/backup-is-src b/tests/mv/backup-is-src index 45ca17cbb1..fe5c680496 100755 --- a/tests/mv/backup-is-src +++ b/tests/mv/backup-is-src @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mv --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mv --version cleanup_() { rm -rf "$other_partition_tmpdir"; } . "$abs_srcdir/other-fs-tmpdir" diff --git a/tests/mv/dir-file b/tests/mv/dir-file index 4a0b37a4a0..ebe2a673f8 100755 --- a/tests/mv/dir-file +++ b/tests/mv/dir-file @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mv --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mv --version mkdir -p dir/file || framework_failure > file || framework_failure diff --git a/tests/mv/dir2dir b/tests/mv/dir2dir index 8df625db5f..de7770b5d0 100755 --- a/tests/mv/dir2dir +++ b/tests/mv/dir2dir @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mv --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mv --version mkdir -p a/t b/t || framework_failure touch a/t/f || framework_failure diff --git a/tests/mv/force b/tests/mv/force index bebb04a26d..708efcbf45 100755 --- a/tests/mv/force +++ b/tests/mv/force @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mv --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mv --version ff=mvforce ff2=mvforce2 diff --git a/tests/mv/hard-3 b/tests/mv/hard-3 index bf6675fe9a..61d71c1faf 100755 --- a/tests/mv/hard-3 +++ b/tests/mv/hard-3 @@ -30,12 +30,8 @@ # directory, because it requires use of the --preserve=link option that # mv enables by default. -if test "$VERBOSE" = yes; then - set -x - cp --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && cp --version skip_if_root_ mkdir -p x dst/x || framework_failure diff --git a/tests/mv/hard-4 b/tests/mv/hard-4 index d3a513af84..b22969eb46 100755 --- a/tests/mv/hard-4 +++ b/tests/mv/hard-4 @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mv --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mv --version touch a || framework_failure ln a b || framework_failure diff --git a/tests/mv/hard-link-1 b/tests/mv/hard-link-1 index b3d5ce6d6c..3d7c6abf0d 100755 --- a/tests/mv/hard-link-1 +++ b/tests/mv/hard-link-1 @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mv --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mv --version cleanup_() { rm -rf "$other_partition_tmpdir"; } . "$abs_srcdir/other-fs-tmpdir" diff --git a/tests/mv/hard-verbose b/tests/mv/hard-verbose index 4c81752c64..8c0dfe0fa4 100755 --- a/tests/mv/hard-verbose +++ b/tests/mv/hard-verbose @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mv --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mv --version touch x || framework_failure ln x y || framework_failure diff --git a/tests/mv/i-3 b/tests/mv/i-3 index 7247d94327..fededda975 100755 --- a/tests/mv/i-3 +++ b/tests/mv/i-3 @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mv --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mv --version require_controlling_input_terminal_ skip_if_root_ trap '' TTIN # Ignore SIGTTIN diff --git a/tests/mv/i-4 b/tests/mv/i-4 index dfd7d8a1b8..d5d7465619 100755 --- a/tests/mv/i-4 +++ b/tests/mv/i-4 @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mv --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mv --version for i in a b; do echo $i > $i || framework_failure diff --git a/tests/mv/i-5 b/tests/mv/i-5 index e1d8a52359..e73d4b209f 100755 --- a/tests/mv/i-5 +++ b/tests/mv/i-5 @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mv --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mv --version mkdir a || framework_failure touch b || framework_failure diff --git a/tests/mv/i-link-no b/tests/mv/i-link-no index e206d2ccc7..2d76301095 100755 --- a/tests/mv/i-link-no +++ b/tests/mv/i-link-no @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mv --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mv --version mkdir a b || framework_failure echo foo > a/foo || framework_failure diff --git a/tests/mv/into-self b/tests/mv/into-self index ea999d84b5..2c28a2f713 100755 --- a/tests/mv/into-self +++ b/tests/mv/into-self @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mv --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mv --version dir=toself-dir file=toself-file diff --git a/tests/mv/into-self-2 b/tests/mv/into-self-2 index 720bc98393..c5d1bd5c4c 100755 --- a/tests/mv/into-self-2 +++ b/tests/mv/into-self-2 @@ -18,12 +18,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mv --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mv --version cleanup_() { rm -rf "$other_partition_tmpdir"; } . "$abs_srcdir/other-fs-tmpdir" diff --git a/tests/mv/into-self-3 b/tests/mv/into-self-3 index d11365a992..8a506626cb 100755 --- a/tests/mv/into-self-3 +++ b/tests/mv/into-self-3 @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mv --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mv --version dir1=is3-dir1 dir2=is3-dir2 diff --git a/tests/mv/into-self-4 b/tests/mv/into-self-4 index 6182c89096..18a32dc591 100755 --- a/tests/mv/into-self-4 +++ b/tests/mv/into-self-4 @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mv --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mv --version touch file || framework_failure ln -s file s || framework_failure diff --git a/tests/mv/leak-fd b/tests/mv/leak-fd index 424f72517d..3155397e79 100755 --- a/tests/mv/leak-fd +++ b/tests/mv/leak-fd @@ -18,12 +18,8 @@ # along with this program. If not, see . # limit so don't run it by default. -if test "$VERBOSE" = yes; then - set -x - mv --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mv --version skip_if_root_ cleanup_() { rm -rf "$other_partition_tmpdir"; } . "$abs_srcdir/other-fs-tmpdir" diff --git a/tests/mv/mv-n b/tests/mv/mv-n index 5886341c00..32739dd9f6 100755 --- a/tests/mv/mv-n +++ b/tests/mv/mv-n @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mv --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mv --version # test miscellaneous combinations of -f -i -n parameters diff --git a/tests/mv/mv-special-1 b/tests/mv/mv-special-1 index 35bdc84c68..fe10acda7e 100755 --- a/tests/mv/mv-special-1 +++ b/tests/mv/mv-special-1 @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mv --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mv --version cleanup_() { rm -rf "$other_partition_tmpdir"; } . "$abs_srcdir/other-fs-tmpdir" diff --git a/tests/mv/no-target-dir b/tests/mv/no-target-dir index 080a290db2..f1d886ba58 100755 --- a/tests/mv/no-target-dir +++ b/tests/mv/no-target-dir @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mv --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mv --version mkdir -p d/sub empty src d2/sub e2 || framework_failure touch f || framework_failure diff --git a/tests/mv/part-fail b/tests/mv/part-fail index 41240c0738..c167076af7 100755 --- a/tests/mv/part-fail +++ b/tests/mv/part-fail @@ -19,12 +19,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mv --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mv --version skip_if_root_ cleanup_() { t=$other_partition_tmpdir; chmod -R 700 "$t"; rm -rf "$t"; } . "$abs_srcdir/other-fs-tmpdir" diff --git a/tests/mv/part-hardlink b/tests/mv/part-hardlink index 5b372d421c..b97b0a0b5e 100755 --- a/tests/mv/part-hardlink +++ b/tests/mv/part-hardlink @@ -19,12 +19,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mv --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mv --version cleanup_() { rm -rf "$other_partition_tmpdir"; } . "$abs_srcdir/other-fs-tmpdir" diff --git a/tests/mv/part-rename b/tests/mv/part-rename index ff32aa9b48..3f18045b48 100755 --- a/tests/mv/part-rename +++ b/tests/mv/part-rename @@ -18,12 +18,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mv --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mv --version cleanup_() { rm -rf "$other_partition_tmpdir"; } . "$abs_srcdir/other-fs-tmpdir" diff --git a/tests/mv/partition-perm b/tests/mv/partition-perm index 27007bdbc7..01b1697d45 100755 --- a/tests/mv/partition-perm +++ b/tests/mv/partition-perm @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mv --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mv --version cleanup_() { rm -rf "$other_partition_tmpdir"; } . "$abs_srcdir/other-fs-tmpdir" diff --git a/tests/mv/perm-1 b/tests/mv/perm-1 index 84b5828fde..fda23ed2d6 100755 --- a/tests/mv/perm-1 +++ b/tests/mv/perm-1 @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mv --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mv --version skip_if_root_ mkdir -p no-write/dir || framework_failure diff --git a/tests/mv/sticky-to-xpart b/tests/mv/sticky-to-xpart index fbb6ab29b4..513c325651 100755 --- a/tests/mv/sticky-to-xpart +++ b/tests/mv/sticky-to-xpart @@ -19,12 +19,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mv --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mv --version require_root_ cleanup_() { rm -rf "$other_partition_tmpdir"; } diff --git a/tests/mv/to-symlink b/tests/mv/to-symlink index d9d77a83fe..5530eee4fb 100755 --- a/tests/mv/to-symlink +++ b/tests/mv/to-symlink @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mv --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mv --version cleanup_() { rm -rf "$other_partition_tmpdir"; } . "$abs_srcdir/other-fs-tmpdir" diff --git a/tests/mv/trailing-slash b/tests/mv/trailing-slash index c23fbdb730..b0b362c8fd 100755 --- a/tests/mv/trailing-slash +++ b/tests/mv/trailing-slash @@ -19,12 +19,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - mv --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && mv --version mkdir foo || framework_failure diff --git a/tests/readlink/can-e b/tests/readlink/can-e index 41656f4777..d7e934e390 100755 --- a/tests/readlink/can-e +++ b/tests/readlink/can-e @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - readlink --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && readlink --version pwd=`pwd` my_pwd=$("$abs_top_builddir/src/pwd") diff --git a/tests/readlink/can-f b/tests/readlink/can-f index 2cfac18a17..a5020e6468 100755 --- a/tests/readlink/can-f +++ b/tests/readlink/can-f @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - readlink --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && readlink --version pwd=`pwd` my_pwd=$("$abs_top_builddir/src/pwd") diff --git a/tests/readlink/can-m b/tests/readlink/can-m index ee24e69cda..cf7c994bdd 100755 --- a/tests/readlink/can-m +++ b/tests/readlink/can-m @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - readlink --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && readlink --version pwd=`pwd` my_pwd=$("$abs_top_builddir/src/pwd") diff --git a/tests/readlink/rl-1 b/tests/readlink/rl-1 index f6885ff0b3..36dde3dc2e 100755 --- a/tests/readlink/rl-1 +++ b/tests/readlink/rl-1 @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - readlink --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && readlink --version mkdir subdir || framework_failure touch regfile || framework_failure diff --git a/tests/rm/cycle b/tests/rm/cycle index e700dbf388..4af7afee39 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 . -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 270459c5b3..b082901a62 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 . -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 8616679161..b21e1e6034 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 cb52b7fed8..c90f607308 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 . -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 c1b6fc4cb9..8dc19d4fa4 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 . -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 7f62bd59c3..816b72d184 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 . -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 e88e9238fa..81d405a726 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 . -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 70c974c6bc..3aef6abaa7 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 . -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 227d4b9974..155de18288 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 . -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 819dc2f19d..6400d5b844 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 04b2ad1e31..0085d1f48c 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 . -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 5d87211f9c..fc20bd69ec 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 . -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 9573f7a3d0..8a4d66154b 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 . -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 b73b617254..20e88e8757 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 fa6d911a3e..b00d3ef1bf 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 . -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 c0548b0879..3178a98434 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 . -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 f7f66b3ee4..9028de8dc0 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 . -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 722e49cb98..6e09de67af 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 . -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 8444f7d36a..9e15e22580 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 bc612b0e77..48086d704c 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 e453def757..b48fa948b8 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 ac3e1420be..1b18654cb1 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 . -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 9ee0357fe9..e85196ce7d 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 . -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 cb0b713b44..8abf7dc719 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 . -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 64725c7bea..83a9cecee0 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 . -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 c1d2d815e7..e07881b0e0 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 445c634c77..485620fe40 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 . -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 3d944f6a9f..829685055d 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 0b6658a4e4..c8d3f9bc7b 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 . -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 eb9a0cbd53..c54259469e 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 . -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 c446d752b9..be3e546c0e 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 . -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 5e54adf345..46ae769716 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 . -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 35fd2f9fd2..11b153feea 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 . -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 5b90025b84..b62dec6031 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 . -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 0f73b276d3..571fdb0194 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 . -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 311b3ee99a..1d27f7cdaa 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 . -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 be988e11f6..3057ecbbd8 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 5da31756a6..69c27474e6 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 . -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 4627c125ff..a2782bbba4 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 . -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 e53d9d9341..a9ab828bc4 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 . -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 diff --git a/tests/rmdir/fail-perm b/tests/rmdir/fail-perm index cadab59bae..8c37f8d90d 100755 --- a/tests/rmdir/fail-perm +++ b/tests/rmdir/fail-perm @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - rmdir --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && rmdir --version mkdir d d/e d/e/f || framework_failure chmod a-w d || framework_failure diff --git a/tests/rmdir/ignore b/tests/rmdir/ignore index 97b51125ba..08183607e7 100755 --- a/tests/rmdir/ignore +++ b/tests/rmdir/ignore @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - rmdir --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && rmdir --version cwd=`pwd` mkdir -p "$cwd/a/b/c" "$cwd/a/x" || framework_failure diff --git a/tests/rmdir/t-slash b/tests/rmdir/t-slash index e035c439c4..f7d1f0dceb 100755 --- a/tests/rmdir/t-slash +++ b/tests/rmdir/t-slash @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - rmdir --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && rmdir --version mkdir dir || framework_failure diff --git a/tests/tail-2/append-only b/tests/tail-2/append-only index 327c41c6fa..32578fe573 100755 --- a/tests/tail-2/append-only +++ b/tests/tail-2/append-only @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - tail --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && tail --version require_root_ chattr_a_works=1 diff --git a/tests/tail-2/assert b/tests/tail-2/assert index 08cd888649..1fdb76a778 100755 --- a/tests/tail-2/assert +++ b/tests/tail-2/assert @@ -23,12 +23,8 @@ # Aborted # due to a race condition in which a dev/inode pair is reused. -if test "$VERBOSE" = yes; then - set -x - tail --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && tail --version # Not "expensive" per se, but sleeping for so long is annoying. very_expensive_ diff --git a/tests/tail-2/assert-2 b/tests/tail-2/assert-2 index 066d6af2cf..fec0525ed8 100755 --- a/tests/tail-2/assert-2 +++ b/tests/tail-2/assert-2 @@ -18,12 +18,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - tail --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && tail --version # Not "expensive" per se, but sleeping for so long is annoying. very_expensive_ diff --git a/tests/tail-2/big-4gb b/tests/tail-2/big-4gb index ec262a9469..3496a622fd 100755 --- a/tests/tail-2/big-4gb +++ b/tests/tail-2/big-4gb @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - tail --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && tail --version expensive_ # Create a file of size exactly 4GB (2^32) with 8 bytes diff --git a/tests/tail-2/flush-initial b/tests/tail-2/flush-initial index 98de2e1f57..df8810dcc0 100755 --- a/tests/tail-2/flush-initial +++ b/tests/tail-2/flush-initial @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - tail --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && tail --version echo line > in || fail=1 # Output should be buffered since we're writing to file diff --git a/tests/tail-2/follow-stdin b/tests/tail-2/follow-stdin index a0e07e6bce..1c50e8b66f 100755 --- a/tests/tail-2/follow-stdin +++ b/tests/tail-2/follow-stdin @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - tail --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && tail --version echo line > exp || framework_failure echo line > in || framework_failure diff --git a/tests/tail-2/infloop-1 b/tests/tail-2/infloop-1 index 895b21dca9..7e98daf6a0 100755 --- a/tests/tail-2/infloop-1 +++ b/tests/tail-2/infloop-1 @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - tail --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && tail --version yes > t & yes_pid=$! diff --git a/tests/tail-2/inotify-hash-abuse2 b/tests/tail-2/inotify-hash-abuse2 index c0cca2338e..f3018a57af 100755 --- a/tests/tail-2/inotify-hash-abuse2 +++ b/tests/tail-2/inotify-hash-abuse2 @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - tail --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && tail --version touch f || framework_failure diff --git a/tests/tail-2/inotify-race b/tests/tail-2/inotify-race index a6393df566..2deff69ae6 100755 --- a/tests/tail-2/inotify-race +++ b/tests/tail-2/inotify-race @@ -20,12 +20,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - tail --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && tail --version # Don't run this test by default because sometimes it's skipped as noted below. # Also gdb has a bug in Debian's gdb-6.8-3 at least that causes it to not diff --git a/tests/tail-2/pid b/tests/tail-2/pid index b1286df05f..b684a36177 100755 --- a/tests/tail-2/pid +++ b/tests/tail-2/pid @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - tail --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && tail --version getlimits_ touch empty here || framework_failure diff --git a/tests/tail-2/pipe-f b/tests/tail-2/pipe-f index bf38c183c6..b6fef16d7c 100755 --- a/tests/tail-2/pipe-f +++ b/tests/tail-2/pipe-f @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - tail --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && tail --version echo foo | timeout 10 tail -f -c3 > out || fail=1 echo oo > exp || fail=1 diff --git a/tests/tail-2/pipe-f2 b/tests/tail-2/pipe-f2 index 83a2265204..426f37b50a 100755 --- a/tests/tail-2/pipe-f2 +++ b/tests/tail-2/pipe-f2 @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - tail --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && tail --version mkfifo_or_skip_ fifo diff --git a/tests/tail-2/proc-ksyms b/tests/tail-2/proc-ksyms index 21e275291e..3e63bfed87 100755 --- a/tests/tail-2/proc-ksyms +++ b/tests/tail-2/proc-ksyms @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - tail --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && tail --version ksyms=/proc/ksyms diff --git a/tests/tail-2/start-middle b/tests/tail-2/start-middle index b98c86863d..404562d889 100755 --- a/tests/tail-2/start-middle +++ b/tests/tail-2/start-middle @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - tail --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && tail --version (echo 1; echo 2) > k || framework_failure diff --git a/tests/tail-2/tail-n0f b/tests/tail-2/tail-n0f index 6a9b59c373..d7badd74f2 100755 --- a/tests/tail-2/tail-n0f +++ b/tests/tail-2/tail-n0f @@ -21,12 +21,8 @@ # It skips the test if your system lacks a /proc/$pid/status # file, or if its contents don't look right. -if test "$VERBOSE" = yes; then - set -x - tail --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && tail --version require_proc_pid_status_ diff --git a/tests/tail-2/wait b/tests/tail-2/wait index a9636910e1..36cfa0e8c3 100755 --- a/tests/tail-2/wait +++ b/tests/tail-2/wait @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - tail --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && tail --version touch here || framework_failure { touch unreadable && chmod a-r unreadable; } || framework_failure diff --git a/tests/touch/60-seconds b/tests/touch/60-seconds index e06c770f29..e50c257656 100755 --- a/tests/touch/60-seconds +++ b/tests/touch/60-seconds @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - touch --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && touch --version echo 60.000000000 > exp || framework_failure diff --git a/tests/touch/dangling-symlink b/tests/touch/dangling-symlink index 6847e460b4..55466c4391 100755 --- a/tests/touch/dangling-symlink +++ b/tests/touch/dangling-symlink @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - touch --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && touch --version rm -f touch-target t-symlink ln -s touch-target t-symlink diff --git a/tests/touch/dir-1 b/tests/touch/dir-1 index ef1543e26e..2d61bb58fe 100755 --- a/tests/touch/dir-1 +++ b/tests/touch/dir-1 @@ -2,12 +2,8 @@ # Make sure touch can operate on a directory. # This was broken in the 4.0[efg] test releases. -if test "$VERBOSE" = yes; then - set -x - touch --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && touch --version touch . || fail=1 Exit $fail diff --git a/tests/touch/empty-file b/tests/touch/empty-file index e279138b2f..e93bf0ac09 100755 --- a/tests/touch/empty-file +++ b/tests/touch/empty-file @@ -21,12 +21,8 @@ # fails to work on SunOS 4.1.3 with `most of the recommended patches' when # the empty file is on an NFS-mounted 4.2 volume. -if test "$VERBOSE" = yes; then - set -x - touch --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && touch --version DEFAULT_SLEEP_SECONDS=2 SLEEP_SECONDS=${SLEEP_SECONDS=$DEFAULT_SLEEP_SECONDS} diff --git a/tests/touch/fail-diag b/tests/touch/fail-diag index 1b7acbc873..a957a8fdbf 100755 --- a/tests/touch/fail-diag +++ b/tests/touch/fail-diag @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - touch --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && touch --version skip_if_root_ d1=no-$$ diff --git a/tests/touch/fifo b/tests/touch/fifo index bf117d9edd..e6743d1662 100755 --- a/tests/touch/fifo +++ b/tests/touch/fifo @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - touch --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && touch --version mkfifo_or_skip_ fifo diff --git a/tests/touch/no-create-missing b/tests/touch/no-create-missing index 7c47c61846..96aa092326 100755 --- a/tests/touch/no-create-missing +++ b/tests/touch/no-create-missing @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - touch --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && touch --version touch -c no-file > /dev/null 2>&1 || fail=1 diff --git a/tests/touch/no-dereference b/tests/touch/no-dereference index 8d80fa5f50..95002e5677 100755 --- a/tests/touch/no-dereference +++ b/tests/touch/no-dereference @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - touch --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && touch --version ln -s nowhere dangling || framework_failure touch file || framework_failure diff --git a/tests/touch/no-rights b/tests/touch/no-rights index f0805e75df..d2032550b2 100755 --- a/tests/touch/no-rights +++ b/tests/touch/no-rights @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - touch --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && touch --version # Make sure t2 is newer than t1. touch -d '2000-01-01 00:00' t1 || framework_failure diff --git a/tests/touch/not-owner b/tests/touch/not-owner index 68eef1fa9d..9645f4dbd6 100755 --- a/tests/touch/not-owner +++ b/tests/touch/not-owner @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - touch --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && touch --version if env -- test -w /; then skip_test_ you have write access to /. diff --git a/tests/touch/now-owned-by-other b/tests/touch/now-owned-by-other index b59f0d3bdb..c7215022c3 100755 --- a/tests/touch/now-owned-by-other +++ b/tests/touch/now-owned-by-other @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - touch --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && touch --version require_root_ group_num=$(id -g $NON_ROOT_USERNAME) diff --git a/tests/touch/obsolescent b/tests/touch/obsolescent index 3c0925b0fa..9821fc1e47 100755 --- a/tests/touch/obsolescent +++ b/tests/touch/obsolescent @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - touch --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && touch --version _POSIX2_VERSION=199209; export _POSIX2_VERSION POSIXLY_CORRECT=1; export POSIXLY_CORRECT diff --git a/tests/touch/read-only b/tests/touch/read-only index 06135c7b8c..265f2880b7 100755 --- a/tests/touch/read-only +++ b/tests/touch/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 . -if test "$VERBOSE" = yes; then - set -x - touch --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && touch --version skip_if_root_ : > read-only || framework_failure diff --git a/tests/touch/relative b/tests/touch/relative index b9f8c2c923..7e56a305ab 100755 --- a/tests/touch/relative +++ b/tests/touch/relative @@ -17,12 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - touch --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && touch --version TZ=UTC0 touch --date='2004-01-16 12:00 +0000' f || framework_failure diff --git a/tests/touch/trailing-slash b/tests/touch/trailing-slash index c1fb8833e9..97b9100182 100755 --- a/tests/touch/trailing-slash +++ b/tests/touch/trailing-slash @@ -16,12 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if test "$VERBOSE" = yes; then - set -x - touch --version -fi - -. $srcdir/test-lib.sh +. "${srcdir=.}/init.sh"; path_prepend_ ../src +test "$VERBOSE" = yes && touch --version ln -s nowhere dangling || framework_failure ln -s loop loop || framework_failure