Re: [PATCH] test: optionally print subtest number
authorDmitry Kurochkin <dmitry.kurochkin@gmail.com>
Tue, 13 Dec 2011 20:15:43 +0000 (00:15 +0400)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:40:49 +0000 (09:40 -0800)
78/4f4c611dbb588ea4ed73d3dec5f0050861abd4 [new file with mode: 0644]

diff --git a/78/4f4c611dbb588ea4ed73d3dec5f0050861abd4 b/78/4f4c611dbb588ea4ed73d3dec5f0050861abd4
new file mode 100644 (file)
index 0000000..8640970
--- /dev/null
@@ -0,0 +1,133 @@
+Return-Path: <dmitry.kurochkin@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id A93F7429E28\r
+       for <notmuch@notmuchmail.org>; Tue, 13 Dec 2011 12:16:25 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id JIoohAjUwry8 for <notmuch@notmuchmail.org>;\r
+       Tue, 13 Dec 2011 12:16:25 -0800 (PST)\r
+Received: from mail-ww0-f41.google.com (mail-ww0-f41.google.com\r
+ [74.125.82.41])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ D9690429E27   for <notmuch@notmuchmail.org>; Tue, 13 Dec 2011 12:16:24 -0800\r
+ (PST)\r
+Received: by wgbdt12 with SMTP id dt12so10224497wgb.2\r
+       for <notmuch@notmuchmail.org>; Tue, 13 Dec 2011 12:16:22 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=from:to:cc:subject:in-reply-to:references:user-agent:date\r
+       :message-id:mime-version:content-type;\r
+       bh=hePDVQWUqi68yIKqA1tdrwSrDRwrdP1jAe97itCZyNI=;\r
+       b=k5fGPRn5XW9sj9xdYjqVLXYhhCMAfOSXdDYlFPQZVduMRqRX/QtQKDXKg4dNrBuP1W\r
+       lrbbP8IRLWgkQpCEkG9t+NTpuO7J0oPmeuqOQOPbHvXOLWOxdA1tU/Zmhy8I796/+2sx\r
+       7KIap2AHVv0BTjX4wbPcVmxAukijNHsf8cwXQ=\r
+Received: by 10.180.92.68 with SMTP id ck4mr14413986wib.27.1323807382039;\r
+       Tue, 13 Dec 2011 12:16:22 -0800 (PST)\r
+Received: from localhost ([91.144.186.21])\r
+       by mx.google.com with ESMTPS id eg7sm242495wib.8.2011.12.13.12.16.19\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Tue, 13 Dec 2011 12:16:20 -0800 (PST)\r
+From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
+To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] test: optionally print subtest number\r
+In-Reply-To: <1323806207-31888-1-git-send-email-david@tethera.net>\r
+References: <1323806207-31888-1-git-send-email-david@tethera.net>\r
+User-Agent: Notmuch/0.10.2+96~g74e5ae5 (http://notmuchmail.org) Emacs/23.3.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Wed, 14 Dec 2011 00:15:43 +0400\r
+Message-ID: <87ty54ut1s.fsf@gmail.com>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Cc: David Bremner <bremner@debian.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 13 Dec 2011 20:16:25 -0000\r
+\r
+On Tue, 13 Dec 2011 15:56:47 -0400, David Bremner <david@tethera.net> wrote:\r
+> From: David Bremner <bremner@debian.org>\r
+> \r
+> The idea is that $test_count could be used in tests to label\r
+> intermediate files. The output enabled by this patch (and --debug)\r
+> helps figure out which OUTPUT.nn file belongs to which test in case\r
+> several subtests write to OUTPUT.$test_count\r
+> ---\r
+> \r
+> Is there something that depends on the test format? I find it pretty\r
+> handy to have the subtest numbers, but I don't want to break some\r
+> other tools. I followed the existing style of conditionally defining\r
+> functions, but maybe someone with more bash-fu can improve that.\r
+> \r
+\r
+Looks good to me.  Except for tabs taking too much space.  Perhaps the\r
+following would be better?\r
+\r
+       printf "%-4s" "[$(($test_count - 1))]"\r
+\r
+Regards,\r
+  Dmitry\r
+\r
+>  test/test-lib.sh |   12 ++++++++++++\r
+>  1 files changed, 12 insertions(+), 0 deletions(-)\r
+> \r
+> diff --git a/test/test-lib.sh b/test/test-lib.sh\r
+> index 6be93fe..aaaaf5c 100644\r
+> --- a/test/test-lib.sh\r
+> +++ b/test/test-lib.sh\r
+> @@ -116,6 +116,16 @@ do\r
+>      esac\r
+>  done\r
+>  \r
+> +if test -n "$debug"; then\r
+> +    print_subtest () {\r
+> +    printf "\t[%d]\t" $(($test_count - 1))\r
+> +    }\r
+> +else\r
+> +    print_subtest () {\r
+> +    true\r
+> +    }\r
+> +fi\r
+> +\r
+>  if test -n "$color"; then\r
+>      say_color () {\r
+>              (\r
+> @@ -132,6 +142,7 @@ if test -n "$color"; then\r
+>              printf " "\r
+>                  printf "$@"\r
+>              tput sgr0\r
+> +            print_subtest\r
+>              )\r
+>      }\r
+>  else\r
+> @@ -140,6 +151,7 @@ else\r
+>              shift\r
+>              printf " "\r
+>                  printf "$@"\r
+> +            print_subtest\r
+>      }\r
+>  fi\r
+>  \r
+> -- \r
+> 1.7.5.4\r
+> \r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r