--- /dev/null
+Return-Path: <bremner@tethera.net>\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 E6571431FBD\r
+ for <notmuch@notmuchmail.org>; Fri, 1 Nov 2013 17:02:19 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+ autolearn=disabled\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 EgXnCqfeTXpN for <notmuch@notmuchmail.org>;\r
+ Fri, 1 Nov 2013 17:02:15 -0700 (PDT)\r
+Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155])\r
+ (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id D59DD431FAF\r
+ for <notmuch@notmuchmail.org>; Fri, 1 Nov 2013 17:02:15 -0700 (PDT)\r
+Received: from remotemail by yantan.tethera.net with local (Exim 4.80)\r
+ (envelope-from <bremner@tethera.net>)\r
+ id 1VcOfN-0002Oj-Ba; Fri, 01 Nov 2013 21:02:13 -0300\r
+Received: (nullmailer pid 24363 invoked by uid 1000); Sat, 02 Nov 2013\r
+ 00:02:05 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] test: fix compact backup / restore test\r
+Date: Fri, 1 Nov 2013 21:01:55 -0300\r
+Message-Id: <1383350515-24320-1-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 1.8.4.rc3\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: Sat, 02 Nov 2013 00:02:20 -0000\r
+\r
+It was looking in completely the wrong place for the backup and the\r
+(test) xapian database. Unfortunately test_begin_subtest hides the\r
+relevant errors.\r
+---\r
+\r
+I found this bug because \r
+\r
+ id:9ee3f2334a117b0a1b88650f44432423cbe95fd7.1383315568.git.jani@nikula.org\r
+\r
+did _not_ break any tests. Which was puzzling.\r
+\r
+ test/compact | 7 ++++---\r
+ 1 file changed, 4 insertions(+), 3 deletions(-)\r
+\r
+diff --git a/test/compact b/test/compact\r
+index 5bb5cea..afab537 100755\r
+--- a/test/compact\r
++++ b/test/compact\r
+@@ -19,10 +19,11 @@ thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; One (inbox tag1 unread)\r
+ thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Two (inbox tag1 tag2 unread)\r
+ thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Three (inbox tag3 unread)"\r
+ \r
+-test_begin_subtest "Restoring backup"\r
+-rm -Rf ${TEST_TMPDIR}/mail/xapian\r
+-mv ${TEST_TMPDIR}/mail/xapian.old ${TEST_TMPDIR}/mail/xapian\r
++test_expect_success 'Restoring Backup' \\r
++ 'rm -Rf ${MAIL_DIR}/.notmuch/xapian &&\r
++ mv ${MAIL_DIR}/xapian.old ${MAIL_DIR}/.notmuch/xapian'\r
+ \r
++test_begin_subtest "Checking restored backup"\r
+ output=$(notmuch search \* | notmuch_search_sanitize)\r
+ test_expect_equal "$output" "\\r
+ thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; One (inbox tag1 unread)\r
+-- \r
+1.8.4.rc3\r
+\r