[PATCH v4 1/7] test: add test-binary to print the number of ghost messages
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Sat, 9 Apr 2016 01:54:46 +0000 (22:54 +2100)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 23:21:32 +0000 (16:21 -0700)
ad/4a2429ce5aec4c3585f786514feef70d31e3fa [new file with mode: 0644]

diff --git a/ad/4a2429ce5aec4c3585f786514feef70d31e3fa b/ad/4a2429ce5aec4c3585f786514feef70d31e3fa
new file mode 100644 (file)
index 0000000..20834e6
--- /dev/null
@@ -0,0 +1,100 @@
+Return-Path: <dkg@fifthhorseman.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 arlo.cworth.org (Postfix) with ESMTP id 772456DE091B\r
+ for <notmuch@notmuchmail.org>; Fri,  8 Apr 2016 18:55:39 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.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=[AWL=0.000]\r
+ autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id UvAKsJwIhDTm for <notmuch@notmuchmail.org>;\r
+ Fri,  8 Apr 2016 18:55:31 -0700 (PDT)\r
+Received: from che.mayfirst.org (che.mayfirst.org [209.234.253.108])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 537FF6DE034D\r
+ for <notmuch@notmuchmail.org>; Fri,  8 Apr 2016 18:55:09 -0700 (PDT)\r
+Received: from fifthhorseman.net (unknown [201.140.212.132])\r
+ by che.mayfirst.org (Postfix) with ESMTPSA id 83C8310071;\r
+ Fri,  8 Apr 2016 21:55:06 -0400 (EDT)\r
+Received: by fifthhorseman.net (Postfix, from userid 1000)\r
+ id 48F332003D; Fri,  8 Apr 2016 22:54:52 -0300 (ART)\r
+From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>\r
+To: Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: [PATCH v4 1/7] test: add test-binary to print the number of ghost\r
+ messages\r
+Date: Fri,  8 Apr 2016 22:54:46 -0300\r
+Message-Id: <1460166892-29721-1-git-send-email-dkg@fifthhorseman.net>\r
+X-Mailer: git-send-email 2.8.0.rc3\r
+In-Reply-To: <1459445693-3900-1-git-send-email-dkg@fifthhorseman.net>\r
+References: <1459445693-3900-1-git-send-email-dkg@fifthhorseman.net>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://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: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 09 Apr 2016 01:55:39 -0000\r
+\r
+From: David Bremner <david@tethera.net>\r
+\r
+This one-liner seems preferable to the complications of depending on\r
+delve, getting the binary name right and parsing the output.\r
+---\r
+ test/Makefile.local  |  4 ++++\r
+ test/ghost-report.cc | 12 ++++++++++++\r
+ 2 files changed, 16 insertions(+)\r
+ create mode 100644 test/ghost-report.cc\r
+\r
+diff --git a/test/Makefile.local b/test/Makefile.local\r
+index 30d420e..022f2cf 100644\r
+--- a/test/Makefile.local\r
++++ b/test/Makefile.local\r
+@@ -38,6 +38,9 @@ $(dir)/parse-time: $(dir)/parse-time.o parse-time-string/parse-time-string.o\r
+ $(dir)/make-db-version: $(dir)/make-db-version.o\r
+       $(call quiet,CXX) $^ -o $@ $(LDFLAGS) $(XAPIAN_LDFLAGS)\r
\r
++$(dir)/ghost-report: $(dir)/ghost-report.o\r
++      $(call quiet,CXX) $^ -o $@ $(LDFLAGS) $(XAPIAN_LDFLAGS)\r
++\r
+ .PHONY: test check\r
\r
+ test_main_srcs=$(dir)/arg-test.c \\r
+@@ -47,6 +50,7 @@ test_main_srcs=$(dir)/arg-test.c \\r
+             $(dir)/smtp-dummy.c \\r
+             $(dir)/symbol-test.cc \\r
+             $(dir)/make-db-version.cc \\r
++            $(dir)/ghost-report.cc\r
\r
+ test_srcs=$(test_main_srcs) $(dir)/database-test.c\r
\r
+diff --git a/test/ghost-report.cc b/test/ghost-report.cc\r
+new file mode 100644\r
+index 0000000..1739be4\r
+--- /dev/null\r
++++ b/test/ghost-report.cc\r
+@@ -0,0 +1,12 @@\r
++#include <iostream>\r
++#include <xapian.h>\r
++\r
++int main(int argc, char **argv) {\r
++\r
++    if (argc < 2) {\r
++      std::cerr << "usage: ghost-report xapian-dir" << std::endl;\r
++    }\r
++\r
++    Xapian::Database db(argv[1]);\r
++    std::cout << db.get_termfreq("Tghost") << std::endl;\r
++}\r
+-- \r
+2.8.0.rc3\r
+\r