From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [kvm-unit-tests PATCH v4 08/13] scripts/runtime: consolidate summary tags Date: Tue, 17 May 2016 14:22:17 +0200 Message-ID: <573B0CF9.3010309@redhat.com> References: <1462983171-4208-1-git-send-email-rkrcmar@redhat.com> <1462983171-4208-9-git-send-email-rkrcmar@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Andrew Jones To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:55637 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932535AbcEQMW1 (ORCPT ); Tue, 17 May 2016 08:22:27 -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 C717480099 for ; Tue, 17 May 2016 12:22:26 +0000 (UTC) In-Reply-To: <1462983171-4208-9-git-send-email-rkrcmar@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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"; } If you use for example $'\e[32mPASS\e[0m', then you can use variables instead of functions. > + > function run() > { > local testname=3D"$1" > @@ -23,7 +27,7 @@ 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 > @@ -34,7 +38,7 @@ function run() > path=3D${check_param%%=3D*} > value=3D${check_param#*=3D} > if [ "$path" ] && [ "$(cat $path)" !=3D "$value" ]; then > - echo "skip $1 ($path not equal to $value)" > + echo "`SKIP` $1 ($path not equal to $value)" > return 2 > fi > done > @@ -50,13 +54,13 @@ function run() > ret=3D$? > =20 > if [ $ret -eq 0 ]; then > - echo -e "\e[32mPASS\e[0m $1" > + echo "`PASS` $1" > elif [ $ret -eq 77 ]; then > - echo -e "\e[33mSKIP\e[0m $1" > + echo "`SKIP` $1" > elif [ $ret -eq 124 ]; then > - echo -e "\e[31mFAIL\e[0m $1 (timeout; duration=3D$timeout)" > + echo "`FAIL` $1 (timeout; duration=3D$timeout)" > else > - echo -e "\e[31mFAIL\e[0m $1" > + echo "`FAIL` $1" > fi > =20 > return $ret >=20