[PATCH 1/3] test: Clear test-ouput output file before running Emacs tests
authorAustin Clements <amdragon@MIT.EDU>
Sat, 29 Sep 2012 17:55:12 +0000 (13:55 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:49:39 +0000 (09:49 -0800)
fe/21c30ac37de77e292afc9f8e520900c9e4c68e [new file with mode: 0644]

diff --git a/fe/21c30ac37de77e292afc9f8e520900c9e4c68e b/fe/21c30ac37de77e292afc9f8e520900c9e4c68e
new file mode 100644 (file)
index 0000000..f5d48eb
--- /dev/null
@@ -0,0 +1,131 @@
+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 8E070431FC0\r
+       for <notmuch@notmuchmail.org>; Sat, 29 Sep 2012 10:55:23 -0700 (PDT)\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 6RjVV4WtehGp for <notmuch@notmuchmail.org>;\r
+       Sat, 29 Sep 2012 10:55:22 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-8.mit.edu (DMZ-MAILSEC-SCANNER-8.MIT.EDU\r
+       [18.7.68.37])\r
+       by olra.theworths.org (Postfix) with ESMTP id C0F50431FBF\r
+       for <notmuch@notmuchmail.org>; Sat, 29 Sep 2012 10:55:21 -0700 (PDT)\r
+X-AuditID: 12074425-b7fcc6d00000091f-dc-5067360995ba\r
+Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
+       by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id B3.C5.02335.90637605; Sat, 29 Sep 2012 13:55:21 -0400 (EDT)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id q8THtKsk018532; \r
+       Sat, 29 Sep 2012 13:55:20 -0400\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 q8THtJvP004646\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Sat, 29 Sep 2012 13:55:20 -0400 (EDT)\r
+Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1TI1G2-0003Em-U0; Sat, 29 Sep 2012 13:55:18 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 1/3] test: Clear test-ouput output file before running Emacs\r
+       tests\r
+Date: Sat, 29 Sep 2012 13:55:12 -0400\r
+Message-Id: <1348941314-8377-2-git-send-email-amdragon@mit.edu>\r
+X-Mailer: git-send-email 1.7.10\r
+In-Reply-To: <1348941314-8377-1-git-send-email-amdragon@mit.edu>\r
+References: <1348941314-8377-1-git-send-email-amdragon@mit.edu>\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFtrEIsWRmVeSWpSXmKPExsUixCmqrMtplh5gMGm5qMX1mzOZHRg9nq26\r
+       xRzAGMVlk5Kak1mWWqRvl8CVcezndKaC2wIVzX0z2BoYz/F2MXJySAiYSPzZMI8JwhaTuHBv\r
+       PVsXIxeHkMA+Rol53+4zQjgbGCXeXLnGDuE8YpI4teQbC4Qzl1Hi3MkeVpB+NgENiW37lzOC\r
+       2CIC0hI7784GinNwMAuoSfzpUgExhQWCJPbNqAGpYBFQlbi/ZwcbiM0rYC/x6fNiNogr5CWe\r
+       3u8DszkFHCQOTNkGZgsB1dw8PItpAiP/AkaGVYyyKblVurmJmTnFqcm6xcmJeXmpRboWermZ\r
+       JXqpKaWbGEFBw+6iuoNxwiGlQ4wCHIxKPLw3T6cGCLEmlhVX5h5ilORgUhLlddFJDxDiS8pP\r
+       qcxILM6ILyrNSS0+xCjBwawkwptRDFTOm5JYWZValA+TkuZgURLnvZFy019IID2xJDU7NbUg\r
+       tQgmK8PBoSTBe9sEaKhgUWp6akVaZk4JQpqJgxNkOA/Q8N0gNbzFBYm5xZnpEPlTjIpS4rwb\r
+       QRICIImM0jy4XlhUv2IUB3pFmPcGSBUPMCHAdb8CGswENLhqVRrI4JJEhJRUA6NhT0/roren\r
+       Fa9qhu99uF9509b433xejSJCk1htfCp9zgseYGw/fjYoQ6Oouz291vbyig2iyU9e+n/pZHrB\r
+       VvXzS/bd/8+Z3GIybptbHshexe9r8XOL5qd1DNNt3py9GrOwUiJVqpvNT+y9CdfiZXMMruSq\r
+       FvyrfvPleXv6GsWt32a2P3i/do4SS3FGoqEWc1FxIgCK/YaAxQIAAA==\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, 29 Sep 2012 17:55:24 -0000\r
+\r
+Most Emacs tests end with a call to (test-output), which saves the\r
+buffer to a filed called OUTPUT.  Previously, if the test code failed\r
+with an exception before this call, the test framework would then\r
+compare against the OUTPUT file from the last Emacs test, resulting in\r
+confusing diffs.\r
+\r
+This requires one tweak to an emacs test that made two calls to\r
+test_emacs and expected an OUTPUT file from the first call.  We simply\r
+reverse the order of the test_emacs calls.\r
+---\r
+ test/emacs       |    4 ++--\r
+ test/test-lib.sh |    8 ++++++++\r
+ 2 files changed, 10 insertions(+), 2 deletions(-)\r
+\r
+diff --git a/test/emacs b/test/emacs\r
+index 5d118b6..174a9ac 100755\r
+--- a/test/emacs\r
++++ b/test/emacs\r
+@@ -653,6 +653,8 @@ test_expect_equal "$(cat OUTPUT)" "thread:XXX"\r
+ test_begin_subtest 'notmuch-show-advance-and-archive with invisible signature'\r
+ message1='id:20091118010116.GC25380@dottiness.seas.harvard.edu'\r
+ message2='id:1258491078-29658-1-git-send-email-dottedmag@dottedmag.net'\r
++test_emacs "(notmuch-show \"$message2\")\r
++          (test-output \"EXPECTED\")"\r
+ test_emacs "(notmuch-search \"$message1 or $message2\")\r
+           (notmuch-test-wait)\r
+           (notmuch-search-show-thread)\r
+@@ -660,8 +662,6 @@ test_emacs "(notmuch-search \"$message1 or $message2\")\r
+           (redisplay)\r
+           (notmuch-show-advance-and-archive)\r
+           (test-output)"\r
+-test_emacs "(notmuch-show \"$message2\")\r
+-          (test-output \"EXPECTED\")"\r
+ test_expect_equal_file OUTPUT EXPECTED\r
+ \r
+ test_begin_subtest "Refresh show buffer"\r
+diff --git a/test/test-lib.sh b/test/test-lib.sh\r
+index f34b1fb..7448b45 100644\r
+--- a/test/test-lib.sh\r
++++ b/test/test-lib.sh\r
+@@ -985,6 +985,14 @@ test_emacs () {\r
+               done\r
+       fi\r
+ \r
++      # Clear test-output output file.  Most Emacs tests end with a\r
++      # call to (test-output).  If the test code fails with an\r
++      # exception before this call, the output file won't get\r
++      # updated.  Since we don't want to compare against an output\r
++      # file from another test, so start out with an empty file.\r
++      rm -f OUTPUT\r
++      touch OUTPUT\r
++\r
+       emacsclient --socket-name="$EMACS_SERVER" --eval "(progn $@)"\r
+ }\r
+ \r
+-- \r
+1.7.10\r
+\r