xapian-core  2.0.0
Macros | Functions
apitest.h File Reference

test functionality of the Xapian API More...

#include <xapian.h>
#include "testsuite.h"
+ Include dependency graph for apitest.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SKIP_TEST_UNLESS_BACKEND(B)   skip_test_unless_backend(B)
 
#define SKIP_TEST_FOR_BACKEND(B)   skip_test_for_backend(B)
 

Functions

std::string get_dbtype ()
 
Xapian::Database get_database (const std::string &db)
 
Xapian::Database get_database (const std::string &db1, const std::string &db2)
 
Xapian::Database get_database (const std::string &db, void(*gen)(Xapian::WritableDatabase &, const std::string &), const std::string &arg=std::string())
 
std::string get_database_path (const std::string &db)
 
std::string get_database_path (const std::string &db, void(*gen)(Xapian::WritableDatabase &, const std::string &), const std::string &arg=std::string())
 
Xapian::WritableDatabase get_writable_database (const std::string &db=std::string())
 
Xapian::WritableDatabase get_named_writable_database (const std::string &name, const std::string &source=std::string())
 
std::string get_named_writable_database_path (const std::string &name)
 
std::string get_compaction_output_path (const std::string &name)
 
Xapian::Database get_remote_database (const std::string &db, unsigned timeout, int *port_ptr=nullptr)
 
void kill_remote (const Xapian::Database &db)
 Kill the server associated with remote database db. More...
 
Xapian::Database get_writable_database_as_database ()
 
Xapian::WritableDatabase get_writable_database_again ()
 
void skip_test_unless_backend (const std::string &backend_prefix)
 
void skip_test_for_backend (const std::string &backend_prefix)
 
void XFAIL_FOR_BACKEND (const std::string &backend_prefix, const char *msg)
 

Detailed Description

test functionality of the Xapian API

Definition in file apitest.h.

Macro Definition Documentation

◆ SKIP_TEST_FOR_BACKEND

#define SKIP_TEST_FOR_BACKEND (   B)    skip_test_for_backend(B)

Definition at line 84 of file apitest.h.

◆ SKIP_TEST_UNLESS_BACKEND

#define SKIP_TEST_UNLESS_BACKEND (   B)    skip_test_unless_backend(B)

Definition at line 83 of file apitest.h.

Function Documentation

◆ get_compaction_output_path()

std::string get_compaction_output_path ( const std::string &  name)

Definition at line 104 of file apitest.cc.

References backendmanager, and BackendManager::get_compaction_output_path().

Referenced by DEFINE_TESTCASE().

◆ get_database() [1/3]

Xapian::Database get_database ( const std::string &  db)

Definition at line 47 of file apitest.cc.

References backendmanager, and BackendManager::get_database().

Referenced by DEFINE_TESTCASE(), and test_termlist3_helper().

◆ get_database() [2/3]

Xapian::Database get_database ( const std::string &  db,
void(*)(Xapian::WritableDatabase &, const std::string &)  gen,
const std::string &  arg = std::string() 
)

Definition at line 62 of file apitest.cc.

References backendmanager, gen, and BackendManager::get_database().

◆ get_database() [3/3]

Xapian::Database get_database ( const std::string &  db1,
const std::string &  db2 
)

Definition at line 53 of file apitest.cc.

References backendmanager, dbnames, and BackendManager::get_database().

◆ get_database_path() [1/2]

std::string get_database_path ( const std::string &  db)

Definition at line 71 of file apitest.cc.

References backendmanager, and BackendManager::get_database_path().

Referenced by DEFINE_TESTCASE().

◆ get_database_path() [2/2]

std::string get_database_path ( const std::string &  db,
void(*)(Xapian::WritableDatabase &, const std::string &)  gen,
const std::string &  arg = std::string() 
)

Definition at line 77 of file apitest.cc.

References backendmanager, gen, and BackendManager::get_database_path().

◆ get_dbtype()

std::string get_dbtype ( )

◆ get_named_writable_database()

Xapian::WritableDatabase get_named_writable_database ( const std::string &  name,
const std::string &  source = std::string() 
)

Definition at line 92 of file apitest.cc.

References backendmanager, and BackendManager::get_writable_database().

Referenced by DEFINE_TESTCASE().

◆ get_named_writable_database_path()

std::string get_named_writable_database_path ( const std::string &  name)

Definition at line 98 of file apitest.cc.

References backendmanager, and BackendManager::get_writable_database_path().

Referenced by DEFINE_TESTCASE().

◆ get_remote_database()

Xapian::Database get_remote_database ( const std::string &  db,
unsigned  timeout,
int *  port_ptr = nullptr 
)

◆ get_writable_database()

Xapian::WritableDatabase get_writable_database ( const std::string &  db = std::string())

◆ get_writable_database_again()

Xapian::WritableDatabase get_writable_database_again ( )

Definition at line 132 of file apitest.cc.

References backendmanager, and BackendManager::get_writable_database_again().

Referenced by DEFINE_TESTCASE().

◆ get_writable_database_as_database()

Xapian::Database get_writable_database_as_database ( )

Definition at line 126 of file apitest.cc.

References backendmanager, and BackendManager::get_writable_database_as_database().

Referenced by DEFINE_TESTCASE().

◆ kill_remote()

void kill_remote ( const Xapian::Database db)

Kill the server associated with remote database db.

Currently only supported for remotetcp and only for a database with a single shard.

Definition at line 120 of file apitest.cc.

References backendmanager, and BackendManager::kill_remote().

Referenced by DEFINE_TESTCASE(), and BackendManagerRemoteTcp::kill_remote().

◆ skip_test_for_backend()

void skip_test_for_backend ( const std::string &  backend_prefix)

Definition at line 146 of file apitest.cc.

References get_dbtype(), SKIP_TEST, and startswith().

◆ skip_test_unless_backend()

void skip_test_unless_backend ( const std::string &  backend_prefix)

Definition at line 138 of file apitest.cc.

References get_dbtype(), SKIP_TEST, and startswith().

◆ XFAIL_FOR_BACKEND()

void XFAIL_FOR_BACKEND ( const std::string &  backend_prefix,
const char *  msg 
)

Definition at line 154 of file apitest.cc.

References get_dbtype(), startswith(), and XFAIL().

Referenced by DEFINE_TESTCASE().