From 293c37b9061c1afd0acd143bbded637a8f00b3a0 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 17 Nov 2010 21:35:31 +0100 Subject: tests: substitute the single-program $VERBOSE/--version uses Automatically make all of the changes like this: -test "$VERBOSE" = yes && chgrp --version +print_ver_ chgrp git grep -l 'VERBOSE.*--version'|xargs perl -pi -e \ 's/test "\$VERBOSE" = yes && (\w+) --version/print_ver_ $1/' --- tests/ls/abmon-align | 2 +- tests/ls/capability | 2 +- tests/ls/color-clear-to-eol | 2 +- tests/ls/color-dtype-dir | 2 +- tests/ls/color-norm | 2 +- tests/ls/dangle | 2 +- tests/ls/dired | 2 +- tests/ls/file-type | 2 +- tests/ls/follow-slink | 2 +- tests/ls/infloop | 2 +- tests/ls/inode | 2 +- tests/ls/m-option | 2 +- tests/ls/multihardlink | 2 +- tests/ls/nameless-uid | 2 +- tests/ls/no-arg | 2 +- tests/ls/no-cap | 2 +- tests/ls/proc-selinux-segfault | 2 +- tests/ls/readdir-mountpoint-inode | 2 +- tests/ls/recursive | 2 +- tests/ls/stat-dtype | 2 +- tests/ls/stat-failed | 2 +- tests/ls/stat-free-symlinks | 2 +- tests/ls/stat-vs-dirent | 2 +- tests/ls/symlink-slash | 2 +- tests/ls/x-option | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) (limited to 'tests/ls') diff --git a/tests/ls/abmon-align b/tests/ls/abmon-align index 21c22f480..8d27bdc57 100755 --- a/tests/ls/abmon-align +++ b/tests/ls/abmon-align @@ -17,7 +17,7 @@ # along with this program. If not, see . . "${srcdir=.}/init.sh"; path_prepend_ ../src -test "$VERBOSE" = yes && ls --version +print_ver_ ls 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 200060ae8..588ec6d07 100755 --- a/tests/ls/capability +++ b/tests/ls/capability @@ -17,7 +17,7 @@ # along with this program. If not, see . . "${srcdir=.}/init.sh"; path_prepend_ ../src -test "$VERBOSE" = yes && ls --version +print_ver_ ls 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 683ee4e9f..383c164a1 100755 --- a/tests/ls/color-clear-to-eol +++ b/tests/ls/color-clear-to-eol @@ -17,7 +17,7 @@ # along with this program. If not, see . . "${srcdir=.}/init.sh"; path_prepend_ ../src -test "$VERBOSE" = yes && ls --version +print_ver_ ls long_name=zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz.foo touch $long_name || framework_failure diff --git a/tests/ls/color-dtype-dir b/tests/ls/color-dtype-dir index b691ae75c..9521f0ddf 100755 --- a/tests/ls/color-dtype-dir +++ b/tests/ls/color-dtype-dir @@ -20,7 +20,7 @@ # along with this program. If not, see . . "${srcdir=.}/init.sh"; path_prepend_ ../src -test "$VERBOSE" = yes && ls --version +print_ver_ ls # Don't let a different umask perturb the results. umask 22 diff --git a/tests/ls/color-norm b/tests/ls/color-norm index 9d946a09b..113bf6ec3 100755 --- a/tests/ls/color-norm +++ b/tests/ls/color-norm @@ -19,7 +19,7 @@ # along with this program. If not, see . . "${srcdir=.}/init.sh"; path_prepend_ ../src -test "$VERBOSE" = yes && ls --version +print_ver_ ls # Don't let a different umask perturb the results. umask 22 diff --git a/tests/ls/dangle b/tests/ls/dangle index f544df266..d34b8f390 100755 --- a/tests/ls/dangle +++ b/tests/ls/dangle @@ -17,7 +17,7 @@ # along with this program. If not, see . . "${srcdir=.}/init.sh"; path_prepend_ ../src -test "$VERBOSE" = yes && ls --version +print_ver_ ls 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 b59426d83..c961cc941 100755 --- a/tests/ls/dired +++ b/tests/ls/dired @@ -17,7 +17,7 @@ # along with this program. If not, see . . "${srcdir=.}/init.sh"; path_prepend_ ../src -test "$VERBOSE" = yes && ls --version +print_ver_ ls mkdir dir || framework_failure diff --git a/tests/ls/file-type b/tests/ls/file-type index 07a8cd433..1dc68d776 100755 --- a/tests/ls/file-type +++ b/tests/ls/file-type @@ -17,7 +17,7 @@ # along with this program. If not, see . . "${srcdir=.}/init.sh"; path_prepend_ ../src -test "$VERBOSE" = yes && ls --version +print_ver_ ls mkdir sub cd sub diff --git a/tests/ls/follow-slink b/tests/ls/follow-slink index 00e49bac9..0c06ded1d 100755 --- a/tests/ls/follow-slink +++ b/tests/ls/follow-slink @@ -17,7 +17,7 @@ # along with this program. If not, see . . "${srcdir=.}/init.sh"; path_prepend_ ../src -test "$VERBOSE" = yes && ls --version +print_ver_ ls # 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 be89efcab..2491dede5 100755 --- a/tests/ls/infloop +++ b/tests/ls/infloop @@ -18,7 +18,7 @@ # along with this program. If not, see . . "${srcdir=.}/init.sh"; path_prepend_ ../src -test "$VERBOSE" = yes && ls --version +print_ver_ ls mkdir loop || framework_failure ln -s ../loop loop/sub || framework_failure diff --git a/tests/ls/inode b/tests/ls/inode index 08ae0f8b9..7072d4661 100755 --- a/tests/ls/inode +++ b/tests/ls/inode @@ -17,7 +17,7 @@ # along with this program. If not, see . . "${srcdir=.}/init.sh"; path_prepend_ ../src -test "$VERBOSE" = yes && ls --version +print_ver_ ls touch f || framework_failure ln -s f slink || framework_failure diff --git a/tests/ls/m-option b/tests/ls/m-option index b35e527d4..f40d3b048 100755 --- a/tests/ls/m-option +++ b/tests/ls/m-option @@ -17,7 +17,7 @@ # along with this program. If not, see . . "${srcdir=.}/init.sh"; path_prepend_ ../src -test "$VERBOSE" = yes && ls --version +print_ver_ ls seq 2000 > b || framework_failure touch a || framework_failure diff --git a/tests/ls/multihardlink b/tests/ls/multihardlink index 46850e883..78f30a005 100755 --- a/tests/ls/multihardlink +++ b/tests/ls/multihardlink @@ -17,7 +17,7 @@ # along with this program. If not, see . . "${srcdir=.}/init.sh"; path_prepend_ ../src -test "$VERBOSE" = yes && ls --version +print_ver_ ls working_umask_or_skip_ touch file file1 || framework_failure diff --git a/tests/ls/nameless-uid b/tests/ls/nameless-uid index 6b4f368d2..e54c7ae55 100755 --- a/tests/ls/nameless-uid +++ b/tests/ls/nameless-uid @@ -20,7 +20,7 @@ . $srcdir/require-perl . "${srcdir=.}/init.sh"; path_prepend_ ../src -test "$VERBOSE" = yes && ls --version +print_ver_ ls require_root_ diff --git a/tests/ls/no-arg b/tests/ls/no-arg index 288688b35..c86ac6a28 100755 --- a/tests/ls/no-arg +++ b/tests/ls/no-arg @@ -17,7 +17,7 @@ # along with this program. If not, see . . "${srcdir=.}/init.sh"; path_prepend_ ../src -test "$VERBOSE" = yes && ls --version +print_ver_ ls 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 c82620269..47e7471ce 100755 --- a/tests/ls/no-cap +++ b/tests/ls/no-cap @@ -17,7 +17,7 @@ # along with this program. If not, see . . "${srcdir=.}/init.sh"; path_prepend_ ../src -test "$VERBOSE" = yes && ls --version +print_ver_ ls 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 f0dbb96ad..f7b9d9665 100755 --- a/tests/ls/proc-selinux-segfault +++ b/tests/ls/proc-selinux-segfault @@ -17,7 +17,7 @@ # along with this program. If not, see . . "${srcdir=.}/init.sh"; path_prepend_ ../src -test "$VERBOSE" = yes && ls --version +print_ver_ ls f=/proc/sys test -r $f || f=. diff --git a/tests/ls/readdir-mountpoint-inode b/tests/ls/readdir-mountpoint-inode index 9a38627c9..8c17eb455 100755 --- a/tests/ls/readdir-mountpoint-inode +++ b/tests/ls/readdir-mountpoint-inode @@ -17,7 +17,7 @@ # along with this program. If not, see . . "${srcdir=.}/init.sh"; path_prepend_ ../src -test "$VERBOSE" = yes && ls --version +print_ver_ ls # 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 a216249d1..06cfcbbdf 100755 --- a/tests/ls/recursive +++ b/tests/ls/recursive @@ -18,7 +18,7 @@ # along with this program. If not, see . . "${srcdir=.}/init.sh"; path_prepend_ ../src -test "$VERBOSE" = yes && ls --version +print_ver_ ls 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 bfc51aad3..ad30920eb 100755 --- a/tests/ls/stat-dtype +++ b/tests/ls/stat-dtype @@ -22,7 +22,7 @@ # can report its type nonetheless, using dirent.d_type. . "${srcdir=.}/init.sh"; path_prepend_ ../src -test "$VERBOSE" = yes && ls --version +print_ver_ ls # 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 e7feba552..8f65bbcaf 100755 --- a/tests/ls/stat-failed +++ b/tests/ls/stat-failed @@ -18,7 +18,7 @@ # along with this program. If not, see . . "${srcdir=.}/init.sh"; path_prepend_ ../src -test "$VERBOSE" = yes && ls --version +print_ver_ ls skip_if_root_ mkdir d || framework_failure diff --git a/tests/ls/stat-free-symlinks b/tests/ls/stat-free-symlinks index f9b6bb59f..5aa5f1e71 100755 --- a/tests/ls/stat-free-symlinks +++ b/tests/ls/stat-free-symlinks @@ -17,7 +17,7 @@ # along with this program. If not, see . . "${srcdir=.}/init.sh"; path_prepend_ ../src -test "$VERBOSE" = yes && ls --version +print_ver_ ls require_strace_ stat touch x || framework_failure diff --git a/tests/ls/stat-vs-dirent b/tests/ls/stat-vs-dirent index 00a08140d..bfa1aba6e 100755 --- a/tests/ls/stat-vs-dirent +++ b/tests/ls/stat-vs-dirent @@ -17,7 +17,7 @@ # along with this program. If not, see . . "${srcdir=.}/init.sh"; path_prepend_ ../src -test "$VERBOSE" = yes && ls --version +print_ver_ ls root_dev_ino=`stat --format=%d-%i /` diff --git a/tests/ls/symlink-slash b/tests/ls/symlink-slash index 9db9ba61d..578cd44be 100755 --- a/tests/ls/symlink-slash +++ b/tests/ls/symlink-slash @@ -17,7 +17,7 @@ # along with this program. If not, see . . "${srcdir=.}/init.sh"; path_prepend_ ../src -test "$VERBOSE" = yes && ls --version +print_ver_ ls mkdir dir || framework_failure ln -s dir symlink || framework_failure diff --git a/tests/ls/x-option b/tests/ls/x-option index ed6ef625f..e4859f706 100755 --- a/tests/ls/x-option +++ b/tests/ls/x-option @@ -17,7 +17,7 @@ # along with this program. If not, see . . "${srcdir=.}/init.sh"; path_prepend_ ../src -test "$VERBOSE" = yes && ls --version +print_ver_ ls mkdir subdir || framework_failure touch subdir/b || framework_failure -- cgit v1.2.3-70-g09d2