exit 1
fi
+# Explicitly require external prerequisite. Useful when binary is
+# called indirectly (e.g. from emacs).
+# Returns success if dependency is available, failure otherwise.
+test_require_external_prereq () {
+ local binary
+ binary="$1"
+ if [[ ${test_missing_external_prereq_["${binary}"]} == t ]]; then
+ # dependency is missing, call the replacement function to note it
+ eval "$binary"
+ else
+ true
+ fi
+}
+
backup_database () {
test_name=$(basename $0 .sh)
rm -rf $TMP_DIRECTORY/notmuch-dir-backup."$test_name"
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}
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
#
# 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
}