Re: [PATCH 0/4] Allow specifying alternate names for addresses in other_email
[notmuch-archives.git] / a1 / ce5a6af753e3fb539d2a1c26cb16ae0ee1a570
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 308CF431FDC\r
6         for <notmuch@notmuchmail.org>; Tue, 12 Nov 2013 12:41:22 -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 hF8o721EUuIK for <notmuch@notmuchmail.org>;\r
16         Tue, 12 Nov 2013 12:41:16 -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 8722D431FCF\r
19         for <notmuch@notmuchmail.org>; Tue, 12 Nov 2013 12:41:16 -0800 (PST)\r
20 Received: by guru.guru-group.fi (Postfix, from userid 501)\r
21         id 30DE810009D; Tue, 12 Nov 2013 22:41:10 +0200 (EET)\r
22 From: Tomi Ollila <tomi.ollila@iki.fi>\r
23 To: notmuch@notmuchmail.org\r
24 Subject: [PATCH 1/3] test: resolve `basename "$0" .sh` once for all in\r
25         test-lib.sh\r
26 Date: Tue, 12 Nov 2013 22:41:06 +0200\r
27 Message-Id: <1384288868-23903-1-git-send-email-tomi.ollila@iki.fi>\r
28 X-Mailer: git-send-email 1.8.0\r
29 Cc: tomi.ollila@iki.fi\r
30 X-BeenThere: notmuch@notmuchmail.org\r
31 X-Mailman-Version: 2.1.13\r
32 Precedence: list\r
33 List-Id: "Use and development of the notmuch mail system."\r
34         <notmuch.notmuchmail.org>\r
35 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
36         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
37 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
38 List-Post: <mailto:notmuch@notmuchmail.org>\r
39 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
40 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
41         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
42 X-List-Received-Date: Tue, 12 Nov 2013 20:41:22 -0000\r
43 \r
44 test-lib.sh sometimes did equivalent of `basename "$0" .sh`, sometimes\r
45 skipping the basename part and sometimes .sh part. This worked as\r
46 we never had path components in $0 (more than ./) nor .sh ending.\r
47 \r
48 Now the equivalent of `basename "$0" .sh` is done once and used\r
49 everywhere. In the future we may have .sh suffix in test names\r
50 -- removing those is a good idea.\r
51 ---\r
52  test/test-lib.sh | 12 +++++++-----\r
53  1 file changed, 7 insertions(+), 5 deletions(-)\r
54 \r
55 diff --git a/test/test-lib.sh b/test/test-lib.sh\r
56 index 2aa4dfc..808bb7f 100644\r
57 --- a/test/test-lib.sh\r
58 +++ b/test/test-lib.sh\r
59 @@ -25,6 +25,9 @@ fi\r
60  # Make sure echo builtin does not expand backslash-escape sequences by default.\r
61  shopt -u xpg_echo\r
62  \r
63 +this_test=${0##*/}\r
64 +this_test=${this_test%.sh}\r
65 +\r
66  # if --tee was passed, write the output not only to the terminal, but\r
67  # additionally to the file test-results/$BASENAME.out, too.\r
68  case "$GIT_TEST_TEE_STARTED, $* " in\r
69 @@ -33,7 +36,7 @@ done,*)\r
70         ;;\r
71  *' --tee '*|*' --va'*)\r
72         mkdir -p test-results\r
73 -       BASE=test-results/$(basename "$0" .sh)\r
74 +       BASE=test-results/$this_test\r
75         (GIT_TEST_TEE_STARTED=done ${SHELL-sh} "$0" "$@" 2>&1;\r
76          echo $? > $BASE.exit) | tee $BASE.out\r
77         test "$(cat $BASE.exit)" = 0\r
78 @@ -187,7 +190,7 @@ then\r
79         exit 0\r
80  fi\r
81  \r
82 -echo $(basename "$0"): "Testing ${test_description}"\r
83 +echo $this_test: "Testing ${test_description}"\r
84  \r
85  exec 5>&1\r
86  \r
87 @@ -956,7 +959,7 @@ test_done () {\r
88         GIT_EXIT_OK=t\r
89         test_results_dir="$TEST_DIRECTORY/test-results"\r
90         mkdir -p "$test_results_dir"\r
91 -       test_results_path="$test_results_dir/${0%.sh}"\r
92 +       test_results_path="$test_results_dir/$this_test"\r
93  \r
94         echo "total $test_count" >> $test_results_path\r
95         echo "success $test_success" >> $test_results_path\r
96 @@ -1015,7 +1018,7 @@ test_emacs () {\r
97         test -z "$missing_dependencies" || return\r
98  \r
99         if [ -z "$EMACS_SERVER" ]; then\r
100 -               emacs_tests="$(basename $0).el"\r
101 +               emacs_tests="${this_test}.el"\r
102                 if [ -f "$TEST_DIRECTORY/$emacs_tests" ]; then\r
103                         load_emacs_tests="--eval '(load \"$emacs_tests\")'"\r
104                 else\r
105 @@ -1129,7 +1132,6 @@ else\r
106         exec 4>test.output 3>&4\r
107  fi\r
108  \r
109 -this_test=${0##*/}\r
110  for skp in $NOTMUCH_SKIP_TESTS\r
111  do\r
112         to_skip=\r
113 -- \r
114 1.8.3.1\r
115 \r