tests: convert the multi-prog $VERBOSE/--version uses

E.g.,

-test "$VERBOSE" = yes && { env -- pwd --version; readlink --version; }
+print_ver_ pwd readlink

-test "$VERBOSE" = yes && { stdbuf --version; mv --version; }
+print_ver_ stdbuf mv

Use this command:
git grep -l 'VERBOSE.*--version'|xargs perl -ni \
  -e '/^test "\$VERBOSE" = yes && { .*--version/ or print,next;' \
  -e 's/env -- //g;' \
  -e 's/test "\$VERBOSE" = yes && { /print_ver_ /;' \
  -e ' s/(\w+) --version;/$1/g; s/ *}$//; print'
This commit is contained in:
Jim Meyering 2010-11-17 21:38:38 +01:00
parent a8c8484ee1
commit 8f9be76b0d
17 changed files with 17 additions and 17 deletions

View File

@ -17,7 +17,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
test "$VERBOSE" = yes && { chgrp --version; chmod --version; chown --version; }
print_ver_ chgrp chmod chown
chmod -f 0 no-such 2> out && fail=1
chgrp -f 0 no-such 2>> out && fail=1

View File

@ -18,7 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
test "$VERBOSE" = yes && { mv --version; getfacl --version; setfacl --version; }
print_ver_ mv getfacl setfacl
require_acl_

View File

@ -19,7 +19,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
test "$VERBOSE" = yes && { cp --version; mv --version; }
print_ver_ cp mv
require_root_

View File

@ -17,7 +17,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
test "$VERBOSE" = yes && { cp --version; mv --version; }
print_ver_ cp mv
very_expensive_

View File

@ -17,7 +17,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
test "$VERBOSE" = yes && { ls --version; touch --version; }
print_ver_ ls touch
date=1998-01-15

View File

@ -17,7 +17,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
test "$VERBOSE" = yes && { env --version; env -- printenv --version; }
print_ver_ env printenv
# POSIX is clear that environ may, but need not be, sorted.
# Environment variable values may contain newlines, which cannot be

View File

@ -19,7 +19,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
test "$VERBOSE" = yes && { env -- pwd --version; readlink --version; }
print_ver_ pwd readlink
test $host_os != linux-gnu &&
skip_test_ 'vendor getcwd may be inadequate'

View File

@ -17,7 +17,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
test "$VERBOSE" = yes && { stdbuf --version; mv --version; }
print_ver_ stdbuf mv
getlimits_
require_built_ stdbuf

View File

@ -19,7 +19,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
test "$VERBOSE" = yes && { cp --version; mv --version; ginstall --version; }
print_ver_ cp mv ginstall
# Skip this test if cp was built without xattr support:
touch src dest || framework_failure

View File

@ -17,7 +17,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
test "$VERBOSE" = yes && { mkdir --version; mkfifo --version; mknod --version; }
print_ver_ mkdir mkfifo mknod
# Note: on an SELinux/enforcing system running mcstransd older than
# mcstrans-0.2.8-1.fc9, the following commands may mistakenly exit

View File

@ -18,7 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
test "$VERBOSE" = yes && { mv --version; getfacl --version; setfacl --version; }
print_ver_ mv getfacl setfacl
require_acl_

View File

@ -19,7 +19,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
test "$VERBOSE" = yes && { cp --version; mv --version; ln --version; }
print_ver_ cp mv ln
skip_if_root_

View File

@ -20,7 +20,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
test "$VERBOSE" = yes && { cp --version; mv --version; }
print_ver_ cp mv
skip_if_root_

View File

@ -18,7 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
test "$VERBOSE" = yes && { cp --version; mv --version; }
print_ver_ cp mv
skip_if_root_

View File

@ -18,7 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
test "$VERBOSE" = yes && { cp --version; mv --version; }
print_ver_ cp mv
skip_if_root_

View File

@ -18,7 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
test "$VERBOSE" = yes && { cp --version; mv --version; }
print_ver_ cp mv
cleanup_() { rm -rf "$other_partition_tmpdir"; }
. "$abs_srcdir/other-fs-tmpdir"

View File

@ -17,7 +17,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
test "$VERBOSE" = yes && { cp --version; mv --version; }
print_ver_ cp mv
echo old > old || framework_failure
touch -d yesterday old || framework_failure