From 56ed9b0eb533ea38825c1be570f48334d1e457f0 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 10 Feb 2016 11:57:11 +0100 Subject: cmocka: Print group setup and teardown errors Signed-off-by: Andreas Schneider --- src/cmocka.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/cmocka.c b/src/cmocka.c index 310073d..e43a8b3 100644 --- a/src/cmocka.c +++ b/src/cmocka.c @@ -2791,8 +2791,13 @@ int _cmocka_run_group_tests(const char *group_name, } } } else { + if (cm_error_message != NULL) { + print_error("[ ERROR ] --- %s\n", cm_error_message); + vcm_free_error(cm_error_message); + cm_error_message = NULL; + } cmprintf(PRINTF_TEST_ERROR, 0, - group_name, "Group setup failed"); + group_name, "[ FAILED ] GROUP SETUP"); total_errors++; } @@ -2803,6 +2808,15 @@ int _cmocka_run_group_tests(const char *group_name, group_teardown, &group_state, group_check_point); + if (rc != 0) { + if (cm_error_message != NULL) { + print_error("[ ERROR ] --- %s\n", cm_error_message); + vcm_free_error(cm_error_message); + cm_error_message = NULL; + } + cmprintf(PRINTF_TEST_ERROR, 0, + group_name, "[ FAILED ] GROUP TEARDOWN"); + } } cmprintf_group_finish(group_name, -- cgit v1.2.3