mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-25 04:18:08 +01:00
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.
This commit is contained in:
parent
54aeab1962
commit
f68e776617
3 changed files with 19 additions and 0 deletions
1
test/.gitignore
vendored
1
test/.gitignore
vendored
|
@ -7,4 +7,5 @@ smtp-dummy
|
||||||
symbol-test
|
symbol-test
|
||||||
make-db-version
|
make-db-version
|
||||||
test-results
|
test-results
|
||||||
|
ghost-report
|
||||||
tmp.*
|
tmp.*
|
||||||
|
|
|
@ -38,6 +38,9 @@ $(dir)/parse-time: $(dir)/parse-time.o parse-time-string/parse-time-string.o
|
||||||
$(dir)/make-db-version: $(dir)/make-db-version.o
|
$(dir)/make-db-version: $(dir)/make-db-version.o
|
||||||
$(call quiet,CXX) $^ -o $@ $(LDFLAGS) $(XAPIAN_LDFLAGS)
|
$(call quiet,CXX) $^ -o $@ $(LDFLAGS) $(XAPIAN_LDFLAGS)
|
||||||
|
|
||||||
|
$(dir)/ghost-report: $(dir)/ghost-report.o
|
||||||
|
$(call quiet,CXX) $^ -o $@ $(LDFLAGS) $(XAPIAN_LDFLAGS)
|
||||||
|
|
||||||
.PHONY: test check
|
.PHONY: test check
|
||||||
|
|
||||||
test_main_srcs=$(dir)/arg-test.c \
|
test_main_srcs=$(dir)/arg-test.c \
|
||||||
|
@ -47,6 +50,7 @@ test_main_srcs=$(dir)/arg-test.c \
|
||||||
$(dir)/smtp-dummy.c \
|
$(dir)/smtp-dummy.c \
|
||||||
$(dir)/symbol-test.cc \
|
$(dir)/symbol-test.cc \
|
||||||
$(dir)/make-db-version.cc \
|
$(dir)/make-db-version.cc \
|
||||||
|
$(dir)/ghost-report.cc
|
||||||
|
|
||||||
test_srcs=$(test_main_srcs) $(dir)/database-test.c
|
test_srcs=$(test_main_srcs) $(dir)/database-test.c
|
||||||
|
|
||||||
|
|
14
test/ghost-report.cc
Normal file
14
test/ghost-report.cc
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#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;
|
||||||
|
}
|
Loading…
Reference in a new issue