X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=test%2Ftest-lib-common.sh;h=ebbf4cdfa6fd2e727f78d651fdf31dcb8c3ead7d;hb=8179c3d1146b6b19c64200f0617c4a1ba7588569;hp=4300eb65418f1afa8d4cd93c3fd1d1a001b47ccf;hpb=d455c8b74a2a63454779445e14ac3e81141b204a;p=notmuch diff --git a/test/test-lib-common.sh b/test/test-lib-common.sh index 4300eb65..ebbf4cdf 100644 --- a/test/test-lib-common.sh +++ b/test/test-lib-common.sh @@ -31,20 +31,16 @@ fi backup_database () { test_name=$(basename $0 .sh) - rm -rf $NOTMUCH_BUILDDIR/test/notmuch-dir-backup."$test_name" - cp -pR ${MAIL_DIR}/.notmuch $NOTMUCH_BUILDDIR/test/notmuch-dir-backup."${test_name}" + rm -rf $TMP_DIRECTORY/notmuch-dir-backup."$test_name" + cp -pR ${MAIL_DIR}/.notmuch $TMP_DIRECTORY/notmuch-dir-backup."${test_name}" } restore_database () { test_name=$(basename $0 .sh) rm -rf ${MAIL_DIR}/.notmuch - cp -pR $NOTMUCH_BUILDDIR/test/notmuch-dir-backup."${test_name}" ${MAIL_DIR}/.notmuch + cp -pR $TMP_DIRECTORY/notmuch-dir-backup."${test_name}" ${MAIL_DIR}/.notmuch } -# Test the binaries we have just built. The tests are kept in -# test/ subdirectory and are run in 'trash directory' subdirectory. -TEST_DIRECTORY=$NOTMUCH_BUILDDIR/test - # Prepend $TEST_DIRECTORY/../lib to LD_LIBRARY_PATH, to make tests work # on systems where ../notmuch depends on LD_LIBRARY_PATH. LD_LIBRARY_PATH=${TEST_DIRECTORY%/*}/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} @@ -109,8 +105,7 @@ fi gen_msg_cnt=0 gen_msg_filename="" gen_msg_id="" -generate_message () -{ +generate_message () { # This is our (bash-specific) magic for doing named parameters local -A template="($@)" local additional_headers @@ -229,8 +224,7 @@ EOF # # All of the arguments and return values supported by generate_message # are also supported here, so see that function for details. -add_message () -{ +add_message () { generate_message "$@" && notmuch new > /dev/null }