aboutsummaryrefslogtreecommitdiff
path: root/test/T055-path-config.sh
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2021-01-03 20:04:46 -0400
committerDavid Bremner <david@tethera.net>2021-03-20 07:43:09 -0300
commitc82554193d0a0c288ad49e3d4fb8c949b92f71fa (patch)
treed917176e6a8aad6baab49f785d4e0ffda9662c0f /test/T055-path-config.sh
parent2c879667b3c9d51eb23f53c040acce341d75920b (diff)
lib/open: support XDG_DATA_HOME as a fallback database location.
This changes some error reporting, either intentionally by reporting the highest level missing directory, or by side effect from looking in XDG locations when given null database location.
Diffstat (limited to 'test/T055-path-config.sh')
-rwxr-xr-xtest/T055-path-config.sh35
1 files changed, 33 insertions, 2 deletions
diff --git a/test/T055-path-config.sh b/test/T055-path-config.sh
index 6df17f80..f9a8e200 100755
--- a/test/T055-path-config.sh
+++ b/test/T055-path-config.sh
@@ -37,8 +37,31 @@ symlink_config () {
unset DATABASE_PATH
}
-for config in traditional split symlink; do
- # start each set of tests with a known set of messages
+xdg_config () {
+ local dir
+ local profile=${1:-default}
+
+ if [[ $profile != default ]]; then
+ export NOTMUCH_PROFILE=$profile
+ fi
+
+ backup_config
+ DATABASE_PATH="${HOME}/.local/share/notmuch/${profile}"
+ rm -rf $DATABASE_PATH
+ mkdir -p $DATABASE_PATH
+
+ config_dir="${HOME}/.config/notmuch/${profile}"
+ mkdir -p ${config_dir}
+ CONFIG_PATH=$config_dir/config
+ mv ${NOTMUCH_CONFIG} $CONFIG_PATH
+ unset NOTMUCH_CONFIG
+
+ notmuch --config=${CONFIG_PATH} config set database.mail_root ${TMP_DIRECTORY}/mail
+ notmuch --config=${CONFIG_PATH} config set database.path
+}
+
+for config in traditional split XDG XDG+profile symlink; do
+ #start each set of tests with an known set of messages
add_email_corpus
case $config in
@@ -49,6 +72,14 @@ for config in traditional split symlink; do
split_config
mv mail/.notmuch/xapian $DATABASE_PATH
;;
+ XDG)
+ xdg_config
+ mv mail/.notmuch/xapian $DATABASE_PATH
+ ;;
+ XDG+profile)
+ xdg_config ${RANDOM}
+ mv mail/.notmuch/xapian $DATABASE_PATH
+ ;;
symlink)
symlink_config
;;