NCBI C++ ToolKit
Classes | Macros | Typedefs | Enumerations | Enumerator | Functions | Variables
Tests

Classes

struct  SNcbiTestUserFuncReg
 Class for implementing automatic registration of user functions. More...
 
struct  SNcbiTestRegistrar
 Extension auto-registrar from Boost.Test that can automatically set the timeout for unit. More...
 
struct  SNcbiTestTCTimeout< T >
 Copy of auto_tc_exp_fail from Boost.Test to store the value of timeout for each test. More...
 
class  CNcbiTestParamTestCaseGenerator< ParamType, ParamIter >
 Special generator of test cases for function accepting one parameter. More...
 
class  CNcbiTestMemoryCleanupList
 CNcbiTestMemoryCleanupList – Define a list of pointers to free at exit. More...
 

Macros

#define NCBITEST_INIT_CMDLINE(var_name)
 Macro for introducing function initializing argument descriptions for tests. More...
 
#define NCBITEST_AUTO_INIT()   NCBITEST_AUTOREG_FUNCTION(eTestUserFuncInit)
 Macro for introducing initialization function which will be called before tests execution and only if tests will be executed (if there's no command line parameter -dryrun or –do_not_test) even if only select number of tests will be executed (if command line parameter –run_test=... More...
 
#define NCBITEST_AUTO_FINI()   NCBITEST_AUTOREG_FUNCTION(eTestUserFuncFini)
 Macro for introducing finalization function which will be called after actual tests execution even if only select number of tests will be executed (if command line parameter –run_test=... More...
 
#define NCBITEST_INIT_VARIABLES(var_name)
 Macro for introducing function which should initialize configuration conditions parser. More...
 
#define NCBITEST_INIT_TREE()   NCBITEST_AUTOREG_FUNCTION(eTestUserFuncDeps)
 Macro for introducing function which should initialize dependencies between test units and some hard coded (not taken from configuration file) tests disablings. More...
 
#define NCBITEST_DISABLE(test_name)    NcbiTestDisable(NcbiTestGetUnit(BOOST_STRINGIZE(test_name)))
 Unconditionally disable test case. More...
 
#define NCBITEST_DEPENDS_ON(test_name, dep_name)
 Add dependency between test test_name and dep_name. More...
 
#define NCBITEST_DEPENDS_ON_N(test_name, N, dep_names_array)
 Add dependency between test test_name and several other tests which names given in the list dep_names_array. More...
 
#define NCBITEST_ADD_TEST_CASE(function)
 Set of macros to manually add test cases that cannot be created using BOOST_AUTO_TEST_CASE. More...
 
#define NCBITEST_ADD_TEST_CASE1(function, param1)
 
#define NCBITEST_ADD_TEST_CASE2(function, param1, param2)
 
#define NCBITEST_ADD_TEST_CASE3(function, param1, param2, param3)
 
#define NCBITEST_DEPENDS_ON_N_IMPL(z, n, names_array)
 Helper macro to implement NCBI_TEST_DEPENDS_ON_N. More...
 
#define NCBITEST_AUTOREG_FUNC(type)    BOOST_JOIN(BOOST_JOIN(Ncbi_, type), __LINE__)
 Helper macros for unique identifiers. More...
 
#define NCBITEST_AUTOREG_OBJ   BOOST_JOIN(NcbiTestAutoObj, __LINE__)
 
#define NCBITEST_AUTOREG_HELPER   BOOST_JOIN(NcbiTestAutoHelper, __LINE__)
 
#define NCBITEST_AUTOREG_FUNCTION(type)
 
#define NCBITEST_AUTOREG_PARAMFUNC(type, param_decl, param_func)
 

Typedefs

typedef void(* TNcbiTestUserFunction) (void)
 Type of user-defined function which will be automatically registered in test framework. More...
 
typedef boost::unit_test::ut_detail::auto_test_unit_registrar SNcbiTestRegistrar::TParent
 
typedef boost::unit_test::callback1< ParamType > CNcbiTestParamTestCaseGenerator< ParamType, ParamIter >::TTestFunc
 

Enumerations

enum  ETestUserFuncType {
  eTestUserFuncInit , eTestUserFuncFini , eTestUserFuncCmdLine , eTestUserFuncVars ,
  eTestUserFuncDeps , eTestUserFuncFirst = eTestUserFuncInit , eTestUserFuncLast = eTestUserFuncDeps
}
 Types of functions that user can define. More...
 

Functions

void NcbiTestSetGlobalDisabled (void)
 Disable execution of all tests in current configuration. More...
 
void NcbiTestSetGlobalSkipped (void)
 Skip execution of all tests in current configuration. More...
 
CNcbiApplicationNcbiTestGetAppInstance (void)
 Return current application instance. More...
 
CNcbiRegistryNcbiTestGetRWConfig (void)
 Wrapper to get the application's configuration parameters, accessible to read-write. More...
 
void NcbiTestDependsOn (boost::unit_test::test_unit *tu, boost::unit_test::test_unit *dep_tu)
 Mark test case/suite as dependent on another test case/suite. More...
 
void NcbiTestDisable (boost::unit_test::test_unit *tu)
 Disable test unit. More...
 
void RegisterNcbiTestUserFunc (TNcbiTestUserFunction func, ETestUserFuncType func_type)
 Registrar of all user-defined functions. More...
 
 SNcbiTestUserFuncReg::SNcbiTestUserFuncReg (TNcbiTestUserFunction func, ETestUserFuncType func_type)
 
CExprParserNcbiTestGetIniParser (void)
 Get pointer to parser which will be used for evaluating conditions written in configuration file. More...
 
CArgDescriptionsNcbiTestGetArgDescrs (void)
 Get ArgDescriptions object which will be passed to application for parsing command line arguments. More...
 
boost::unit_test::test_unit * NcbiTestGetUnit (CTempString test_name)
 Get pointer to test unit by its name which can be partial, i.e. More...
 
 SNcbiTestRegistrar::SNcbiTestRegistrar (boost::unit_test::test_case *tc, boost::unit_test::counter_t exp_fail, unsigned int timeout)
 
 SNcbiTestRegistrar::SNcbiTestRegistrar (boost::unit_test::test_case *tc, boost::unit_test::counter_t exp_fail)
 
 SNcbiTestRegistrar::SNcbiTestRegistrar (boost::unit_test::const_string ts_name)
 
 SNcbiTestRegistrar::SNcbiTestRegistrar (boost::unit_test::test_unit_generator const &tc_gen)
 
 SNcbiTestRegistrar::SNcbiTestRegistrar (int n)
 
 SNcbiTestTCTimeout< T >::SNcbiTestTCTimeout ()
 
 SNcbiTestTCTimeout< T >::SNcbiTestTCTimeout (unsigned int v)
 
static SNcbiTestTCTimeout *& SNcbiTestTCTimeout< T >::instance ()
 
unsigned int SNcbiTestTCTimeout< T >::value () const
 
 CNcbiTestParamTestCaseGenerator< ParamType, ParamIter >::CNcbiTestParamTestCaseGenerator (TTestFunc const &test_func, boost::unit_test::const_string name, ParamIter par_begin, ParamIter par_end)
 
virtual CNcbiTestParamTestCaseGenerator< ParamType, ParamIter >::~CNcbiTestParamTestCaseGenerator ()
 
virtual boost::unit_test::test_unit * CNcbiTestParamTestCaseGenerator< ParamType, ParamIter >::next () const
 
template<typename ParamType , typename ParamIter >
CNcbiTestParamTestCaseGenerator< ParamType, ParamIter > NcbiTestGenTestCases (typename CNcbiTestParamTestCaseGenerator< ParamType, ParamIter >::TTestFunc const &test_func, boost::unit_test::const_string name, ParamIter par_begin, ParamIter par_end)
 Helper functions to be used in BOOST_PARAM_TEST_CASE macro to create special test case generator. More...
 
template<typename ParamType , typename ParamIter >
CNcbiTestParamTestCaseGenerator< typename boost::remove_const< typename boost::remove_reference< ParamType >::type >::type, ParamIter > NcbiTestGenTestCases (void(*test_func)(ParamType), boost::unit_test::const_string name, ParamIter par_begin, ParamIter par_end)
 
static CNcbiTestMemoryCleanupListCNcbiTestMemoryCleanupList::GetInstance ()
 
 CNcbiTestMemoryCleanupList::~CNcbiTestMemoryCleanupList ()
 
void CNcbiTestMemoryCleanupList::Add (void *ptr)
 

Variables

CAutoInitializeStaticFastMutex g_NcbiTestMutex
 
unsigned SNcbiTestTCTimeout< T >::m_value
 
TTestFunc CNcbiTestParamTestCaseGenerator< ParamType, ParamIter >::m_TestFunc
 
string CNcbiTestParamTestCaseGenerator< ParamType, ParamIter >::m_Name
 
ParamIter CNcbiTestParamTestCaseGenerator< ParamType, ParamIter >::m_ParBegin
 
ParamIter CNcbiTestParamTestCaseGenerator< ParamType, ParamIter >::m_ParEnd
 
int CNcbiTestParamTestCaseGenerator< ParamType, ParamIter >::m_CaseIndex
 
std::list< void * > CNcbiTestMemoryCleanupList::m_List
 

Detailed Description

Macro Definition Documentation

◆ NCBITEST_ADD_TEST_CASE

#define NCBITEST_ADD_TEST_CASE (   function)
Value:
boost::unit_test::framework::master_test_suite().add( \
boost::unit_test::make_test_case( \
boost::bind(function), \
BOOST_TEST_STRINGIZE(function) \
) )

Set of macros to manually add test cases that cannot be created using BOOST_AUTO_TEST_CASE.

To create such test cases you should have a function (that can accept up to 3 parameters) and use one of macros below inside NCBITEST_INIT_TREE() function. All function parameters are passed by value.

See also
NCBITEST_INIT_TREE, BOOST_AUTO_PARAM_TEST_CASE

Definition at line 965 of file test_boost.hpp.

◆ NCBITEST_ADD_TEST_CASE1

#define NCBITEST_ADD_TEST_CASE1 (   function,
  param1 
)
Value:
boost::unit_test::framework::master_test_suite().add( \
boost::unit_test::make_test_case( \
boost::bind(function, (param1)), \
BOOST_TEST_STRINGIZE(function) \
) )

Definition at line 971 of file test_boost.hpp.

◆ NCBITEST_ADD_TEST_CASE2

#define NCBITEST_ADD_TEST_CASE2 (   function,
  param1,
  param2 
)
Value:
boost::unit_test::framework::master_test_suite().add( \
boost::unit_test::make_test_case( \
boost::bind(function, (param1), (param2)), \
BOOST_TEST_STRINGIZE(function) \
) )

Definition at line 977 of file test_boost.hpp.

◆ NCBITEST_ADD_TEST_CASE3

#define NCBITEST_ADD_TEST_CASE3 (   function,
  param1,
  param2,
  param3 
)
Value:
boost::unit_test::framework::master_test_suite().add( \
boost::unit_test::make_test_case( \
boost::bind(function, (param1), (param2), (param3)), \
BOOST_TEST_STRINGIZE(function) \
) )

Definition at line 983 of file test_boost.hpp.

◆ NCBITEST_AUTO_FINI

#define NCBITEST_AUTO_FINI ( )    NCBITEST_AUTOREG_FUNCTION(eTestUserFuncFini)

Macro for introducing finalization function which will be called after actual tests execution even if only select number of tests will be executed (if command line parameter –run_test=...

were given). The usage of this macro:

NCBITEST_AUTO_FINI()
{
    // finalization function body
}

Arbitrary number of finalization functions can be defined. They all will be called after tests are executed but the order of these callings is not defined.

See also
NCBITEST_AUTO_INIT

Definition at line 852 of file test_boost.hpp.

◆ NCBITEST_AUTO_INIT

#define NCBITEST_AUTO_INIT ( )    NCBITEST_AUTOREG_FUNCTION(eTestUserFuncInit)

Macro for introducing initialization function which will be called before tests execution and only if tests will be executed (if there's no command line parameter -dryrun or –do_not_test) even if only select number of tests will be executed (if command line parameter –run_test=...

were given). If any of these initialization functions will throw an exception then tests will not be executed. The usage of this macro:

NCBITEST_AUTO_INIT()
{
    // initialization function body
}

Arbitrary number of initialization functions can be defined. They all will be called before tests but the order of these callings is not defined.

See also
NCBITEST_AUTO_FINI

Definition at line 834 of file test_boost.hpp.

◆ NCBITEST_AUTOREG_FUNC

#define NCBITEST_AUTOREG_FUNC (   type)     BOOST_JOIN(BOOST_JOIN(Ncbi_, type), __LINE__)

Helper macros for unique identifiers.

Definition at line 1111 of file test_boost.hpp.

◆ NCBITEST_AUTOREG_FUNCTION

#define NCBITEST_AUTOREG_FUNCTION (   type)
Value:
static void NCBITEST_AUTOREG_FUNC(type)(void); \
static ::NCBI_NS_NCBI::SNcbiTestUserFuncReg \
NCBITEST_AUTOREG_OBJ(&NCBITEST_AUTOREG_FUNC(type), ::NCBI_NS_NCBI::type); \
static void NCBITEST_AUTOREG_FUNC(type)(void)
static int type
Definition: getdata.c:31
#define NCBITEST_AUTOREG_FUNC(type)
Helper macros for unique identifiers.
Definition: type.c:6

Definition at line 1116 of file test_boost.hpp.

◆ NCBITEST_AUTOREG_HELPER

#define NCBITEST_AUTOREG_HELPER   BOOST_JOIN(NcbiTestAutoHelper, __LINE__)

Definition at line 1114 of file test_boost.hpp.

◆ NCBITEST_AUTOREG_OBJ

#define NCBITEST_AUTOREG_OBJ   BOOST_JOIN(NcbiTestAutoObj, __LINE__)

Definition at line 1113 of file test_boost.hpp.

◆ NCBITEST_AUTOREG_PARAMFUNC

#define NCBITEST_AUTOREG_PARAMFUNC (   type,
  param_decl,
  param_func 
)
Value:
static void NCBITEST_AUTOREG_FUNC(type)(::NCBI_NS_NCBI::param_decl); \
static void NCBITEST_AUTOREG_HELPER(void) \
{ \
NCBITEST_AUTOREG_FUNC(type)(::NCBI_NS_NCBI::param_func()); \
} \
static ::NCBI_NS_NCBI::SNcbiTestUserFuncReg \
NCBITEST_AUTOREG_OBJ(&NCBITEST_AUTOREG_HELPER, ::NCBI_NS_NCBI::type); \
static void NCBITEST_AUTOREG_FUNC(type)(::NCBI_NS_NCBI::param_decl)
#define NCBITEST_AUTOREG_HELPER

Definition at line 1122 of file test_boost.hpp.

◆ NCBITEST_DEPENDS_ON

#define NCBITEST_DEPENDS_ON (   test_name,
  dep_name 
)
Value:
NcbiTestGetUnit(BOOST_STRINGIZE(dep_name)))
static char test_name[128]
Definition: utf8_2.c:34
void NcbiTestDependsOn(boost::unit_test::test_unit *tu, boost::unit_test::test_unit *dep_tu)
Mark test case/suite as dependent on another test case/suite.
boost::unit_test::test_unit * NcbiTestGetUnit(CTempString test_name)
Get pointer to test unit by its name which can be partial, i.e.

Add dependency between test test_name and dep_name.

This dependency means if test dep_name is failed during execution or was disabled by any reason then test test_name will not be executed (will be skipped). To be used inside function introduced by NCBITEST_INIT_TREE.

Parameters
test_nameName of the test as a bare text without quotes. Name can exclude test_ prefix if function name includes one and class prefix if it is class member test case.
dep_nameName of the test to depend on. Name can be given with the same assumptions as test_name.
See also
NCBITEST_INIT_TREE, NCBI_TEST_DEPENDS_ON_N

Definition at line 925 of file test_boost.hpp.

◆ NCBITEST_DEPENDS_ON_N

#define NCBITEST_DEPENDS_ON_N (   test_name,
  N,
  dep_names_array 
)
Value:
BOOST_PP_REPEAT(N, NCBITEST_DEPENDS_ON_N_IMPL, \
(BOOST_PP_INC(N), (test_name, \
BOOST_PP_TUPLE_REM(N) dep_names_array))) \
(void)0
#define NCBITEST_DEPENDS_ON_N_IMPL(z, n, names_array)
Helper macro to implement NCBI_TEST_DEPENDS_ON_N.
#define N
Definition: crc32.c:57

Add dependency between test test_name and several other tests which names given in the list dep_names_array.

This dependency means if any of the tests in list dep_names_array is failed during execution or was disabled by any reason then test test_name will not be executed (will be skipped). To be used inside function introduced by NCBITEST_INIT_TREE. Macro is equivalent to use NCBI_TEST_DEPENDS_ON several times for each test in dep_names_array.

Parameters
test_nameName of the test as a bare text without quotes. Name can exclude test_ prefix if function name includes one and class prefix if it is class member test case.
NNumber of tests in dep_names_array
dep_names_arrayNames of tests to depend on. Every name can be given with the same assumptions as test_name. Array should be given enclosed in parenthesis like (test_name1, ..., test_nameN) and should include exactly N elements or preprocessor error will occur during compilation.
See also
NCBITEST_INIT_TREE, NCBI_TEST_DEPENDS_ON

Definition at line 952 of file test_boost.hpp.

◆ NCBITEST_DEPENDS_ON_N_IMPL

#define NCBITEST_DEPENDS_ON_N_IMPL (   z,
  n,
  names_array 
)
Value:
NCBITEST_DEPENDS_ON(BOOST_PP_ARRAY_ELEM(0, names_array), \
BOOST_PP_ARRAY_ELEM(BOOST_PP_INC(n), names_array));
#define NCBITEST_DEPENDS_ON(test_name, dep_name)
Add dependency between test test_name and dep_name.
Definition: test_boost.hpp:925
yy_size_t n

Helper macro to implement NCBI_TEST_DEPENDS_ON_N.

Definition at line 1040 of file test_boost.hpp.

◆ NCBITEST_DISABLE

#define NCBITEST_DISABLE (   test_name)     NcbiTestDisable(NcbiTestGetUnit(BOOST_STRINGIZE(test_name)))

Unconditionally disable test case.

To be used inside function introduced by NCBITEST_INIT_TREE.

Parameters
test_nameName of the test as a bare text without quotes. Name can exclude test_ prefix if function name includes one and class prefix if it is class member test case.
See also
NCBITEST_INIT_TREE

Definition at line 906 of file test_boost.hpp.

◆ NCBITEST_INIT_CMDLINE

#define NCBITEST_INIT_CMDLINE (   var_name)
Value:
CArgDescriptions* var_name, \
CArgDescriptions –.
Definition: ncbiargs.hpp:541
#define NCBITEST_AUTOREG_PARAMFUNC(type, param_decl, param_func)
CArgDescriptions * NcbiTestGetArgDescrs(void)
Get ArgDescriptions object which will be passed to application for parsing command line arguments.
@ eTestUserFuncCmdLine

Macro for introducing function initializing argument descriptions for tests.

This function will be called before CNcbiApplication will parse command line arguments. So it will parse command line using descriptions set by this function. Also test framework will react correctly on such arguments as -h, -help or -dryrun (the last will just print list of unit tests without actually executing them). The parameter var_name is a name for variable of type CArgDescriptions* that can be used inside function to set up argument descriptions. Usage of this macro is like this:

NCBITEST_INIT_CMDLINE(my_args)
{
    my_args->SetUsageContext(...);
    my_args->AddPositional(...);
}

Definition at line 812 of file test_boost.hpp.

◆ NCBITEST_INIT_TREE

#define NCBITEST_INIT_TREE ( )    NCBITEST_AUTOREG_FUNCTION(eTestUserFuncDeps)

Macro for introducing function which should initialize dependencies between test units and some hard coded (not taken from configuration file) tests disablings.

All function job can be done by using NCBITEST_DISABLE, NCBITEST_DEPENDS_ON and NCBITEST_DEPENDS_ON_N macros in conjunction with some conditional statements maybe. The usage of this macro:

NCBITEST_INIT_TREE()
{
    NCBITEST_DISABLE(test_name11);

    NCBITEST_DEPENDS_ON(test_name22, test_name1);
    NCBITEST_DEPENDS_ON_N(test_name33, N, (test_name1, ..., test_nameN));
}

Arbitrary number of such functions can be defined.

See also
NCBITEST_DISABLE, NCBITEST_DEPENDS_ON, NCBITEST_DEPENDS_ON_N

Definition at line 893 of file test_boost.hpp.

◆ NCBITEST_INIT_VARIABLES

#define NCBITEST_INIT_VARIABLES (   var_name)
Value:
CExprParser* var_name, \
CExprParser * NcbiTestGetIniParser(void)
Get pointer to parser which will be used for evaluating conditions written in configuration file.
@ eTestUserFuncVars

Macro for introducing function which should initialize configuration conditions parser.

This parser will be used to evaluate conditions for running tests written in configuration file. So you should set values for all variables that you want to participate in those expressions. Test framework automatically adds all OS*, COMPILER* and DLL_BUILD variables with the values of analogous NCBI_OS*, NCBI_COMPILER* and NCBI_DLL_BUILD macros. The usage of this macro:

NCBITEST_INIT_VARIABLES(my_parser)
{
   my_parser->AddSymbol("var_name1", value_expr1);
   my_parser->AddSymbol("var_name2", value_expr2);
}

Arbitrary number of such functions can be defined.

Definition at line 870 of file test_boost.hpp.

Typedef Documentation

◆ TNcbiTestUserFunction

typedef void(* TNcbiTestUserFunction) (void)

Type of user-defined function which will be automatically registered in test framework.

Definition at line 1069 of file test_boost.hpp.

◆ TParent

typedef boost::unit_test::ut_detail::auto_test_unit_registrar SNcbiTestRegistrar::TParent

Definition at line 1137 of file test_boost.hpp.

◆ TTestFunc

template<typename ParamType , typename ParamIter >
typedef boost::unit_test::callback1<ParamType> CNcbiTestParamTestCaseGenerator< ParamType, ParamIter >::TTestFunc

Definition at line 1222 of file test_boost.hpp.

Enumeration Type Documentation

◆ ETestUserFuncType

Types of functions that user can define.

Enumerator
eTestUserFuncInit 
eTestUserFuncFini 
eTestUserFuncCmdLine 
eTestUserFuncVars 
eTestUserFuncDeps 
eTestUserFuncFirst 
eTestUserFuncLast 

Definition at line 1072 of file test_boost.hpp.

Function Documentation

◆ Add()

void CNcbiTestMemoryCleanupList::Add ( void *  ptr)

Definition at line 929 of file test_boost.cpp.

References CNcbiTestMemoryCleanupList::m_List.

◆ CNcbiTestParamTestCaseGenerator()

template<typename ParamType , typename ParamIter >
CNcbiTestParamTestCaseGenerator< ParamType, ParamIter >::CNcbiTestParamTestCaseGenerator ( TTestFunc const test_func,
boost::unit_test::const_string  name,
ParamIter  par_begin,
ParamIter  par_end 
)
inline

◆ GetInstance()

CNcbiTestMemoryCleanupList * CNcbiTestMemoryCleanupList::GetInstance ( void  )
static

Definition at line 913 of file test_boost.cpp.

References s_TestMemoryCleanupList.

◆ instance()

template<typename T >
static SNcbiTestTCTimeout*& SNcbiTestTCTimeout< T >::instance ( )
inlinestatic

Definition at line 1194 of file test_boost.hpp.

Referenced by SNcbiTestTCTimeout< T >::SNcbiTestTCTimeout().

◆ NcbiTestDependsOn()

void NcbiTestDependsOn ( boost::unit_test::test_unit *  tu,
boost::unit_test::test_unit *  dep_tu 
)

Mark test case/suite as dependent on another test case/suite.

If dependency test case didn't executed successfully for any reason then dependent test will not be executed. This rule has one exception: if test is requested to execute in command line via parameter "--run_test" and dependency was not requested to execute, requested test will be executed anyways.

Parameters
tuTest case/suite that should be marked as dependent
dep_tuTest case/suite that will be "parent" for tu

◆ NcbiTestDisable()

void NcbiTestDisable ( boost::unit_test::test_unit *  tu)

Disable test unit.

Disabled test unit will not be executed (as if p_enabled is set to false) but it will be reported in final Boost.Test report as disabled (as opposed to setting p_enabled to false when test does not appear in final Boost.Test report).

◆ NcbiTestGenTestCases() [1/2]

template<typename ParamType , typename ParamIter >
CNcbiTestParamTestCaseGenerator<ParamType, ParamIter> NcbiTestGenTestCases ( typename CNcbiTestParamTestCaseGenerator< ParamType, ParamIter >::TTestFunc const test_func,
boost::unit_test::const_string  name,
ParamIter  par_begin,
ParamIter  par_end 
)
inline

Helper functions to be used in BOOST_PARAM_TEST_CASE macro to create special test case generator.

Definition at line 1276 of file test_boost.hpp.

◆ NcbiTestGenTestCases() [2/2]

template<typename ParamType , typename ParamIter >
CNcbiTestParamTestCaseGenerator< typename boost::remove_const< typename boost::remove_reference<ParamType>::type >::type, ParamIter> NcbiTestGenTestCases ( void(*)(ParamType)  test_func,
boost::unit_test::const_string  name,
ParamIter  par_begin,
ParamIter  par_end 
)
inline

Definition at line 1290 of file test_boost.hpp.

References type.

◆ NcbiTestGetAppInstance()

CNcbiApplication* NcbiTestGetAppInstance ( void  )

Return current application instance.

Similar to CNcbiApplication::Instance().

Definition at line 2192 of file test_boost.cpp.

Referenced by NCBITEST_AUTO_INIT().

◆ NcbiTestGetArgDescrs()

CArgDescriptions* NcbiTestGetArgDescrs ( void  )

Get ArgDescriptions object which will be passed to application for parsing command line arguments.

Definition at line 2209 of file test_boost.cpp.

◆ NcbiTestGetIniParser()

CExprParser* NcbiTestGetIniParser ( void  )

Get pointer to parser which will be used for evaluating conditions written in configuration file.

Definition at line 2203 of file test_boost.cpp.

◆ NcbiTestGetRWConfig()

CNcbiRegistry& NcbiTestGetRWConfig ( void  )

Wrapper to get the application's configuration parameters, accessible to read-write.

We cannot use CNcbiApplication::GetConfig(), because it return read-only registry, and protected CNcbiApplication::GetRWConfig() is not accessible for unit tests directly.

Definition at line 2197 of file test_boost.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), CAutoNcbiConfigFile::CAutoNcbiConfigFile(), and NCBITEST_AUTO_INIT().

◆ NcbiTestGetUnit()

boost::unit_test::test_unit* NcbiTestGetUnit ( CTempString  test_name)

Get pointer to test unit by its name which can be partial, i.e.

without class prefix and/or test_ prefix if any. Throws an exception in case of name of non-existent test

Definition at line 2215 of file test_boost.cpp.

◆ NcbiTestSetGlobalDisabled()

void NcbiTestSetGlobalDisabled ( void  )

Disable execution of all tests in current configuration.

Call to the function is equivalent to setting GLOBAL = true in ini file. Globally disabled tests are shown as DIS by check scripts (called via make check). Function should be called only from NCBITEST_AUTO_INIT() or NCBITEST_INIT_TREE() functions.

See also
NCBITEST_AUTO_INIT, NCBITEST_INIT_TREE

Definition at line 2181 of file test_boost.cpp.

◆ NcbiTestSetGlobalSkipped()

void NcbiTestSetGlobalSkipped ( void  )

Skip execution of all tests in current configuration.

Globally skipped tests are shown as SKP by check scripts (called via make check). Function should be called only from NCBITEST_AUTO_INIT() or NCBITEST_INIT_TREE() functions.

See also
NCBITEST_AUTO_INIT, NCBITEST_INIT_TREE

Definition at line 2187 of file test_boost.cpp.

◆ next()

template<typename ParamType , typename ParamIter >
virtual boost::unit_test::test_unit* CNcbiTestParamTestCaseGenerator< ParamType, ParamIter >::next ( ) const
inlinevirtual

◆ RegisterNcbiTestUserFunc()

void RegisterNcbiTestUserFunc ( TNcbiTestUserFunction  func,
ETestUserFuncType  func_type 
)

Registrar of all user-defined functions.

Definition at line 2162 of file test_boost.cpp.

Referenced by SNcbiTestUserFuncReg::SNcbiTestUserFuncReg().

◆ SNcbiTestRegistrar() [1/5]

SNcbiTestRegistrar::SNcbiTestRegistrar ( boost::unit_test::const_string  ts_name)
inlineexplicit

Definition at line 1164 of file test_boost.hpp.

◆ SNcbiTestRegistrar() [2/5]

SNcbiTestRegistrar::SNcbiTestRegistrar ( boost::unit_test::test_case *  tc,
boost::unit_test::counter_t  exp_fail 
)
inline

Definition at line 1157 of file test_boost.hpp.

◆ SNcbiTestRegistrar() [3/5]

SNcbiTestRegistrar::SNcbiTestRegistrar ( boost::unit_test::test_case *  tc,
boost::unit_test::counter_t  exp_fail,
unsigned int  timeout 
)
inline

Definition at line 1139 of file test_boost.hpp.

◆ SNcbiTestRegistrar() [4/5]

SNcbiTestRegistrar::SNcbiTestRegistrar ( boost::unit_test::test_unit_generator const tc_gen)
inlineexplicit

Definition at line 1170 of file test_boost.hpp.

◆ SNcbiTestRegistrar() [5/5]

SNcbiTestRegistrar::SNcbiTestRegistrar ( int  n)
inlineexplicit

Definition at line 1175 of file test_boost.hpp.

◆ SNcbiTestTCTimeout() [1/2]

template<typename T >
SNcbiTestTCTimeout< T >::SNcbiTestTCTimeout ( )
inline

Definition at line 1186 of file test_boost.hpp.

◆ SNcbiTestTCTimeout() [2/2]

template<typename T >
SNcbiTestTCTimeout< T >::SNcbiTestTCTimeout ( unsigned int  v)
inlineexplicit

Definition at line 1188 of file test_boost.hpp.

References SNcbiTestTCTimeout< T >::instance().

◆ SNcbiTestUserFuncReg()

SNcbiTestUserFuncReg::SNcbiTestUserFuncReg ( TNcbiTestUserFunction  func,
ETestUserFuncType  func_type 
)
inline

Definition at line 1089 of file test_boost.hpp.

References RegisterNcbiTestUserFunc().

◆ value()

template<typename T >
unsigned int SNcbiTestTCTimeout< T >::value ( ) const
inline

Definition at line 1202 of file test_boost.hpp.

References SNcbiTestTCTimeout< T >::m_value.

◆ ~CNcbiTestMemoryCleanupList()

CNcbiTestMemoryCleanupList::~CNcbiTestMemoryCleanupList ( )

◆ ~CNcbiTestParamTestCaseGenerator()

template<typename ParamType , typename ParamIter >
virtual CNcbiTestParamTestCaseGenerator< ParamType, ParamIter >::~CNcbiTestParamTestCaseGenerator ( )
inlinevirtual

Definition at line 1238 of file test_boost.hpp.

Variable Documentation

◆ g_NcbiTestMutex

CAutoInitializeStaticFastMutex g_NcbiTestMutex
extern

Definition at line 162 of file test_boost.cpp.

◆ m_CaseIndex

template<typename ParamType , typename ParamIter >
int CNcbiTestParamTestCaseGenerator< ParamType, ParamIter >::m_CaseIndex
mutableprivate

◆ m_List

std::list<void*> CNcbiTestMemoryCleanupList::m_List
private

◆ m_Name

template<typename ParamType , typename ParamIter >
string CNcbiTestParamTestCaseGenerator< ParamType, ParamIter >::m_Name
private

◆ m_ParBegin

template<typename ParamType , typename ParamIter >
ParamIter CNcbiTestParamTestCaseGenerator< ParamType, ParamIter >::m_ParBegin
mutableprivate

◆ m_ParEnd

template<typename ParamType , typename ParamIter >
ParamIter CNcbiTestParamTestCaseGenerator< ParamType, ParamIter >::m_ParEnd
private

◆ m_TestFunc

template<typename ParamType , typename ParamIter >
TTestFunc CNcbiTestParamTestCaseGenerator< ParamType, ParamIter >::m_TestFunc
private

◆ m_value

template<typename T >
unsigned SNcbiTestTCTimeout< T >::m_value
private

Definition at line 1206 of file test_boost.hpp.

Referenced by SNcbiTestTCTimeout< T >::value().

Modified on Fri Sep 20 14:57:56 2024 by modify_doxy.py rev. 669887