From patchwork Thu Jul 23 16:45:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Tulak X-Patchwork-Id: 6854891 Return-Path: X-Original-To: patchwork-fstests@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id ADCD39F358 for ; Thu, 23 Jul 2015 16:46:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D933120681 for ; Thu, 23 Jul 2015 16:46:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EB5AA20773 for ; Thu, 23 Jul 2015 16:46:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753948AbbGWQqD (ORCPT ); Thu, 23 Jul 2015 12:46:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47360 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754344AbbGWQp6 (ORCPT ); Thu, 23 Jul 2015 12:45:58 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id CDCF49022B for ; Thu, 23 Jul 2015 16:45:58 +0000 (UTC) Received: from jtulak-t430.brq.redhat.com (jtulak.brq.redhat.com [10.34.1.5]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t6NGjvqI027672; Thu, 23 Jul 2015 12:45:58 -0400 From: Jan Tulak To: fstests@vger.kernel.org Cc: Jan Tulak Subject: [PATCH] xfstests: add a flag for direct printing of test output Date: Thu, 23 Jul 2015 18:45:55 +0200 Message-Id: <1437669955-18454-1-git-send-email-jtulak@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add -d debug dump flag to ./check to directly print a test output to stdout, instead of just saving it into a file and showing a diff snippet. Useful e.g. when writing a new test. Signed-off-by: Jan Tulak --- check | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/check b/check index a300130..a4ee224 100755 --- a/check +++ b/check @@ -37,6 +37,8 @@ randomize=false export here=`pwd` xfile="" +DUMP_OUTPUT=false + # start the initialisation work now iam=check @@ -74,6 +76,7 @@ check options -n show me, do not run tests -T output timestamps -r randomize test order + -d dump test output to stdout --large-fs optimise scratch device for large filesystems -s section run only specified section from config file @@ -237,6 +240,7 @@ while [ $# -gt 0 ]; do -r) randomize=true ;; -T) timestamp=true ;; + -d) DUMP_OUTPUT=true ;; --large-fs) export LARGE_SCRATCH_DEV=yes ;; --extra-space=*) export SCRATCH_DEV_EMPTY_SPACE=${r#*=} ;; @@ -598,8 +602,14 @@ for section in $HOST_OPTIONS_SECTIONS; do # _check_dmesg depends on this log in dmesg touch ${RESULT_DIR}/check_dmesg fi - ./$seq >$tmp.rawout 2>&1 - sts=$? + if [ "$DUMP_OUTPUT" = true ]; then + ./$seq 2>&1 | tee $tmp.rawout + # Because $? would get tee's return code + sts=${PIPESTATUS[0]} + else + ./$seq >$tmp.rawout 2>&1 + sts=$? + fi $timestamp && _timestamp stop=`_wallclock`