From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH kvm-unit-tests v2 10/12] run_tests: print summary Date: Fri, 18 Dec 2015 13:24:15 +0100 Message-ID: <20151218122414.GD21525@potion.brq.redhat.com> References: <1450374823-7648-1-git-send-email-rkrcmar@redhat.com> <1450374823-7648-11-git-send-email-rkrcmar@redhat.com> <20151217195551.GH14168@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]:37925 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752970AbbLRMYS (ORCPT ); Fri, 18 Dec 2015 07:24:18 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 2192232D3AC for ; Fri, 18 Dec 2015 12:24:18 +0000 (UTC) Content-Disposition: inline In-Reply-To: <20151217195551.GH14168@hawk.localdomain> Sender: kvm-owner@vger.kernel.org List-ID: 2015-12-17 13:55-0600, Andrew Jones: > On Thu, Dec 17, 2015 at 06:53:41PM +0100, Radim Kr=C4=8Dm=C3=A1=C5=99= wrote: >> Might be interesting and hopefully won't break too many scripts. >>=20 >> Signed-off-by: Radim Kr=C4=8Dm=C3=A1=C5=99 >> --- >> v2: >> - don't print "0 unexpected failures" in run_tests' summary. [Drew] >> (This could have been done in lib/report, but I'm not sure why we= want >> to always print it in the summary, so I've kept it there.) >> - use $testname >> - don't buffer the output (a serious bug in v1) >> - worse performance (reads the output of all tests) >> =20 >> diff --git a/run_tests.sh b/run_tests.sh >> + __echo_last_log | sed 'x;$s/^SUMMARY: //;ta;$s/.*//p;d; >> + :a s/, 0 unexpected failures//;s/^/ (/= ;s/$/)/' >=20 > This sed is way beyond my skillz. I would have just done the followin= g > at the expense of an extra pipe :-) >=20 > tac test.log | grep -m1 '^SUMMARY:' | sed 's/.*: \(.*\),.*/\1/' This won't print a newline in case there is no summary, but yeah, I wil= l limit myself to the well known 's' command. (tail won't buffer the whole file and `head` instead of -m is POSIX.)