1 Return-Path: <bremner@tethera.net>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by arlo.cworth.org (Postfix) with ESMTP id 3B18A6DE02D1
\r
6 for <notmuch@notmuchmail.org>; Sat, 2 Apr 2016 09:19:24 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
11 X-Spam-Status: No, score=-0.02 tagged_above=-999 required=5 tests=[AWL=-0.009,
\r
12 SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled
\r
13 Received: from arlo.cworth.org ([127.0.0.1])
\r
14 by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id lNKKcNUlESRF for <notmuch@notmuchmail.org>;
\r
16 Sat, 2 Apr 2016 09:19:16 -0700 (PDT)
\r
17 Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197])
\r
18 by arlo.cworth.org (Postfix) with ESMTPS id 6133F6DE0243
\r
19 for <notmuch@notmuchmail.org>; Sat, 2 Apr 2016 09:19:16 -0700 (PDT)
\r
20 Received: from remotemail by fethera.tethera.net with local (Exim 4.84)
\r
21 (envelope-from <bremner@tethera.net>)
\r
22 id 1amOH6-0004fL-Im; Sat, 02 Apr 2016 12:19:48 -0400
\r
23 Received: (nullmailer pid 13165 invoked by uid 1000);
\r
24 Sat, 02 Apr 2016 16:19:12 -0000
\r
25 From: David Bremner <david@tethera.net>
\r
26 To: Daniel Kahn Gillmor <dkg@fifthhorseman.net>,
\r
27 Notmuch Mail <notmuch@notmuchmail.org>
\r
28 Subject: [PATCH 2/2] test: add test-binary to print the number of ghost
\r
30 Date: Sat, 2 Apr 2016 13:19:02 -0300
\r
31 Message-Id: <1459613942-13098-2-git-send-email-david@tethera.net>
\r
32 X-Mailer: git-send-email 2.8.0.rc3
\r
33 In-Reply-To: <1459613942-13098-1-git-send-email-david@tethera.net>
\r
34 References: <1459606541-23889-1-git-send-email-dkg@fifthhorseman.net>
\r
35 <1459613942-13098-1-git-send-email-david@tethera.net>
\r
36 X-BeenThere: notmuch@notmuchmail.org
\r
37 X-Mailman-Version: 2.1.20
\r
39 List-Id: "Use and development of the notmuch mail system."
\r
40 <notmuch.notmuchmail.org>
\r
41 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,
\r
42 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
43 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>
\r
44 List-Post: <mailto:notmuch@notmuchmail.org>
\r
45 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
46 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,
\r
47 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
48 X-List-Received-Date: Sat, 02 Apr 2016 16:19:24 -0000
\r
50 This one-liner seems preferable to the complications of depending on
\r
51 delve, getting the binary name right and parsing the output.
\r
54 I wasn't sure where exactly you wanted to count ghosts, so here is
\r
55 some example code to do the counting. Feel free to modify to suit your
\r
58 test/Makefile.local | 4 ++++
\r
59 test/ghost-report.cc | 12 ++++++++++++
\r
60 2 files changed, 16 insertions(+)
\r
61 create mode 100644 test/ghost-report.cc
\r
63 diff --git a/test/Makefile.local b/test/Makefile.local
\r
64 index 30d420e..022f2cf 100644
\r
65 --- a/test/Makefile.local
\r
66 +++ b/test/Makefile.local
\r
67 @@ -38,6 +38,9 @@ $(dir)/parse-time: $(dir)/parse-time.o parse-time-string/parse-time-string.o
\r
68 $(dir)/make-db-version: $(dir)/make-db-version.o
\r
69 $(call quiet,CXX) $^ -o $@ $(LDFLAGS) $(XAPIAN_LDFLAGS)
\r
71 +$(dir)/ghost-report: $(dir)/ghost-report.o
\r
72 + $(call quiet,CXX) $^ -o $@ $(LDFLAGS) $(XAPIAN_LDFLAGS)
\r
76 test_main_srcs=$(dir)/arg-test.c \
\r
77 @@ -47,6 +50,7 @@ test_main_srcs=$(dir)/arg-test.c \
\r
78 $(dir)/smtp-dummy.c \
\r
79 $(dir)/symbol-test.cc \
\r
80 $(dir)/make-db-version.cc \
\r
81 + $(dir)/ghost-report.cc
\r
83 test_srcs=$(test_main_srcs) $(dir)/database-test.c
\r
85 diff --git a/test/ghost-report.cc b/test/ghost-report.cc
\r
86 new file mode 100644
\r
87 index 0000000..1739be4
\r
89 +++ b/test/ghost-report.cc
\r
91 +#include <iostream>
\r
92 +#include <xapian.h>
\r
94 +int main(int argc, char **argv) {
\r
97 + std::cerr << "usage: ghost-report xapian-dir" << std::endl;
\r
100 + Xapian::Database db(argv[1]);
\r
101 + std::cout << db.get_termfreq("Tghost") << std::endl;
\r