From patchwork Thu Aug 24 17:40:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eryu Guan X-Patchwork-Id: 9920639 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 73F7260327 for ; Thu, 24 Aug 2017 17:40:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 39E6528C1D for ; Thu, 24 Aug 2017 17:40:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2ECC528C36; Thu, 24 Aug 2017 17:40:50 +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,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 778CF28C3A for ; Thu, 24 Aug 2017 17:40:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751615AbdHXRkq (ORCPT ); Thu, 24 Aug 2017 13:40:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37336 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751185AbdHXRkq (ORCPT ); Thu, 24 Aug 2017 13:40:46 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 37FA5404322; Thu, 24 Aug 2017 17:40:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 37FA5404322 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=eguan@redhat.com Received: from localhost (dhcp-12-147.nay.redhat.com [10.66.12.147]) by smtp.corp.redhat.com (Postfix) with ESMTP id B5A6E7F7FA; Thu, 24 Aug 2017 17:40:45 +0000 (UTC) Date: Fri, 25 Aug 2017 01:40:44 +0800 From: Eryu Guan To: David Sterba Cc: fstests@vger.kernel.org Subject: Re: [PATCH] check: print elapsed time even for failed tests Message-ID: <20170824174044.GO31418@eguan.usersys.redhat.com> References: <20170824131557.32342-1-dsterba@suse.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170824131557.32342-1-dsterba@suse.com> User-Agent: Mutt/1.8.3 (2017-05-23) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 24 Aug 2017 17:40:46 +0000 (UTC) Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, Aug 24, 2017 at 03:15:57PM +0200, David Sterba wrote: > Sometimes it's useful to see how long the test runs. The time is > calculated the same way as in the normal case but the time is not stored > in the $tmp.time file. > > Signed-off-by: David Sterba > --- > check | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/check b/check > index f8db3cd6dfab..f3a1b72e4b2b 100755 > --- a/check > +++ b/check > @@ -755,7 +755,7 @@ for section in $HOST_OPTIONS_SECTIONS; do > fi > echo "" > else > - echo " - output mismatch (see $seqres.out.bad)" > + echo " `expr $stop - $start`s - output mismatch (see $seqres.out.bad)" This only prints out test time in the output mismatch case, there's another 'exit with nonzero' failure case needs the test time too. I did the following updates based on your patch and it worked for me for both failure cases, can you please take a look and verify too? I can fold this update to your patch if it looks fine to you. --- --- Thanks, Eryu -- To unsubscribe from this list: send the line "unsubscribe fstests" 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/check b/check index f3a1b72..7763389 100755 --- a/check +++ b/check @@ -729,18 +729,12 @@ for section in $HOST_OPTIONS_SECTIONS; do n_notrun=`expr $n_notrun + 1` tc_status="notrun" else - if [ $sts -ne 0 ] - then - err_msg="[failed, exit status $sts]" - echo -n " $err_msg" - err=true - fi if [ ! -f $seq.out ] then _dump_err "no qualified output" err=true else - + testtime=`expr $stop - $start` # coreutils 8.16+ changed quote formats in error messages from # `foo' to 'foo'. Filter old versions to match the new version. sed -i "s/\`/\'/g" $tmp.out @@ -750,12 +744,19 @@ for section in $HOST_OPTIONS_SECTIONS; do then : else - echo "$seqnum `expr $stop - $start`" >>$tmp.time - echo -n " `expr $stop - $start`s" + if [ $sts -ne 0 ] + then + err_msg="[failed, exit status $sts]" + echo -n " ${testtime}s $err_msg" + err=true + else + echo "$seqnum $testtime" >>$tmp.time + echo -n " ${testtime}s" + fi fi echo "" else - echo " `expr $stop - $start`s - output mismatch (see $seqres.out.bad)" + echo " ${testtime}s - output mismatch (see $seqres.out.bad)" mv $tmp.out $seqres.out.bad $diff $seq.out $seqres.out.bad | { if test "$DIFF_LENGTH" -le 0; then