aboutsummaryrefslogtreecommitdiffstats
path: root/main/asterisk.c
diff options
context:
space:
mode:
authordvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-12-22 16:09:11 +0000
committerdvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-12-22 16:09:11 +0000
commit5d1bac896ee1c376049912f82212e43eb39ae238 (patch)
tree738bc8fbe6fe70bae3bc7e71e0f51bcb02e441a9 /main/asterisk.c
parent78a06c758e7f233eaa39a50a1356ed85381bb337 (diff)
Unit Test Framework API
The Unit Test Framework is a new API that manages registration and execution of unit tests in Asterisk with the purpose of verifying the operation of C functions. The Framework consists of a single test manager accompanied by a list of registered test functions defined within the code. A test is defined, registered, and unregistered from the framework using a set of macros which allow the test code to only be compiled within asterisk when the TEST_FRAMEWORK flag is enabled in menuselect. This allows the test code to exist in the same file as the C functions it intends to verify. Registered tests may be viewed and executed via a set of new CLI commands. CLI commands are also present for generating and exporting test results into xml and txt formats. For more information and use cases please refer to the documentation provided at the beginning of the test.h file. Review: https://reviewboard.asterisk.org/r/447/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@236027 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/asterisk.c')
-rw-r--r--main/asterisk.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index f8f3fa468..5509788e2 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -140,6 +140,7 @@ int daemon(int, int); /* defined in libresolv of all places */
#include "asterisk/buildinfo.h"
#include "asterisk/xmldoc.h"
#include "asterisk/poll-compat.h"
+#include "asterisk/test.h"
#include "../defaults.h"
@@ -3547,6 +3548,13 @@ int main(int argc, char *argv[])
exit(1);
}
+#ifdef TEST_FRAMEWORK
+ if (ast_test_init()) {
+ printf("%s", term_quit());
+ exit(1);
+ }
+#endif
+
ast_makesocket();
sigemptyset(&sigs);
sigaddset(&sigs, SIGHUP);