From: =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Subject: [PATCH v3 7/9] scripts/runtime: consolidate summary tags Date: Fri, 15 Apr 2016 22:52:49 +0200 Message-ID: <1460753571-20732-8-git-send-email-rkrcmar@redhat.com> References: <1460753571-20732-1-git-send-email-rkrcmar@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Paolo Bonzini , Andrew Jones To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:50109 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751587AbcDOUxV (ORCPT ); Fri, 15 Apr 2016 16:53:21 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (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 53FFDC0467ED for ; Fri, 15 Apr 2016 20:53:21 +0000 (UTC) In-Reply-To: <1460753571-20732-1-git-send-email-rkrcmar@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Turn skip into yellow SKIP and add reusable definitions of all tags. Signed-off-by: Radim Kr=C4=8Dm=C3=A1=C5=99 --- scripts/runtime.bash | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/scripts/runtime.bash b/scripts/runtime.bash index 4f29a59307f3..59f0df080988 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"; } + 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,14 +38,14 @@ 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 =20 cmdline=3D"TIMEOUT=3D$timeout ACCEL=3D$accel $RUNTIME_arch_run /de= v/null -smp $smp $opts" eval $cmdline |& grep -q "could not load kernel" || { - echo "skip $1 (QEMU won't run)" + echo "`SKIP` $1 (QEMU won't run)" return 2 } =20 @@ -56,13 +60,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 2.8.1