1
0
mirror of https://git.savannah.gnu.org/git/coreutils.git synced 2025-08-07 07:22:55 +03:00

tests: env-related clean up

* 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.
This commit is contained in:
Jim Meyering
2008-05-12 08:49:58 +02:00
parent c6a3937288
commit 4a4fe636dc
3 changed files with 9 additions and 11 deletions

View File

@@ -217,7 +217,7 @@ sub run_tests ($$$$$)
# To indicate that $prog is a shell built-in, you'd make it a string 'ref'. # 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); # E.g., call run_tests ($prog, \$prog, \@Tests, $save_temps, $verbose);
# If it's a ref, invoke it via "env": # 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. # Warn about empty t_spec.
# FIXME # FIXME

View File

@@ -50,10 +50,8 @@ for lang in C fr da; do
# false fails even when invoked with --help or --version. # false fails even when invoked with --help or --version.
if test $i = false; then if test $i = false; then
env LC_MESSAGES=$lang "$abs_top_builddir/src/$i" --help \ env LC_MESSAGES=$lang $i" --help >/dev/null && fail=1
>/dev/null && fail=1 env LC_MESSAGES=$lang $i" --version >/dev/null && fail=1
env LC_MESSAGES=$lang "$abs_top_builddir/src/$i" --version \
>/dev/null && fail=1
continue continue
fi fi
@@ -61,8 +59,8 @@ for lang in C fr da; do
test $i = install && i=ginstall test $i = install && i=ginstall
# Make sure they exit successfully, under normal conditions. # Make sure they exit successfully, under normal conditions.
"$abs_top_builddir/src/$i" --help > h-$i || fail=1 env $i --help > h-$i || fail=1
"$abs_top_builddir/src/$i" --version >/dev/null || fail=1 env $i --version >/dev/null || fail=1
# Make sure they mention the bug-reporting address in --help output. # Make sure they mention the bug-reporting address in --help output.
grep "$PACKAGE_BUGREPORT" h-$i > /dev/null || fail=1 grep "$PACKAGE_BUGREPORT" h-$i > /dev/null || fail=1
@@ -188,7 +186,7 @@ for i in $built_programs; do
# echo ================== $i # echo ================== $i
test $i = [ && prog=lbracket || prog=$i test $i = [ && prog=lbracket || prog=$i
eval "args=\$${prog}_args" 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 : # ok
else else
echo FAIL: $i echo FAIL: $i

View File

@@ -16,11 +16,11 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # 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 if test "$VERBOSE" = yes; then
set -x set -x
"$prog" --version env $prog --version
fi fi
. $top_srcdir/tests/test-lib.sh . $top_srcdir/tests/test-lib.sh
@@ -50,7 +50,7 @@ fail=0
# triggering the printf(3) misbehavior -- which, btw, is required by ISO C99. # triggering the printf(3) misbehavior -- which, btw, is required by ISO C99.
( ulimit -v 10000 ( 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. # Map this longer, and rarer, diagnostic to the common one.
# printf: cannot perform formatted output: Cannot allocate memory" \ # printf: cannot perform formatted output: Cannot allocate memory" \