]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: factor out VERBOSE-only --version-printing code
authorJim Meyering <meyering@redhat.com>
Tue, 16 Nov 2010 07:05:11 +0000 (08:05 +0100)
committerJim Meyering <meyering@redhat.com>
Wed, 17 Nov 2010 20:34:54 +0000 (21:34 +0100)
* tests/init.cfg (print_ver_): New function.

tests/init.cfg

index 97dad175ecbc2d0d0523a61f212a4d9be698a4af..2270c0d187a08a41bafad124e7500562697b24e3 100644 (file)
@@ -399,4 +399,16 @@ retry_delay_()
   test "$time_fail" = 0
 }
 
+# Call this with a list of programs under test immediately after
+# sourcing init.sh.
+print_ver_()
+{
+  if test "$VERBOSE" = yes; then
+    local i
+    for i in $*; do
+      env $i --version
+    done
+  fi
+}
+
 sanitize_path_