Re: [PATCH] configure: add --without-api-docs option
[notmuch-archives.git] / bf / 4b6cef15a287232d38f01709ecbdb28f812f1f
1 Return-Path: <jrollins@servo.finestructure.net>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id C38C7429E48\r
6         for <notmuch@notmuchmail.org>; Wed, 25 May 2011 18:01:36 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -1.921\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.921 tagged_above=-999 required=5\r
12         tests=[NO_DNS_FOR_FROM=0.379, RCVD_IN_DNSWL_MED=-2.3]\r
13         autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id 4gAXbaVRWJTJ for <notmuch@notmuchmail.org>;\r
17         Wed, 25 May 2011 18:01:36 -0700 (PDT)\r
18 Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu\r
19         [131.215.239.19])\r
20         by olra.theworths.org (Postfix) with ESMTP id 3F176429E30\r
21         for <notmuch@notmuchmail.org>; Wed, 25 May 2011 18:01:34 -0700 (PDT)\r
22 Received: from fire-doxen.imss.caltech.edu (localhost [127.0.0.1])\r
23         by fire-doxen-postvirus (Postfix) with ESMTP id DEEB53282D2;\r
24         Wed, 25 May 2011 17:55:18 -0700 (PDT)\r
25 X-Spam-Scanned: at Caltech-IMSS on fire-doxen by amavisd-new\r
26 Received: from servo.finestructure.net (gwave-104.ligo.caltech.edu\r
27         [131.215.114.104]) (Authenticated sender: jrollins)\r
28         by fire-doxen-submit (Postfix) with ESMTP id 2721F3282C8;\r
29         Wed, 25 May 2011 17:55:13 -0700 (PDT)\r
30 Received: by servo.finestructure.net (Postfix, from userid 1000)\r
31         id 78AFE7C5; Wed, 25 May 2011 18:01:26 -0700 (PDT)\r
32 From: Jameson Graef Rollins <jrollins@finestructure.net>\r
33 To: notmuch@notmuchmail.org\r
34 Subject: [PATCH 05/11] test: new test-lib function to test for equality\r
35         between files\r
36 Date: Wed, 25 May 2011 18:01:14 -0700\r
37 Message-Id: <1306371680-19441-6-git-send-email-jrollins@finestructure.net>\r
38 X-Mailer: git-send-email 1.7.4.4\r
39 In-Reply-To: <1306371680-19441-1-git-send-email-jrollins@finestructure.net>\r
40 References: <1306371680-19441-1-git-send-email-jrollins@finestructure.net>\r
41 X-BeenThere: notmuch@notmuchmail.org\r
42 X-Mailman-Version: 2.1.13\r
43 Precedence: list\r
44 List-Id: "Use and development of the notmuch mail system."\r
45         <notmuch.notmuchmail.org>\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
47         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
49 List-Post: <mailto:notmuch@notmuchmail.org>\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
52         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
53 X-List-Received-Date: Thu, 26 May 2011 01:01:37 -0000\r
54 \r
55 We need to be able to test for the presence of a newline at the end of\r
56 output.  There's no good way to capture trailing newlines in bash, so\r
57 redirecting output to a file is the next best thing.  This new\r
58 function should be used when testing for output that is expected to\r
59 have trailing newlines.\r
60 \r
61 The next commit will demonstrate the use of this.\r
62 ---\r
63  test/test-lib.sh |   23 +++++++++++++++++++++++\r
64  1 files changed, 23 insertions(+), 0 deletions(-)\r
65 \r
66 diff --git a/test/test-lib.sh b/test/test-lib.sh\r
67 index f536172..9e2e0b5 100755\r
68 --- a/test/test-lib.sh\r
69 +++ b/test/test-lib.sh\r
70 @@ -441,6 +441,29 @@ test_expect_equal ()\r
71      fi\r
72  }\r
73  \r
74 +test_expect_equal_file ()\r
75 +{\r
76 +       exec 1>&6 2>&7          # Restore stdout and stderr\r
77 +       inside_subtest=\r
78 +       test "$#" = 3 && { prereq=$1; shift; } || prereq=\r
79 +       test "$#" = 2 ||\r
80 +       error "bug in the test script: not 2 or 3 parameters to test_expect_equal"\r
81 +\r
82 +       output="$1"\r
83 +       expected="$2"\r
84 +       if ! test_skip "$@"\r
85 +       then\r
86 +               if diff -q "$expected" "$output" >/dev/null ; then\r
87 +                       test_ok_ "$test_subtest_name"\r
88 +               else\r
89 +                       testname=$this_test.$test_count\r
90 +                       mv "$output" $testname.output\r
91 +                       mv "$expected" $testname.expected\r
92 +                       test_failure_ "$test_subtest_name" "$(diff -u $testname.expected $testname.output)"\r
93 +               fi\r
94 +    fi\r
95 +}\r
96 +\r
97  test_expect_equal_failure ()\r
98  {\r
99         exec 1>&6 2>&7          # Restore stdout and stderr\r
100 -- \r
101 1.7.4.4\r
102 \r