From patchwork Mon Feb 13 13:26:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 9569727 X-Patchwork-Delegate: geert@linux-m68k.org 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 2483460578 for ; Mon, 13 Feb 2017 13:26:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1FCBB26E81 for ; Mon, 13 Feb 2017 13:26:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 11DA427F8C; Mon, 13 Feb 2017 13:26:34 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, 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 72D0126E90 for ; Mon, 13 Feb 2017 13:26:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752920AbdBMN00 (ORCPT ); Mon, 13 Feb 2017 08:26:26 -0500 Received: from galahad.ideasonboard.com ([185.26.127.97]:46028 "EHLO galahad.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751665AbdBMN0Y (ORCPT ); Mon, 13 Feb 2017 08:26:24 -0500 Received: from avalon.bb.dnainternet.fi (dfj612ybrt5fhg77mgycy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:2e86:4862:ef6a:2804]) by galahad.ideasonboard.com (Postfix) with ESMTPSA id C0E9D200DF; Mon, 13 Feb 2017 14:25:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1486992334; bh=6K1lvwO241F7xmfDNez9Zs+BS1H1UFFOr8xatZeZaNA=; h=From:To:Cc:Subject:Date:From; b=kq7OZnmJAK3lLtBsY5ShW/760vGGKxQ9tai1JbQjJLfG+9aU/fTHp3un+QjM6OOz0 j1L3kuDyjJJxfDSIZDWUVdowHGcaU3TYc0eLRzXM7vt+ABIhtXnfjK6zjmh5uURFo6 EfNM8Xo2NTCWDOv4BPpe4u4Wd7llMc+mHerRaJLI= From: Laurent Pinchart To: linux-renesas-soc@vger.kernel.org Cc: kieran.bingham@ideasonboard.com Subject: [PATCH] scripts: Add statistics to test suite runner Date: Mon, 13 Feb 2017 15:26:46 +0200 Message-Id: <20170213132646.10599-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.10.2 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Print the number of passed, failed and skipped tests. Signed-off-by: Laurent Pinchart --- scripts/vsp-tests.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/scripts/vsp-tests.sh b/scripts/vsp-tests.sh index 6a10f70ca35c..1ed81713e5c5 100755 --- a/scripts/vsp-tests.sh +++ b/scripts/vsp-tests.sh @@ -21,9 +21,17 @@ KERNEL_VERSION=`uname -r` run_test() { local script=$1 local iteration=$2 + local IFS="$(printf '\n\t')" echo "- $script" - ./$script + + local output=$(./$script 2>&1 | tee /proc/self/fd/2) + for line in $output ; do + (echo "$line" | grep -q 'fail$') && num_fail=$((num_fail+1)) + (echo "$line" | grep -q 'pass$') && num_pass=$((num_pass+1)) + (echo "$line" | grep -q 'skipped$') && num_skip=$((num_skip+1)) + num_test=$((num_test+1)) + done if [ $(ls *.bin 2>/dev/null | wc -l) != 0 ] ; then local dir=$KERNEL_VERSION/test-$script/$iteration/ @@ -36,9 +44,16 @@ run_test() { run_suite() { echo "--- Test loop $1 ---" + num_fail=0 + num_pass=0 + num_skip=0 + num_test=0 + for test in vsp-unit-test*.sh; do run_test $test $1 done; + + echo "$num_test tests: $num_pass passed, $num_fail failed, $num_skip skipped" } for loop in `seq 1 1 $1`; do