From b1c9bf27cb10345542a8090c2f6e9475c2060b57 Mon Sep 17 00:00:00 2001 From: Matthias Bolte Date: Sat, 9 Jul 2011 10:40:37 +0200 Subject: [PATCH] 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. --- tests/test-lib.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tests/test-lib.sh b/tests/test-lib.sh index 768f96b2bf..527dfda383 100644 --- a/tests/test-lib.sh +++ b/tests/test-lib.sh @@ -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