summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorDavid Vossel <dvossel@digium.com>2010-02-26 18:41:36 +0000
committerDavid Vossel <dvossel@digium.com>2010-02-26 18:41:36 +0000
commitfeae3dbbdf2ac234c00c8c98bf026a852cf1800b (patch)
tree6a5f318d5eaafd5a82ce47d4f2c4f8487816cab7 /main
parentda96c84c67f50cac114aa236c86c47df6efb12d0 (diff)
adds Time field to "test show results" cli command
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@249186 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r--main/test.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/main/test.c b/main/test.c
index 082af2901..02cb32b94 100644
--- a/main/test.c
+++ b/main/test.c
@@ -731,7 +731,8 @@ static char *test_cli_execute_registered(struct ast_cli_entry *e, int cmd, struc
static char *test_cli_show_results(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
-#define FORMAT_RES_ALL "%s%s %-30.30s %-25.25s\n"
+#define FORMAT_RES_ALL1 "%s%s %-30.30s %-25.25s %-10.10s\n"
+#define FORMAT_RES_ALL2 "%s%s %-30.30s %-25.25s %s%ums\n"
static const char * const option1[] = { "all", "failed", "passed", NULL };
char result_buf[32] = { 0 };
struct ast_test *test = NULL;
@@ -768,7 +769,7 @@ static char *test_cli_show_results(struct ast_cli_entry *e, int cmd, struct ast_
return CLI_SHOWUSAGE;
}
- ast_cli(a->fd, FORMAT_RES_ALL, "Result", "", "Name", "Category");
+ ast_cli(a->fd, FORMAT_RES_ALL1, "Result", "", "Name", "Category", "Time");
AST_LIST_LOCK(&tests);
AST_LIST_TRAVERSE(&tests, test, entry) {
if (test->state == AST_TEST_NOT_RUN) {
@@ -781,11 +782,13 @@ static char *test_cli_show_results(struct ast_cli_entry *e, int cmd, struct ast_
(test->state == AST_TEST_FAIL) ? COLOR_RED : COLOR_GREEN,
0, sizeof(result_buf));
- ast_cli(a->fd, FORMAT_RES_ALL,
+ ast_cli(a->fd, FORMAT_RES_ALL2,
result_buf,
" ",
test->info.name,
- test->info.category);
+ test->info.category,
+ test->time ? " " : "<",
+ test->time ? test->time : 1);
}
}
AST_LIST_UNLOCK(&tests);