Re: notmuch-search-toggle-order and notmuch-tree
[notmuch-archives.git] / 84 / 64f3a6d1dfe4322992d539965a0c9a6a9d6aae
1 Return-Path: <tomi.ollila@iki.fi>\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 arlo.cworth.org (Postfix) with ESMTP id 534926DE1781\r
6  for <notmuch@notmuchmail.org>; Sun,  2 Aug 2015 01:31:40 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.926\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.926 tagged_above=-999 required=5 tests=[AWL=0.274, \r
12  SPF_NEUTRAL=0.652] autolearn=disabled\r
13 Received: from arlo.cworth.org ([127.0.0.1])\r
14  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
15  with ESMTP id xYQSHlZD6aXU for <notmuch@notmuchmail.org>;\r
16  Sun,  2 Aug 2015 01:31:37 -0700 (PDT)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18  by arlo.cworth.org (Postfix) with ESMTP id 5C6246DE177D\r
19  for <notmuch@notmuchmail.org>; Sun,  2 Aug 2015 01:31:36 -0700 (PDT)\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
21  by guru.guru-group.fi (Postfix) with ESMTP id AE417100046;\r
22  Sun,  2 Aug 2015 11:31:19 +0300 (EEST)\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>\r
24 To: David Bremner <david@tethera.net>, David Bremner <david@tethera.net>,\r
25  notmuch@notmuchmail.org\r
26 Subject: Re: [PATCH] test: use the python interpreter in sh.config\r
27 In-Reply-To: <1438497655-15446-1-git-send-email-david@tethera.net>\r
28 References: <87mw0agsp7.fsf@maritornes.cs.unb.ca>\r
29  <1438497655-15446-1-git-send-email-david@tethera.net>\r
30 User-Agent: Notmuch/0.20.2+31~g967a7a3 (http://notmuchmail.org) Emacs/24.3.1\r
31  (x86_64-unknown-linux-gnu)\r
32 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
33  $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
34  !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
35 Date: Sun, 02 Aug 2015 11:31:19 +0300\r
36 Message-ID: <m2d1z62iso.fsf@guru.guru-group.fi>\r
37 MIME-Version: 1.0\r
38 Content-Type: text/plain\r
39 X-BeenThere: notmuch@notmuchmail.org\r
40 X-Mailman-Version: 2.1.18\r
41 Precedence: list\r
42 List-Id: "Use and development of the notmuch mail system."\r
43  <notmuch.notmuchmail.org>\r
44 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
45  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
46 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
47 List-Post: <mailto:notmuch@notmuchmail.org>\r
48 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
49 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
50  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
51 X-List-Received-Date: Sun, 02 Aug 2015 08:31:40 -0000\r
52 \r
53 On Sun, Aug 02 2015, David Bremner <david@tethera.net> wrote:\r
54 \r
55 > The configure script chooses "python" if both python and python{2,3}\r
56 > exist exists, so this could change the version of python used to run\r
57 > the test suite.\r
58 \r
59 LGTM. tests pass. \r
60 \r
61 >\r
62 > The checking for ${NOTMUCH_PYTHON} in the test suite is arguably\r
63 > over-engineering, since the configure step will fail if it can't find\r
64 > it.\r
65 \r
66 Unless we accidentally edit NOTMUCH_PYTHON (away) in configure...\r
67 (i.e. I parsonally think this comment part is unnecessary, but i'm not\r
68 against having it)\r
69 \r
70 Tomi\r
71 \r
72 > ---\r
73 >\r
74 > Here is an updated version which fixes the subject typo, and actually\r
75 > tests for the python binary read from sh.config. I'll probably merge this version unless there are objections\r
76 >\r
77 >  configure           |  2 ++\r
78 >  test/T390-python.sh |  2 ++\r
79 >  test/test-lib.sh    | 15 ++++-----------\r
80 >  3 files changed, 8 insertions(+), 11 deletions(-)\r
81 >\r
82 > diff --git a/configure b/configure\r
83 > index 56f550b..20fbed6 100755\r
84 > --- a/configure\r
85 > +++ b/configure\r
86 > @@ -114,6 +114,8 @@ Other environment variables can be used to control configure itself,\r
87 >       XAPIAN_CONFIG   The program to use to determine flags for\r
88 >                       compiling and linking against the Xapian\r
89 >                       library. [$XAPIAN_CONFIG]\r
90 > +     PYTHON          Name of python command to use in\r
91 > +                     configure and the test suite.\r
92 >  \r
93 >  Additionally, various options can be specified on the configure\r
94 >  command line.\r
95 > diff --git a/test/T390-python.sh b/test/T390-python.sh\r
96 > index 26d0b97..c3f24f7 100755\r
97 > --- a/test/T390-python.sh\r
98 > +++ b/test/T390-python.sh\r
99 > @@ -2,6 +2,8 @@\r
100 >  test_description="python bindings"\r
101 >  . ./test-lib.sh\r
102 >  \r
103 > +test_require_external_prereq ${NOTMUCH_PYTHON}\r
104 > +\r
105 >  add_email_corpus\r
106 >  \r
107 >  test_begin_subtest "compare thread ids"\r
108 > diff --git a/test/test-lib.sh b/test/test-lib.sh\r
109 > index 3466e9c..db3b6aa 100644\r
110 > --- a/test/test-lib.sh\r
111 > +++ b/test/test-lib.sh\r
112 > @@ -621,9 +621,9 @@ test_expect_equal_json () {\r
113 >      # The test suite forces LC_ALL=C, but this causes Python 3 to\r
114 >      # decode stdin as ASCII.  We need to read JSON in UTF-8, so\r
115 >      # override Python's stdio encoding defaults.\r
116 > -    output=$(echo "$1" | PYTHONIOENCODING=utf-8 python -mjson.tool \\r
117 > +    output=$(echo "$1" | PYTHONIOENCODING=utf-8 $NOTMUCH_PYTHON -mjson.tool \\r
118 >          || echo "$1")\r
119 > -    expected=$(echo "$2" | PYTHONIOENCODING=utf-8 python -mjson.tool \\r
120 > +    expected=$(echo "$2" | PYTHONIOENCODING=utf-8 $NOTMUCH_PYTHON -mjson.tool \\r
121 >          || echo "$2")\r
122 >      shift 2\r
123 >      test_expect_equal "$output" "$expected" "$@"\r
124 > @@ -1153,14 +1153,8 @@ test_python() {\r
125 >       export LD_LIBRARY_PATH=$TEST_DIRECTORY/../lib\r
126 >       export PYTHONPATH=$TEST_DIRECTORY/../bindings/python\r
127 >  \r
128 > -     # Some distros (e.g. Arch Linux) ship Python 2.* as /usr/bin/python2,\r
129 > -     # most others as /usr/bin/python. So first try python2, and fallback to\r
130 > -     # python if python2 doesn't exist.\r
131 > -     cmd=python2\r
132 > -     [[ ${test_missing_external_prereq_[python2]} == t ]] && cmd=python\r
133 > -\r
134 >       (echo "import sys; _orig_stdout=sys.stdout; sys.stdout=open('OUTPUT', 'w')"; cat) \\r
135 > -             | $cmd -\r
136 > +             | $NOTMUCH_PYTHON -\r
137 >  }\r
138 >  \r
139 >  test_ruby() {\r
140 > @@ -1325,5 +1319,4 @@ test_declare_external_prereq emacs\r
141 >  test_declare_external_prereq ${TEST_EMACSCLIENT}\r
142 >  test_declare_external_prereq gdb\r
143 >  test_declare_external_prereq gpg\r
144 > -test_declare_external_prereq python\r
145 > -test_declare_external_prereq python2\r
146 > +test_declare_external_prereq ${NOTMUCH_PYTHON}\r
147 > -- \r
148 > 2.1.4\r
149 >\r
150 > _______________________________________________\r
151 > notmuch mailing list\r
152 > notmuch@notmuchmail.org\r
153 > http://notmuchmail.org/mailman/listinfo/notmuch\r