[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:
Andrey Volk
2020-01-14 20:12:18 +00:00
parent 5e83ef7e7b
commit 751d5ff55b
20 changed files with 186 additions and 89 deletions
+12 -2
View File
@@ -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