mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 12:42:02 +00:00
[Unit-tests] Place module tests into their module's Makefile.am, fix tests, add missing Makefile.am to mod_png, implement recursive make check.
This commit is contained in:
@@ -76,6 +76,12 @@ static switch_status_t fst_init_core_and_modload(const char *confdir, const char
|
||||
//SWITCH_GLOBAL_dirs.lib_dir = strdup("/usr/local/freeswitch/lib");
|
||||
//SWITCH_GLOBAL_dirs.temp_dir = strdup("/tmp");
|
||||
|
||||
#ifdef SWITCH_TEST_BASE_DIR_OVERRIDE
|
||||
basedir = SWITCH_TEST_BASE_DIR_OVERRIDE;
|
||||
#else
|
||||
#define SWITCH_TEST_BASE_DIR_OVERRIDE "."
|
||||
#endif
|
||||
|
||||
if (zstr(basedir)) {
|
||||
basedir = ".";
|
||||
}
|
||||
@@ -350,7 +356,9 @@ static switch_status_t fst_init_core_and_modload(const char *confdir, const char
|
||||
const char *fst_test_module = #modname; \
|
||||
if (fst_core && !zstr(fst_test_module)) { \
|
||||
const char *err; \
|
||||
switch_loadable_module_load_module((char *)"../.libs", (char *)fst_test_module, SWITCH_TRUE, &err); \
|
||||
char path[1024]; \
|
||||
sprintf(path, "%s%s%s", SWITCH_TEST_BASE_DIR_OVERRIDE, SWITCH_PATH_SEPARATOR, "../.libs/"); \
|
||||
switch_loadable_module_load_module((char *)path, (char *)fst_test_module, SWITCH_TRUE, &err); \
|
||||
} \
|
||||
FCT_FIXTURE_SUITE_BGN(suite);
|
||||
#endif
|
||||
@@ -371,7 +379,9 @@ static switch_status_t fst_init_core_and_modload(const char *confdir, const char
|
||||
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); \
|
||||
char path[1024]; \
|
||||
sprintf(path, "%s%s%s", SWITCH_TEST_BASE_DIR_OVERRIDE, SWITCH_PATH_SEPARATOR, "../.libs/"); \
|
||||
switch_loadable_module_unload_module((char*)path, (char *)fst_test_module, SWITCH_FALSE, &err); \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user