Re: [PATCH v4 01/16] add util/search-path.{c, h} to test for executables in $PATH
[notmuch-archives.git] / 13 / a9ade01b40bfd9134019eafa8cfcaa57ac7492
1 Return-Path: <too@guru-group.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 olra.theworths.org (Postfix) with ESMTP id C7A0F431FDB\r
6         for <notmuch@notmuchmail.org>; Fri, 22 Nov 2013 13:06:46 -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\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id A5MIUgzbD104 for <notmuch@notmuchmail.org>;\r
16         Fri, 22 Nov 2013 13:06:40 -0800 (PST)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18         by olra.theworths.org (Postfix) with ESMTP id 7EC5A431FCB\r
19         for <notmuch@notmuchmail.org>; Fri, 22 Nov 2013 13:06:40 -0800 (PST)\r
20 Received: by guru.guru-group.fi (Postfix, from userid 501)\r
21         id 0557B1000D0; Fri, 22 Nov 2013 23:06:30 +0200 (EET)\r
22 From: Tomi Ollila <tomi.ollila@iki.fi>\r
23 To: notmuch@notmuchmail.org\r
24 Subject: [PATCH] test: replace $PWD with XXX in emacs & emacs-show tests\r
25 Date: Fri, 22 Nov 2013 23:06:29 +0200\r
26 Message-Id: <1385154389-3243-1-git-send-email-tomi.ollila@iki.fi>\r
27 X-Mailer: git-send-email 1.8.0\r
28 Cc: tomi.ollila@iki.fi\r
29 X-BeenThere: notmuch@notmuchmail.org\r
30 X-Mailman-Version: 2.1.13\r
31 Precedence: list\r
32 List-Id: "Use and development of the notmuch mail system."\r
33         <notmuch.notmuchmail.org>\r
34 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
35         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
36 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
37 List-Post: <mailto:notmuch@notmuchmail.org>\r
38 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
39 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
40         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
41 X-List-Received-Date: Fri, 22 Nov 2013 21:06:46 -0000\r
42 \r
43 When executed command line is written to *Notmuch errors* buffer,\r
44 shell-quote-argument will backslash-escape any char that is not in\r
45 "POSIX filename characters" (i.e. matching "[^-0-9a-zA-Z_./\n]").\r
46 \r
47 Currently in two emacs tests shell has expanded $PWD as part of\r
48 emacs variable, which will later be fed to #'shell-quote-argument\r
49 and finally writte to ERROR file. If $PWD contained non-POSIX\r
50 filename characters, data in ERROR file will not match $PWD when\r
51 later comparing in shell. Therefore, in these two particular cases\r
52 the escaped $PWD is replaced with XXX in ERROR file and expected\r
53 content is adjusted accordingly.\r
54 ---\r
55 \r
56 The regexp match replaces anything non-space ([^ ]) up to the command\r
57 name with XXX. As test suite generally doesn't support spaces in\r
58 directry path this is fine:\r
59 \r
60 try  ln -s notmuch not\ much; cd not\ much; make test\r
61 \r
62 and see what happens.\r
63 \r
64  test/emacs      | 5 +++--\r
65  test/emacs-show | 5 +++--\r
66  2 files changed, 6 insertions(+), 4 deletions(-)\r
67 \r
68 diff --git a/test/emacs b/test/emacs\r
69 index 3b3b14d..751d34e 100755\r
70 --- a/test/emacs\r
71 +++ b/test/emacs\r
72 @@ -881,7 +881,8 @@ test_emacs "(let ((notmuch-command \"$PWD/notmuch_fail\"))\r
73                (with-current-buffer \"*Notmuch errors*\"\r
74                   (test-output \"ERROR\"))\r
75                (test-output))"\r
76 -sed -i -e 's/^\[.*\]$/[XXX]/' ERROR\r
77 +sed -i -e 's/^\[.*\]$/[XXX]/' \\r
78 +       -e '/^command: / s|[^ ]*/notmuch_fail |XXX/notmuch_fail |' ERROR\r
79  test_expect_equal "$(cat OUTPUT; echo ---; cat MESSAGES; echo ---; cat ERROR)" "\\r
80  End of search results.\r
81  ---\r
82 @@ -889,7 +890,7 @@ $PWD/notmuch_fail exited with status 1 (see *Notmuch errors* for more details)\r
83  ---\r
84  [XXX]\r
85  $PWD/notmuch_fail exited with status 1\r
86 -command: $PWD/notmuch_fail search --format\=sexp --format-version\=2 --sort\=newest-first tag\:inbox\r
87 +command: XXX/notmuch_fail search --format\=sexp --format-version\=2 --sort\=newest-first tag\:inbox\r
88  exit status: 1"\r
89  \r
90  test_begin_subtest "Search handles subprocess warnings"\r
91 diff --git a/test/emacs-show b/test/emacs-show\r
92 index fb23db4..08de108 100755\r
93 --- a/test/emacs-show\r
94 +++ b/test/emacs-show\r
95 @@ -181,14 +181,15 @@ test_emacs "(let ((notmuch-command \"$PWD/notmuch_fail\"))\r
96                (with-current-buffer \"*Notmuch errors*\"\r
97                   (test-output \"ERROR\"))\r
98                (test-output))"\r
99 -sed -i -e 's/^\[.*\]$/[XXX]/' ERROR\r
100 +sed -i -e 's/^\[.*\]$/[XXX]/' \\r
101 +       -e '/^command: / s|[^ ]*/notmuch_fail |XXX/notmuch_fail |' ERROR\r
102  test_expect_equal "$(cat OUTPUT; echo ---; cat MESSAGES; echo ---; cat ERROR)" "\\r
103  ---\r
104  This is an error (see *Notmuch errors* for more details)\r
105  ---\r
106  [XXX]\r
107  This is an error\r
108 -command: $PWD/notmuch_fail show --format\\=sexp --format-version\\=1 --exclude\\=false \\' \\* \\'\r
109 +command: XXX/notmuch_fail show --format\\=sexp --format-version\\=1 --exclude\\=false \\' \\* \\'\r
110  exit status: 1\r
111  stderr:\r
112  This is an error\r
113 -- \r
114 1.8.4.2\r
115 \r