tests: env-related clean up
authorJim Meyering <meyering@redhat.com>
Mon, 12 May 2008 06:49:58 +0000 (08:49 +0200)
committerJim Meyering <meyering@redhat.com>
Fri, 16 May 2008 08:10:34 +0000 (10:10 +0200)
* tests/Coreutils.pm: tiny clean-up: s/env/env --/
* tests/misc/help-version: Use "env" rather than an absolute file
name prefix.
* tests/misc/printf-surprise: Likewise.

tests/Coreutils.pm
tests/misc/help-version
tests/misc/printf-surprise

index 2406dd1..3245eda 100644 (file)
@@ -217,7 +217,7 @@ sub run_tests ($$$$$)
   # To indicate that $prog is a shell built-in, you'd make it a string 'ref'.
   # E.g., call run_tests ($prog, \$prog, \@Tests, $save_temps, $verbose);
   # If it's a ref, invoke it via "env":
-  my @prog = ref $prog ? ('env', $$prog) : $prog;
+  my @prog = ref $prog ? (qw(env --), $$prog) : $prog;
 
   # Warn about empty t_spec.
   # FIXME
index b14c153..77e54c7 100755 (executable)
@@ -50,10 +50,8 @@ for lang in C fr da; do
 
     # false fails even when invoked with --help or --version.
     if test $i = false; then
-      env LC_MESSAGES=$lang "$abs_top_builddir/src/$i" --help \
-         >/dev/null && fail=1
-      env LC_MESSAGES=$lang "$abs_top_builddir/src/$i" --version \
-         >/dev/null && fail=1
+      env LC_MESSAGES=$lang $i" --help >/dev/null && fail=1
+      env LC_MESSAGES=$lang $i" --version >/dev/null && fail=1
       continue
     fi
 
@@ -61,8 +59,8 @@ for lang in C fr da; do
     test $i = install && i=ginstall
 
     # Make sure they exit successfully, under normal conditions.
-    "$abs_top_builddir/src/$i" --help    > h-$i     || fail=1
-    "$abs_top_builddir/src/$i" --version >/dev/null || fail=1
+    env $i --help    > h-$i     || fail=1
+    env $i --version >/dev/null || fail=1
 
     # Make sure they mention the bug-reporting address in --help output.
     grep "$PACKAGE_BUGREPORT" h-$i > /dev/null || fail=1
@@ -188,7 +186,7 @@ for i in $built_programs; do
   # echo ================== $i
   test $i = [ && prog=lbracket || prog=$i
   eval "args=\$${prog}_args"
-  if "$abs_top_builddir/src/$i" $args < $tmp_in > $tmp_out; then
+  if env $i $args < $tmp_in > $tmp_out; then
     : # ok
   else
     echo FAIL: $i
index 9056602..64fdad0 100755 (executable)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-prog="$abs_top_builddir/src/printf"
+prog=printf
 
 if test "$VERBOSE" = yes; then
   set -x
-  "$prog" --version
+  env $prog --version
 fi
 
 . $top_srcdir/tests/test-lib.sh
@@ -50,7 +50,7 @@ fail=0
 # triggering the printf(3) misbehavior -- which, btw, is required by ISO C99.
 
 ( ulimit -v 10000
-  "$prog" %20000000f 0 2>err | head -c 10 >out )
+  env $prog %20000000f 0 2>err | head -c 10 >out )
 
 # Map this longer, and rarer, diagnostic to the common one.
 # printf: cannot perform formatted output: Cannot allocate memory" \