X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=test%2Ftest-lib.sh;h=418eaa7f6404097f0ba31a0a3a4fe8f9a66d7f6d;hb=f6ec7ca78f867c2ae27d0dba154a2395ccf15f52;hp=8ecc9a08cbcb92a84e23f4779d2fda6b00a61ae0;hpb=fd16b37dc1b59dac765d459459ce00907506d559;p=notmuch diff --git a/test/test-lib.sh b/test/test-lib.sh index 8ecc9a08..418eaa7f 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -245,6 +245,12 @@ increment_mtime () # Generate the message in directory 'directory/of/choice' within # the mail store. The directory will be created if necessary. # +# [filename]=name +# +# Store the message in file 'name'. The default is to store it +# in 'msg-', where is three-digit number of the +# message. +# # [body]=text # # Text to use as the body of the email message @@ -281,10 +287,14 @@ generate_message () local additional_headers gen_msg_cnt=$((gen_msg_cnt + 1)) - gen_msg_name=msg-$(printf "%03d" $gen_msg_cnt) + if [ -z "${template[filename]}" ]; then + gen_msg_name="msg-$(printf "%03d" $gen_msg_cnt)" + else + gen_msg_name=${template[filename]} + fi if [ -z "${template[id]}" ]; then - gen_msg_id="${gen_msg_name}@notmuch-test-suite" + gen_msg_id="${gen_msg_name%:2,*}@notmuch-test-suite" else gen_msg_id="${template[id]}" fi @@ -909,7 +919,6 @@ EOF cd -P "$test" || error "Cannot setup test environment" this_test=${0##*/} -this_test=${this_test%%-*} for skp in $NOTMUCH_SKIP_TESTS do to_skip=