Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 048A64196F0 for ; Fri, 30 Apr 2010 12:09:09 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -4.199 X-Spam-Level: X-Spam-Status: No, score=-4.199 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, NORMAL_HTTP_TO_IP=0.001, RCVD_IN_DNSWL_MED=-2.3] autolearn=ham Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6RCETDguDYSr for ; Fri, 30 Apr 2010 12:09:04 -0700 (PDT) Received: from ipex2.johnshopkins.edu (ipex2.johnshopkins.edu [162.129.8.151]) by olra.theworths.org (Postfix) with ESMTP id 41926431FC1 for ; Fri, 30 Apr 2010 12:09:04 -0700 (PDT) X-IronPort-AV: E=Sophos;i="4.52,304,1270440000"; d="scan'208";a="326233036" Received: from c-69-255-36-229.hsd1.md.comcast.net (HELO lucky) ([69.255.36.229]) by ipex2.johnshopkins.edu with ESMTP/TLS/AES256-SHA; 30 Apr 2010 15:09:03 -0400 Received: from jkr by lucky with local (Exim 4.69) (envelope-from ) id 1O7vaA-0004zc-31; Fri, 30 Apr 2010 15:09:02 -0400 From: Jesse Rosenthal To: Notmuch developer list Subject: [PATCH 2/2] test: Have notmuch-test use the modular test collections In-Reply-To: <87iq78daii.fsf@jhu.edu> References: <87sk6cdbxz.fsf@jhu.edu> <87iq78daii.fsf@jhu.edu> User-Agent: Notmuch/0.3-23-g5efa9bd (http://notmuchmail.org) Emacs/23.1.1 (i486-pc-linux-gnu) Date: Fri, 30 Apr 2010 15:09:01 -0400 Message-ID: <87fx2cdagi.fsf@jhu.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2010 19:09:09 -0000 Introduce two new functions (run_collection_setup_and_tests and run_test_suite) to notmuch-test. The first takes as an argument a subdir of test/tests and runs all .setup and .test files in there in order of their numerical prefix. The latter either runs all tests (if given "all" or no argument) or a given dir (if given it as an argument). Also introduce the variable TEST_COLLECTIONS. These are all the folders that "notmuch-test all" should look for. It won't automatically run all folders, in case there is something that is only relevant in certain circumstances (such as, perhaps, future tests for remote usage). --- test/notmuch-test | 921 +++----------------------------------------------= ---- 1 files changed, 47 insertions(+), 874 deletions(-) diff --git a/test/notmuch-test b/test/notmuch-test index a861df1..29d5c91 100755 --- a/test/notmuch-test +++ b/test/notmuch-test @@ -7,6 +7,20 @@ set -e # without regard to the time zone of where the test suite is run. export TZ=3DUTC+8 =20 +TEST_COLLECTION_DIR=3D"$(dirname $(readlink -f $0))/tests" + +TEST_COLLECTIONS=3D"notmuch-new +notmuch-search +json +thread-naming +notmuch-reply +uuencoded +notmuch-dump-restore +out-of-order-threading +author-reordering +from-guessing-multiple +from-guessing-single" + find_notmuch_binary () { dir=3D$1 @@ -210,13 +224,15 @@ notmuch_show_sanitize () sed -e "$NOTMUCH_SHOW_FILENAME_SQUELCH" } =20 -rm -rf ${TEST_DIR} -mkdir ${TEST_DIR} -cd ${TEST_DIR} +initialize_notmuch_test () +{ + rm -rf ${TEST_DIR} + mkdir ${TEST_DIR} + cd ${TEST_DIR} =20 -mkdir ${MAIL_DIR} + mkdir ${MAIL_DIR} =20 -cat < ${NOTMUCH_CONFIG} + cat < ${NOTMUCH_CONFIG} [database] path=3D${MAIL_DIR} =20 @@ -225,878 +241,35 @@ name=3DNotmuch Test Suite primary_email=3Dtest_suite@notmuchmail.org other_email=3Dtest_suite_other@notmuchmail.org;test_suite@otherdomain.org EOF +} =20 -printf "Testing \"notmuch new\" in several variations:\n" -printf " No new messages...\t\t\t\t" -output=3D$(NOTMUCH_NEW) -pass_if_equal "$output" "No new mail." - -printf " Single new message...\t\t\t\t" -generate_message -output=3D$(NOTMUCH_NEW) -pass_if_equal "$output" "Added 1 new message to the database." - -printf " Multiple new messages...\t\t\t" -generate_message -generate_message -output=3D$(NOTMUCH_NEW) -pass_if_equal "$output" "Added 2 new messages to the database." - -printf " No new messages (non-empty DB)...\t\t" -output=3D$(NOTMUCH_NEW) -pass_if_equal "$output" "No new mail." - -printf " New directories...\t\t\t\t" -rm -rf ${MAIL_DIR}/* ${MAIL_DIR}/.notmuch -mkdir ${MAIL_DIR}/def -mkdir ${MAIL_DIR}/ghi -generate_message [dir]=3Ddef - -output=3D$(NOTMUCH_NEW) -pass_if_equal "$output" "Added 1 new message to the database." - -printf " Alternate inode order...\t\t\t" - -rm -rf ${MAIL_DIR}/.notmuch -mv ${MAIL_DIR}/ghi ${MAIL_DIR}/abc -rm ${MAIL_DIR}/def/* -generate_message [dir]=3Dabc - -output=3D$(NOTMUCH_NEW) -pass_if_equal "$output" "Added 1 new message to the database." - -printf " Message moved in...\t\t\t\t" -rm -rf ${MAIL_DIR}/* ${MAIL_DIR}/.notmuch -generate_message -tmp_msg_filename=3Dtmp/$gen_msg_filename -mkdir -p $(dirname $tmp_msg_filename) -mv $gen_msg_filename $tmp_msg_filename -increment_mtime ${MAIL_DIR} -$NOTMUCH new > /dev/null -mv $tmp_msg_filename $gen_msg_filename -increment_mtime ${MAIL_DIR} -output=3D$(NOTMUCH_NEW) -pass_if_equal "$output" "Added 1 new message to the database." - -printf " Renamed message...\t\t\t\t" - -generate_message -$NOTMUCH new > /dev/null -mv $gen_msg_filename ${gen_msg_filename}-renamed -increment_mtime ${MAIL_DIR} -output=3D$(NOTMUCH_NEW) -pass_if_equal "$output" "No new mail. Detected 1 file rename." - -printf " Deleted message...\t\t\t\t" - -rm ${gen_msg_filename}-renamed -increment_mtime ${MAIL_DIR} -output=3D$(NOTMUCH_NEW) -pass_if_equal "$output" "No new mail. Removed 1 message." - -printf " Renamed directory...\t\t\t\t" - -generate_message [dir]=3Ddir -generate_message [dir]=3Ddir -generate_message [dir]=3Ddir - -$NOTMUCH new > /dev/null - -mv ${MAIL_DIR}/dir ${MAIL_DIR}/dir-renamed -increment_mtime ${MAIL_DIR} - -output=3D$(NOTMUCH_NEW) -pass_if_equal "$output" "No new mail. Detected 3 file renames." - -printf " Deleted directory...\t\t\t\t" - -rm -rf ${MAIL_DIR}/dir-renamed -increment_mtime ${MAIL_DIR} - -output=3D$(NOTMUCH_NEW) -pass_if_equal "$output" "No new mail. Removed 3 messages." - -printf " New directory (at end of list)...\t\t" - -generate_message [dir]=3Dzzz -generate_message [dir]=3Dzzz -generate_message [dir]=3Dzzz - -output=3D$(NOTMUCH_NEW) -pass_if_equal "$output" "Added 3 new messages to the database." - -printf " Deleted directory (end of list)...\t\t" - -rm -rf ${MAIL_DIR}/zzz -increment_mtime ${MAIL_DIR} - -output=3D$(NOTMUCH_NEW) -pass_if_equal "$output" "No new mail. Removed 3 messages." - -printf " New symlink to directory...\t\t\t" - -rm -rf ${MAIL_DIR}/.notmuch -mv ${MAIL_DIR} ${TEST_DIR}/actual_maildir - -mkdir ${MAIL_DIR} -ln -s ${TEST_DIR}/actual_maildir ${MAIL_DIR}/symlink - -output=3D$(NOTMUCH_NEW) -pass_if_equal "$output" "Added 1 new message to the database." - -printf " New symlink to a file...\t\t\t" -generate_message -external_msg_filename=3D${TEST_DIR}/external/$(basename $gen_msg_filename) -mkdir -p $(dirname $external_msg_filename) -mv $gen_msg_filename $external_msg_filename -ln -s $external_msg_filename $gen_msg_filename -increment_mtime ${MAIL_DIR} -output=3D$(NOTMUCH_NEW) -pass_if_equal "$output" "Added 1 new message to the database." - -printf " New two-level directory...\t\t\t" - -generate_message [dir]=3Dtwo/levels -generate_message [dir]=3Dtwo/levels -generate_message [dir]=3Dtwo/levels - -output=3D$(NOTMUCH_NEW) -pass_if_equal "$output" "Added 3 new messages to the database." - -printf " Deleted two-level directory...\t\t\t" - -rm -rf ${MAIL_DIR}/two -increment_mtime ${MAIL_DIR} - -output=3D$(NOTMUCH_NEW) -pass_if_equal "$output" "No new mail. Removed 3 messages." - -printf "\nTesting \"notmuch search\" in several variations:\n" - -printf " Search body...\t\t\t\t\t" -add_message '[subject]=3D"body search"' '[date]=3D"Sat, 01 Jan 2000 12:00:= 00 -0000"' [body]=3Dbodysearchtest -output=3D$($NOTMUCH search bodysearchtest | notmuch_search_sanitize) -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite;= body search (inbox unread)" - -printf " Search by from:...\t\t\t\t" -add_message '[subject]=3D"search by from"' '[date]=3D"Sat, 01 Jan 2000 12:= 00:00 -0000"' [from]=3Dsearchbyfrom -output=3D$($NOTMUCH search from:searchbyfrom | notmuch_search_sanitize) -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] searchbyfrom; searc= h by from (inbox unread)" - -printf " Search by to:...\t\t\t\t" -add_message '[subject]=3D"search by to"' '[date]=3D"Sat, 01 Jan 2000 12:00= :00 -0000"' [to]=3Dsearchbyto -output=3D$($NOTMUCH search to:searchbyto | notmuch_search_sanitize) -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite;= search by to (inbox unread)" - -printf " Search by subject:...\t\t\t\t" -add_message [subject]=3Dsubjectsearchtest '[date]=3D"Sat, 01 Jan 2000 12:0= 0:00 -0000"' -output=3D$($NOTMUCH search subject:subjectsearchtest | notmuch_search_sani= tize) -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite;= subjectsearchtest (inbox unread)" - -printf " Search by id:...\t\t\t\t" -add_message '[subject]=3D"search by id"' '[date]=3D"Sat, 01 Jan 2000 12:00= :00 -0000"' -output=3D$($NOTMUCH search id:${gen_msg_id} | notmuch_search_sanitize) -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite;= search by id (inbox unread)" - -printf " Search by tag:...\t\t\t\t" -add_message '[subject]=3D"search by tag"' '[date]=3D"Sat, 01 Jan 2000 12:0= 0:00 -0000"' -$NOTMUCH tag +searchbytag id:${gen_msg_id} -output=3D$($NOTMUCH search tag:searchbytag | notmuch_search_sanitize) -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite;= search by tag (inbox searchbytag unread)" - -printf " Search by thread:...\t\t\t\t" -add_message '[subject]=3D"search by thread"' '[date]=3D"Sat, 01 Jan 2000 1= 2:00:00 -0000"' -thread_id=3D$($NOTMUCH search id:${gen_msg_id} | sed -e 's/thread:\([a-f0-= 9]*\).*/\1/') -output=3D$($NOTMUCH search thread:${thread_id} | notmuch_search_sanitize) -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite;= search by thread (inbox unread)" - -printf " Search body (phrase)...\t\t\t" -add_message '[subject]=3D"body search (phrase)"' '[date]=3D"Sat, 01 Jan 20= 00 12:00:00 -0000"' '[body]=3D"body search (phrase)"' -add_message '[subject]=3D"negative result"' '[date]=3D"Sat, 01 Jan 2000 12= :00:00 -0000"' '[body]=3D"This phrase should not match the body search"' -output=3D$($NOTMUCH search '\"body search (phrase)\"' | notmuch_search_san= itize) -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite;= body search (phrase) (inbox unread)" - -printf " Search by from: (address)...\t\t\t" -add_message '[subject]=3D"search by from (address)"' '[date]=3D"Sat, 01 Ja= n 2000 12:00:00 -0000"' [from]=3Dsearchbyfrom@example.com -output=3D$($NOTMUCH search from:searchbyfrom@example.com | notmuch_search_= sanitize) -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] searchbyfrom@exampl= e.com; search by from (address) (inbox unread)" - -printf " Search by from: (name)...\t\t\t" -add_message '[subject]=3D"search by from (name)"' '[date]=3D"Sat, 01 Jan 2= 000 12:00:00 -0000"' '[from]=3D"Search By From Name "' -output=3D$($NOTMUCH search from:'Search By From Name' | notmuch_search_san= itize) -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Search By From Name= ; search by from (name) (inbox unread)" - -printf " Search by to: (address)...\t\t\t" -add_message '[subject]=3D"search by to (address)"' '[date]=3D"Sat, 01 Jan = 2000 12:00:00 -0000"' [to]=3Dsearchbyto@example.com -output=3D$($NOTMUCH search to:searchbyto@example.com | notmuch_search_sani= tize) -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite;= search by to (address) (inbox unread)" - -printf " Search by to: (name)...\t\t\t" -add_message '[subject]=3D"search by to (name)"' '[date]=3D"Sat, 01 Jan 200= 0 12:00:00 -0000"' '[to]=3D"Search By To Name "' -output=3D$($NOTMUCH search to:'Search By To Name' | notmuch_search_sanitiz= e) -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite;= search by to (name) (inbox unread)" - -printf " Search by subject: (phrase)...\t\t\t" -add_message '[subject]=3D"subject search test (phrase)"' '[date]=3D"Sat, 0= 1 Jan 2000 12:00:00 -0000"' -add_message '[subject]=3D"this phrase should not match the subject search = test"' '[date]=3D"Sat, 01 Jan 2000 12:00:00 -0000"' -output=3D$($NOTMUCH search 'subject:\"subject search test (phrase)\"' | no= tmuch_search_sanitize) -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite;= subject search test (phrase) (inbox unread)" - -printf " Search for all messages (\"*\"):...\t\t" -output=3D$($NOTMUCH search '*' | notmuch_search_sanitize) -pass_if_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite;= Test message #6 (inbox unread) -thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Test message #14 (inbox = unread) -thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; body search (inbox unrea= d) -thread:XXX 2000-01-01 [1/1] searchbyfrom; search by from (inbox unread) -thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by to (inbox unre= ad) -thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; subjectsearchtest (inbox= unread) -thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by id (inbox unre= ad) -thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by tag (inbox sea= rchbytag unread) -thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by thread (inbox = unread) -thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; body search (phrase) (in= box unread) -thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; negative result (inbox u= nread) -thread:XXX 2000-01-01 [1/1] searchbyfrom@example.com; search by from (ad= dress) (inbox unread) -thread:XXX 2000-01-01 [1/1] Search By From Name; search by from (name) (= inbox unread) -thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by to (address) (= inbox unread) -thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by to (name) (inb= ox unread) -thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; subject search test (phr= ase) (inbox unread) -thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; this phrase should not m= atch the subject search test (inbox unread)" - -printf " Search body (utf-8):...\t\t\t" -add_message '[subject]=3D"utf8-message-body-subject"' '[date]=3D"Sat, 01 J= an 2000 12:00:00 -0000"' '[body]=3D"message body utf8: b=C3=B6d=C3=BD"' -output=3D$($NOTMUCH search 'b=C3=B6d=C3=BD' | notmuch_search_sanitize) -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite;= utf8-message-body-subject (inbox unread)" - -printf "\nTesting --format=3Djson output:\n" - -printf " Show message: json...\t\t\t\t" -add_message '[subject]=3D"json-show-subject"' '[date]=3D"Sat, 01 Jan 2000 = 12:00:00 -0000"' '[body]=3D"json-show-message"' -output=3D$($NOTMUCH show --format=3Djson 'json-show-message') -pass_if_equal "$output" '[[[{"id": "'${gen_msg_id}'", "match": true, "file= name": "'${gen_msg_filename}'", "timestamp": 946728000, "date_relative": "2= 000-01-01", "tags": ["inbox","unread"], "headers": {"Subject": "json-show-s= ubject", "From": "Notmuch Test Suite ", "To": "= Notmuch Test Suite ", "Cc": "", "Bcc": "", "Dat= e": "Sat, 01 Jan 2000 12:00:00 -0000"}, "body": [{"id": 1, "content-type": = "text/plain", "content": "json-show-message\n"}]}, []]]]' - -printf " Search message: json...\t\t\t" -add_message '[subject]=3D"json-search-subject"' '[date]=3D"Sat, 01 Jan 200= 0 12:00:00 -0000"' '[body]=3D"json-search-message"' -output=3D$($NOTMUCH search --format=3Djson 'json-search-message' | notmuch= _search_sanitize) -pass_if_equal "$output" '[{"thread": "XXX", -"timestamp": 946728000, -"matched": 1, -"total": 1, -"authors": "Notmuch Test Suite", -"subject": "json-search-subject", -"tags": ["inbox", "unread"]}]' - -printf " Search by subject (utf-8):...\t\t\t" -add_message [subject]=3Dutf8-s=C3=BCbj=C3=A9ct '[date]=3D"Sat, 01 Jan 2000= 12:00:00 -0000"' -output=3D$($NOTMUCH search subject:utf8-s=C3=BCbj=C3=A9ct | notmuch_search= _sanitize) -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite;= utf8-s=C3=BCbj=C3=A9ct (inbox unread)" - -printf " Show message: json, utf-8...\t\t\t" -add_message '[subject]=3D"json-show-utf8-body-s=C3=BCbj=C3=A9ct"' '[date]= =3D"Sat, 01 Jan 2000 12:00:00 -0000"' '[body]=3D"js=C3=B6n-show-m=C3=A9ssag= e"' -output=3D$($NOTMUCH show --format=3Djson 'js=C3=B6n-show-m=C3=A9ssage') -pass_if_equal "$output" '[[[{"id": "'${gen_msg_id}'", "match": true, "file= name": "'${gen_msg_filename}'", "timestamp": 946728000, "date_relative": "2= 000-01-01", "tags": ["inbox","unread"], "headers": {"Subject": "json-show-u= tf8-body-s=C3=BCbj=C3=A9ct", "From": "Notmuch Test Suite ", "To": "Notmuch Test Suite ", "Cc":= "", "Bcc": "", "Date": "Sat, 01 Jan 2000 12:00:00 -0000"}, "body": [{"id":= 1, "content-type": "text/plain", "content": "js=C3=B6n-show-m=C3=A9ssage\n= "}]}, []]]]' - -printf " Search message: json, utf-8...\t\t\t" -add_message '[subject]=3D"json-search-utf8-body-s=C3=BCbj=C3=A9ct"' '[date= ]=3D"Sat, 01 Jan 2000 12:00:00 -0000"' '[body]=3D"js=C3=B6n-search-m=C3=A9s= sage"' -output=3D$($NOTMUCH search --format=3Djson 'js=C3=B6n-search-m=C3=A9ssage'= | notmuch_search_sanitize) -pass_if_equal "$output" '[{"thread": "XXX", -"timestamp": 946728000, -"matched": 1, -"total": 1, -"authors": "Notmuch Test Suite", -"subject": "json-search-utf8-body-s=C3=BCbj=C3=A9ct", -"tags": ["inbox", "unread"]}]' - -printf "\nTesting naming of threads with changing subject:\n" -add_message '[subject]=3D"thread-naming: Initial thread subject"' \ - '[date]=3D"Fri, 05 Jan 2001 15:43:56 -0800"' -first=3D${gen_msg_cnt} -parent=3D${gen_msg_id} -add_message '[subject]=3D"thread-naming: Older changed subject"' \ - '[date]=3D"Sat, 06 Jan 2001 15:43:56 -0800"' \ - "[in-reply-to]=3D\<$parent\>" -add_message '[subject]=3D"thread-naming: Newer changed subject"' \ - '[date]=3D"Sun, 07 Jan 2001 15:43:56 -0800"' \ - "[in-reply-to]=3D\<$parent\>" -add_message '[subject]=3D"thread-naming: Final thread subject"' \ - '[date]=3D"Mon, 08 Jan 2001 15:43:56 -0800"' \ - "[in-reply-to]=3D\<$parent\>" -final=3D${gen_msg_id} - -printf " Initial thread name (oldest-first search)...\t" -output=3D$($NOTMUCH search --sort=3Doldest-first thread-naming and tag:inb= ox | notmuch_search_sanitize) -pass_if_equal "$output" "thread:XXX 2001-01-05 [4/4] Notmuch Test Suite;= thread-naming: Initial thread subject (inbox unread)" - -printf " Initial thread name (newest-first search)...\t" -output=3D$($NOTMUCH search --sort=3Dnewest-first thread-naming and tag:inb= ox | notmuch_search_sanitize) -pass_if_equal "$output" "thread:XXX 2001-01-08 [4/4] Notmuch Test Suite;= thread-naming: Final thread subject (inbox unread)" - -# Remove oldest and newest messages from search results -$NOTMUCH tag -inbox id:$parent or id:$final - -printf " Changed thread name (oldest-first search)...\t" -output=3D$($NOTMUCH search --sort=3Doldest-first thread-naming and tag:inb= ox | notmuch_search_sanitize) -pass_if_equal "$output" "thread:XXX 2001-01-06 [2/4] Notmuch Test Suite;= thread-naming: Older changed subject (inbox unread)" - -printf " Changed thread name (newest-first search)...\t" -output=3D$($NOTMUCH search --sort=3Dnewest-first thread-naming and tag:inb= ox | notmuch_search_sanitize) -pass_if_equal "$output" "thread:XXX 2001-01-07 [2/4] Notmuch Test Suite;= thread-naming: Newer changed subject (inbox unread)" - -printf " Ignore added reply prefix (Re:)...\t\t" -add_message '[subject]=3D"Re: thread-naming: Initial thread subject"' \ - '[date]=3D"Tue, 09 Jan 2001 15:43:45 -0800"' \ - "[in-reply-to]=3D\<$parent\>" -output=3D$($NOTMUCH search --sort=3Dnewest-first thread-naming and tag:inb= ox | notmuch_search_sanitize) -pass_if_equal "$output" "thread:XXX 2001-01-09 [3/5] Notmuch Test Suite;= thread-naming: Initial thread subject (inbox unread)" - -printf " Ignore added reply prefix (Aw:)...\t\t" -add_message '[subject]=3D"Aw: thread-naming: Initial thread subject"' \ - '[date]=3D"Wed, 10 Jan 2001 15:43:45 -0800"' \ - "[in-reply-to]=3D\<$parent\>" -output=3D$($NOTMUCH search --sort=3Dnewest-first thread-naming and tag:inb= ox | notmuch_search_sanitize) -pass_if_equal "$output" "thread:XXX 2001-01-10 [4/6] Notmuch Test Suite;= thread-naming: Initial thread subject (inbox unread)" - -printf " Ignore added reply prefix (Vs:)...\t\t" -add_message '[subject]=3D"Vs: thread-naming: Initial thread subject"' \ - '[date]=3D"Thu, 11 Jan 2001 15:43:45 -0800"' \ - "[in-reply-to]=3D\<$parent\>" -output=3D$($NOTMUCH search --sort=3Dnewest-first thread-naming and tag:inb= ox | notmuch_search_sanitize) -pass_if_equal "$output" "thread:XXX 2001-01-11 [5/7] Notmuch Test Suite;= thread-naming: Initial thread subject (inbox unread)" - -printf " Ignore added reply prefix (Sv:)...\t\t" -add_message '[subject]=3D"Sv: thread-naming: Initial thread subject"' \ - '[date]=3D"Fri, 12 Jan 2001 15:43:45 -0800"' \ - "[in-reply-to]=3D\<$parent\>" -output=3D$($NOTMUCH search --sort=3Dnewest-first thread-naming and tag:inb= ox | notmuch_search_sanitize) -pass_if_equal "$output" "thread:XXX 2001-01-12 [6/8] Notmuch Test Suite;= thread-naming: Initial thread subject (inbox unread)" - -printf " Test order of messages in \"notmuch show\"\t" -output=3D$($NOTMUCH show thread-naming | notmuch_show_sanitize) -pass_if_equal "$output" " message{ id:msg-$(printf "%03d" $first)@notmuch-= test-suite depth:0 match:1 filename:/XXX/mail/msg-$(printf "%03d" $first) - header{ -Notmuch Test Suite (2001-01-05) (unread) -Subject: thread-naming: Initial thread subject -From: Notmuch Test Suite -To: Notmuch Test Suite -Date: Fri, 05 Jan 2001 15:43:56 -0800 - header} - body{ - part{ ID: 1, Content-type: text/plain -This is just a test message (#$first) - part} - body} - message} - message{ id:msg-$(printf "%03d" $((first + 1)))@notmuch-test-suite depth:= 1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 1))) - header{ -Notmuch Test Suite (2001-01-06) (inbox unread) -Subject: thread-naming: Older changed subject -From: Notmuch Test Suite -To: Notmuch Test Suite -Date: Sat, 06 Jan 2001 15:43:56 -0800 - header} - body{ - part{ ID: 1, Content-type: text/plain -This is just a test message (#$((first + 1))) - part} - body} - message} - message{ id:msg-$(printf "%03d" $((first + 2)))@notmuch-test-suite depth:= 1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 2))) - header{ -Notmuch Test Suite (2001-01-07) (inbox unread) -Subject: thread-naming: Newer changed subject -From: Notmuch Test Suite -To: Notmuch Test Suite -Date: Sun, 07 Jan 2001 15:43:56 -0800 - header} - body{ - part{ ID: 1, Content-type: text/plain -This is just a test message (#$((first + 2))) - part} - body} - message} - message{ id:msg-$(printf "%03d" $((first + 3)))@notmuch-test-suite depth:= 1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 3))) - header{ -Notmuch Test Suite (2001-01-08) (unread) -Subject: thread-naming: Final thread subject -From: Notmuch Test Suite -To: Notmuch Test Suite -Date: Mon, 08 Jan 2001 15:43:56 -0800 - header} - body{ - part{ ID: 1, Content-type: text/plain -This is just a test message (#$((first + 3))) - part} - body} - message} - message{ id:msg-$(printf "%03d" $((first + 4)))@notmuch-test-suite depth:= 1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 4))) - header{ -Notmuch Test Suite (2001-01-09) (inbox unread) -Subject: Re: thread-naming: Initial thread subject -From: Notmuch Test Suite -To: Notmuch Test Suite -Date: Tue, 09 Jan 2001 15:43:45 -0800 - header} - body{ - part{ ID: 1, Content-type: text/plain -This is just a test message (#$((first + 4))) - part} - body} - message} - message{ id:msg-$(printf "%03d" $((first + 5)))@notmuch-test-suite depth:= 1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 5))) - header{ -Notmuch Test Suite (2001-01-10) (inbox unread) -Subject: Aw: thread-naming: Initial thread subject -From: Notmuch Test Suite -To: Notmuch Test Suite -Date: Wed, 10 Jan 2001 15:43:45 -0800 - header} - body{ - part{ ID: 1, Content-type: text/plain -This is just a test message (#$((first + 5))) - part} - body} - message} - message{ id:msg-$(printf "%03d" $((first + 6)))@notmuch-test-suite depth:= 1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 6))) - header{ -Notmuch Test Suite (2001-01-11) (inbox unread) -Subject: Vs: thread-naming: Initial thread subject -From: Notmuch Test Suite -To: Notmuch Test Suite -Date: Thu, 11 Jan 2001 15:43:45 -0800 - header} - body{ - part{ ID: 1, Content-type: text/plain -This is just a test message (#$((first + 6))) - part} - body} - message} - message{ id:msg-$(printf "%03d" $((first + 7)))@notmuch-test-suite depth:= 1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 7))) - header{ -Notmuch Test Suite (2001-01-12) (inbox unread) -Subject: Sv: thread-naming: Initial thread subject -From: Notmuch Test Suite -To: Notmuch Test Suite -Date: Fri, 12 Jan 2001 15:43:45 -0800 - header} - body{ - part{ ID: 1, Content-type: text/plain -This is just a test message (#$((first + 7))) - part} - body} - message}" - -printf "\nTesting \"notmuch reply\" in several variations:\n" - -printf " Basic reply...\t\t\t\t\t" -add_message '[from]=3D"Sender "' \ - [to]=3Dtest_suite@notmuchmail.org \ - [subject]=3Dnotmuch-reply-test \ - '[date]=3D"Tue, 05 Jan 2010 15:43:56 -0800"' \ - '[body]=3D"basic reply test"' - -output=3D$($NOTMUCH reply id:${gen_msg_id}) -pass_if_equal "$output" "From: Notmuch Test Suite -Subject: Re: notmuch-reply-test -To: Sender -Bcc: test_suite@notmuchmail.org -In-Reply-To: <${gen_msg_id}> -References: <${gen_msg_id}> - -On Tue, 05 Jan 2010 15:43:56 -0800, Sender wrote: -> basic reply test" - -printf " Multiple recipients...\t\t\t\t" -add_message '[from]=3D"Sender "' \ - '[to]=3D"test_suite@notmuchmail.org, Someone Else "' \ - [subject]=3Dnotmuch-reply-test \ - '[date]=3D"Tue, 05 Jan 2010 15:43:56 -0800"' \ - '[body]=3D"Multiple recipients"' - -output=3D$($NOTMUCH reply id:${gen_msg_id}) -pass_if_equal "$output" "From: Notmuch Test Suite -Subject: Re: notmuch-reply-test -To: Sender , Someone Else -Bcc: test_suite@notmuchmail.org -In-Reply-To: <${gen_msg_id}> -References: <${gen_msg_id}> - -On Tue, 05 Jan 2010 15:43:56 -0800, Sender wrote: -> Multiple recipients" - -printf " Reply with CC...\t\t\t\t" -add_message '[from]=3D"Sender "' \ - [to]=3Dtest_suite@notmuchmail.org \ - '[cc]=3D"Other Parties "' \ - [subject]=3Dnotmuch-reply-test \ - '[date]=3D"Tue, 05 Jan 2010 15:43:56 -0800"' \ - '[body]=3D"reply with CC"' - -output=3D$($NOTMUCH reply id:${gen_msg_id}) -pass_if_equal "$output" "From: Notmuch Test Suite -Subject: Re: notmuch-reply-test -To: Sender -Cc: Other Parties -Bcc: test_suite@notmuchmail.org -In-Reply-To: <${gen_msg_id}> -References: <${gen_msg_id}> - -On Tue, 05 Jan 2010 15:43:56 -0800, Sender wrote: -> reply with CC" - -printf " Reply from alternate address...\t\t" -add_message '[from]=3D"Sender "' \ - [to]=3Dtest_suite_other@notmuchmail.org \ - [subject]=3Dnotmuch-reply-test \ - '[date]=3D"Tue, 05 Jan 2010 15:43:56 -0800"' \ - '[body]=3D"reply from alternate address"' - -output=3D$($NOTMUCH reply id:${gen_msg_id}) -pass_if_equal "$output" "From: Notmuch Test Suite -Subject: Re: notmuch-reply-test -To: Sender -Bcc: test_suite@notmuchmail.org -In-Reply-To: <${gen_msg_id}> -References: <${gen_msg_id}> - -On Tue, 05 Jan 2010 15:43:56 -0800, Sender wrote: -> reply from alternate address" - -printf " Support for Reply-To...\t\t\t" -add_message '[from]=3D"Sender "' \ - [to]=3Dtest_suite@notmuchmail.org \ - [subject]=3Dnotmuch-reply-test \ - '[date]=3D"Tue, 05 Jan 2010 15:43:56 -0800"' \ - '[body]=3D"support for reply-to"' \ - '[reply-to]=3D"Sender "' - -output=3D$($NOTMUCH reply id:${gen_msg_id}) -pass_if_equal "$output" "From: Notmuch Test Suite -Subject: Re: notmuch-reply-test -To: Sender -Bcc: test_suite@notmuchmail.org -In-Reply-To: <${gen_msg_id}> -References: <${gen_msg_id}> - -On Tue, 05 Jan 2010 15:43:56 -0800, Sender wrote: -> support for reply-to" - -printf " Un-munging Reply-To...\t\t\t\t" -add_message '[from]=3D"Sender "' \ - '[to]=3D"Some List "' \ - [subject]=3Dnotmuch-reply-test \ - '[date]=3D"Tue, 05 Jan 2010 15:43:56 -0800"' \ - '[body]=3D"Un-munging Reply-To"' \ - '[reply-to]=3D"Evil Munging List "' - -output=3D$($NOTMUCH reply id:${gen_msg_id}) -pass_if_equal "$output" "From: Notmuch Test Suite -Subject: Re: notmuch-reply-test -To: Sender , Some List -Bcc: test_suite@notmuchmail.org -In-Reply-To: <${gen_msg_id}> -References: <${gen_msg_id}> - -On Tue, 05 Jan 2010 15:43:56 -0800, Sender wrote: -> Un-munging Reply-To" - -printf "\nTesting handling of uuencoded data:\n" - -add_message [subject]=3Duuencodetest '[date]=3D"Sat, 01 Jan 2000 12:00:00 = -0000"' \ -'[body]=3D"This message is used to ensure that notmuch correctly handles a -message containing a block of uuencoded data. First, we have a marker -this content beforeuudata . Then we beging the uunencoded data itself: - -begin 644 bogus-uuencoded-data -M0123456789012345678901234567890123456789012345678901234567890 -MOBVIOUSLY, THIS IS NOT ANY SORT OF USEFUL UUNECODED DATA.=20=20=20=20 -MINSTEAD THIS IS JUST A WAY TO ENSURE THAT THIS BLOCK OF DATA=20 -MIS CORRECTLY IGNORED WHEN NOTMUCH CREATES ITS INDEX. SO WE=20=20=20 -MINCLUDE A DURINGUUDATA MARKER THAT SHOULD NOT RESULT IN ANY=20=20 -MSEARCH RESULT.=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20 -\` -end - -Finally, we have our afteruudata marker as well."' - -printf " Ensure content before uu data is indexed...\t" -output=3D$($NOTMUCH search beforeuudata | notmuch_search_sanitize) -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite;= uuencodetest (inbox unread)" -printf " Ensure uu data is not indexed...\t\t" -output=3D$($NOTMUCH search DURINGUUDATA | notmuch_search_sanitize) -pass_if_equal "$output" "" -printf " Ensure content after uu data is indexed...\t" -output=3D$($NOTMUCH search afteruudata | notmuch_search_sanitize) -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite;= uuencodetest (inbox unread)" - -printf "\nTesting \"notmuch dump\" and \"notmuch restore\":\n" - -printf " Dumping all tags...\t\t\t\t" -$NOTMUCH dump dump.expected -pass_if_equal "$?" "0" - -printf " Clearing all tags...\t\t\t\t" -sed -e 's/(\([^(]*\))$/()/' < dump.expected > clear.expected -$NOTMUCH restore clear.expected -$NOTMUCH dump clear.actual -pass_if_equal "$(< clear.actual)" "$(< clear.expected)" - -printf " Restoring original tags...\t\t\t" -$NOTMUCH restore dump.expected -$NOTMUCH dump dump.actual -pass_if_equal "$(< dump.actual)" "$(< dump.expected)" - -printf " Restore with nothing to do...\t\t\t" -$NOTMUCH restore dump.expected -pass_if_equal "$?" "0" - -printf "\nTesting threading when messages received out of order:\n" -printf " Adding initial child message...\t\t" -generate_message [body]=3Dfoo '[in-reply-to]=3D\' [subject]=3D= brokenthreadtest '[date]=3D"Sat, 01 Jan 2000 12:00:00 -0000"' -output=3D$(NOTMUCH_NEW) -pass_if_equal "$output" "Added 1 new message to the database." -printf " Searching returns the message...\t\t" -output=3D$($NOTMUCH search foo | notmuch_search_sanitize) -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite;= brokenthreadtest (inbox unread)" -printf " Adding second child message...\t\t\t" -generate_message [body]=3Dfoo '[in-reply-to]=3D\' [subject]=3D= brokenthreadtest '[date]=3D"Sat, 01 Jan 2000 12:00:00 -0000"' -output=3D$(NOTMUCH_NEW) -pass_if_equal "$output" "Added 1 new message to the database." -printf " Searching returns both messages in one thread..." -output=3D$($NOTMUCH search foo | notmuch_search_sanitize) -pass_if_equal "$output" "thread:XXX 2000-01-01 [2/2] Notmuch Test Suite;= brokenthreadtest (inbox unread)" -printf " Adding parent message...\t\t\t" -generate_message [body]=3Dfoo [id]=3Dparent-id [subject]=3Dbrokenthreadtes= t '[date]=3D"Sat, 01 Jan 2000 12:00:00 -0000"' -output=3D$(NOTMUCH_NEW) -pass_if_equal "$output" "Added 1 new message to the database." -printf " Searching returns all three messages in one thread..." -output=3D$($NOTMUCH search foo | notmuch_search_sanitize) -pass_if_equal "$output" "thread:XXX 2000-01-01 [3/3] Notmuch Test Suite;= brokenthreadtest (inbox unread)" - -printf "\nTesting author reordering;\n" -printf " Adding parent message...\t\t\t" -generate_message [body]=3Dfindme [id]=3Dnew-parent-id [subject]=3Dauthor-r= eorder-threadtest '[from]=3D"User "' '[date]=3D"Sat, 01 J= an 2000 12:00:00 -0000"' -output=3D$(NOTMUCH_NEW) -pass_if_equal "$output" "Added 1 new message to the database." -printf " Adding initial child message...\t\t" -generate_message [body]=3Dfindme '[in-reply-to]=3D\' [subj= ect]=3Dauthor-reorder-threadtest '[from]=3D"User1 "' '[d= ate]=3D"Sat, 01 Jan 2000 12:00:00 -0000"' -output=3D$(NOTMUCH_NEW) -pass_if_equal "$output" "Added 1 new message to the database." -printf " Adding second child message...\t\t\t" -generate_message [body]=3Dfindme '[in-reply-to]=3D\' [subj= ect]=3Dauthor-reorder-threadtest '[from]=3D"User2 "' '[d= ate]=3D"Sat, 01 Jan 2000 12:00:00 -0000"' -output=3D$(NOTMUCH_NEW) -pass_if_equal "$output" "Added 1 new message to the database." -printf " Searching when all three messages match...\t" -output=3D$($NOTMUCH search findme | notmuch_search_sanitize) -pass_if_equal "$output" "thread:XXX 2000-01-01 [3/3] User, User1, User2;= author-reorder-threadtest (inbox unread)" -printf " Searching when two messages match...\t\t" -output=3D$($NOTMUCH search User1 or User2 | notmuch_search_sanitize) -pass_if_equal "$output" "thread:XXX 2000-01-01 [2/3] User1, User2| User;= author-reorder-threadtest (inbox unread)" -printf " Searching when only one message matches...\t" -output=3D$($NOTMUCH search User2 | notmuch_search_sanitize) -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/3] User2| User, User1;= author-reorder-threadtest (inbox unread)" -printf " Searching when only first message matches...\t" -output=3D$($NOTMUCH search User | notmuch_search_sanitize) -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/3] User| User1, User2;= author-reorder-threadtest (inbox unread)" - -printf "\nTesting From line heuristics (with multiple configured addresses= ):\n" -printf " Magic from guessing (nothing to go on)...\t" -add_message '[from]=3D"Sender "' \ - [to]=3Dmailinglist@notmuchmail.org \ - [subject]=3Dnotmuch-reply-test \ - '[date]=3D"Tue, 05 Jan 2010 15:43:56 -0800"' \ - '[body]=3D"from guessing test"' - -output=3D$($NOTMUCH reply id:${gen_msg_id}) -pass_if_equal "$output" "From: Notmuch Test Suite -Subject: Re: notmuch-reply-test -To: Sender , mailinglist@notmuchmail.org -Bcc: test_suite@notmuchmail.org -In-Reply-To: <${gen_msg_id}> -References: <${gen_msg_id}> - -On Tue, 05 Jan 2010 15:43:56 -0800, Sender wrote: -> from guessing test" - -printf " Magic from guessing (Envelope-to:)...\t\t" -add_message '[from]=3D"Sender "' \ - [to]=3Dmailinglist@notmuchmail.org \ - [subject]=3Dnotmuch-reply-test \ - '[header]=3D"Envelope-To: test_suite_other@notmuchmail.org"' \ - '[date]=3D"Tue, 05 Jan 2010 15:43:56 -0800"' \ - '[body]=3D"from guessing test"' - -output=3D$($NOTMUCH reply id:${gen_msg_id}) -pass_if_equal "$output" "From: Notmuch Test Suite -Subject: Re: notmuch-reply-test -To: Sender , mailinglist@notmuchmail.org -Bcc: test_suite@notmuchmail.org -In-Reply-To: <${gen_msg_id}> -References: <${gen_msg_id}> - -On Tue, 05 Jan 2010 15:43:56 -0800, Sender wrote: -> from guessing test" - -printf " Magic from guessing (X-Original-To:)...\t" -add_message '[from]=3D"Sender "' \ - [to]=3Dmailinglist@notmuchmail.org \ - [subject]=3Dnotmuch-reply-test \ - '[header]=3D"X-Original-To: test_suite_other@notmuchmail.org"'= \ - '[date]=3D"Tue, 05 Jan 2010 15:43:56 -0800"' \ - '[body]=3D"from guessing test"' - -output=3D$($NOTMUCH reply id:${gen_msg_id}) -pass_if_equal "$output" "From: Notmuch Test Suite -Subject: Re: notmuch-reply-test -To: Sender , mailinglist@notmuchmail.org -Bcc: test_suite@notmuchmail.org -In-Reply-To: <${gen_msg_id}> -References: <${gen_msg_id}> - -On Tue, 05 Jan 2010 15:43:56 -0800, Sender wrote: -> from guessing test" - -printf " Magic from guessing (Received: .. for ..)...\t" -add_message '[from]=3D"Sender "' \ - [to]=3Dmailinglist@notmuchmail.org \ - [subject]=3Dnotmuch-reply-test \ - '[header]=3D"Received: from mail.example.com (mail.example.com= [1.1.1.1])\ - by mail.notmuchmail.org (some MTA) with ESMTP id 12345678\ - for ; Sat, 10 Apr 2010 07:54:51 = -0400 (EDT)"' \ - '[date]=3D"Tue, 05 Jan 2010 15:43:56 -0800"' \ - '[body]=3D"from guessing test"' - -output=3D$($NOTMUCH reply id:${gen_msg_id}) -pass_if_equal "$output" "From: Notmuch Test Suite -Subject: Re: notmuch-reply-test -To: Sender , mailinglist@notmuchmail.org -Bcc: test_suite@notmuchmail.org -In-Reply-To: <${gen_msg_id}> -References: <${gen_msg_id}> - -On Tue, 05 Jan 2010 15:43:56 -0800, Sender wrote: -> from guessing test" - -printf " Magic from guessing (Received: domain)...\t" -add_message '[from]=3D"Sender "' \ - [to]=3Dmailinglist@notmuchmail.org \ - [subject]=3Dnotmuch-reply-test \ - '[header]=3D"Received: from mail.example.com (mail.example.com= [1.1.1.1])\ - by mail.otherdomain.org (some MTA) with ESMTP id 12345678\ - Sat, 10 Apr 2010 07:54:51 -0400 (EDT)"' \ - '[date]=3D"Tue, 05 Jan 2010 15:43:56 -0800"' \ - '[body]=3D"from guessing test"' - -output=3D$($NOTMUCH reply id:${gen_msg_id}) -pass_if_equal "$output" "From: Notmuch Test Suite -Subject: Re: notmuch-reply-test -To: Sender , mailinglist@notmuchmail.org -Bcc: test_suite@notmuchmail.org -In-Reply-To: <${gen_msg_id}> -References: <${gen_msg_id}> - -On Tue, 05 Jan 2010 15:43:56 -0800, Sender wrote: -> from guessing test" - - -printf "\nTesting From line heuristics (with single configured address):\n" -sed -i -e 's/^other_email.*//' ${NOTMUCH_CONFIG} - -printf " Magic from guessing (nothing to go on)...\t" -add_message '[from]=3D"Sender "' \ - [to]=3Dmailinglist@notmuchmail.org \ - [subject]=3Dnotmuch-reply-test \ - '[date]=3D"Tue, 05 Jan 2010 15:43:56 -0800"' \ - '[body]=3D"from guessing test"' - -output=3D$($NOTMUCH reply id:${gen_msg_id}) -pass_if_equal "$output" "From: Notmuch Test Suite -Subject: Re: notmuch-reply-test -To: Sender , mailinglist@notmuchmail.org -Bcc: test_suite@notmuchmail.org -In-Reply-To: <${gen_msg_id}> -References: <${gen_msg_id}> - -On Tue, 05 Jan 2010 15:43:56 -0800, Sender wrote: -> from guessing test" - -printf " Magic from guessing (Envelope-to:)...\t\t" -add_message '[from]=3D"Sender "' \ - [to]=3Dmailinglist@notmuchmail.org \ - [subject]=3Dnotmuch-reply-test \ - '[header]=3D"Envelope-To: test_suite_other@notmuchmail.org"' \ - '[date]=3D"Tue, 05 Jan 2010 15:43:56 -0800"' \ - '[body]=3D"from guessing test"' - -output=3D$($NOTMUCH reply id:${gen_msg_id}) -pass_if_equal "$output" "From: Notmuch Test Suite -Subject: Re: notmuch-reply-test -To: Sender , mailinglist@notmuchmail.org -Bcc: test_suite@notmuchmail.org -In-Reply-To: <${gen_msg_id}> -References: <${gen_msg_id}> - -On Tue, 05 Jan 2010 15:43:56 -0800, Sender wrote: -> from guessing test" - -printf " Magic from guessing (X-Original-To:)...\t" -add_message '[from]=3D"Sender "' \ - [to]=3Dmailinglist@notmuchmail.org \ - [subject]=3Dnotmuch-reply-test \ - '[header]=3D"X-Original-To: test_suite_other@notmuchmail.org"'= \ - '[date]=3D"Tue, 05 Jan 2010 15:43:56 -0800"' \ - '[body]=3D"from guessing test"' - -output=3D$($NOTMUCH reply id:${gen_msg_id}) -pass_if_equal "$output" "From: Notmuch Test Suite -Subject: Re: notmuch-reply-test -To: Sender , mailinglist@notmuchmail.org -Bcc: test_suite@notmuchmail.org -In-Reply-To: <${gen_msg_id}> -References: <${gen_msg_id}> - -On Tue, 05 Jan 2010 15:43:56 -0800, Sender wrote: -> from guessing test" - -printf " Magic from guessing (Received: .. for ..)...\t" -add_message '[from]=3D"Sender "' \ - [to]=3Dmailinglist@notmuchmail.org \ - [subject]=3Dnotmuch-reply-test \ - '[header]=3D"Received: from mail.example.com (mail.example.com= [1.1.1.1])\ - by mail.notmuchmail.org (some MTA) with ESMTP id 12345678\ - for ; Sat, 10 Apr 2010 07:54:51 = -0400 (EDT)"' \ - '[date]=3D"Tue, 05 Jan 2010 15:43:56 -0800"' \ - '[body]=3D"from guessing test"' - -output=3D$($NOTMUCH reply id:${gen_msg_id}) -pass_if_equal "$output" "From: Notmuch Test Suite -Subject: Re: notmuch-reply-test -To: Sender , mailinglist@notmuchmail.org -Bcc: test_suite@notmuchmail.org -In-Reply-To: <${gen_msg_id}> -References: <${gen_msg_id}> - -On Tue, 05 Jan 2010 15:43:56 -0800, Sender wrote: -> from guessing test" - -printf " Magic from guessing (Received: domain)...\t" -add_message '[from]=3D"Sender "' \ - [to]=3Dmailinglist@notmuchmail.org \ - [subject]=3Dnotmuch-reply-test \ - '[header]=3D"Received: from mail.example.com (mail.example.com= [1.1.1.1])\ - by mail.otherdomain.org (some MTA) with ESMTP id 12345678\ - Sat, 10 Apr 2010 07:54:51 -0400 (EDT)"' \ - '[date]=3D"Tue, 05 Jan 2010 15:43:56 -0800"' \ - '[body]=3D"from guessing test"' +run_collection_setup_and_tests () +{ + for testfile in $(find ${TEST_COLLECTION_DIR}/$1 \ + -name "*.test" -o -name "*.setup" | + sort -n); + do + source $testfile + done +} =20 -output=3D$($NOTMUCH reply id:${gen_msg_id}) -pass_if_equal "$output" "From: Notmuch Test Suite -Subject: Re: notmuch-reply-test -To: Sender , mailinglist@notmuchmail.org -Bcc: test_suite@notmuchmail.org -In-Reply-To: <${gen_msg_id}> -References: <${gen_msg_id}> +run_test_suite () +{ + initialize_notmuch_test; + + if [ "$#" =3D "0" -o "$1" =3D "all" ]; then + for dir in $(echo ${TEST_COLLECTIONS}); do + run_collection_setup_and_tests "$(basename ${dir})"; + done; + elif [ ! -d "${TEST_COLLECTION_DIR}/$1" ]; then + echo "${TEST_COLLECTION_DIR}/$1 is not a directory" + exit + else + run_collection_setup_and_tests "$1"; + fi +} =20 -On Tue, 05 Jan 2010 15:43:56 -0800, Sender wrote: -> from guessing test" +run_test_suite $1 =20 echo "" echo "Notmuch test suite complete." --=20 1.6.3.3