aboutsummaryrefslogtreecommitdiff
path: root/test/test-lib-emacs.sh
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2023-04-09 11:26:26 -0300
committerDavid Bremner <david@tethera.net>2023-07-21 07:41:50 -0300
commitec26eeaeec87781dee7dbf720103a5bc9b6bba5d (patch)
tree421ad3947e7c06066663f3e53a3c41af5605057f /test/test-lib-emacs.sh
parent73f3081160fb80345f3953cbdeba340975375325 (diff)
test: support testing notmuch as installed
We put some effort into testing the built copy rather than some installed copy. On the other hand for people like packagers, testing the installed copy is also of interest. When NOTMUCH_TEST_INSTALLED is set to a nonempty value, tests do not require a built notmuch tree or running configure. Some of the tests marked as broken when running against installed notmuch are probably fixable.
Diffstat (limited to 'test/test-lib-emacs.sh')
-rw-r--r--test/test-lib-emacs.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/test-lib-emacs.sh b/test/test-lib-emacs.sh
index ad4c4aeb..0ab58fc2 100644
--- a/test/test-lib-emacs.sh
+++ b/test/test-lib-emacs.sh
@@ -30,6 +30,7 @@ test_require_emacs () {
# to the message and encrypting/signing.
emacs_deliver_message () {
local subject body smtp_dummy_pid smtp_dummy_port
+ test_subtest_broken_for_installed
subject="$1"
body="$2"
shift 2
@@ -144,6 +145,13 @@ emacs_generate_script () {
# Construct a little test script here for the benefit of the user,
# (who can easily run "run_emacs" to get the same emacs environment
# for investigating any failures).
+ if [ -z "${NOTMUCH_TEST_INSTALLED-}" ]; then
+ find_notmuch_el='--directory "$NOTMUCH_BUILDDIR/emacs"'
+ else
+ ### XXX FIXME: this should really use the installed emacs lisp files
+ find_notmuch_el='--directory "$NOTMUCH_SRCDIR/emacs"'
+ fi
+
cat <<EOF >"$TMP_DIRECTORY/run_emacs"
#!/bin/sh
export PATH=$PATH
@@ -158,8 +166,8 @@ export NOTMUCH_CONFIG=$NOTMUCH_CONFIG
#
# --load Force loading of notmuch.el and test-lib.el
-exec ${TEST_EMACS} --quick \
- --directory "$NOTMUCH_BUILDDIR/emacs" --load notmuch.el \
+exec ${TEST_EMACS} ${find_notmuch_el} --quick \
+ ${EXTRA_DIR} --load notmuch.el \
--directory "$NOTMUCH_SRCDIR/test" --load test-lib.el \
"\$@"
EOF