notmuch/test/ghost-report.cc
David Bremner f68e776617 test: add test-binary to print the number of ghost messages
This one-liner seems preferable to the complications of depending on
delve, getting the binary name right and parsing the output.
2016-04-15 07:07:23 -03:00

14 lines
286 B
C++

#include <iostream>
#include <cstdlib>
#include <xapian.h>
int main(int argc, char **argv) {
if (argc < 2) {
std::cerr << "usage: ghost-report xapian-dir" << std::endl;
exit(1);
}
Xapian::Database db(argv[1]);
std::cout << db.get_termfreq("Tghost") << std::endl;
}