[PATCH 03/24] test: use $(dirname "$0") for sourcing test-lib.sh

Jani Nikula jani at nikula.org
Mon Sep 25 13:38:19 PDT 2017


Don't assume the tests are always run from within the source tree.
---
 test/T000-basic.sh                            | 2 +-
 test/T010-help-test.sh                        | 2 +-
 test/T020-compact.sh                          | 2 +-
 test/T030-config.sh                           | 2 +-
 test/T040-setup.sh                            | 2 +-
 test/T050-new.sh                              | 2 +-
 test/T060-count.sh                            | 2 +-
 test/T070-insert.sh                           | 2 +-
 test/T080-search.sh                           | 2 +-
 test/T090-search-output.sh                    | 2 +-
 test/T095-address.sh                          | 2 +-
 test/T100-search-by-folder.sh                 | 2 +-
 test/T110-search-position-overlap-bug.sh      | 2 +-
 test/T120-search-insufficient-from-quoting.sh | 2 +-
 test/T130-search-limiting.sh                  | 2 +-
 test/T140-excludes.sh                         | 2 +-
 test/T150-tagging.sh                          | 2 +-
 test/T160-json.sh                             | 2 +-
 test/T170-sexp.sh                             | 2 +-
 test/T180-text.sh                             | 2 +-
 test/T190-multipart.sh                        | 2 +-
 test/T200-thread-naming.sh                    | 2 +-
 test/T205-author-naming.sh                    | 2 +-
 test/T210-raw.sh                              | 2 +-
 test/T220-reply.sh                            | 2 +-
 test/T230-reply-to-sender.sh                  | 2 +-
 test/T240-dump-restore.sh                     | 2 +-
 test/T250-uuencode.sh                         | 2 +-
 test/T260-thread-order.sh                     | 2 +-
 test/T270-author-order.sh                     | 2 +-
 test/T280-from-guessing.sh                    | 2 +-
 test/T290-long-id.sh                          | 2 +-
 test/T300-encoding.sh                         | 2 +-
 test/T310-emacs.sh                            | 2 +-
 test/T320-emacs-large-search-buffer.sh        | 2 +-
 test/T330-emacs-subject-to-filename.sh        | 2 +-
 test/T340-maildir-sync.sh                     | 2 +-
 test/T350-crypto.sh                           | 2 +-
 test/T355-smime.sh                            | 2 +-
 test/T360-symbol-hiding.sh                    | 2 +-
 test/T370-search-folder-coherence.sh          | 2 +-
 test/T380-atomicity.sh                        | 2 +-
 test/T390-python.sh                           | 2 +-
 test/T395-ruby.sh                             | 2 +-
 test/T400-hooks.sh                            | 2 +-
 test/T410-argument-parsing.sh                 | 2 +-
 test/T420-emacs-test-functions.sh             | 2 +-
 test/T430-emacs-address-cleaning.sh           | 2 +-
 test/T440-emacs-hello.sh                      | 2 +-
 test/T450-emacs-show.sh                       | 2 +-
 test/T455-emacs-charsets.sh                   | 2 +-
 test/T460-emacs-tree.sh                       | 2 +-
 test/T470-missing-headers.sh                  | 2 +-
 test/T480-hex-escaping.sh                     | 2 +-
 test/T490-parse-time-string.sh                | 2 +-
 test/T500-search-date.sh                      | 2 +-
 test/T510-thread-replies.sh                   | 2 +-
 test/T520-show.sh                             | 2 +-
 test/T530-upgrade.sh                          | 2 +-
 test/T550-db-features.sh                      | 2 +-
 test/T560-lib-error.sh                        | 2 +-
 test/T570-revision-tracking.sh                | 2 +-
 test/T580-thread-search.sh                    | 2 +-
 test/T590-libconfig.sh                        | 2 +-
 test/T590-thread-breakage.sh                  | 2 +-
 test/T600-named-queries.sh                    | 2 +-
 test/T610-message-property.sh                 | 2 +-
 test/T620-lock.sh                             | 2 +-
 test/T630-emacs-draft.sh                      | 2 +-
 test/T640-database-modified.sh                | 2 +-
 test/T650-regexp-query.sh                     | 2 +-
 test/T660-bad-date.sh                         | 2 +-
 test/T670-duplicate-mid.sh                    | 2 +-
 test/T680-html-indexing.sh                    | 2 +-
 test/T690-command-line-args.sh                | 2 +-
 test/T700-reindex.sh                          | 2 +-
 test/test-verbose                             | 2 +-
 77 files changed, 77 insertions(+), 77 deletions(-)

diff --git a/test/T000-basic.sh b/test/T000-basic.sh
index a4efa3cab8b5..d514082d48e3 100755
--- a/test/T000-basic.sh
+++ b/test/T000-basic.sh
@@ -14,7 +14,7 @@ then
 	exit 1
 fi
 
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 ################################################################
 # Test harness
diff --git a/test/T010-help-test.sh b/test/T010-help-test.sh
index 0c833de26217..da45d3aecf7a 100755
--- a/test/T010-help-test.sh
+++ b/test/T010-help-test.sh
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description="online help"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 test_begin_subtest 'notmuch --help'
 test_expect_success 'notmuch --help'
diff --git a/test/T020-compact.sh b/test/T020-compact.sh
index a3d7380e81c8..58cd2ba74cef 100755
--- a/test/T020-compact.sh
+++ b/test/T020-compact.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='"notmuch compact"'
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 add_message '[subject]=One'
 add_message '[subject]=Two'
diff --git a/test/T030-config.sh b/test/T030-config.sh
index 35d757f6b227..e91c36597e3c 100755
--- a/test/T030-config.sh
+++ b/test/T030-config.sh
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description='"notmuch config"'
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 test_begin_subtest "Get string value"
 test_expect_equal "$(notmuch config get user.name)" "Notmuch Test Suite"
diff --git a/test/T040-setup.sh b/test/T040-setup.sh
index 998bd6e0798a..56efe1d57b49 100755
--- a/test/T040-setup.sh
+++ b/test/T040-setup.sh
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description='"notmuch setup"'
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 test_begin_subtest "Notmuch new without a config suggests notmuch setup"
 output=$(notmuch --config=new-notmuch-config new 2>&1)
diff --git a/test/T050-new.sh b/test/T050-new.sh
index 272ed417aa2e..2035d29f529a 100755
--- a/test/T050-new.sh
+++ b/test/T050-new.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='"notmuch new" in several variations'
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 test_begin_subtest "No new messages"
 output=$(NOTMUCH_NEW --debug)
diff --git a/test/T060-count.sh b/test/T060-count.sh
index 4751440e94a1..0c0bf47309e9 100755
--- a/test/T060-count.sh
+++ b/test/T060-count.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='"notmuch count" for messages and threads'
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 add_email_corpus
 
diff --git a/test/T070-insert.sh b/test/T070-insert.sh
index e56a9d21880e..f1650e623e35 100755
--- a/test/T070-insert.sh
+++ b/test/T070-insert.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='"notmuch insert"'
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 test_require_external_prereq gdb
 
diff --git a/test/T080-search.sh b/test/T080-search.sh
index 3bb3dced8915..70f2854973a9 100755
--- a/test/T080-search.sh
+++ b/test/T080-search.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='"notmuch search" in several variations'
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 add_email_corpus
 
diff --git a/test/T090-search-output.sh b/test/T090-search-output.sh
index dccefcb7f012..bf28d220a760 100755
--- a/test/T090-search-output.sh
+++ b/test/T090-search-output.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='various settings for "notmuch search --output="'
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 add_email_corpus
 
diff --git a/test/T095-address.sh b/test/T095-address.sh
index 5931b1475e0b..f0291d29ec43 100755
--- a/test/T095-address.sh
+++ b/test/T095-address.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='"notmuch address" in several variants'
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 add_email_corpus
 
diff --git a/test/T100-search-by-folder.sh b/test/T100-search-by-folder.sh
index 79c266e445f5..a090f3d247c4 100755
--- a/test/T100-search-by-folder.sh
+++ b/test/T100-search-by-folder.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='"notmuch search" by folder: and path: (with variations)'
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 add_message '[dir]=bad' '[subject]="To the bone"'
 add_message '[dir]=.' '[subject]="Top level"'
diff --git a/test/T110-search-position-overlap-bug.sh b/test/T110-search-position-overlap-bug.sh
index 2a4238f95fc9..f4d5ee1479ba 100755
--- a/test/T110-search-position-overlap-bug.sh
+++ b/test/T110-search-position-overlap-bug.sh
@@ -18,7 +18,7 @@
 # id:3wd4o8wa7fx.fsf at testarossa.amd.com
 
 test_description='that notmuch does not overlap term positions'
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 add_message '[to]="a at b.c, x at y.z"'
 
diff --git a/test/T120-search-insufficient-from-quoting.sh b/test/T120-search-insufficient-from-quoting.sh
index 4862d82644df..509fec8b0f2a 100755
--- a/test/T120-search-insufficient-from-quoting.sh
+++ b/test/T120-search-insufficient-from-quoting.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='messages with unquoted . in name'
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 add_message \
   '[from]="Some.Name for Someone <bugs at quoting.com>"' \
diff --git a/test/T130-search-limiting.sh b/test/T130-search-limiting.sh
index c8986f4e4057..8a30e7abf87f 100755
--- a/test/T130-search-limiting.sh
+++ b/test/T130-search-limiting.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='"notmuch search" --offset and --limit parameters'
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 add_email_corpus
 
diff --git a/test/T140-excludes.sh b/test/T140-excludes.sh
index f91d4d7f0cac..0cf69975f442 100755
--- a/test/T140-excludes.sh
+++ b/test/T140-excludes.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='"notmuch search, count and show" with excludes in several variations'
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 # Generates a thread consisting of a top level message and 'length'
 # replies. The subject of the top message 'subject: top message"
diff --git a/test/T150-tagging.sh b/test/T150-tagging.sh
index 0d0a3b874526..6140c6768630 100755
--- a/test/T150-tagging.sh
+++ b/test/T150-tagging.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='"notmuch tag"'
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 add_message '[subject]=One'
 add_message '[subject]=Two'
diff --git a/test/T160-json.sh b/test/T160-json.sh
index 07955a2bb90a..765b78a6746d 100755
--- a/test/T160-json.sh
+++ b/test/T160-json.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="--format=json output"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 test_begin_subtest "Show message: json"
 add_message "[subject]=\"json-show-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[bcc]=\"test_suite+bcc at notmuchmail.org\"" "[reply-to]=\"test_suite+replyto at notmuchmail.org\"" "[body]=\"json-show-message\""
diff --git a/test/T170-sexp.sh b/test/T170-sexp.sh
index db142e49683d..1125fdc91ec0 100755
--- a/test/T170-sexp.sh
+++ b/test/T170-sexp.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="--format=sexp output"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 test_begin_subtest "Show message: sexp"
 add_message "[subject]=\"sexp-show-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[bcc]=\"test_suite+bcc at notmuchmail.org\"" "[reply-to]=\"test_suite+replyto at notmuchmail.org\"" "[body]=\"sexp-show-message\""
diff --git a/test/T180-text.sh b/test/T180-text.sh
index 3a265dbd5a73..ad2cb1f37c9b 100755
--- a/test/T180-text.sh
+++ b/test/T180-text.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="--format=text output"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 test_begin_subtest "Show message: text"
 add_message "[subject]=\"text-show-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"text-show-message\""
diff --git a/test/T190-multipart.sh b/test/T190-multipart.sh
index 94bb0570a3b2..f73535b7bf7e 100755
--- a/test/T190-multipart.sh
+++ b/test/T190-multipart.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="output of multipart message"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 cat <<EOF > embedded_message_body
 Content-Type: multipart/alternative; boundary="==-=-=="
diff --git a/test/T200-thread-naming.sh b/test/T200-thread-naming.sh
index 2167ba8ef973..594d301f7c3a 100755
--- a/test/T200-thread-naming.sh
+++ b/test/T200-thread-naming.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="naming of threads with changing subject"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 test_begin_subtest "Initial thread name (oldest-first search)"
 add_message '[subject]="thread-naming: Initial thread subject"' \
diff --git a/test/T205-author-naming.sh b/test/T205-author-naming.sh
index 69d8dc50ff86..68b85ced724e 100755
--- a/test/T205-author-naming.sh
+++ b/test/T205-author-naming.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="naming of authors with unusual addresses"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 test_begin_subtest "Add author with empty quoted real name"
 add_message '[subject]="author-naming: Initial thread subject"' \
diff --git a/test/T210-raw.sh b/test/T210-raw.sh
index 832a4ad311b7..99fdef72e634 100755
--- a/test/T210-raw.sh
+++ b/test/T210-raw.sh
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description='notmuch show --format=raw'
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 add_message
 add_message
diff --git a/test/T220-reply.sh b/test/T220-reply.sh
index 4fb67ffbfc0d..ebe710f98c55 100755
--- a/test/T220-reply.sh
+++ b/test/T220-reply.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="\"notmuch reply\" in several variations"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 test_begin_subtest "Basic reply"
 add_message '[from]="Sender <sender at example.com>"' \
diff --git a/test/T230-reply-to-sender.sh b/test/T230-reply-to-sender.sh
index 608334dc023e..134a106365c4 100755
--- a/test/T230-reply-to-sender.sh
+++ b/test/T230-reply-to-sender.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="\"notmuch reply --reply-to=sender\" in several variations"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 test_begin_subtest "Basic reply-to-sender"
 add_message '[from]="Sender <sender at example.com>"' \
diff --git a/test/T240-dump-restore.sh b/test/T240-dump-restore.sh
index 75fb0b404bbe..0870ff921f1e 100755
--- a/test/T240-dump-restore.sh
+++ b/test/T240-dump-restore.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="\"notmuch dump\" and \"notmuch restore\""
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 NOTMUCH_NEW > /dev/null
 test_begin_subtest "dump header"
diff --git a/test/T250-uuencode.sh b/test/T250-uuencode.sh
index 6f45d3959bf2..251c0b40f186 100755
--- a/test/T250-uuencode.sh
+++ b/test/T250-uuencode.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="handling of uuencoded data"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 add_message [subject]=uuencodetest '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' \
 '[body]="This message is used to ensure that notmuch correctly handles a
diff --git a/test/T260-thread-order.sh b/test/T260-thread-order.sh
index 89f4d1be4816..7f71ce097eb5 100755
--- a/test/T260-thread-order.sh
+++ b/test/T260-thread-order.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="threading when messages received out of order"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 # Generate all single-root four message thread structures.  We'll use
 # this for multiple tests below.
diff --git a/test/T270-author-order.sh b/test/T270-author-order.sh
index 9124ece6f911..c28ecb028515 100755
--- a/test/T270-author-order.sh
+++ b/test/T270-author-order.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="author reordering;"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 test_begin_subtest "Adding parent message"
 generate_message [body]=findme [id]=new-parent-id [subject]=author-reorder-threadtest '[from]="User <user at example.com>"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"'
diff --git a/test/T280-from-guessing.sh b/test/T280-from-guessing.sh
index 7c562fb9e353..b87182323b72 100755
--- a/test/T280-from-guessing.sh
+++ b/test/T280-from-guessing.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="From line heuristics (with multiple configured addresses)"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 test_begin_subtest "Magic from guessing (nothing to go on)"
 add_message '[from]="Sender <sender at example.com>"' \
diff --git a/test/T290-long-id.sh b/test/T290-long-id.sh
index 1fb7c037ee52..5e3879f5dabf 100755
--- a/test/T290-long-id.sh
+++ b/test/T290-long-id.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="messages with ridiculously-long message IDs"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 test_begin_subtest "Referencing long ID before adding"
 generate_message '[subject]="Reference of ridiculously-long message ID"' \
diff --git a/test/T300-encoding.sh b/test/T300-encoding.sh
index 8d201c7e8aa4..2c656a1e0950 100755
--- a/test/T300-encoding.sh
+++ b/test/T300-encoding.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="encoding issues"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 test_begin_subtest "Message with text of unknown charset"
 add_message '[content-type]="text/plain; charset=unknown-8bit"' \
diff --git a/test/T310-emacs.sh b/test/T310-emacs.sh
index fde11790a600..b8a89a4ac4c9 100755
--- a/test/T310-emacs.sh
+++ b/test/T310-emacs.sh
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description="emacs interface"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 EXPECTED=$TEST_DIRECTORY/emacs.expected-output
 
diff --git a/test/T320-emacs-large-search-buffer.sh b/test/T320-emacs-large-search-buffer.sh
index e9d5e3584f87..f61e8a973fc5 100755
--- a/test/T320-emacs-large-search-buffer.sh
+++ b/test/T320-emacs-large-search-buffer.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="Emacs with large search results buffer"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 x=xxxxxxxxxx # 10
 x=$x$x$x$x$x$x$x$x$x$x # 100
diff --git a/test/T330-emacs-subject-to-filename.sh b/test/T330-emacs-subject-to-filename.sh
index 517fa8398261..eaf7c980903b 100755
--- a/test/T330-emacs-subject-to-filename.sh
+++ b/test/T330-emacs-subject-to-filename.sh
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description="emacs: mail subject to filename"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 # emacs server can't be started in a child process with $(test_emacs ...)
 test_emacs '(ignore)' > /dev/null
diff --git a/test/T340-maildir-sync.sh b/test/T340-maildir-sync.sh
index b473ae4e1c0f..7fece5f2302c 100755
--- a/test/T340-maildir-sync.sh
+++ b/test/T340-maildir-sync.sh
@@ -2,7 +2,7 @@
 
 test_description="maildir synchronization"
 
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 # Create the expected maildir structure
 mkdir $MAIL_DIR/cur
diff --git a/test/T350-crypto.sh b/test/T350-crypto.sh
index 53bf4113d622..0e19bd08f7f3 100755
--- a/test/T350-crypto.sh
+++ b/test/T350-crypto.sh
@@ -5,7 +5,7 @@
 # - verification of signatures from expired/revoked keys
 
 test_description='PGP/MIME signature verification and decryption'
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 add_gnupg_home ()
 {
diff --git a/test/T355-smime.sh b/test/T355-smime.sh
index 03d24581de2b..b813b6cad2e5 100755
--- a/test/T355-smime.sh
+++ b/test/T355-smime.sh
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description='S/MIME signature verification and decryption'
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 add_gpgsm_home ()
 {
diff --git a/test/T360-symbol-hiding.sh b/test/T360-symbol-hiding.sh
index 9c6d4e647db5..68edc2d3a7ab 100755
--- a/test/T360-symbol-hiding.sh
+++ b/test/T360-symbol-hiding.sh
@@ -9,7 +9,7 @@
 
 test_description='exception symbol hiding'
 
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 test_begin_subtest 'running test' run_test
 mkdir -p ${PWD}/fakedb/.notmuch
diff --git a/test/T370-search-folder-coherence.sh b/test/T370-search-folder-coherence.sh
index 8748b3d00eeb..0a2727e74fb4 100755
--- a/test/T370-search-folder-coherence.sh
+++ b/test/T370-search-folder-coherence.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='folder tags removed and added through file renames remain consistent'
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 test_begin_subtest "No new messages"
 output=$(NOTMUCH_NEW)
diff --git a/test/T380-atomicity.sh b/test/T380-atomicity.sh
index a46a2df2a1fe..17a3e478aeca 100755
--- a/test/T380-atomicity.sh
+++ b/test/T380-atomicity.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='atomicity'
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 # This script tests the effects of killing and restarting "notmuch
 # new" at arbitrary points.  If notmuch new is properly atomic, the
diff --git a/test/T390-python.sh b/test/T390-python.sh
index a9a61145699b..fd338743f44d 100755
--- a/test/T390-python.sh
+++ b/test/T390-python.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="python bindings"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 test_require_external_prereq ${NOTMUCH_PYTHON}
 
diff --git a/test/T395-ruby.sh b/test/T395-ruby.sh
index 52f9fe0f8bfd..a0b76eb89ca1 100755
--- a/test/T395-ruby.sh
+++ b/test/T395-ruby.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="ruby bindings"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 if [ "${NOTMUCH_HAVE_RUBY_DEV}" = "0" ]; then
     test_subtest_missing_external_prereq_["ruby development files"]=t
diff --git a/test/T400-hooks.sh b/test/T400-hooks.sh
index 7917a82f0154..49c690eb0360 100755
--- a/test/T400-hooks.sh
+++ b/test/T400-hooks.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='hooks'
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 HOOK_DIR=${MAIL_DIR}/.notmuch/hooks
 
diff --git a/test/T410-argument-parsing.sh b/test/T410-argument-parsing.sh
index fad134e305c5..f22434814a75 100755
--- a/test/T410-argument-parsing.sh
+++ b/test/T410-argument-parsing.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="argument parsing"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 test_begin_subtest "sanity check"
 $TEST_DIRECTORY/arg-test  pos1  --keyword=one --string=foo pos2 --int=7 --flag=one --flag=three > OUTPUT
diff --git a/test/T420-emacs-test-functions.sh b/test/T420-emacs-test-functions.sh
index 955c5f7ff295..bfc10be3b7b5 100755
--- a/test/T420-emacs-test-functions.sh
+++ b/test/T420-emacs-test-functions.sh
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description="emacs test function sanity"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 test_begin_subtest "emacs test function sanity"
 test_emacs_expect_t 't'
diff --git a/test/T430-emacs-address-cleaning.sh b/test/T430-emacs-address-cleaning.sh
index 664b79d293fb..02d3b4117b94 100755
--- a/test/T430-emacs-address-cleaning.sh
+++ b/test/T430-emacs-address-cleaning.sh
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description="emacs address cleaning"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 test_begin_subtest "notmuch-test-address-clean part 1"
 test_emacs_expect_t '(notmuch-test-address-cleaning-1)'
diff --git a/test/T440-emacs-hello.sh b/test/T440-emacs-hello.sh
index ac214a5b2b45..76e795937c6c 100755
--- a/test/T440-emacs-hello.sh
+++ b/test/T440-emacs-hello.sh
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description="emacs notmuch-hello view"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 EXPECTED=$TEST_DIRECTORY/emacs.expected-output
 
diff --git a/test/T450-emacs-show.sh b/test/T450-emacs-show.sh
index db48c7d5b4c0..95babb1f0812 100755
--- a/test/T450-emacs-show.sh
+++ b/test/T450-emacs-show.sh
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description="emacs notmuch-show view"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 EXPECTED=$TEST_DIRECTORY/emacs-show.expected-output
 
diff --git a/test/T455-emacs-charsets.sh b/test/T455-emacs-charsets.sh
index 5d6d53a82326..cb1297caa5dc 100755
--- a/test/T455-emacs-charsets.sh
+++ b/test/T455-emacs-charsets.sh
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description="emacs notmuch-show charset handling"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 
 UTF8_YEN=$'\xef\xbf\xa5'
diff --git a/test/T460-emacs-tree.sh b/test/T460-emacs-tree.sh
index 958ff888a865..dc5978419be7 100755
--- a/test/T460-emacs-tree.sh
+++ b/test/T460-emacs-tree.sh
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description="emacs tree view interface"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 EXPECTED=$TEST_DIRECTORY/tree.expected-output
 
diff --git a/test/T470-missing-headers.sh b/test/T470-missing-headers.sh
index 32031e3174d3..4bf5d285c49b 100755
--- a/test/T470-missing-headers.sh
+++ b/test/T470-missing-headers.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='messages with missing headers'
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 # Notmuch requires at least one of from, subject, or to or it will
 # ignore the file.  Generate two messages so that together they cover
diff --git a/test/T480-hex-escaping.sh b/test/T480-hex-escaping.sh
index 18b56600480c..28564c3c9da2 100755
--- a/test/T480-hex-escaping.sh
+++ b/test/T480-hex-escaping.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="hex encoding and decoding"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 test_begin_subtest "round trip"
 find $TEST_DIRECTORY/corpora/default -type f -print | sort | xargs cat > EXPECTED
diff --git a/test/T490-parse-time-string.sh b/test/T490-parse-time-string.sh
index ab90fcc5a76d..d1c70cfaf5d5 100755
--- a/test/T490-parse-time-string.sh
+++ b/test/T490-parse-time-string.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="date/time parser module"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 # Sanity/smoke tests for the date/time parser independent of notmuch
 
diff --git a/test/T500-search-date.sh b/test/T500-search-date.sh
index fc4ecdc30b16..5c5b99a0e2b0 100755
--- a/test/T500-search-date.sh
+++ b/test/T500-search-date.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="date:since..until queries"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 add_email_corpus
 
diff --git a/test/T510-thread-replies.sh b/test/T510-thread-replies.sh
index fa288bb19903..6837ff176630 100755
--- a/test/T510-thread-replies.sh
+++ b/test/T510-thread-replies.sh
@@ -9,7 +9,7 @@ test_description='test of proper handling of in-reply-to and references headers'
 # database is constructed properly, even in the presence of
 # non-RFC-compliant headers'
 
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 test_begin_subtest "Use References when In-Reply-To is broken"
 add_message '[id]="foo at one.com"' \
diff --git a/test/T520-show.sh b/test/T520-show.sh
index fb232a32510f..16222650eafc 100755
--- a/test/T520-show.sh
+++ b/test/T520-show.sh
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 test_description='"notmuch show"'
 
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 add_email_corpus
 
diff --git a/test/T530-upgrade.sh b/test/T530-upgrade.sh
index f0fd1511d056..69ebec688464 100755
--- a/test/T530-upgrade.sh
+++ b/test/T530-upgrade.sh
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 test_description="database upgrade"
 
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 dbtarball=database-v1.tar.xz
 
diff --git a/test/T550-db-features.sh b/test/T550-db-features.sh
index f94a660d7508..9d5a9e70a598 100755
--- a/test/T550-db-features.sh
+++ b/test/T550-db-features.sh
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 test_description="database version and feature compatibility"
 
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 test_begin_subtest "future database versions abort open"
 ${TEST_DIRECTORY}/make-db-version ${MAIL_DIR} 9999 ""
diff --git a/test/T560-lib-error.sh b/test/T560-lib-error.sh
index a50eca807700..06a6b860ae8a 100755
--- a/test/T560-lib-error.sh
+++ b/test/T560-lib-error.sh
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 test_description="error reporting for library"
 
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 add_email_corpus
 
diff --git a/test/T570-revision-tracking.sh b/test/T570-revision-tracking.sh
index 76ad227944a0..a59e7c980fc9 100755
--- a/test/T570-revision-tracking.sh
+++ b/test/T570-revision-tracking.sh
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 test_description="database revision tracking"
 
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 add_email_corpus
 
diff --git a/test/T580-thread-search.sh b/test/T580-thread-search.sh
index 512559a3aff9..01aa3efd2e79 100755
--- a/test/T580-thread-search.sh
+++ b/test/T580-thread-search.sh
@@ -5,7 +5,7 @@
 
 test_description='test of searching by thread-id'
 
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 add_email_corpus
 
diff --git a/test/T590-libconfig.sh b/test/T590-libconfig.sh
index 1b308693c527..46f3a76d574f 100755
--- a/test/T590-libconfig.sh
+++ b/test/T590-libconfig.sh
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 test_description="library config API"
 
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 add_email_corpus
 
diff --git a/test/T590-thread-breakage.sh b/test/T590-thread-breakage.sh
index 38abc2113c26..53932d63effe 100755
--- a/test/T590-thread-breakage.sh
+++ b/test/T590-thread-breakage.sh
@@ -19,7 +19,7 @@ test_description='thread breakage during reindexing'
 # works properly and attempted fixes to threading issues do not break
 # the expected contents of the index.
 
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 message_a() {
     mkdir -p ${MAIL_DIR}/cur
diff --git a/test/T600-named-queries.sh b/test/T600-named-queries.sh
index 495b7699a0a7..59496c3e94a1 100755
--- a/test/T600-named-queries.sh
+++ b/test/T600-named-queries.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='named queries'
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 QUERYSTR="date:2009-11-18..2009-11-18 and tag:unread"
 
diff --git a/test/T610-message-property.sh b/test/T610-message-property.sh
index ba5f55daf9b1..74b3f5a1811f 100755
--- a/test/T610-message-property.sh
+++ b/test/T610-message-property.sh
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 test_description="message property API"
 
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 add_email_corpus
 
diff --git a/test/T620-lock.sh b/test/T620-lock.sh
index f46475e8ddcc..085ffe4377c2 100755
--- a/test/T620-lock.sh
+++ b/test/T620-lock.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="locking"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 if [ "${NOTMUCH_HAVE_XAPIAN_DB_RETRY_LOCK}" = "0" ]; then
     test_subtest_missing_external_prereq_["lock retry support"]=t
diff --git a/test/T630-emacs-draft.sh b/test/T630-emacs-draft.sh
index cd9e33a7c405..d7903ce799da 100755
--- a/test/T630-emacs-draft.sh
+++ b/test/T630-emacs-draft.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="Emacs Draft Handling"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 add_email_corpus
 
diff --git a/test/T640-database-modified.sh b/test/T640-database-modified.sh
index e35e35f64289..274105c708fa 100755
--- a/test/T640-database-modified.sh
+++ b/test/T640-database-modified.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="DatabaseModifiedError handling"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 # add enough messages to trigger the exception
 add_email_corpus
diff --git a/test/T650-regexp-query.sh b/test/T650-regexp-query.sh
index d5def7649d0f..4085340f66d4 100755
--- a/test/T650-regexp-query.sh
+++ b/test/T650-regexp-query.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='regular expression searches'
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 if [ $NOTMUCH_HAVE_XAPIAN_FIELD_PROCESSOR -eq 0 ]; then
     test_done
diff --git a/test/T660-bad-date.sh b/test/T660-bad-date.sh
index a98e11c88714..f65544b9ffdf 100755
--- a/test/T660-bad-date.sh
+++ b/test/T660-bad-date.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="parsing of bad dates"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 add_message [date]='"()"'
 
diff --git a/test/T670-duplicate-mid.sh b/test/T670-duplicate-mid.sh
index 21a9689ab870..c198c506378c 100755
--- a/test/T670-duplicate-mid.sh
+++ b/test/T670-duplicate-mid.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="duplicate message ids"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 add_message '[id]="duplicate"' '[subject]="message 1" [filename]=copy1'
 add_message '[id]="duplicate"' '[subject]="message 2" [filename]=copy2'
diff --git a/test/T680-html-indexing.sh b/test/T680-html-indexing.sh
index 74f33708be93..62ba84985231 100755
--- a/test/T680-html-indexing.sh
+++ b/test/T680-html-indexing.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="indexing of html parts"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 add_email_corpus html
 
diff --git a/test/T690-command-line-args.sh b/test/T690-command-line-args.sh
index a4f4b5f50f8d..9aa47611a935 100755
--- a/test/T690-command-line-args.sh
+++ b/test/T690-command-line-args.sh
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description="command line arguments"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 add_message
 
diff --git a/test/T700-reindex.sh b/test/T700-reindex.sh
index 051fbb3cef48..2b7bc6588b8d 100755
--- a/test/T700-reindex.sh
+++ b/test/T700-reindex.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='reindexing messages'
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 add_email_corpus
 
diff --git a/test/test-verbose b/test/test-verbose
index 158be28a365e..8af6d9a97600 100755
--- a/test/test-verbose
+++ b/test/test-verbose
@@ -2,7 +2,7 @@
 
 test_description='the verbosity options of the test framework itself.'
 
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 test_begin_subtest 'print something in test_expect_success and pass'
 test_expect_success '
-- 
2.11.0



More information about the notmuch mailing list