X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2FT055-path-config.sh;h=f9a8e2004695801249fb9bb73df3c30281937115;hp=6df17f80f02067ef6444e40a174a78ad150dbcea;hb=c82554193d0a0c288ad49e3d4fb8c949b92f71fa;hpb=2c879667b3c9d51eb23f53c040acce341d75920b 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 ;;