提交 b1c9bf27 编写于 作者: M Matthias Bolte

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.
上级 4540f8d2
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册