--- /dev/null
+Return-Path: <sojkam1@fel.cvut.cz>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id C85D0409DE5\r
+ for <notmuch@notmuchmail.org>; Mon, 10 May 2010 09:49:01 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.9\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5\r
+ tests=[BAYES_00=-1.9] autolearn=ham\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id 4J8lycp2o0yD for <notmuch@notmuchmail.org>;\r
+ Mon, 10 May 2010 09:48:49 -0700 (PDT)\r
+Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36])\r
+ by olra.theworths.org (Postfix) with ESMTP id 08841418C25\r
+ for <notmuch@notmuchmail.org>; Mon, 10 May 2010 09:48:23 -0700 (PDT)\r
+Received: from localhost (unknown [192.168.200.4])\r
+ by max.feld.cvut.cz (Postfix) with ESMTP id 6144319F3407;\r
+ Mon, 10 May 2010 18:48:22 +0200 (CEST)\r
+X-Virus-Scanned: IMAP AMAVIS\r
+Received: from max.feld.cvut.cz ([192.168.200.1])\r
+ by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new,\r
+ port 10044)\r
+ with ESMTP id JoiujGtlBRS6; Mon, 10 May 2010 18:48:14 +0200 (CEST)\r
+Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34])\r
+ by max.feld.cvut.cz (Postfix) with ESMTP id 7075219F343E;\r
+ Mon, 10 May 2010 18:48:14 +0200 (CEST)\r
+Received: from steelpick.2x.cz (k335-30.felk.cvut.cz [147.32.86.30])\r
+ (Authenticated sender: sojkam1)\r
+ by imap.feld.cvut.cz (Postfix) with ESMTPSA id 68AC2FA003;\r
+ Mon, 10 May 2010 18:48:14 +0200 (CEST)\r
+Received: from wsh by steelpick.2x.cz with local (Exim 4.71)\r
+ (envelope-from <sojkam1@fel.cvut.cz>)\r
+ id 1OBW9O-0005Bb-7g; Mon, 10 May 2010 18:48:14 +0200\r
+From: Michal Sojka <sojkam1@fel.cvut.cz>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 3/5] test: Update helper functions\r
+Date: Mon, 10 May 2010 18:48:02 +0200\r
+Message-Id: <1273510084-19896-4-git-send-email-sojkam1@fel.cvut.cz>\r
+X-Mailer: git-send-email 1.7.1\r
+In-Reply-To: <1273510084-19896-1-git-send-email-sojkam1@fel.cvut.cz>\r
+References: <1273510084-19896-1-git-send-email-sojkam1@fel.cvut.cz>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 10 May 2010 16:49:02 -0000\r
+\r
+Modify the helper functions to work with git-based test suite i.e.\r
+1) Quote arguments where it is necessary.\r
+2) Do not use $NOTMUCH. It doesn't exist and $PATH is set to the build\r
+ tree\r
+3) Modify pass_if_equal to fit into the git-based test suite.\r
+\r
+Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>\r
+---\r
+ test/test-lib.sh | 33 +++++++++++++--------------------\r
+ 1 files changed, 13 insertions(+), 20 deletions(-)\r
+\r
+diff --git a/test/test-lib.sh b/test/test-lib.sh\r
+index e780dd3..06559cd 100755\r
+--- a/test/test-lib.sh\r
++++ b/test/test-lib.sh\r
+@@ -221,10 +221,10 @@ remove_cr () {\r
+ increment_mtime_amount=0\r
+ increment_mtime ()\r
+ {\r
+- dir=$1\r
++ dir="$1"\r
+ \r
+ increment_mtime_amount=$((increment_mtime_amount + 1))\r
+- touch -d "+${increment_mtime_amount} seconds" $dir\r
++ touch -d "+${increment_mtime_amount} seconds" "$dir"\r
+ }\r
+ \r
+ # Generate a new message in the mail directory, with a unique message\r
+@@ -289,7 +289,7 @@ generate_message ()\r
+ gen_msg_filename="${MAIL_DIR}/$gen_msg_name"\r
+ else\r
+ gen_msg_filename="${MAIL_DIR}/${template[dir]}/$gen_msg_name"\r
+- mkdir -p $(dirname $gen_msg_filename)\r
++ mkdir -p "$(dirname "$gen_msg_filename")"\r
+ fi\r
+ \r
+ if [ -z "${template[body]}" ]; then\r
+@@ -334,7 +334,7 @@ ${additional_headers}"\r
+ fi\r
+ \r
+ \r
+-cat <<EOF >$gen_msg_filename\r
++cat <<EOF >"$gen_msg_filename"\r
+ From: ${template[from]}\r
+ To: ${template[to]}\r
+ Message-Id: <${gen_msg_id}>\r
+@@ -345,7 +345,7 @@ ${template[body]}\r
+ EOF\r
+ \r
+ # Ensure that the mtime of the containing directory is updated\r
+- increment_mtime $(dirname ${gen_msg_filename})\r
++ increment_mtime "$(dirname "${gen_msg_filename}")"\r
+ }\r
+ \r
+ # Generate a new message and add it to the index.\r
+@@ -354,41 +354,34 @@ EOF\r
+ # are also supported here, so see that function for details.\r
+ add_message ()\r
+ {\r
+- generate_message "$@"\r
+-\r
+- $NOTMUCH new > /dev/null\r
++ generate_message "$@" &&\r
++ notmuch new > /dev/null\r
+ }\r
+ \r
+-tests=0\r
+-test_failures=0\r
+-\r
+ pass_if_equal ()\r
+ {\r
+ output=$1\r
+ expected=$2\r
+ \r
+- tests=$((tests + 1))\r
+-\r
+ if [ "$output" = "$expected" ]; then\r
+- echo " PASS"\r
++ true\r
+ else\r
+- echo " FAIL"\r
+- testname=test-$(printf "%03d" $tests)\r
++ testname=$this_test.$test_count\r
+ echo "$expected" > $testname.expected\r
+ echo "$output" > $testname.output\r
+- diff -u $testname.expected $testname.output || true\r
+- test_failures=$((test_failures + 1))\r
++ diff -u $testname.expected $testname.output\r
++ false\r
+ fi\r
+ }\r
+ \r
+ TEST_DIR=$(pwd)/test.$$\r
+ MAIL_DIR=${TEST_DIR}/mail\r
+ export NOTMUCH_CONFIG=${TEST_DIR}/notmuch-config\r
+-NOTMUCH=$(find_notmuch_binary $(pwd))\r
++NOTMUCH=notmuch\r
+ \r
+ NOTMUCH_NEW ()\r
+ {\r
+- $NOTMUCH new | grep -v -E -e '^Processed [0-9]*( total)? file|Found [0-9]* total file'\r
++ notmuch new | grep -v -E -e '^Processed [0-9]*( total)? file|Found [0-9]* total file'\r
+ }\r
+ \r
+ notmuch_search_sanitize ()\r
+-- \r
+1.7.1\r
+\r