[PATCH 1/1] test: always source test-lib.sh as ./test-lib.sh

Subject: [PATCH 1/1] test: always source test-lib.sh as ./test-lib.sh

Date: Wed, 21 Nov 2012 17:16:14 +0200

To: notmuch@notmuchmail.org

Cc: tomi.ollila@iki.fi, Tomi Ollila

From: Tomi Ollila


From: Tomi Ollila <too@iki.fi>

There are currently 45 TESTS scripts. 36 of those load
test-lib.sh using '. ./test-lib.sh' and 9 '. test-lib.sh'.

In latter case test-lib.sh is first searched from directories
in PATH (posix) and then from current directory (bash feature).

Changed the 9 files to execute '. ./test-lib.sh'. The test-lib.sh
should never be loaded from directory in PATH.
---
 test/config                    | 2 +-
 test/emacs                     | 2 +-
 test/emacs-address-cleaning    | 2 +-
 test/emacs-hello               | 2 +-
 test/emacs-large-search-buffer | 2 +-
 test/emacs-show                | 2 +-
 test/emacs-subject-to-filename | 2 +-
 test/emacs-test-functions      | 2 +-
 test/help-test                 | 2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/test/config b/test/config
index 93ecb13..cfa1f32 100755
--- a/test/config
+++ b/test/config
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description='"notmuch config"'
-. test-lib.sh
+. ./test-lib.sh
 
 test_begin_subtest "Get string value"
 test_expect_equal "$(notmuch config get user.name)" "Notmuch Test Suite"
diff --git a/test/emacs b/test/emacs
index 77265b0..ba3bbd0 100755
--- a/test/emacs
+++ b/test/emacs
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description="emacs interface"
-. test-lib.sh
+. ./test-lib.sh
 
 EXPECTED=$TEST_DIRECTORY/emacs.expected-output
 
diff --git a/test/emacs-address-cleaning b/test/emacs-address-cleaning
index 6ddde5c..0472346 100755
--- a/test/emacs-address-cleaning
+++ b/test/emacs-address-cleaning
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description="emacs address cleaning"
-. test-lib.sh
+. ./test-lib.sh
 
 test_begin_subtest "notmuch-test-address-clean part 1"
 test_emacs_expect_t '(notmuch-test-address-cleaning-1)'
diff --git a/test/emacs-hello b/test/emacs-hello
index 48d1420..f729616 100755
--- a/test/emacs-hello
+++ b/test/emacs-hello
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description="emacs notmuch-hello view"
-. test-lib.sh
+. ./test-lib.sh
 
 EXPECTED=$TEST_DIRECTORY/emacs.expected-output
 
diff --git a/test/emacs-large-search-buffer b/test/emacs-large-search-buffer
index 4351e33..678328d 100755
--- a/test/emacs-large-search-buffer
+++ b/test/emacs-large-search-buffer
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="Emacs with large search results buffer"
-. test-lib.sh
+. ./test-lib.sh
 
 x=xxxxxxxxxx # 10
 x=$x$x$x$x$x$x$x$x$x$x # 100
diff --git a/test/emacs-show b/test/emacs-show
index ec3be8b..b670abf 100755
--- a/test/emacs-show
+++ b/test/emacs-show
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description="emacs notmuch-show view"
-. test-lib.sh
+. ./test-lib.sh
 
 EXPECTED=$TEST_DIRECTORY/emacs-show.expected-output
 
diff --git a/test/emacs-subject-to-filename b/test/emacs-subject-to-filename
index a0ffdfe..43529a4 100755
--- a/test/emacs-subject-to-filename
+++ b/test/emacs-subject-to-filename
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description="emacs: mail subject to filename"
-. test-lib.sh
+. ./test-lib.sh
 
 # emacs server can't be started in a child process with $(test_emacs ...)
 test_emacs '(ignore)'
diff --git a/test/emacs-test-functions b/test/emacs-test-functions
index 0e1f9fc..ca4a798 100755
--- a/test/emacs-test-functions
+++ b/test/emacs-test-functions
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description="emacs test function sanity"
-. test-lib.sh
+. ./test-lib.sh
 
 test_begin_subtest "emacs test function sanity"
 test_emacs_expect_t 't'
diff --git a/test/help-test b/test/help-test
index 9f4b9c7..f7df725 100755
--- a/test/help-test
+++ b/test/help-test
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description="online help"
-. test-lib.sh
+. ./test-lib.sh
 
 test_expect_success 'notmuch --help' 'notmuch --help'
 test_expect_success 'notmuch --help tag' 'notmuch --help tag'
-- 
1.7.11.7


Thread: