From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH kvm-unit-tests 4/6] run_tests: generalize check Date: Tue, 15 Dec 2015 14:05:46 +0100 Message-ID: <20151215130546.GD17283@potion.brq.redhat.com> References: <1450128261-21170-1-git-send-email-rkrcmar@redhat.com> <1450128261-21170-5-git-send-email-rkrcmar@redhat.com> <20151214221129.GE3633@hawk.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org, Paolo Bonzini To: Andrew Jones Return-path: Received: from mx1.redhat.com ([209.132.183.28]:45449 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932281AbbLONFv (ORCPT ); Tue, 15 Dec 2015 08:05:51 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id EDC1AC06C9FB for ; Tue, 15 Dec 2015 13:05:50 +0000 (UTC) Content-Disposition: inline In-Reply-To: <20151214221129.GE3633@hawk.localdomain> Sender: kvm-owner@vger.kernel.org List-ID: 2015-12-14 16:11-0600, Andrew Jones: > On Mon, Dec 14, 2015 at 10:24:19PM +0100, Radim Kr=C4=8Dm=C3=A1=C5=99= wrote: > > --- >> diff --git a/run_tests.sh b/run_tests.sh >> @@ -35,17 +35,10 @@ function run() >> return >> fi >> =20 >> - # check a file for a particular value before running a test >> - # the check line can contain multiple files to check separated = by a space >> - # but each check parameter needs to be of the form =3D >> - for check_param in ${check[@]}; do >> - 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)" >> - return >> - fi >> - done >> + eval $check || { >> + echo "skip $1 (failed \$($check))" >> + return >> + } >=20 > I think we should use "\e[33mSKIP\e[0m" for skip. Maybe we should cre= ate > pass(),fail(),skip() functions in order to make sure all callers use = the > same prefix with the same color. Sounds good.