Re: [PATCH v2] test: source $NOTMUCH_SRCDIR/test/test-lib-emacs.sh

2021-06-03 Thread David Bremner
Tomi Ollila  writes:

> 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.

Applied to master.

d
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


[PATCH v2] test: source $NOTMUCH_SRCDIR/test/test-lib-emacs.sh

2021-05-23 Thread Tomi Ollila
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.
---

s/_BUILDD/_SRCD/ to id:20210522152741.27213-1-tomi.oll...@iki.fi

now works with in-tree and out-of-tree builds.

 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..9b3bc676 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 -\"" "[bcc]=\"test_suite+...@notmuchmail.org\"" 
"[reply-to]=\"test_suite+repl...@notmuchmail.org\"" 
"[body]=\"json-show-message\""
diff --git a/test/T170-sexp.sh b/test/T170-sexp.sh
index af8c4b44..94648d49 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 -\"" "[bcc]=\"test_suite+...@notmuchmail.org\"" 
"[reply-to]=\"test_suite+repl...@notmuchmail.org\"" 
"[body]=\"sexp-show-message\""
diff --git a/test/T310-emacs.sh b/test/T310-emacs.sh
index 1ece6e00..8f114571 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..9c42e7f1 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=xx # 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..b55566bf 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..3bcf1488 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..7fa9d337 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..7b5f13db 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