From f373160c3d6837f18709246fb7d1b196f438e1b5 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 16 Jul 2003 19:54:13 +0000 Subject: This script would have caught at least two recent bugs: those in [ and kill. Revive this script. It wasn't doing anything useful, since $all_programs wasn't being defined by the invoking Makefile.am. Reflect that nohup is no longer a script, so don't exclude it. Add framework to handle the programs added since it was last run: kill, stat, unlink, [, link, readlink. Fix path-related problems deriving from the move of this script from src/ to its present location. --- tests/help-version | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) (limited to 'tests/help-version') diff --git a/tests/help-version b/tests/help-version index ceb760359..e752fec77 100755 --- a/tests/help-version +++ b/tests/help-version @@ -10,7 +10,7 @@ expected_failure_status_tty=3 expected_failure_status_sort=2 case "$all_programs" in - *nohup*) + *groups*) if test -w /dev/full && test -c /dev/full && echo > /dev/full; then cat 1>&2 <<\EOF ************************************************ @@ -23,12 +23,12 @@ To demonstrate, run this command: Notice that the failing echo leaves its exit status set to zero and does not produce a diagnostic. -That bug in /bin/sh would cause the tests of the nohup and groups -scripts to fail, so those two are being removed from the list of +That bug in /bin/sh would cause the test of the groups +scripts to fail, so it is being removed from the list of programs checked by this test. ************************************************ EOF - all_programs=`echo $all_programs|sed 's/\ *//;s/\ *//'` + all_programs=`echo $all_programs|sed 's/\ *//'` fi ;; esac @@ -40,8 +40,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 ./$i --help >/dev/null && fail=1 - env LC_MESSAGES=$lang ./$i --version >/dev/null && fail=1 + env LC_MESSAGES=$lang ../src/$i --help >/dev/null && fail=1 + env LC_MESSAGES=$lang ../src/$i --version >/dev/null && fail=1 continue fi @@ -49,13 +49,13 @@ for lang in C fr da; do test $i = install && i=ginstall # Make sure they exit successfully, under normal conditions. - ./$i --help >/dev/null || fail=1 - ./$i --version >/dev/null || fail=1 + ../src/$i --help >/dev/null || fail=1 + ../src/$i --version >/dev/null || fail=1 # Make sure they fail upon `disk full' error. if test -w /dev/full && test -c /dev/full; then - ./$i --help >/dev/full 2>/dev/null && fail=1 - ./$i --version >/dev/full 2>/dev/null && fail=1 + ../src/$i --help >/dev/full 2>/dev/null && fail=1 + ../src/$i --version >/dev/full 2>/dev/null && fail=1 status=$? eval "expected=\$expected_failure_status_$i" test x$expected = x && expected=1 @@ -96,10 +96,10 @@ diff_args="$tmp_in $tmp_in2" sdiff_args="$tmp_in $tmp_in2" diff3_args="$tmp_in $tmp_in2 $tmp_in2" cp_args="$tmp_in $tmp_in2" -ln_args="$tmp_in $tmp_in2" +ln_args="$tmp_in ln-target" ginstall_args="$tmp_in $tmp_in2" mv_args="$tmp_in $tmp_in2" -mkdir_args=$tmp_in2 +mkdir_args=$tmp_dir/subdir rmdir_args=$tmp_dir rm_args=$tmp_in shred_args=$tmp_in @@ -123,6 +123,19 @@ su_args=--version test_args=foo # skip chroot, stty, tty, false +sleep 10m & +kill_args=$! + +link_args="$tmp_in link-target" +unlink_args=$tmp_in + +ln -s . slink +readlink_args=slink + +stat_args=$tmp_in +unlink_args=$tmp_in +lbracket_args=": ]" + for i in $all_programs; do # Skip these. case $i in chroot|stty|tty|false) continue;; esac @@ -132,8 +145,9 @@ for i in $all_programs; do echo > $tmp_in2 mkdir $tmp_dir # echo ================== $i - eval "args=\$${i}_args" - if ../$i $args < $tmp_in > $tmp_out; then + test $i = [ && prog=lbracket || prog=$i + eval "args=\$${prog}_args" + if ../../src/$i $args < $tmp_in > $tmp_out; then : # ok else echo FAIL: $i -- cgit v1.2.3-70-g09d2