1 /* apitest.cc: tests the Xapian API
3 * Copyright 1999,2000,2001 BrightStation PLC
4 * Copyright 2002 Ananova Ltd
5 * Copyright 2003,2004,2006,2007,2008,2009 Olly Betts
6 * Copyright 2008 Lemur Consulting Ltd
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of the
11 * License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
29 #include "backendmanager.h"
30 #include "stringutils.h"
31 #include "testrunner.h"
32 #include "testsuite.h"
42 get_database(const string
&dbname
)
44 return backendmanager
->get_database(dbname
);
48 get_database(const string
&dbname
, const string
&dbname2
)
50 vector
<string
> dbnames
;
51 dbnames
.push_back(dbname
);
52 dbnames
.push_back(dbname2
);
53 return backendmanager
->get_database(dbnames
);
57 get_database_path(const string
&dbname
)
59 return backendmanager
->get_database_path(dbname
);
63 get_database_path(const std::string
&dbname
,
64 void (*gen
)(Xapian::WritableDatabase
&,
66 const std::string
&arg
)
68 return backendmanager
->get_database_path(dbname
, gen
, arg
);
72 get_database(const std::string
&dbname
,
73 void (*gen
)(Xapian::WritableDatabase
&,
75 const std::string
&arg
)
77 return backendmanager
->get_database(dbname
, gen
, arg
);
80 class ApiTestRunner
: public TestRunner
85 #include "api_collated.h"
86 test_driver::report(test_driver::subtotal
,
87 "backend " + backendmanager
->get_dbtype());
88 test_driver::total
+= test_driver::subtotal
;
89 test_driver::subtotal
.reset();
94 int main(int argc
, char **argv
)
97 return runner
.run_tests(argc
, argv
);