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.
Definition at line 970 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 976 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 982 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 988 of file test_boost.hpp.
◆ NCBITEST_AUTO_FINIMacro 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.
Definition at line 857 of file test_boost.hpp.
◆ NCBITEST_AUTO_INITMacro 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.
Definition at line 839 of file test_boost.hpp.
◆ NCBITEST_AUTOREG_FUNC #define NCBITEST_AUTOREG_FUNC ( type ) BOOST_JOIN(BOOST_JOIN(Ncbi_, type), __LINE__) ◆ NCBITEST_AUTOREG_FUNCTION #define NCBITEST_AUTOREG_FUNCTION ( type ) Value:static ::NCBI_NS_NCBI::SNcbiTestUserFuncReg \
#define NCBITEST_AUTOREG_FUNC(type)
Helper macros for unique identifiers.
Definition at line 1121 of file test_boost.hpp.
◆ NCBITEST_AUTOREG_HELPER #define NCBITEST_AUTOREG_HELPER BOOST_JOIN(NcbiTestAutoHelper, __LINE__)Definition at line 1119 of file test_boost.hpp.
◆ NCBITEST_AUTOREG_OBJ #define NCBITEST_AUTOREG_OBJ BOOST_JOIN(NcbiTestAutoObj, __LINE__)Definition at line 1118 of file test_boost.hpp.
◆ NCBITEST_AUTOREG_PARAMFUNC #define NCBITEST_AUTOREG_PARAMFUNC ( type, param_decl, param_func ) Value:{ \
NCBITEST_AUTOREG_FUNC(
type)(::NCBI_NS_NCBI::param_func()); \
} \
static ::NCBI_NS_NCBI::SNcbiTestUserFuncReg \
#define NCBITEST_AUTOREG_HELPER
Definition at line 1127 of file test_boost.hpp.
◆ NCBITEST_DEPENDS_ON #define NCBITEST_DEPENDS_ON ( test_name, dep_name ) Value:static char test_name[128]
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.
Definition at line 930 of file test_boost.hpp.
◆ NCBITEST_DEPENDS_ON_N #define NCBITEST_DEPENDS_ON_N ( test_name, N, dep_names_array ) Value: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.
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.
Definition at line 957 of file test_boost.hpp.
◆ NCBITEST_DEPENDS_ON_N_IMPL #define NCBITEST_DEPENDS_ON_N_IMPL ( z, n, names_array ) Value: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.
Helper macro to implement NCBI_TEST_DEPENDS_ON_N.
Definition at line 1045 of file test_boost.hpp.
◆ NCBITEST_DISABLEUnconditionally disable test case.
To be used inside function introduced by NCBITEST_INIT_TREE.
Definition at line 911 of file test_boost.hpp.
◆ NCBITEST_INIT_CMDLINE #define NCBITEST_INIT_CMDLINE ( var_name ) Value:#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.
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 817 of file test_boost.hpp.
◆ NCBITEST_INIT_TREE ◆ NCBITEST_INIT_VARIABLES #define NCBITEST_INIT_VARIABLES ( var_name ) Value:CExprParser * NcbiTestGetIniParser(void)
Get pointer to parser which will be used for evaluating conditions written in configuration file.
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 875 of file test_boost.hpp.
◆ TNcbiTestUserFunction typedef void(* TNcbiTestUserFunction) (void)Type of user-defined function which will be automatically registered in test framework.
Definition at line 1074 of file test_boost.hpp.
◆ TParent ◆ TTestFunctemplate<typename ParamType , typename ParamIter >
Definition at line 1227 of file test_boost.hpp.
◆ ETestUserFuncTypeTypes of functions that user can define.
Enumerator eTestUserFuncInit eTestUserFuncFini eTestUserFuncCmdLine eTestUserFuncVars eTestUserFuncDeps eTestUserFuncFirst eTestUserFuncLastDefinition at line 1077 of file test_boost.hpp.
◆ Add() void CNcbiTestMemoryCleanupList::Add ( void * ptr ) ◆ CNcbiTestParamTestCaseGenerator()template<typename ParamType , typename ParamIter >
◆ GetInstance() ◆ instance() ◆ 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.
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 >
Helper functions to be used in BOOST_PARAM_TEST_CASE macro to create special test case generator.
Definition at line 1281 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 ◆ NcbiTestGetAppInstance() ◆ NcbiTestGetArgDescrs()Get ArgDescriptions object which will be passed to application for parsing command line arguments.
Definition at line 2209 of file test_boost.cpp.
◆ NcbiTestGetIniParser()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() ◆ 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 ) ◆ NcbiTestSetGlobalSkipped() void NcbiTestSetGlobalSkipped ( void ) ◆ next()template<typename ParamType , typename ParamIter >
Definition at line 1245 of file test_boost.hpp.
References NStr::IntToString(), CNcbiTestParamTestCaseGenerator< ParamType, ParamIter >::m_CaseIndex, CNcbiTestParamTestCaseGenerator< ParamType, ParamIter >::m_Name, CNcbiTestParamTestCaseGenerator< ParamType, ParamIter >::m_ParBegin, CNcbiTestParamTestCaseGenerator< ParamType, ParamIter >::m_ParEnd, CNcbiTestParamTestCaseGenerator< ParamType, ParamIter >::m_TestFunc, and NULL.
◆ RegisterNcbiTestUserFunc() ◆ SNcbiTestRegistrar() [1/5] SNcbiTestRegistrar::SNcbiTestRegistrar ( boost::unit_test::const_string ts_name ) inlineexplicitDefinition at line 1169 of file test_boost.hpp.
◆ SNcbiTestRegistrar() [2/5] SNcbiTestRegistrar::SNcbiTestRegistrar ( boost::unit_test::test_case * tc, boost::unit_test::counter_t exp_fail ) inlineDefinition at line 1162 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 ) inlineDefinition at line 1144 of file test_boost.hpp.
◆ SNcbiTestRegistrar() [4/5] SNcbiTestRegistrar::SNcbiTestRegistrar ( boost::unit_test::test_unit_generator const & tc_gen ) inlineexplicitDefinition at line 1175 of file test_boost.hpp.
◆ SNcbiTestRegistrar() [5/5] SNcbiTestRegistrar::SNcbiTestRegistrar ( int n ) inlineexplicitDefinition at line 1180 of file test_boost.hpp.
◆ SNcbiTestTCTimeout() [1/2] ◆ SNcbiTestTCTimeout() [2/2] ◆ SNcbiTestUserFuncReg() ◆ value() ◆ ~CNcbiTestMemoryCleanupList() CNcbiTestMemoryCleanupList::~CNcbiTestMemoryCleanupList ( ) ◆ ~CNcbiTestParamTestCaseGenerator()template<typename ParamType , typename ParamIter >
Definition at line 1243 of file test_boost.hpp.
◆ g_NcbiTestMutex CAutoInitializeStaticFastMutex g_NcbiTestMutex externDefinition at line 162 of file test_boost.cpp.
◆ m_CaseIndextemplate<typename ParamType , typename ParamIter >
◆ m_List std::list<void*> CNcbiTestMemoryCleanupList::m_List private ◆ m_Nametemplate<typename ParamType , typename ParamIter >
◆ m_ParBegintemplate<typename ParamType , typename ParamIter >
◆ m_ParEndtemplate<typename ParamType , typename ParamIter >
◆ m_TestFunctemplate<typename ParamType , typename ParamIter >
◆ m_valueRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4