From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [kvm-unit-tests PATCH v4 08/13] scripts/runtime: consolidate summary tags Date: Wed, 25 May 2016 19:46:25 +0200 Message-ID: <20160525174624.GI14795@potion> References: <1462983171-4208-1-git-send-email-rkrcmar@redhat.com> <1462983171-4208-9-git-send-email-rkrcmar@redhat.com> <573B0CF9.3010309@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org, Andrew Jones To: Paolo Bonzini Return-path: Received: from mx1.redhat.com ([209.132.183.28]:44123 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932309AbcEYRq2 (ORCPT ); Wed, 25 May 2016 13:46:28 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 14AA37F6A4 for ; Wed, 25 May 2016 17:46:28 +0000 (UTC) Content-Disposition: inline In-Reply-To: <573B0CF9.3010309@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 2016-05-17 14:22+0200, Paolo Bonzini: > On 11/05/2016 18:12, Radim Kr=C4=8Dm=C3=A1=C5=99 wrote: >> Turn skip into yellow SKIP and add reusable definitions of all tags. >>=20 >> Reviewed-by: Andrew Jones >> Signed-off-by: Radim Kr=C4=8Dm=C3=A1=C5=99 >> --- >> scripts/runtime.bash | 16 ++++++++++------ >> 1 file changed, 10 insertions(+), 6 deletions(-) >>=20 >> diff --git a/scripts/runtime.bash b/scripts/runtime.bash >> index ed073721216c..8d374103a71c 100644 >> --- a/scripts/runtime.bash >> +++ b/scripts/runtime.bash >> @@ -2,6 +2,10 @@ >> : ${MAX_SMP:=3D$(getconf _NPROCESSORS_CONF)} >> : ${TIMEOUT:=3D90s} >> =20 >> +PASS() { echo -ne "\e[32mPASS\e[0m"; } >> +SKIP() { echo -ne "\e[33mSKIP\e[0m"; } >> +FAIL() { echo -ne "\e[31mFAIL\e[0m"; } >=20 > If you use for example $'\e[32mPASS\e[0m', then you can use variables > instead of functions. Great, thanks. A fixup is below ---8<--- diff --git a/scripts/runtime.bash b/scripts/runtime.bash index 39a9072ed103..2bbdb864c889 100644 --- a/scripts/runtime.bash +++ b/scripts/runtime.bash @@ -2,9 +2,9 @@ : ${MAX_SMP:=3D$(getconf _NPROCESSORS_CONF)} : ${TIMEOUT:=3D90s} =20 -PASS() { echo -ne "\e[32mPASS\e[0m"; } -SKIP() { echo -ne "\e[33mSKIP\e[0m"; } -FAIL() { echo -ne "\e[31mFAIL\e[0m"; } +PASS=3D$'\e[32mPASS\e[0m' +SKIP=3D$'\e[33mSKIP\e[0m' +FAIL=3D$'\e[31mFAIL\e[0m' =20 extract_summary() { @@ -53,18 +53,18 @@ function run() fi =20 if [ -n "$arch" ] && [ "$arch" !=3D "$ARCH" ]; then - echo "`SKIP` $1 ($arch only)" + echo "$SKIP $1 ($arch only)" return 2 fi =20 eval $check || { echo "skipped $testname (\`$check\` returned $?)" | RUNTIME_lo= g_stderr - echo "`SKIP` $testname (check failed)" + echo "$SKIP $testname (check failed)" return 77 } =20 last_line=3D$(premature_failure) && { - echo "`SKIP` $1 ($last_line)" + echo "$SKIP $1 ($last_line)" return 77 } =20 @@ -80,13 +80,13 @@ function run() ret=3D$? =20 if [ $ret -eq 0 ]; then - echo "`PASS` $1 $summary" + echo "$PASS $1 $summary" elif [ $ret -eq 77 ]; then - echo "`SKIP` $1 $summary" + echo "$SKIP $1 $summary" elif [ $ret -eq 124 ]; then - echo "`FAIL` $1 (timeout; duration=3D$timeout)" + echo "$FAIL $1 (timeout; duration=3D$timeout)" else - echo "`FAIL` $1 $summary" + echo "$FAIL $1 $summary" fi =20 return $ret