mirror of
https://github.com/coreutils/coreutils.git
synced 2024-11-23 18:05:42 +08:00
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:
parent
a8c8484ee1
commit
8f9be76b0d
@ -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
|
||||
|
@ -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_
|
||||
|
||||
|
@ -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_
|
||||
|
||||
|
@ -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_
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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'
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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_
|
||||
|
||||
|
@ -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_
|
||||
|
||||
|
@ -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_
|
||||
|
||||
|
@ -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_
|
||||
|
||||
|
@ -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_
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user