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:
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -16,11 +16,11 @@
|
||||
# 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" \
|
||||
|
Reference in New Issue
Block a user