2 * Asterisk -- An open source telephony toolkit.
4 * Copyright (C) 2009-2010, Digium, Inc.
6 * David Vossel <dvossel@digium.com>
7 * Russell Bryant <russell@digium.com>
9 * See http://www.asterisk.org for more information about
10 * the Asterisk project. Please do not directly contact
11 * any of the maintainers of this project for assistance;
12 * the project provides a web site, mailing lists and IRC
13 * channels for your use.
15 * This program is free software, distributed under the terms of
16 * the GNU General Public License Version 2. See the LICENSE file
17 * at the top of the source tree.
22 * \brief Unit Test Framework
24 * \author David Vossel <dvossel@digium.com>
25 * \author Russell Bryant <russell@digium.com>
30 ASTERISK_FILE_VERSION(__FILE__, "$Revision$");
32 #include "asterisk/_private.h"
35 #include "asterisk/test.h"
36 #include "asterisk/logger.h"
37 #include "asterisk/linkedlists.h"
38 #include "asterisk/utils.h"
39 #include "asterisk/cli.h"
40 #include "asterisk/term.h"
41 #include "asterisk/ast_version.h"
42 #include "asterisk/paths.h"
43 #include "asterisk/time.h"
44 #include "asterisk/manager.h"
46 /*! This array corresponds to the values defined in the ast_test_state enum */
47 static const char * const test_result2str[] = {
48 [AST_TEST_NOT_RUN] = "NOT RUN",
49 [AST_TEST_PASS] = "PASS",
50 [AST_TEST_FAIL] = "FAIL",
53 /*! holds all the information pertaining to a single defined test */
55 struct ast_test_info info; /*!< holds test callback information */
57 * \brief Test defined status output from last execution
59 struct ast_str *status_str;
61 * \brief CLI arguments, if tests being run from the CLI
63 * If this is set, status updates from the tests will be sent to the
64 * CLI in addition to being saved off in status_str.
66 struct ast_cli_args *cli;
67 enum ast_test_result_state state; /*!< current test state */
68 unsigned int time; /*!< time in ms test took */
69 ast_test_cb_t *cb; /*!< test callback function */
70 AST_LIST_ENTRY(ast_test) entry;
73 /*! global structure containing both total and last test execution results */
74 static struct ast_test_execute_results {
75 unsigned int total_tests; /*!< total number of tests, regardless if they have been executed or not */
76 unsigned int total_passed; /*!< total number of executed tests passed */
77 unsigned int total_failed; /*!< total number of executed tests failed */
78 unsigned int total_time; /*!< total time of all executed tests */
79 unsigned int last_passed; /*!< number of passed tests during last execution */
80 unsigned int last_failed; /*!< number of failed tests during last execution */
81 unsigned int last_time; /*!< total time of the last test execution */
87 TEST_NAME_CATEGORY = 2,
90 /*! List of registered test definitions */
91 static AST_LIST_HEAD_STATIC(tests, ast_test);
93 static struct ast_test *test_alloc(ast_test_cb_t *cb);
94 static struct ast_test *test_free(struct ast_test *test);
95 static int test_insert(struct ast_test *test);
96 static struct ast_test *test_remove(ast_test_cb_t *cb);
97 static int test_cat_cmp(const char *cat1, const char *cat2);
99 int __ast_test_status_update(const char *file, const char *func, int line,
100 struct ast_test *test, const char *fmt, ...)
102 struct ast_str *buf = NULL;
105 if (!(buf = ast_str_create(128))) {
110 ast_str_set_va(&buf, 0, fmt, ap);
114 ast_cli(test->cli->fd, "[%s:%s:%d]: %s",
115 file, func, line, ast_str_buffer(buf));
118 ast_str_append(&test->status_str, 0, "[%s:%s:%d]: %s",
119 file, func, line, ast_str_buffer(buf));
126 int ast_test_register(ast_test_cb_t *cb)
128 struct ast_test *test;
131 ast_log(LOG_WARNING, "Attempted to register test without all required information\n");
135 if (!(test = test_alloc(cb))) {
139 if (test_insert(test)) {
147 int ast_test_unregister(ast_test_cb_t *cb)
149 struct ast_test *test;
151 if (!(test = test_remove(cb))) {
152 return -1; /* not found */
162 * \brief executes a single test, storing the results in the test->result structure.
164 * \note The last_results structure which contains global statistics about test execution
165 * must be updated when using this function. See use in test_execute_multiple().
167 static void test_execute(struct ast_test *test)
169 struct timeval begin;
171 ast_str_reset(test->status_str);
174 test->state = test->cb(&test->info, TEST_EXECUTE, test);
175 test->time = ast_tvdiff_ms(ast_tvnow(), begin);
178 static void test_xml_entry(struct ast_test *test, FILE *f)
180 if (!f || !test || test->state == AST_TEST_NOT_RUN) {
184 fprintf(f, "\t<testcase time=\"%d.%d\" name=\"%s%s\"%s>\n",
185 test->time / 1000, test->time % 1000,
186 test->info.category, test->info.name,
187 test->state == AST_TEST_PASS ? "/" : "");
189 if (test->state == AST_TEST_FAIL) {
190 fprintf(f, "\t\t<failure><![CDATA[\n%s\n\t\t]]></failure>\n",
191 S_OR(ast_str_buffer(test->status_str), "NA"));
192 fprintf(f, "\t</testcase>\n");
197 static void test_txt_entry(struct ast_test *test, FILE *f)
203 fprintf(f, "\nName: %s\n", test->info.name);
204 fprintf(f, "Category: %s\n", test->info.category);
205 fprintf(f, "Summary: %s\n", test->info.summary);
206 fprintf(f, "Description: %s\n", test->info.description);
207 fprintf(f, "Result: %s\n", test_result2str[test->state]);
208 if (test->state != AST_TEST_NOT_RUN) {
209 fprintf(f, "Time: %d\n", test->time);
211 if (test->state == AST_TEST_FAIL) {
212 fprintf(f, "Error Description: %s\n\n", S_OR(ast_str_buffer(test->status_str), "NA"));
218 * \brief Executes registered unit tests
220 * \param name of test to run (optional)
221 * \param test category to run (optional)
222 * \param cli args for cli test updates (optional)
224 * \return number of tests executed.
226 * \note This function has three modes of operation
227 * -# When given a name and category, a matching individual test will execute if found.
228 * -# When given only a category all matching tests within that category will execute.
229 * -# If given no name or category all registered tests will execute.
231 static int test_execute_multiple(const char *name, const char *category, struct ast_cli_args *cli)
233 char result_buf[32] = { 0 };
234 struct ast_test *test = NULL;
235 enum test_mode mode = TEST_ALL; /* 3 modes, 0 = run all, 1 = only by category, 2 = only by name and category */
239 if (!ast_strlen_zero(category)) {
240 if (!ast_strlen_zero(name)) {
241 mode = TEST_NAME_CATEGORY;
243 mode = TEST_CATEGORY;
247 AST_LIST_LOCK(&tests);
248 /* clear previous execution results */
249 memset(&last_results, 0, sizeof(last_results));
250 AST_LIST_TRAVERSE(&tests, test, entry) {
255 if (!test_cat_cmp(test->info.category, category)) {
259 case TEST_NAME_CATEGORY:
260 if (!(test_cat_cmp(test->info.category, category)) && !(strcmp(test->info.name, name))) {
270 ast_cli(cli->fd, "START %s - %s \n", test->info.category, test->info.name);
273 /* set the test status update argument. it is ok if cli is NULL */
276 /* execute the test and save results */
281 /* update execution specific counts here */
282 last_results.last_time += test->time;
283 if (test->state == AST_TEST_PASS) {
284 last_results.last_passed++;
285 } else if (test->state == AST_TEST_FAIL) {
286 last_results.last_failed++;
290 term_color(result_buf,
291 test_result2str[test->state],
292 (test->state == AST_TEST_FAIL) ? COLOR_RED : COLOR_GREEN,
295 ast_cli(cli->fd, "END %s - %s Time: %s%dms Result: %s\n",
298 test->time ? "" : "<",
299 test->time ? test->time : 1,
304 /* update total counts as well during this iteration
305 * even if the current test did not execute this time */
306 last_results.total_time += test->time;
307 last_results.total_tests++;
308 if (test->state != AST_TEST_NOT_RUN) {
309 if (test->state == AST_TEST_PASS) {
310 last_results.total_passed++;
312 last_results.total_failed++;
316 res = last_results.last_passed + last_results.last_failed;
317 AST_LIST_UNLOCK(&tests);
324 * \brief Generate test results.
326 * \param name of test result to generate (optional)
327 * \param test category to generate (optional)
328 * \param path to xml file to generate. (optional)
329 * \param path to txt file to generate, (optional)
334 * \note This function has three modes of operation.
335 * -# When given both a name and category, results will be generated for that single test.
336 * -# When given only a category, results for every test within the category will be generated.
337 * -# When given no name or category, results for every registered test will be generated.
339 * In order for the results to be generated, an xml and or txt file path must be provided.
341 static int test_generate_results(const char *name, const char *category, const char *xml_path, const char *txt_path)
343 enum test_mode mode = TEST_ALL; /* 0 generate all, 1 generate by category only, 2 generate by name and category */
344 FILE *f_xml = NULL, *f_txt = NULL;
346 struct ast_test *test = NULL;
348 /* verify at least one output file was given */
349 if (ast_strlen_zero(xml_path) && ast_strlen_zero(txt_path)) {
353 /* define what mode is to be used */
354 if (!ast_strlen_zero(category)) {
355 if (!ast_strlen_zero(name)) {
356 mode = TEST_NAME_CATEGORY;
358 mode = TEST_CATEGORY;
361 /* open files for writing */
362 if (!ast_strlen_zero(xml_path)) {
363 if (!(f_xml = fopen(xml_path, "w"))) {
364 ast_log(LOG_WARNING, "Could not open file %s for xml test results\n", xml_path);
369 if (!ast_strlen_zero(txt_path)) {
370 if (!(f_txt = fopen(txt_path, "w"))) {
371 ast_log(LOG_WARNING, "Could not open file %s for text output of test results\n", txt_path);
377 AST_LIST_LOCK(&tests);
378 /* xml header information */
381 * http://confluence.atlassian.com/display/BAMBOO/JUnit+parsing+in+Bamboo
383 fprintf(f_xml, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
384 fprintf(f_xml, "<testsuite errors=\"0\" time=\"%d.%d\" tests=\"%d\" "
385 "name=\"AsteriskUnitTests\">\n",
386 last_results.total_time / 1000, last_results.total_time % 1000,
387 last_results.total_tests);
388 fprintf(f_xml, "\t<properties>\n");
389 fprintf(f_xml, "\t\t<property name=\"version\" value=\"%s\"/>\n", ast_get_version());
390 fprintf(f_xml, "\t</properties>\n");
393 /* txt header information */
395 fprintf(f_txt, "Asterisk Version: %s\n", ast_get_version());
396 fprintf(f_txt, "Asterisk Version Number: %s\n", ast_get_version_num());
397 fprintf(f_txt, "Number of Tests: %d\n", last_results.total_tests);
398 fprintf(f_txt, "Number of Tests Executed: %d\n", (last_results.total_passed + last_results.total_failed));
399 fprintf(f_txt, "Passed Tests: %d\n", last_results.total_passed);
400 fprintf(f_txt, "Failed Tests: %d\n", last_results.total_failed);
401 fprintf(f_txt, "Total Execution Time: %d\n", last_results.total_time);
404 /* export each individual test */
405 AST_LIST_TRAVERSE(&tests, test, entry) {
408 if (!test_cat_cmp(test->info.category, category)) {
409 test_xml_entry(test, f_xml);
410 test_txt_entry(test, f_txt);
413 case TEST_NAME_CATEGORY:
414 if (!(strcmp(test->info.category, category)) && !(strcmp(test->info.name, name))) {
415 test_xml_entry(test, f_xml);
416 test_txt_entry(test, f_txt);
420 test_xml_entry(test, f_xml);
421 test_txt_entry(test, f_txt);
424 AST_LIST_UNLOCK(&tests);
428 fprintf(f_xml, "</testsuite>\n");
440 * \brief adds test to container sorted first by category then by name
445 static int test_insert(struct ast_test *test)
447 /* This is a slow operation that may need to be optimized in the future
448 * as the test framework expands. At the moment we are doing string
449 * comparisons on every item within the list to insert in sorted order. */
451 AST_LIST_LOCK(&tests);
452 AST_LIST_INSERT_SORTALPHA(&tests, test, entry, info.category);
453 AST_LIST_UNLOCK(&tests);
460 * \brief removes test from container
462 * \return ast_test removed from list on success, or NULL on failure
464 static struct ast_test *test_remove(ast_test_cb_t *cb)
466 struct ast_test *cur = NULL;
468 AST_LIST_LOCK(&tests);
469 AST_LIST_TRAVERSE_SAFE_BEGIN(&tests, cur, entry) {
471 AST_LIST_REMOVE_CURRENT(entry);
475 AST_LIST_TRAVERSE_SAFE_END;
476 AST_LIST_UNLOCK(&tests);
482 * \brief compares two test categories to determine if cat1 resides in cat2
486 * \retval non-zero false
489 static int test_cat_cmp(const char *cat1, const char *cat2)
494 if (!cat1 || !cat2) {
505 return strncmp(cat1, cat2, len2) ? 1 : 0;
510 * \brief free an ast_test object and all it's data members
512 static struct ast_test *test_free(struct ast_test *test)
518 ast_free(test->status_str);
526 * \brief allocate an ast_test object.
528 static struct ast_test *test_alloc(ast_test_cb_t *cb)
530 struct ast_test *test;
532 if (!cb || !(test = ast_calloc(1, sizeof(*test)))) {
538 test->cb(&test->info, TEST_INIT, test);
540 if (ast_strlen_zero(test->info.name)) {
541 ast_log(LOG_WARNING, "Test has no name, test registration refused.\n");
542 return test_free(test);
545 if (ast_strlen_zero(test->info.category)) {
546 ast_log(LOG_WARNING, "Test %s has no category, test registration refused.\n",
548 return test_free(test);
551 if (test->info.category[0] != '/' || test->info.category[strlen(test->info.category) - 1] != '/') {
552 ast_log(LOG_WARNING, "Test category is missing a leading or trailing backslash for test %s%s\n",
553 test->info.category, test->info.name);
556 if (ast_strlen_zero(test->info.summary)) {
557 ast_log(LOG_WARNING, "Test %s/%s has no summary, test registration refused.\n",
558 test->info.category, test->info.name);
559 return test_free(test);
562 if (ast_strlen_zero(test->info.description)) {
563 ast_log(LOG_WARNING, "Test %s/%s has no description, test registration refused.\n",
564 test->info.category, test->info.name);
565 return test_free(test);
568 if (!(test->status_str = ast_str_create(128))) {
569 return test_free(test);
575 static char *complete_test_category(const char *line, const char *word, int pos, int state)
578 int wordlen = strlen(word);
580 struct ast_test *test;
582 AST_LIST_LOCK(&tests);
583 AST_LIST_TRAVERSE(&tests, test, entry) {
584 if (!strncasecmp(word, test->info.category, wordlen) && ++which > state) {
585 ret = ast_strdup(test->info.category);
589 AST_LIST_UNLOCK(&tests);
593 static char *complete_test_name(const char *line, const char *word, int pos, int state, const char *category)
596 int wordlen = strlen(word);
598 struct ast_test *test;
600 AST_LIST_LOCK(&tests);
601 AST_LIST_TRAVERSE(&tests, test, entry) {
602 if (!test_cat_cmp(test->info.category, category) && (!strncasecmp(word, test->info.name, wordlen) && ++which > state)) {
603 ret = ast_strdup(test->info.name);
607 AST_LIST_UNLOCK(&tests);
612 static char *test_cli_show_registered(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
614 #define FORMAT "%-25.25s %-30.30s %-40.40s %-13.13s\n"
615 static const char * const option1[] = { "all", "category", NULL };
616 static const char * const option2[] = { "name", NULL };
617 struct ast_test *test = NULL;
621 e->command = "test show registered";
624 "Usage: 'test show registered' can be used in three ways.\n"
625 " 1. 'test show registered all' shows all registered tests\n"
626 " 2. 'test show registered category [test category]' shows all tests in the given\n"
628 " 3. 'test show registered category [test category] name [test name]' shows all\n"
629 " tests in a given category matching a given name\n";
633 return ast_cli_complete(a->word, option1, a->n);
636 return complete_test_category(a->line, a->word, a->pos, a->n);
639 return ast_cli_complete(a->word, option2, a->n);
642 return complete_test_name(a->line, a->word, a->pos, a->n, a->argv[3]);
646 if ((a->argc < 4) || (a->argc == 6) || (a->argc > 7) ||
647 ((a->argc == 4) && strcmp(a->argv[3], "all")) ||
648 ((a->argc == 7) && strcmp(a->argv[5], "name"))) {
649 return CLI_SHOWUSAGE;
651 ast_cli(a->fd, FORMAT, "Category", "Name", "Summary", "Test Result");
652 ast_cli(a->fd, FORMAT, "--------", "----", "-------", "-----------");
653 AST_LIST_LOCK(&tests);
654 AST_LIST_TRAVERSE(&tests, test, entry) {
655 if ((a->argc == 4) ||
656 ((a->argc == 5) && !test_cat_cmp(test->info.category, a->argv[4])) ||
657 ((a->argc == 7) && !strcmp(test->info.category, a->argv[4]) && !strcmp(test->info.name, a->argv[6]))) {
659 ast_cli(a->fd, FORMAT, test->info.category, test->info.name,
660 test->info.summary, test_result2str[test->state]);
664 AST_LIST_UNLOCK(&tests);
665 ast_cli(a->fd, FORMAT, "--------", "----", "-------", "-----------");
666 ast_cli(a->fd, "\n%d Registered Tests Matched\n", count);
674 static char *test_cli_execute_registered(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
676 static const char * const option1[] = { "all", "category", NULL };
677 static const char * const option2[] = { "name", NULL };
681 e->command = "test execute";
683 "Usage: test execute can be used in three ways.\n"
684 " 1. 'test execute all' runs all registered tests\n"
685 " 2. 'test execute category [test category]' runs all tests in the given\n"
687 " 3. 'test execute category [test category] name [test name]' runs all\n"
688 " tests in a given category matching a given name\n";
692 return ast_cli_complete(a->word, option1, a->n);
695 return complete_test_category(a->line, a->word, a->pos, a->n);
698 return ast_cli_complete(a->word, option2, a->n);
701 return complete_test_name(a->line, a->word, a->pos, a->n, a->argv[3]);
706 if (a->argc < 3|| a->argc > 6) {
707 return CLI_SHOWUSAGE;
710 if ((a->argc == 3) && !strcmp(a->argv[2], "all")) { /* run all registered tests */
711 ast_cli(a->fd, "Running all available tests...\n\n");
712 test_execute_multiple(NULL, NULL, a);
713 } else if (a->argc == 4) { /* run only tests within a category */
714 ast_cli(a->fd, "Running all available tests matching category %s\n\n", a->argv[3]);
715 test_execute_multiple(NULL, a->argv[3], a);
716 } else if (a->argc == 6) { /* run only a single test matching the category and name */
717 ast_cli(a->fd, "Running all available tests matching category %s and name %s\n\n", a->argv[3], a->argv[5]);
718 test_execute_multiple(a->argv[5], a->argv[3], a);
720 return CLI_SHOWUSAGE;
723 AST_LIST_LOCK(&tests);
724 if (!(last_results.last_passed + last_results.last_failed)) {
725 ast_cli(a->fd, "--- No Tests Found! ---\n");
727 ast_cli(a->fd, "\n%d Test(s) Executed %d Passed %d Failed\n",
728 (last_results.last_passed + last_results.last_failed),
729 last_results.last_passed,
730 last_results.last_failed);
731 AST_LIST_UNLOCK(&tests);
739 static char *test_cli_show_results(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
741 #define FORMAT_RES_ALL1 "%s%s %-30.30s %-25.25s %-10.10s\n"
742 #define FORMAT_RES_ALL2 "%s%s %-30.30s %-25.25s %s%ums\n"
743 static const char * const option1[] = { "all", "failed", "passed", NULL };
744 char result_buf[32] = { 0 };
745 struct ast_test *test = NULL;
748 int mode; /* 0 for show all, 1 for show fail, 2 for show passed */
752 e->command = "test show results";
754 "Usage: test show results can be used in three ways\n"
755 " 1. 'test show results all' Displays results for all executed tests.\n"
756 " 2. 'test show results passed' Displays results for all passed tests.\n"
757 " 3. 'test show results failed' Displays results for all failed tests.\n";
761 return ast_cli_complete(a->word, option1, a->n);
768 return CLI_SHOWUSAGE;
769 } else if (!strcmp(a->argv[3], "passed")) {
771 } else if (!strcmp(a->argv[3], "failed")) {
773 } else if (!strcmp(a->argv[3], "all")) {
776 return CLI_SHOWUSAGE;
779 ast_cli(a->fd, FORMAT_RES_ALL1, "Result", "", "Name", "Category", "Time");
780 AST_LIST_LOCK(&tests);
781 AST_LIST_TRAVERSE(&tests, test, entry) {
782 if (test->state == AST_TEST_NOT_RUN) {
785 test->state == AST_TEST_FAIL ? failed++ : passed++;
786 if (!mode || ((mode == 1) && (test->state == AST_TEST_FAIL)) || ((mode == 2) && (test->state == AST_TEST_PASS))) {
787 /* give our results pretty colors */
788 term_color(result_buf, test_result2str[test->state],
789 (test->state == AST_TEST_FAIL) ? COLOR_RED : COLOR_GREEN,
790 0, sizeof(result_buf));
792 ast_cli(a->fd, FORMAT_RES_ALL2,
797 test->time ? " " : "<",
798 test->time ? test->time : 1);
801 AST_LIST_UNLOCK(&tests);
803 ast_cli(a->fd, "%d Test(s) Executed %d Passed %d Failed\n", (failed + passed), passed, failed);
810 static char *test_cli_generate_results(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
812 static const char * const option[] = { "xml", "txt", NULL };
813 const char *file = NULL;
814 const char *type = "";
817 struct ast_str *buf = NULL;
818 struct timeval time = ast_tvnow();
822 e->command = "test generate results";
824 "Usage: 'test generate results'\n"
825 " Generates test results in either xml or txt format. An optional \n"
826 " file path may be provided to specify the location of the xml or\n"
828 " \nExample usage:\n"
829 " 'test generate results xml' this writes to a default file\n"
830 " 'test generate results xml /path/to/file.xml' writes to specified file\n";
834 return ast_cli_complete(a->word, option, a->n);
840 if (a->argc < 4 || a->argc > 5) {
841 return CLI_SHOWUSAGE;
842 } else if (!strcmp(a->argv[3], "xml")) {
845 } else if (!strcmp(a->argv[3], "txt")) {
848 return CLI_SHOWUSAGE;
854 if (!(buf = ast_str_create(256))) {
857 ast_str_set(&buf, 0, "%s/asterisk_test_results-%ld.%s", ast_config_AST_LOG_DIR, (long) time.tv_sec, type);
859 file = ast_str_buffer(buf);
863 res = test_generate_results(NULL, NULL, file, NULL);
865 res = test_generate_results(NULL, NULL, NULL, file);
869 ast_cli(a->fd, "Results Generated Successfully: %s\n", S_OR(file, ""));
871 ast_cli(a->fd, "Results Could Not Be Generated: %s\n", S_OR(file, ""));
882 static struct ast_cli_entry test_cli[] = {
883 AST_CLI_DEFINE(test_cli_show_registered, "show registered tests"),
884 AST_CLI_DEFINE(test_cli_execute_registered, "execute registered tests"),
885 AST_CLI_DEFINE(test_cli_show_results, "show last test results"),
886 AST_CLI_DEFINE(test_cli_generate_results, "generate test results to file"),
889 int __ast_test_suite_event_notify(const char *file, const char *func, int line,
890 const char *state, const char *fmt, ...)
892 struct ast_str *buf = NULL;
895 if (!(buf = ast_str_create(128))) {
900 ast_str_set_va(&buf, 0, fmt, ap);
903 manager_event(EVENT_FLAG_TEST, "TestEvent",
904 "Type: StateChange\r\n"
907 "AppFunction: %s\r\n"
908 "AppLine: %d\r\n%s\r\n",
909 state, file, func, line, ast_str_buffer(buf));
916 int __ast_test_suite_assert_notify(const char *file, const char *func, int line,
919 manager_event(EVENT_FLAG_TEST, "TestEvent",
922 "AppFunction: %s\r\n"
924 "Expression: %s\r\n",
925 file, func, line, exp);
930 #endif /* TEST_FRAMEWORK */
934 #ifdef TEST_FRAMEWORK
935 /* Register cli commands */
936 ast_cli_register_multiple(test_cli, ARRAY_LEN(test_cli));