mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 20:04:50 +00:00
Add test instrumentation
This adds test instrumentation for loading and unloading of modules and for certain actions in MeetMe to be used in the testsuite or any other consumer of AMI events. These will only be generated when Asterisk is built with TEST_FRAMEWORK enabled. (issue PQ-1131) (issue PQ-1133) ........ Merged revisions 371201 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 371203 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 371227 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371228 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -55,6 +55,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "asterisk/udptl.h"
|
||||
#include "asterisk/heap.h"
|
||||
#include "asterisk/app.h"
|
||||
#include "asterisk/test.h"
|
||||
|
||||
#include <dlfcn.h>
|
||||
|
||||
@@ -572,8 +573,10 @@ int ast_unload_resource(const char *resource_name, enum ast_module_unload_mode f
|
||||
mod->info->restore_globals();
|
||||
|
||||
#ifdef LOADABLE_MODULES
|
||||
if (!error)
|
||||
if (!error) {
|
||||
unload_dynamic_module(mod);
|
||||
ast_test_suite_event_notify("MODULE_UNLOAD", "Message: %s", resource_name);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!error)
|
||||
@@ -907,6 +910,7 @@ int ast_load_resource(const char *resource_name)
|
||||
int res;
|
||||
AST_LIST_LOCK(&module_list);
|
||||
res = load_resource(resource_name, 0, NULL, 0);
|
||||
ast_test_suite_event_notify("MODULE_LOAD", "Message: %s", resource_name);
|
||||
AST_LIST_UNLOCK(&module_list);
|
||||
|
||||
return res;
|
||||
|
Reference in New Issue
Block a user