tests: Fix compressed test output padding logic

The current logic tries to count from 1 to 40 and ignores paddings
of 0 and 1 to 40. This doesn't work for counter + 1 mod 40 == 0
like here for counter value 159

TEST: virsh-all
      ........................................ 40
      ........................................ 80
      ........................................ 120
      ....................................... 159 OK
PASS: virsh-all

Also seq isn't portable. Therefore, calculate the correct padding
length directly and use printf to output it at once.
This commit is contained in:
Matthias Bolte 2011-07-09 10:40:37 +02:00
parent 4540f8d227
commit b1c9bf27cb

View File

@ -54,13 +54,8 @@ test_final()
status=$2
if test "$verbose" = "0" ; then
mod=`expr \( $counter + 1 \) % 40`
if test "$mod" != "0" && test "$mod" != "1" ; then
for i in `seq $mod 40`
do
printf " "
done
fi
len=`expr 40 - \( $counter % 40 \)`
printf "%${len}s" ""
if test "$status" = "0" ; then
printf " %-3d OK\n" $counter
else