1 Return-Path: <dkg@fifthhorseman.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 5B5EE6DE02D0
\r
6 for <notmuch@notmuchmail.org>; Fri, 8 Apr 2016 18:03:03 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\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 t_jG7THYqqid for <notmuch@notmuchmail.org>;
\r
16 Fri, 8 Apr 2016 18:02:54 -0700 (PDT)
\r
17 Received: from che.mayfirst.org (che.mayfirst.org [209.234.253.108])
\r
18 by arlo.cworth.org (Postfix) with ESMTP id E27C96DE02D5
\r
19 for <notmuch@notmuchmail.org>; Fri, 8 Apr 2016 18:02:42 -0700 (PDT)
\r
20 Received: from fifthhorseman.net (unknown [201.140.212.132])
\r
21 by che.mayfirst.org (Postfix) with ESMTPSA id 6F00F1007E;
\r
22 Fri, 8 Apr 2016 21:02:36 -0400 (EDT)
\r
23 Received: by fifthhorseman.net (Postfix, from userid 1000)
\r
24 id EDDD81FF50; Fri, 8 Apr 2016 22:02:34 -0300 (ART)
\r
25 From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
\r
26 To: Notmuch Mail <notmuch@notmuchmail.org>
\r
27 Subject: [PATCH v3 1/7] test: add test-binary to print the number of ghost
\r
29 Date: Fri, 8 Apr 2016 22:02:28 -0300
\r
30 Message-Id: <1460163754-22994-1-git-send-email-dkg@fifthhorseman.net>
\r
31 X-Mailer: git-send-email 2.8.0.rc3
\r
32 In-Reply-To: <1459445693-3900-1-git-send-email-dkg@fifthhorseman.net>
\r
33 References: <1459445693-3900-1-git-send-email-dkg@fifthhorseman.net>
\r
34 X-BeenThere: notmuch@notmuchmail.org
\r
35 X-Mailman-Version: 2.1.20
\r
37 List-Id: "Use and development of the notmuch mail system."
\r
38 <notmuch.notmuchmail.org>
\r
39 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,
\r
40 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
41 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>
\r
42 List-Post: <mailto:notmuch@notmuchmail.org>
\r
43 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
44 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,
\r
45 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
46 X-List-Received-Date: Sat, 09 Apr 2016 01:03:03 -0000
\r
48 From: David Bremner <david@tethera.net>
\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
53 test/Makefile.local | 4 ++++
\r
54 test/ghost-report.cc | 12 ++++++++++++
\r
55 2 files changed, 16 insertions(+)
\r
56 create mode 100644 test/ghost-report.cc
\r
58 diff --git a/test/Makefile.local b/test/Makefile.local
\r
59 index 30d420e..022f2cf 100644
\r
60 --- a/test/Makefile.local
\r
61 +++ b/test/Makefile.local
\r
62 @@ -38,6 +38,9 @@ $(dir)/parse-time: $(dir)/parse-time.o parse-time-string/parse-time-string.o
\r
63 $(dir)/make-db-version: $(dir)/make-db-version.o
\r
64 $(call quiet,CXX) $^ -o $@ $(LDFLAGS) $(XAPIAN_LDFLAGS)
\r
66 +$(dir)/ghost-report: $(dir)/ghost-report.o
\r
67 + $(call quiet,CXX) $^ -o $@ $(LDFLAGS) $(XAPIAN_LDFLAGS)
\r
71 test_main_srcs=$(dir)/arg-test.c \
\r
72 @@ -47,6 +50,7 @@ test_main_srcs=$(dir)/arg-test.c \
\r
73 $(dir)/smtp-dummy.c \
\r
74 $(dir)/symbol-test.cc \
\r
75 $(dir)/make-db-version.cc \
\r
76 + $(dir)/ghost-report.cc
\r
78 test_srcs=$(test_main_srcs) $(dir)/database-test.c
\r
80 diff --git a/test/ghost-report.cc b/test/ghost-report.cc
\r
81 new file mode 100644
\r
82 index 0000000..1739be4
\r
84 +++ b/test/ghost-report.cc
\r
86 +#include <iostream>
\r
87 +#include <xapian.h>
\r
89 +int main(int argc, char **argv) {
\r
92 + std::cerr << "usage: ghost-report xapian-dir" << std::endl;
\r
95 + Xapian::Database db(argv[1]);
\r
96 + std::cout << db.get_termfreq("Tghost") << std::endl;
\r