From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Jones Subject: Re: [PATCH kvm-unit-tests v2 10/12] run_tests: print summary Date: Thu, 17 Dec 2015 13:55:51 -0600 Message-ID: <20151217195551.GH14168@hawk.localdomain> References: <1450374823-7648-1-git-send-email-rkrcmar@redhat.com> <1450374823-7648-11-git-send-email-rkrcmar@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org, Paolo Bonzini To: Radim =?utf-8?B?S3LEjW3DocWZ?= Return-path: Received: from mx1.redhat.com ([209.132.183.28]:49041 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754829AbbLQT4A (ORCPT ); Thu, 17 Dec 2015 14:56:00 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 694958F4F6 for ; Thu, 17 Dec 2015 19:56:00 +0000 (UTC) Content-Disposition: inline In-Reply-To: <1450374823-7648-11-git-send-email-rkrcmar@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Dec 17, 2015 at 06:53:41PM +0100, Radim Kr=C4=8Dm=C3=A1=C5=99 w= rote: > 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 > run_tests.sh | 1 + > scripts/mkstandalone.sh | 2 ++ > scripts/run.bash | 5 ++++- > 3 files changed, 7 insertions(+), 1 deletion(-) >=20 > diff --git a/run_tests.sh b/run_tests.sh > index e09d410beaa4..62c106a0b693 100755 > --- a/run_tests.sh > +++ b/run_tests.sh > @@ -30,6 +30,7 @@ EOF > =20 > __run() { ./$TEST_DIR-run "${@}"; } > __eval_log() { eval "${@}" >> test.log; } > +__echo_last_log() { cat test.log; } # XXX: ignores the 'last' bit > =20 > echo > test.log > =20 > diff --git a/scripts/mkstandalone.sh b/scripts/mkstandalone.sh > index 778383077769..c37f694398b8 100755 > --- a/scripts/mkstandalone.sh > +++ b/scripts/mkstandalone.sh > @@ -104,7 +104,9 @@ __run() > \$qemu \$cmdline -smp $smp $opts > } > =20 > +# log goes to stdout and nothing is remembered > __eval_log() { eval "\${@}"; } > +__echo_last_log() { echo; } > =20 > run `escape "${@}"` > exit \$? > diff --git a/scripts/run.bash b/scripts/run.bash > index f532cb9e8b1c..d3e8d37d315d 100644 > --- a/scripts/run.bash > +++ b/scripts/run.bash > @@ -46,7 +46,10 @@ function run() > *) echo -ne "\e[31mFAIL\e[0m" > esac > =20 > - echo " $1" > + echo -n " $testname" > + > + __echo_last_log | sed 'x;$s/^SUMMARY: //;ta;$s/.*//p;d; > + :a s/, 0 unexpected failures//;s/^/ (/;= s/$/)/' This sed is way beyond my skillz. I would have just done the following at the expense of an extra pipe :-) tac test.log | grep -m1 '^SUMMARY:' | sed 's/.*: \(.*\),.*/\1/' > =20 > return $ret > } > --=20 > 2.6.4 >=20 > -- > 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