FS-11442 [core] allow multiple test modules to be loaded in the same test program.

This commit is contained in:
Chris Rienzo 2018-10-09 21:35:28 +00:00
parent 5014e11eeb
commit a4a0dd81bb
1 changed files with 14 additions and 7 deletions

View File

@ -212,17 +212,24 @@ static void fst_session_park(switch_core_session_t *session)
* @param suite the name of this test suite
*/
#define FST_MODULE_BEGIN(modname,suite) \
const char *fst_test_module = #modname; \
if (!zstr(fst_test_module)) { \
const char *err; \
switch_loadable_module_load_module((char *)"../.libs", (char *)fst_test_module, SWITCH_FALSE, &err); \
} \
FCT_FIXTURE_SUITE_BGN(suite)
{ \
const char *fst_test_module = #modname; \
if (!zstr(fst_test_module)) { \
const char *err; \
switch_loadable_module_load_module((char *)"../.libs", (char *)fst_test_module, SWITCH_FALSE, &err); \
} \
FCT_FIXTURE_SUITE_BGN(suite);
/**
* Define the end of a FreeSWITCH module test suite.
*/
#define FST_MODULE_END FCT_FIXTURE_SUITE_END
#define FST_MODULE_END() \
FCT_FIXTURE_SUITE_END(); \
if (!zstr(fst_test_module) && switch_loadable_module_exists(fst_test_module) == SWITCH_STATUS_SUCCESS) { \
const char *err; \
switch_loadable_module_unload_module((char *)"../.libs", (char *)fst_test_module, SWITCH_FALSE, &err); \
} \
}
/**