1 Return-Path: <bremner@tesseract.cs.unb.ca>
\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 283586DE173B
\r
6 for <notmuch@notmuchmail.org>; Sat, 1 Aug 2015 23:42:06 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
11 X-Spam-Status: No, score=0.151 tagged_above=-999 required=5 tests=[AWL=0.141,
\r
12 T_HEADER_FROM_DIFFERENT_DOMAINS=0.01] 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 mWcD6iKIRBrS for <notmuch@notmuchmail.org>;
\r
16 Sat, 1 Aug 2015 23:42:03 -0700 (PDT)
\r
17 Received: from gitolite.debian.net (gitolite.debian.net [87.98.215.224])
\r
18 by arlo.cworth.org (Postfix) with ESMTPS id 577B66DE1715
\r
19 for <notmuch@notmuchmail.org>; Sat, 1 Aug 2015 23:42:03 -0700 (PDT)
\r
20 Received: from remotemail by gitolite.debian.net with local (Exim 4.80)
\r
21 (envelope-from <bremner@tesseract.cs.unb.ca>)
\r
22 id 1ZLmxU-00008R-Qi; Sun, 02 Aug 2015 06:41:20 +0000
\r
23 Received: (nullmailer pid 15607 invoked by uid 1000); Sun, 02 Aug 2015
\r
25 From: David Bremner <david@tethera.net>
\r
26 To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org
\r
27 Subject: [PATCH] test: use the python interpreter in sh.config
\r
28 Date: Sun, 2 Aug 2015 08:40:55 +0200
\r
29 Message-Id: <1438497655-15446-1-git-send-email-david@tethera.net>
\r
30 X-Mailer: git-send-email 2.1.4
\r
31 In-Reply-To: <87mw0agsp7.fsf@maritornes.cs.unb.ca>
\r
32 References: <87mw0agsp7.fsf@maritornes.cs.unb.ca>
\r
33 X-BeenThere: notmuch@notmuchmail.org
\r
34 X-Mailman-Version: 2.1.18
\r
36 List-Id: "Use and development of the notmuch mail system."
\r
37 <notmuch.notmuchmail.org>
\r
38 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
39 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
40 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>
\r
41 List-Post: <mailto:notmuch@notmuchmail.org>
\r
42 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
43 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
44 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
45 X-List-Received-Date: Sun, 02 Aug 2015 06:42:06 -0000
\r
47 The configure script chooses "python" if both python and python{2,3}
\r
48 exist exists, so this could change the version of python used to run
\r
51 The checking for ${NOTMUCH_PYTHON} in the test suite is arguably
\r
52 over-engineering, since the configure step will fail if it can't find
\r
56 Here is an updated version which fixes the subject typo, and actually
\r
57 tests for the python binary read from sh.config. I'll probably merge this version unless there are objections
\r
60 test/T390-python.sh | 2 ++
\r
61 test/test-lib.sh | 15 ++++-----------
\r
62 3 files changed, 8 insertions(+), 11 deletions(-)
\r
64 diff --git a/configure b/configure
\r
65 index 56f550b..20fbed6 100755
\r
68 @@ -114,6 +114,8 @@ Other environment variables can be used to control configure itself,
\r
69 XAPIAN_CONFIG The program to use to determine flags for
\r
70 compiling and linking against the Xapian
\r
71 library. [$XAPIAN_CONFIG]
\r
72 + PYTHON Name of python command to use in
\r
73 + configure and the test suite.
\r
75 Additionally, various options can be specified on the configure
\r
77 diff --git a/test/T390-python.sh b/test/T390-python.sh
\r
78 index 26d0b97..c3f24f7 100755
\r
79 --- a/test/T390-python.sh
\r
80 +++ b/test/T390-python.sh
\r
82 test_description="python bindings"
\r
85 +test_require_external_prereq ${NOTMUCH_PYTHON}
\r
89 test_begin_subtest "compare thread ids"
\r
90 diff --git a/test/test-lib.sh b/test/test-lib.sh
\r
91 index 3466e9c..db3b6aa 100644
\r
92 --- a/test/test-lib.sh
\r
93 +++ b/test/test-lib.sh
\r
94 @@ -621,9 +621,9 @@ test_expect_equal_json () {
\r
95 # The test suite forces LC_ALL=C, but this causes Python 3 to
\r
96 # decode stdin as ASCII. We need to read JSON in UTF-8, so
\r
97 # override Python's stdio encoding defaults.
\r
98 - output=$(echo "$1" | PYTHONIOENCODING=utf-8 python -mjson.tool \
\r
99 + output=$(echo "$1" | PYTHONIOENCODING=utf-8 $NOTMUCH_PYTHON -mjson.tool \
\r
101 - expected=$(echo "$2" | PYTHONIOENCODING=utf-8 python -mjson.tool \
\r
102 + expected=$(echo "$2" | PYTHONIOENCODING=utf-8 $NOTMUCH_PYTHON -mjson.tool \
\r
105 test_expect_equal "$output" "$expected" "$@"
\r
106 @@ -1153,14 +1153,8 @@ test_python() {
\r
107 export LD_LIBRARY_PATH=$TEST_DIRECTORY/../lib
\r
108 export PYTHONPATH=$TEST_DIRECTORY/../bindings/python
\r
110 - # Some distros (e.g. Arch Linux) ship Python 2.* as /usr/bin/python2,
\r
111 - # most others as /usr/bin/python. So first try python2, and fallback to
\r
112 - # python if python2 doesn't exist.
\r
114 - [[ ${test_missing_external_prereq_[python2]} == t ]] && cmd=python
\r
116 (echo "import sys; _orig_stdout=sys.stdout; sys.stdout=open('OUTPUT', 'w')"; cat) \
\r
118 + | $NOTMUCH_PYTHON -
\r
122 @@ -1325,5 +1319,4 @@ test_declare_external_prereq emacs
\r
123 test_declare_external_prereq ${TEST_EMACSCLIENT}
\r
124 test_declare_external_prereq gdb
\r
125 test_declare_external_prereq gpg
\r
126 -test_declare_external_prereq python
\r
127 -test_declare_external_prereq python2
\r
128 +test_declare_external_prereq ${NOTMUCH_PYTHON}
\r