From patchwork Wed May 25 17:46:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFkaW0gS3LEjW3DocWZ?= X-Patchwork-Id: 9135965 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 843C36075C for ; Wed, 25 May 2016 17:46:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7AFF1280BB for ; Wed, 25 May 2016 17:46:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6FE722829C; Wed, 25 May 2016 17:46:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,HK_RANDOM_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1348528123 for ; Wed, 25 May 2016 17:46:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932590AbcEYRql (ORCPT ); Wed, 25 May 2016 13:46:41 -0400 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) Received: from potion (dhcp-1-116.brq.redhat.com [10.34.1.116]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id u4PHkPgG017814; Wed, 25 May 2016 13:46:26 -0400 Received: by potion (sSMTP sendmail emulation); Wed, 25 May 2016 19:46:25 +0200 Date: Wed, 25 May 2016 19:46:25 +0200 From: Radim =?utf-8?B?S3LEjW3DocWZ?= To: Paolo Bonzini Cc: kvm@vger.kernel.org, Andrew Jones Subject: Re: [kvm-unit-tests PATCH v4 08/13] scripts/runtime: consolidate summary tags 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-Disposition: inline In-Reply-To: <573B0CF9.3010309@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 25 May 2016 17:46:28 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 2016-05-17 14:22+0200, Paolo Bonzini: > On 11/05/2016 18:12, Radim Krčmář wrote: >> Turn skip into yellow SKIP and add reusable definitions of all tags. >> >> Reviewed-by: Andrew Jones >> Signed-off-by: Radim Krčmář >> --- >> scripts/runtime.bash | 16 ++++++++++------ >> 1 file changed, 10 insertions(+), 6 deletions(-) >> >> 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:=$(getconf _NPROCESSORS_CONF)} >> : ${TIMEOUT:=90s} >> >> +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. Great, thanks. A fixup is below ---8<--- --- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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:=$(getconf _NPROCESSORS_CONF)} : ${TIMEOUT:=90s} -PASS() { echo -ne "\e[32mPASS\e[0m"; } -SKIP() { echo -ne "\e[33mSKIP\e[0m"; } -FAIL() { echo -ne "\e[31mFAIL\e[0m"; } +PASS=$'\e[32mPASS\e[0m' +SKIP=$'\e[33mSKIP\e[0m' +FAIL=$'\e[31mFAIL\e[0m' extract_summary() { @@ -53,18 +53,18 @@ function run() fi if [ -n "$arch" ] && [ "$arch" != "$ARCH" ]; then - echo "`SKIP` $1 ($arch only)" + echo "$SKIP $1 ($arch only)" return 2 fi eval $check || { echo "skipped $testname (\`$check\` returned $?)" | RUNTIME_log_stderr - echo "`SKIP` $testname (check failed)" + echo "$SKIP $testname (check failed)" return 77 } last_line=$(premature_failure) && { - echo "`SKIP` $1 ($last_line)" + echo "$SKIP $1 ($last_line)" return 77 } @@ -80,13 +80,13 @@ function run() ret=$? 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=$timeout)" + echo "$FAIL $1 (timeout; duration=$timeout)" else - echo "`FAIL` $1 $summary" + echo "$FAIL $1 $summary" fi return $ret