[PATCH] configure: add --without-api-docs option
[notmuch-archives.git] / c3 / 0e6241a8c69bc76b68e61731a5f5161c8d7129
1 Return-Path: <dmitry.kurochkin@gmail.com>\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 28868431E64\r
6         for <notmuch@notmuchmail.org>; Tue, 31 Jan 2012 23:21:11 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.799\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] 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 95Loiri3Irfb for <notmuch@notmuchmail.org>;\r
17         Tue, 31 Jan 2012 23:21:10 -0800 (PST)\r
18 Received: from mail-bk0-f53.google.com (mail-bk0-f53.google.com\r
19         [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 42FF2431FAF\r
22         for <notmuch@notmuchmail.org>; Tue, 31 Jan 2012 23:21:10 -0800 (PST)\r
23 Received: by bke11 with SMTP id 11so817306bke.26\r
24         for <notmuch@notmuchmail.org>; Tue, 31 Jan 2012 23:21:07 -0800 (PST)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
26         h=from:to:subject:date:message-id:x-mailer;\r
27         bh=iD0SGwyFbNav9t1BddkGbRV4n4UbIJzo3hLAHRZzkSo=;\r
28         b=KCSPbRZ/5yJp3A5n3inzP5F6xl7DUQy40GYtr2XdDug29Gr0qJwjJcPbZb7EVJtXFh\r
29         GOu9dXXq8d3tXUz+x5ufPIKcekQFOwHp2OnLIPWTzJQe7TJ5hXVqVXnadV81GRRcqBbO\r
30         pwGpBDNTDQi4umcrTakpCMV65ltmN5lETrYRw=\r
31 Received: by 10.204.133.201 with SMTP id g9mr12403655bkt.137.1328080867433;\r
32         Tue, 31 Jan 2012 23:21:07 -0800 (PST)\r
33 Received: from localhost ([91.144.186.21])\r
34         by mx.google.com with ESMTPS id ga13sm51760580bkc.5.2012.01.31.23.21.06\r
35         (version=TLSv1/SSLv3 cipher=OTHER);\r
36         Tue, 31 Jan 2012 23:21:07 -0800 (PST)\r
37 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
38 To: notmuch@notmuchmail.org\r
39 Subject: [PATCH] test: make test_expect_equal_file() arguments flexible\r
40 Date: Wed,  1 Feb 2012 11:19:54 +0400\r
41 Message-Id: <1328080794-24670-1-git-send-email-dmitry.kurochkin@gmail.com>\r
42 X-Mailer: git-send-email 1.7.9\r
43 X-BeenThere: notmuch@notmuchmail.org\r
44 X-Mailman-Version: 2.1.13\r
45 Precedence: list\r
46 List-Id: "Use and development of the notmuch mail system."\r
47         <notmuch.notmuchmail.org>\r
48 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
50 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
51 List-Post: <mailto:notmuch@notmuchmail.org>\r
52 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
53 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
55 X-List-Received-Date: Wed, 01 Feb 2012 07:21:11 -0000\r
56 \r
57 Before the change, test_expect_equal_file() function treated the first\r
58 argument as "actual output file" and the second argument as "expected\r
59 output file".  When the test fails, the files are copied for later\r
60 inspection.  The first files was copied to "$testname.output" and the\r
61 second file to "$testname.expected".  The argument order for\r
62 test_expect_equal_file() is often wrong which results in confusing\r
63 diff output and incorrectly named files.\r
64 \r
65 The patch solves the issue by changing test_expect_equal_file() to\r
66 treat arguments just as two files, without any special properties\r
67 (like "actual" and "expected").  The file names for copying is now\r
68 based on the given file name: "$testname.$file1" and\r
69 "$testname.$file2".  E.g. if test_expect_equal_file() is called with\r
70 "OUTPUT" and "EXPECTED", the copied files can be named\r
71 "emacs.1.OUTPUT" and "emacs.1.EXPECTED".\r
72 \r
73 The down side of this approach is that diff argument order depends on\r
74 test_expect_equal_file() argument order.  So sometimes we get diff\r
75 from expected to actual results, and sometimes the other way around.\r
76 But the files are always named correctly.\r
77 ---\r
78  test/README      |   10 +++++-----\r
79  test/test-lib.sh |   12 ++++++------\r
80  2 files changed, 11 insertions(+), 11 deletions(-)\r
81 \r
82 diff --git a/test/README b/test/README\r
83 index 43656a3..e0364e8 100644\r
84 --- a/test/README\r
85 +++ b/test/README\r
86 @@ -176,12 +176,12 @@ library for your script to use.\r
87     will generate a failure and print the difference of the two\r
88     strings.\r
89  \r
90 - test_expect_equal_file <output> <expected>\r
91 + test_expect_equal_file <file1> <file2>\r
92  \r
93 -   Identical to test_exepect_equal, except that <output> and\r
94 -   <expected> are files instead of strings.  This is a much more\r
95 -   robust method to compare formatted textual information, since it\r
96 -   also notices whitespace and closing newline differences.\r
97 +   Identical to test_exepect_equal, except that <file1> and <file2>\r
98 +   are files instead of strings.  This is a much more robust method to\r
99 +   compare formatted textual information, since it also notices\r
100 +   whitespace and closing newline differences.\r
101  \r
102   test_debug <script>\r
103  \r
104 diff --git a/test/test-lib.sh b/test/test-lib.sh\r
105 index 8158328..581b8be 100644\r
106 --- a/test/test-lib.sh\r
107 +++ b/test/test-lib.sh\r
108 @@ -488,17 +488,17 @@ test_expect_equal_file ()\r
109         test "$#" = 2 ||\r
110         error "bug in the test script: not 2 or 3 parameters to test_expect_equal"\r
111  \r
112 -       output="$1"\r
113 -       expected="$2"\r
114 +       file1="$1"\r
115 +       file2="$2"\r
116         if ! test_skip "$test_subtest_name"\r
117         then\r
118 -               if diff -q "$expected" "$output" >/dev/null ; then\r
119 +               if diff -q "$file1" "$file2" >/dev/null ; then\r
120                         test_ok_ "$test_subtest_name"\r
121                 else\r
122                         testname=$this_test.$test_count\r
123 -                       cp "$output" $testname.output\r
124 -                       cp "$expected" $testname.expected\r
125 -                       test_failure_ "$test_subtest_name" "$(diff -u $testname.expected $testname.output)"\r
126 +                       cp "$file1" "$testname.$file1"\r
127 +                       cp "$file2" "$testname.$file2"\r
128 +                       test_failure_ "$test_subtest_name" "$(diff -u "$testname.$file1" "$testname.$file2")"\r
129                 fi\r
130      fi\r
131  }\r
132 -- \r
133 1.7.9\r
134 \r