--- /dev/null
+Return-Path: <amdragon@mit.edu>\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 ACF01431FC0\r
+ for <notmuch@notmuchmail.org>; Sat, 15 Dec 2012 12:04:35 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[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 uKr56sjqgtzn for <notmuch@notmuchmail.org>;\r
+ Sat, 15 Dec 2012 12:04:35 -0800 (PST)\r
+Received: from dmz-mailsec-scanner-3.mit.edu (DMZ-MAILSEC-SCANNER-3.MIT.EDU\r
+ [18.9.25.14])\r
+ by olra.theworths.org (Postfix) with ESMTP id 9297D431FB6\r
+ for <notmuch@notmuchmail.org>; Sat, 15 Dec 2012 12:04:34 -0800 (PST)\r
+X-AuditID: 1209190e-b7f516d0000008e4-e6-50ccd7d1509d\r
+Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])\r
+ by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP\r
+ id AE.06.02276.1D7DCC05; Sat, 15 Dec 2012 15:04:33 -0500 (EST)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+ by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id qBFK4WD6014731; \r
+ Sat, 15 Dec 2012 15:04:32 -0500\r
+Received: from drake.dyndns.org\r
+ (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com\r
+ [209.6.116.242]) (authenticated bits=0)\r
+ (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+ by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id qBFK4TKr025685\r
+ (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+ Sat, 15 Dec 2012 15:04:31 -0500 (EST)\r
+Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
+ (envelope-from <amdragon@mit.edu>)\r
+ id 1TjxyG-0007sb-OR; Sat, 15 Dec 2012 15:04:28 -0500\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 5/7] test: Test show's handling of subprocess errors\r
+Date: Sat, 15 Dec 2012 15:04:18 -0500\r
+Message-Id: <1355601860-30121-6-git-send-email-amdragon@mit.edu>\r
+X-Mailer: git-send-email 1.7.10.4\r
+In-Reply-To: <1355601860-30121-1-git-send-email-amdragon@mit.edu>\r
+References: <1355601860-30121-1-git-send-email-amdragon@mit.edu>\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFjrKIsWRmVeSWpSXmKPExsUixG6nonvx+pkAg389shar5/JYXL85k9ni\r
+ zcp5rA7MHjtn3WX3OPx1IYvHs1W3mAOYo7hsUlJzMstSi/TtErgy1t9bzlJwiL1i+e6cBsYW\r
+ ti5GTg4JAROJyY9WQtliEhfurQeyuTiEBPYxSpz+tIgdJCEksIFRon+NHETiEZPEt1c9jBDO\r
+ XEaJ5kOtYFVsAhoS2/YvZwSxRQSkJXbenc0KYjMLxElsmfIfLC4s4C5x6fVEsHoWAVWJ979n\r
+ soDYvAIOEhdX7GeBOENRovvZBLCTOAUcJSZO3sUEcYWDxO0Fc5gmMPIvYGRYxSibklulm5uY\r
+ mVOcmqxbnJyYl5dapGusl5tZopeaUrqJERRanJJ8Oxi/HlQ6xCjAwajEw7sj4nSAEGtiWXFl\r
+ 7iFGSQ4mJVHejMtnAoT4kvJTKjMSizPii0pzUosPMUpwMCuJ8CbNB8rxpiRWVqUW5cOkpDlY\r
+ lMR5r6Tc9BcSSE8sSc1OTS1ILYLJynBwKEnwCgFjSEiwKDU9tSItM6cEIc3EwQkynAdoOAdI\r
+ DW9xQWJucWY6RP4Uo6KUOK8dSEIAJJFRmgfXC4v9V4ziQK8I8364BlTFA0wbcN2vgAYzAQ1e\r
+ bgM2uCQRISXVwLg+8rnz5MkXz2fztDDYLC5LMuwLO+vvWLLuY+HfIJ+GxGSlKd5f1uxJrPwX\r
+ ydTJvZtbbUWP1DsVu1r3ize2Pzm76qag0L/yxOi2Tha5OuakcJ3eXT4fLLKc8vRjdxueWSv7\r
+ /lHdw1+HUs99/RZccsAhy372IqH9J6/Iysp1653yn7/rN8+bYCWW4oxEQy3mouJEAM45CjzY AgAA\r
+Cc: tomi.ollila@iki.fi\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: Sat, 15 Dec 2012 20:04:36 -0000\r
+\r
+---\r
+ test/emacs-show | 22 ++++++++++++++++++++++\r
+ 1 file changed, 22 insertions(+)\r
+\r
+diff --git a/test/emacs-show b/test/emacs-show\r
+index b670abf..40fab61 100755\r
+--- a/test/emacs-show\r
++++ b/test/emacs-show\r
+@@ -163,4 +163,26 @@ EOF\r
+ test_expect_equal_file OUTPUT EXPECTED\r
+ \r
+ \r
++test_begin_subtest "Show handles subprocess errors"\r
++cat > notmuch_fail <<EOF\r
++#!/bin/sh\r
++echo This is output\r
++echo This is an error >&2\r
++exit 1\r
++EOF\r
++chmod a+x notmuch_fail\r
++test_emacs "(let ((notmuch-command \"$PWD/notmuch_fail\"))\r
++ (ignore-errors (notmuch-show \"*\"))\r
++ (notmuch-test-wait)\r
++ (test-output)\r
++ (with-current-buffer \"*Notmuch errors*\"\r
++ (test-output \"ERROR\")))"\r
++test_expect_equal "$(cat OUTPUT ERROR)" "\\r
++Error invoking notmuch. $PWD/notmuch_fail show --format=json --exclude=false ' * ' exited with status 1.\r
++Error:\r
++This is an error\r
++Output:\r
++This is output"\r
++\r
++\r
+ test_done\r
+-- \r
+1.7.10.4\r
+\r