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
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\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
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
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
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
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
60 try ln -s notmuch not\ much; cd not\ much; make test
\r
62 and see what happens.
\r
64 test/emacs | 5 +++--
\r
65 test/emacs-show | 5 +++--
\r
66 2 files changed, 6 insertions(+), 4 deletions(-)
\r
68 diff --git a/test/emacs b/test/emacs
\r
69 index 3b3b14d..751d34e 100755
\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
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
82 @@ -889,7 +890,7 @@ $PWD/notmuch_fail exited with status 1 (see *Notmuch errors* for more details)
\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
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
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
104 This is an error (see *Notmuch errors* for more details)
\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