From patchwork Tue Nov 29 02:48:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 9450861 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 C60096074E for ; Tue, 29 Nov 2016 02:48:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B987C27BE5 for ; Tue, 29 Nov 2016 02:48:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ADC7827D5E; Tue, 29 Nov 2016 02:48:13 +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 26B0427BE5 for ; Tue, 29 Nov 2016 02:48:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754607AbcK2CsM (ORCPT ); Mon, 28 Nov 2016 21:48:12 -0500 Received: from ipmail07.adl2.internode.on.net ([150.101.137.131]:33509 "EHLO ipmail07.adl2.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752817AbcK2CsM (ORCPT ); Mon, 28 Nov 2016 21:48:12 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BlDwCC6zxYIK+pLHldHAEBBAEBCgEBgzgBAQEBAR+BW4Z0nEoBBpQDhBWGHQKBdVQBAgEBAQEBAgYBAQEBAQE5RUIShHE7GGoDBy2IbJ0JkiWLeIV0j08FiFIHh1mKIolYhyGQPQKRfYFKEwyDBwEBCAEBAQGCUSo0hQ2DAAEBAQ Received: from ppp121-44-169-175.lns20.syd7.internode.on.net (HELO dastard) ([121.44.169.175]) by ipmail07.adl2.internode.on.net with ESMTP; 29 Nov 2016 13:18:09 +1030 Received: from discord.disaster.area ([192.168.1.111]) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1cBYSn-0000H1-5j for fstests@vger.kernel.org; Tue, 29 Nov 2016 13:48:09 +1100 Received: from dave by discord.disaster.area with local (Exim 4.88) (envelope-from ) id 1cBYSn-00045S-4a for fstests@vger.kernel.org; Tue, 29 Nov 2016 13:48:09 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH] check: add brief result summaries Date: Tue, 29 Nov 2016 13:48:09 +1100 Message-Id: <20161129024809.15671-1-david@fromorbit.com> X-Mailer: git-send-email 2.10.2 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Dave Chinner When running multiple sections and hundreds of tests in each config section, it's hard to see what failed from the summary output because of the hundreds of tests listed in the "tests run" and "tests not run" output. Add a "-b" option for brief result summaries that only output the tests that failed and the summary count of tests failed. Signed-Off-By: Dave Chinner --- check | 114 ++++++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 58 insertions(+), 56 deletions(-) diff --git a/check b/check index 69341d8c4f72..738621858b90 100755 --- a/check +++ b/check @@ -36,6 +36,7 @@ have_test_arg=false randomize=false export here=`pwd` xfile="" +brief_test_summary=false DUMP_OUTPUT=false @@ -71,6 +72,7 @@ check options -T output timestamps -r randomize test order -d dump test output to stdout + -b brief test summary --large-fs optimise scratch device for large filesystems -s section run only specified section from config file -S section exclude the specified section from the config file @@ -244,6 +246,7 @@ while [ $# -gt 0 ]; do -T) timestamp=true ;; -d) DUMP_OUTPUT=true ;; + -b) brief_test_summary=true;; --large-fs) export LARGE_SCRATCH_DEV=yes ;; --extra-space=*) export SCRATCH_DEV_EMPTY_SPACE=${r#*=} ;; @@ -319,71 +322,70 @@ _wipe_counters() _wrapup() { - seq="check" - check="$RESULT_BASE/check" + seq="check" + check="$RESULT_BASE/check" - if $showme - then + if $showme; then : - elif $needwrap - then - if [ -f $check.time -a -f $tmp.time ] - then - cat $check.time $tmp.time \ - | $AWK_PROG ' - { t[$1] = $2 } -END { if (NR > 0) { - for (i in t) print i " " t[i] - } - }' \ - | sort -n >$tmp.out - mv $tmp.out $check.time - fi + elif $needwrap; then + if [ -f $check.time -a -f $tmp.time ]; then + cat $check.time $tmp.time \ + | $AWK_PROG ' + { t[$1] = $2 } + END { + if (NR > 0) { + for (i in t) print i " " t[i] + } + }' \ + | sort -n >$tmp.out + mv $tmp.out $check.time + fi - echo "" >>$check.log - date >>$check.log + echo "" >>$check.log + date >>$check.log - echo "SECTION -- $section" >>$tmp.summary - echo "=========================" >>$tmp.summary - if [ ! -z "$n_try" -a $n_try != 0 ] - then - echo "Ran:$try" - echo "Ran:$try" >>$check.log - echo "Ran:$try" >>$tmp.summary - fi + echo "SECTION -- $section" >>$tmp.summary + echo "=========================" >>$tmp.summary + if [ ! -z "$n_try" -a $n_try != 0 ]; then + if [ $brief_test_summary == "false" ]; then + echo "Ran:$try" + echo "Ran:$try" >>$tmp.summary + fi + echo "Ran:$try" >>$check.log + fi - $interrupt && echo "Interrupted!" >>$check.log + $interrupt && echo "Interrupted!" >>$check.log - if [ ! -z "$notrun" ] - then - echo "Not run:$notrun" - echo "Not run:$notrun" >>$check.log - echo "Not run:$notrun" >>$tmp.summary + if [ ! -z "$notrun" ]; then + if [ $brief_test_summary == "false" ]; then + echo "Not run:$notrun" + echo "Not run:$notrun" >>$tmp.summary + fi + echo "Not run:$notrun" >>$check.log + fi + + if [ ! -z "$n_bad" -a $n_bad != 0 ]; then + echo "Failures:$bad" + echo "Failed $n_bad of $n_try tests" + echo "Failures:$bad" >>$check.log + echo "Failed $n_bad of $n_try tests" >>$check.log + echo "Failures:$bad" >>$tmp.summary + echo "Failed $n_bad of $n_try tests" >>$tmp.summary + else + echo "Passed all $n_try tests" + echo "Passed all $n_try tests" >>$check.log + echo "Passed all $n_try tests" >>$tmp.summary + fi + echo "" >>$tmp.summary + needwrap=false fi - if [ ! -z "$n_bad" -a $n_bad != 0 ] - then - echo "Failures:$bad" - echo "Failed $n_bad of $n_try tests" - echo "Failures:$bad" >>$check.log - echo "Failed $n_bad of $n_try tests" >>$check.log - echo "Failures:$bad" >>$tmp.summary - echo "Failed $n_bad of $n_try tests" >>$tmp.summary - else - echo "Passed all $n_try tests" - echo "Passed all $n_try tests" >>$check.log - echo "Passed all $n_try tests" >>$tmp.summary + sum_bad=`expr $sum_bad + $n_bad` + _wipe_counters + rm -f /tmp/*.rawout /tmp/*.out /tmp/*.err /tmp/*.time + if ! $OPTIONS_HAVE_SECTIONS; then + rm -f $tmp.* fi - echo "" >>$tmp.summary - needwrap=false - fi - - sum_bad=`expr $sum_bad + $n_bad` - _wipe_counters - rm -f /tmp/*.rawout /tmp/*.out /tmp/*.err /tmp/*.time - if ! $OPTIONS_HAVE_SECTIONS; then - rm -f $tmp.* - fi } _summary()