From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 8E070431FC0 for ; Sat, 29 Sep 2012 10:55:23 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6RjVV4WtehGp for ; Sat, 29 Sep 2012 10:55:22 -0700 (PDT) Received: from dmz-mailsec-scanner-8.mit.edu (DMZ-MAILSEC-SCANNER-8.MIT.EDU [18.7.68.37]) by olra.theworths.org (Postfix) with ESMTP id C0F50431FBF for ; Sat, 29 Sep 2012 10:55:21 -0700 (PDT) X-AuditID: 12074425-b7fcc6d00000091f-dc-5067360995ba Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP id B3.C5.02335.90637605; Sat, 29 Sep 2012 13:55:21 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id q8THtKsk018532; Sat, 29 Sep 2012 13:55:20 -0400 Received: from drake.dyndns.org (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com [209.6.116.242]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q8THtJvP004646 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Sat, 29 Sep 2012 13:55:20 -0400 (EDT) Received: from amthrax by drake.dyndns.org with local (Exim 4.77) (envelope-from ) id 1TI1G2-0003Em-U0; Sat, 29 Sep 2012 13:55:18 -0400 From: Austin Clements To: notmuch@notmuchmail.org Subject: [PATCH 1/3] test: Clear test-ouput output file before running Emacs tests Date: Sat, 29 Sep 2012 13:55:12 -0400 Message-Id: <1348941314-8377-2-git-send-email-amdragon@mit.edu> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1348941314-8377-1-git-send-email-amdragon@mit.edu> References: <1348941314-8377-1-git-send-email-amdragon@mit.edu> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrEIsWRmVeSWpSXmKPExsUixCmqrMtplh5gMGm5qMX1mzOZHRg9nq26 xRzAGMVlk5Kak1mWWqRvl8CVcezndKaC2wIVzX0z2BoYz/F2MXJySAiYSPzZMI8JwhaTuHBv PVsXIxeHkMA+Rol53+4zQjgbGCXeXLnGDuE8YpI4teQbC4Qzl1Hi3MkeVpB+NgENiW37lzOC 2CIC0hI7784GinNwMAuoSfzpUgExhQWCJPbNqAGpYBFQlbi/ZwcbiM0rYC/x6fNiNogr5CWe 3u8DszkFHCQOTNkGZgsB1dw8PItpAiP/AkaGVYyyKblVurmJmTnFqcm6xcmJeXmpRboWermZ JXqpKaWbGEFBw+6iuoNxwiGlQ4wCHIxKPLw3T6cGCLEmlhVX5h5ilORgUhLlddFJDxDiS8pP qcxILM6ILyrNSS0+xCjBwawkwptRDFTOm5JYWZValA+TkuZgURLnvZFy019IID2xJDU7NbUg tQgmK8PBoSTBe9sEaKhgUWp6akVaZk4JQpqJgxNkOA/Q8N0gNbzFBYm5xZnpEPlTjIpS4rwb QRICIImM0jy4XlhUv2IUB3pFmPcGSBUPMCHAdb8CGswENLhqVRrI4JJEhJRUA6NhT0/roren Fa9qhu99uF9509b433xejSJCk1htfCp9zgseYGw/fjYoQ6Oouz291vbyig2iyU9e+n/pZHrB VvXzS/bd/8+Z3GIybptbHshexe9r8XOL5qd1DNNt3py9GrOwUiJVqpvNT+y9CdfiZXMMruSq FvyrfvPleXv6GsWt32a2P3i/do4SS3FGoqEWc1FxIgCK/YaAxQIAAA== X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Sep 2012 17:55:24 -0000 Most Emacs tests end with a call to (test-output), which saves the buffer to a filed called OUTPUT. Previously, if the test code failed with an exception before this call, the test framework would then compare against the OUTPUT file from the last Emacs test, resulting in confusing diffs. This requires one tweak to an emacs test that made two calls to test_emacs and expected an OUTPUT file from the first call. We simply reverse the order of the test_emacs calls. --- test/emacs | 4 ++-- test/test-lib.sh | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/test/emacs b/test/emacs index 5d118b6..174a9ac 100755 --- a/test/emacs +++ b/test/emacs @@ -653,6 +653,8 @@ test_expect_equal "$(cat OUTPUT)" "thread:XXX" test_begin_subtest 'notmuch-show-advance-and-archive with invisible signature' message1='id:20091118010116.GC25380@dottiness.seas.harvard.edu' message2='id:1258491078-29658-1-git-send-email-dottedmag@dottedmag.net' +test_emacs "(notmuch-show \"$message2\") + (test-output \"EXPECTED\")" test_emacs "(notmuch-search \"$message1 or $message2\") (notmuch-test-wait) (notmuch-search-show-thread) @@ -660,8 +662,6 @@ test_emacs "(notmuch-search \"$message1 or $message2\") (redisplay) (notmuch-show-advance-and-archive) (test-output)" -test_emacs "(notmuch-show \"$message2\") - (test-output \"EXPECTED\")" test_expect_equal_file OUTPUT EXPECTED test_begin_subtest "Refresh show buffer" diff --git a/test/test-lib.sh b/test/test-lib.sh index f34b1fb..7448b45 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -985,6 +985,14 @@ test_emacs () { done fi + # Clear test-output output file. Most Emacs tests end with a + # call to (test-output). If the test code fails with an + # exception before this call, the output file won't get + # updated. Since we don't want to compare against an output + # file from another test, so start out with an empty file. + rm -f OUTPUT + touch OUTPUT + emacsclient --socket-name="$EMACS_SERVER" --eval "(progn $@)" } -- 1.7.10