From 572af2795007464ffbf9cd4656e0e5736d78d362 Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Sun, 23 May 2021 10:34:43 +0300 Subject: [PATCH] test: source $NOTMUCH_SRCDIR/test/test-lib-emacs.sh Sourcing test-lib.sh will cd to TMP_DIRECTORY, so relative path in $0 will not work in previous version . $(dirname "$0")/test-lib-emacs.sh Now individual test scripts -- e.g. ./test/T310-emacs.sh will work. --- test/T160-json.sh | 2 +- test/T170-sexp.sh | 2 +- test/T310-emacs.sh | 2 +- test/T320-emacs-large-search-buffer.sh | 2 +- test/T330-emacs-subject-to-filename.sh | 2 +- test/T350-crypto.sh | 2 +- test/T355-smime.sh | 2 +- test/T357-index-decryption.sh | 2 +- test/T358-emacs-protected-headers.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/T510-thread-replies.sh | 2 +- test/T630-emacs-draft.sh | 2 +- test/T720-emacs-attachment-warnings.sh | 2 +- test/T730-emacs-forwarding.sh | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/test/T160-json.sh b/test/T160-json.sh index 638afb4d..6a3e5812 100755 --- a/test/T160-json.sh +++ b/test/T160-json.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash test_description="--format=json output" . $(dirname "$0")/test-lib.sh || exit 1 -. $(dirname "$0")/test-lib-emacs.sh || exit 1 +. $NOTMUCH_SRCDIR/test/test-lib-emacs.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@notmuchmail.org\"" "[reply-to]=\"test_suite+replyto@notmuchmail.org\"" "[body]=\"json-show-message\"" diff --git a/test/T170-sexp.sh b/test/T170-sexp.sh index af8c4b44..18084273 100755 --- a/test/T170-sexp.sh +++ b/test/T170-sexp.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash test_description="--format=sexp output" . $(dirname "$0")/test-lib.sh || exit 1 -. $(dirname "$0")/test-lib-emacs.sh || exit 1 +. $NOTMUCH_SRCDIR/test/test-lib-emacs.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@notmuchmail.org\"" "[reply-to]=\"test_suite+replyto@notmuchmail.org\"" "[body]=\"sexp-show-message\"" diff --git a/test/T310-emacs.sh b/test/T310-emacs.sh index b94236fd..1967de22 100755 --- a/test/T310-emacs.sh +++ b/test/T310-emacs.sh @@ -2,7 +2,7 @@ test_description="emacs interface" . $(dirname "$0")/test-lib.sh || exit 1 -. $(dirname "$0")/test-lib-emacs.sh || exit 1 +. $NOTMUCH_SRCDIR/test/test-lib-emacs.sh || exit 1 EXPECTED=$NOTMUCH_SRCDIR/test/emacs.expected-output diff --git a/test/T320-emacs-large-search-buffer.sh b/test/T320-emacs-large-search-buffer.sh index d2638c8b..617985e6 100755 --- a/test/T320-emacs-large-search-buffer.sh +++ b/test/T320-emacs-large-search-buffer.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash test_description="Emacs with large search results buffer" . $(dirname "$0")/test-lib.sh || exit 1 -. $(dirname "$0")/test-lib-emacs.sh || exit 1 +. $NOTMUCH_SRCDIR/test/test-lib-emacs.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 6e09a048..405b063b 100755 --- a/test/T330-emacs-subject-to-filename.sh +++ b/test/T330-emacs-subject-to-filename.sh @@ -2,7 +2,7 @@ test_description="emacs: mail subject to filename" . $(dirname "$0")/test-lib.sh || exit 1 -. $(dirname "$0")/test-lib-emacs.sh || exit 1 +. $NOTMUCH_SRCDIR/test/test-lib-emacs.sh || exit 1 test_require_emacs diff --git a/test/T350-crypto.sh b/test/T350-crypto.sh index 4508c984..c1c1fccc 100755 --- a/test/T350-crypto.sh +++ b/test/T350-crypto.sh @@ -6,7 +6,7 @@ test_description='PGP/MIME signature verification and decryption' . $(dirname "$0")/test-lib.sh || exit 1 -. $(dirname "$0")/test-lib-emacs.sh || exit 1 +. $NOTMUCH_SRCDIR/test/test-lib-emacs.sh || exit 1 ################################################## diff --git a/test/T355-smime.sh b/test/T355-smime.sh index 69bdcfac..b7269686 100755 --- a/test/T355-smime.sh +++ b/test/T355-smime.sh @@ -2,7 +2,7 @@ test_description='S/MIME signature verification and decryption' . $(dirname "$0")/test-lib.sh || exit 1 -. $(dirname "$0")/test-lib-emacs.sh || exit 1 +. $NOTMUCH_SRCDIR/test/test-lib-emacs.sh || exit 1 test_require_emacs test_require_external_prereq openssl diff --git a/test/T357-index-decryption.sh b/test/T357-index-decryption.sh index 0d30e566..a96c1b5e 100755 --- a/test/T357-index-decryption.sh +++ b/test/T357-index-decryption.sh @@ -4,7 +4,7 @@ test_description='indexing decrypted mail' . $(dirname "$0")/test-lib.sh || exit 1 -. $(dirname "$0")/test-lib-emacs.sh || exit 1 +. $NOTMUCH_SRCDIR/test/test-lib-emacs.sh || exit 1 ################################################## diff --git a/test/T358-emacs-protected-headers.sh b/test/T358-emacs-protected-headers.sh index b25d7ea7..96e42bf3 100755 --- a/test/T358-emacs-protected-headers.sh +++ b/test/T358-emacs-protected-headers.sh @@ -2,7 +2,7 @@ test_description="protected headers in emacs interface" . $(dirname "$0")/test-lib.sh || exit 1 -. $(dirname "$0")/test-lib-emacs.sh || exit 1 +. $NOTMUCH_SRCDIR/test/test-lib-emacs.sh || exit 1 # testing protected headers with emacs test_require_emacs diff --git a/test/T420-emacs-test-functions.sh b/test/T420-emacs-test-functions.sh index 22e4f01e..2dfd7c56 100755 --- a/test/T420-emacs-test-functions.sh +++ b/test/T420-emacs-test-functions.sh @@ -2,7 +2,7 @@ test_description="emacs test function sanity" . $(dirname "$0")/test-lib.sh || exit 1 -. $(dirname "$0")/test-lib-emacs.sh || exit 1 +. $NOTMUCH_SRCDIR/test/test-lib-emacs.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 640bff3f..7d3d61ff 100755 --- a/test/T430-emacs-address-cleaning.sh +++ b/test/T430-emacs-address-cleaning.sh @@ -2,7 +2,7 @@ test_description="emacs address cleaning" . $(dirname "$0")/test-lib.sh || exit 1 -. $(dirname "$0")/test-lib-emacs.sh || exit 1 +. $NOTMUCH_SRCDIR/test/test-lib-emacs.sh || exit 1 test_require_emacs diff --git a/test/T440-emacs-hello.sh b/test/T440-emacs-hello.sh index 642aa3cc..bafccd1f 100755 --- a/test/T440-emacs-hello.sh +++ b/test/T440-emacs-hello.sh @@ -2,7 +2,7 @@ test_description="emacs notmuch-hello view" . $(dirname "$0")/test-lib.sh || exit 1 -. $(dirname "$0")/test-lib-emacs.sh || exit 1 +. $NOTMUCH_SRCDIR/test/test-lib-emacs.sh || exit 1 EXPECTED=$NOTMUCH_SRCDIR/test/emacs.expected-output diff --git a/test/T450-emacs-show.sh b/test/T450-emacs-show.sh index 31be55f8..9d08d2cc 100755 --- a/test/T450-emacs-show.sh +++ b/test/T450-emacs-show.sh @@ -2,7 +2,7 @@ test_description="emacs notmuch-show view" . $(dirname "$0")/test-lib.sh || exit 1 -. $(dirname "$0")/test-lib-emacs.sh || exit 1 +. $NOTMUCH_SRCDIR/test/test-lib-emacs.sh || exit 1 EXPECTED=$NOTMUCH_SRCDIR/test/emacs-show.expected-output diff --git a/test/T455-emacs-charsets.sh b/test/T455-emacs-charsets.sh index a0f4dc24..db03bb67 100755 --- a/test/T455-emacs-charsets.sh +++ b/test/T455-emacs-charsets.sh @@ -2,7 +2,7 @@ test_description="emacs notmuch-show charset handling" . $(dirname "$0")/test-lib.sh || exit 1 -. $(dirname "$0")/test-lib-emacs.sh || exit 1 +. $NOTMUCH_SRCDIR/test/test-lib-emacs.sh || exit 1 UTF8_YEN=$'\xef\xbf\xa5' diff --git a/test/T460-emacs-tree.sh b/test/T460-emacs-tree.sh index dfc69049..405d7ee7 100755 --- a/test/T460-emacs-tree.sh +++ b/test/T460-emacs-tree.sh @@ -2,7 +2,7 @@ test_description="emacs tree view interface" . $(dirname "$0")/test-lib.sh || exit 1 -. $(dirname "$0")/test-lib-emacs.sh || exit 1 +. $NOTMUCH_SRCDIR/test/test-lib-emacs.sh || exit 1 EXPECTED=$NOTMUCH_SRCDIR/test/emacs-tree.expected-output diff --git a/test/T510-thread-replies.sh b/test/T510-thread-replies.sh index cdb4be44..35f3ff83 100755 --- a/test/T510-thread-replies.sh +++ b/test/T510-thread-replies.sh @@ -10,7 +10,7 @@ test_description='test of proper handling of in-reply-to and references headers' # non-RFC-compliant headers' . $(dirname "$0")/test-lib.sh || exit 1 -. $(dirname "$0")/test-lib-emacs.sh || exit 1 +. $NOTMUCH_SRCDIR/test/test-lib-emacs.sh || exit 1 test_begin_subtest "Use References when In-Reply-To is broken" add_message '[id]="foo@one.com"' \ diff --git a/test/T630-emacs-draft.sh b/test/T630-emacs-draft.sh index 8553f022..c443f417 100755 --- a/test/T630-emacs-draft.sh +++ b/test/T630-emacs-draft.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash test_description="Emacs Draft Handling" . $(dirname "$0")/test-lib.sh || exit 1 -. $(dirname "$0")/test-lib-emacs.sh || exit 1 +. $NOTMUCH_SRCDIR/test/test-lib-emacs.sh || exit 1 test_require_emacs add_email_corpus diff --git a/test/T720-emacs-attachment-warnings.sh b/test/T720-emacs-attachment-warnings.sh index 4e8c5d26..6e03f39d 100755 --- a/test/T720-emacs-attachment-warnings.sh +++ b/test/T720-emacs-attachment-warnings.sh @@ -2,7 +2,7 @@ test_description="emacs attachment warnings" . $(dirname "$0")/test-lib.sh || exit 1 -. $(dirname "$0")/test-lib-emacs.sh || exit 1 +. $NOTMUCH_SRCDIR/test/test-lib-emacs.sh || exit 1 test_require_emacs diff --git a/test/T730-emacs-forwarding.sh b/test/T730-emacs-forwarding.sh index 378067ed..7b6ebf15 100755 --- a/test/T730-emacs-forwarding.sh +++ b/test/T730-emacs-forwarding.sh @@ -2,7 +2,7 @@ test_description="emacs forwarding" . $(dirname "$0")/test-lib.sh || exit 1 -. $(dirname "$0")/test-lib-emacs.sh || exit 1 +. $NOTMUCH_SRCDIR/test/test-lib-emacs.sh || exit 1 test_require_emacs -- 2.43.0